pub enum Environment {
ClaudeCode,
OpenCode,
Codex,
Cursor,
Generic,
}Expand description
The detected AI agent environment.
Variants§
ClaudeCode
Anthropic’s Claude Code CLI.
OpenCode
OpenCode CLI.
Codex
OpenAI’s Codex CLI.
Cursor
Cursor AI editor.
Generic
Unknown or generic environment.
Implementations§
Source§impl Environment
impl Environment
Sourcepub fn skill_rel_path(&self, name: &str) -> PathBuf
pub fn skill_rel_path(&self, name: &str) -> PathBuf
Return the skill file path pattern for this environment.
Given a skill name, returns the relative path where the skill file
should be installed. Each environment has its own convention:
| Environment | Path |
|---|---|
| Claude Code | .claude/skills/{name}/SKILL.md |
| OpenCode | .opencode/skills/{name}/SKILL.md |
| Codex | .codex/AGENTS.md |
| Cursor | .cursor/rules/{name}.md |
| Generic | AGENTS.md |
Sourcepub fn all_skill_rel_paths(name: &str) -> Vec<(Environment, PathBuf)>
pub fn all_skill_rel_paths(name: &str) -> Vec<(Environment, PathBuf)>
Return all skill file paths for installing across all environments.
Used by install --all to write skill files for every supported harness.
Sourcepub fn skill_path(&self, name: &str, root: Option<&Path>) -> PathBuf
pub fn skill_path(&self, name: &str, root: Option<&Path>) -> PathBuf
Resolve the skill file path under a given root directory.
When root is None, the returned path is relative to CWD.
Sourcepub fn rules_dir(&self) -> PathBuf
pub fn rules_dir(&self) -> PathBuf
Return the rules/instruction file directory for this environment.
| Environment | Directory |
|---|---|
| Claude Code | .claude/ (CLAUDE.md lives at root) |
| Cursor | .cursor/rules/ |
| Windsurf | .windsurf/rules/ |
| Others | .agent/rules/ |
Sourcepub fn runbooks_dir(&self) -> PathBuf
pub fn runbooks_dir(&self) -> PathBuf
Return the runbooks directory for this environment.
Runbooks use .agent/runbooks/ universally — they’re tool-agnostic.
Sourcepub fn memories_dir(&self) -> PathBuf
pub fn memories_dir(&self) -> PathBuf
Return the memories directory for this environment.
Memories use .agent/memories/ universally — they’re tool-agnostic.
Sourcepub fn skills_dir(&self) -> PathBuf
pub fn skills_dir(&self) -> PathBuf
Return the skills directory for this environment.
| Environment | Directory |
|---|---|
| Claude Code | .claude/skills/ |
| OpenCode | .opencode/skills/ |
| Cursor | .cursor/rules/ (skills map to rules) |
| Others | .agent/skills/ |
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more