Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Load repository skills in Codex (#3903)

Maximilian Roosff7748036c1a
diff --git a/.agents/skills b/.agents/skills
new file mode 120000
index 000000000..454b8427c
--- /dev/null
+++ b/.agents/skills
@@ -0,0 +1 @@
+../.claude/skills
\ No newline at end of file
diff --git a/CLAUDE.md b/CLAUDE.md
index de9e0ef26..e40ef90e6 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -30,7 +30,7 @@ Use consistently in docs, help text, and code comments:
## Skills
-Load relevant skills before starting; reload when scope changes mid-session. Project-local skills in `.claude/skills/`:
+Load relevant skills before starting; reload when scope changes mid-session. Project-local skills live in `.claude/skills/`, with `.agents/skills` linking Codex to the same files:
- `writing-user-outputs` — before editing code that calls `warning_message`, `hint_message`, `error_message`, `info_message`, `eprintln`, `println`, or otherwise produces user-visible strings (CLI help, progress UI, snapshots).
- `running-tend` — operating in CI or writing tend workflows.
diff --git a/Cargo.toml b/Cargo.toml
index 147cfcdbd..cdaf05faf 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -57,6 +57,7 @@ homepage = "https://worktrunk.dev"
description = "A CLI for Git worktree management, designed for parallel AI agent workflows"
license = "MIT OR Apache-2.0"
default-run = "wt"
+exclude = [".agents/skills/**"]
[package.metadata.release]
# Allow releases from any branch (GitHub Actions uses detached HEAD)
diff --git a/plugins/worktrunk/CLAUDE.md b/plugins/worktrunk/CLAUDE.md
index 9abd5fc81..5d9caa7d6 100644
--- a/plugins/worktrunk/CLAUDE.md
+++ b/plugins/worktrunk/CLAUDE.md
@@ -12,6 +12,9 @@ call the canonical `hooks/wt.sh` below.
worktrunk/ ← repo root = marketplace root
├── .claude-plugin/marketplace.json ← Claude pointer (source → ./plugins/worktrunk)
├── .agents/plugins/marketplace.json← Codex pointer (source → ./plugins/worktrunk)
+├── .claude/skills/ ← authored repo-local maintainer skills
+├── .agents/skills → ../.claude/skills
+│ Codex repo-skill pointer
├── gemini-extension.json ← Gemini manifest (extensionPath = repo root)
├── hooks/hooks.json ← Gemini activity hooks (call the wt.sh below)
├── skills/ ← real dir; Gemini reads ${extensionPath}/skills directly
@@ -37,6 +40,13 @@ worktrunk/ ← repo root = marketplace root
`hooks` key — see Known Limitations below)
```
+The repo-local maintainer skills are separate from the distributed plugin
+skills. `.claude/skills/` is their authored home, and the relative
+`.agents/skills` symlink lets Codex discover the same files. On Windows
+checkouts with `core.symlinks=false`, Git materializes the link as a plain file
+and Codex loads none of these repo-local skills. This limitation is accepted;
+installed plugins use the real-file mirror below and are unaffected.
+
Path resolution differs by tool, all verified end-to-end against the real CLIs:
- **Claude** (claude-cli 2.1.207): `.claude-plugin/marketplace.json` `source:
diff --git a/tests/integration_tests/config_show.rs b/tests/integration_tests/config_show.rs
index 4b9fd64fe..3e99364bf 100644
--- a/tests/integration_tests/config_show.rs
+++ b/tests/integration_tests/config_show.rs
@@ -3688,6 +3688,24 @@ fn test_plugin_layout_is_consolidated() {
let read = |p: &str| fs::read_to_string(root.join(p)).unwrap();
let json = |p: &str| serde_json::from_str::<serde_json::Value>(&read(p)).unwrap();
+ // Repo-local maintainer skills are authored once for Claude and exposed to
+ // Codex through its conventional .agents/skills discovery path. Windows
+ // checkouts with core.symlinks=false materialize the link as a plain file;
+ // that accepted limitation is documented in plugins/worktrunk/CLAUDE.md.
+ #[cfg(unix)]
+ {
+ let codex_skills = root.join(".agents/skills");
+ assert_eq!(
+ fs::read_link(&codex_skills).unwrap(),
+ std::path::Path::new("../.claude/skills"),
+ ".agents/skills must point at the authored Claude maintainer skills"
+ );
+ assert!(
+ codex_skills.join("running-tend/SKILL.md").is_file(),
+ ".agents/skills must resolve to the repo-local maintainer skills"
+ );
+ }
+
// Repo root keeps ONLY the two loader-mandated marketplace pointers.
assert!(
!root.join(".claude-plugin/plugin.json").exists()