feat(codex): surface skills + persona to codex agents (parity with Claude)#2475
Open
chiptoe-svg wants to merge 1 commit into
Open
feat(codex): surface skills + persona to codex agents (parity with Claude)#2475chiptoe-svg wants to merge 1 commit into
chiptoe-svg wants to merge 1 commit into
Conversation
…rk cross-provider Codex doesn't have Claude Code's discoverable Skill tool. With only CLAUDE.md/CLAUDE.local.md inlined into baseInstructions, agents running on Codex couldn't act on phrases like "your first action is Skill: make-website" — the tool didn't exist, the skill bodies weren't loaded, and the per-group prompt's references just dangled. This adds composeAvailableSkills(): scans the per-group skill symlinks at /home/node/.claude/skills/ (the same set Claude Code sees, scoped by container.json's skill selection), parses each SKILL.md's frontmatter for name + description, and emits a markdown discovery list as part of baseInstructions. The list directs Codex agents to Read /app/skills/<name>/SKILL.md when a description matches the user's request — mirroring the "lazy-load full body" approach Claude Code uses internally rather than inlining tens of KB up front. Net effect: persona, CLAUDE.local.md, and the skill catalog all work the same on Claude or Codex (or any future non-Claude provider that uses the same agent-runner shim). Switching providers is now a config change, not a content rewrite. Tests cover frontmatter parsing edge cases (missing description, missing name field, no frontmatter at all), determinism (alphabetical sort), and the empty-dir/no-eligible-skills paths. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
chiptoe-svg
added a commit
to chiptoe-svg/nanoclaw_gccourse
that referenced
this pull request
May 14, 2026
§1 (AI-coding-CLI picker) PR opened as nanocoai/nanoclaw#2474. Captured the cherry-pick decisions made in the worktree (excluded OpenCode adapter — depends on opencodeCli symbol upstream's providers branch doesn't have yet; dropped fork-only files; resolved the rename × opencode-add 3-way conflict in index.ts; adapted resolve.test.ts). §1.5 (NEW): Codex skills/persona surfacing — commit 2317a1f cherry- picked onto upstream/providers as PR nanocoai/nanoclaw#2475. Single commit, clean cherry-pick, container tests 86/86. Documents the test coverage and net post-merge effect (cross-provider parity for skills). §1.6 (NEW): Two more codex commits worth porting but blocked. 0e79ab5 (stop OPENAI_API_KEY container leak) is fork-specific as written — upstream has no native credential proxy. Captured three reframe options; recommend the harden-against-host-env-overriding-container- set-values framing as smallest behavior delta. b09abb4 (provider contracts) needs splitting — touches a SKILL.md upstream evolved separately. Both deferred until §1.5 lands so we know upstream's review style. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make Codex agents see the same persona + skill catalog that Claude Code agents see, so switching providers becomes a config change instead of a content rewrite.
Why
Today's codex provider on `upstream/providers` reads the agent's `CLAUDE.local.md` (persona) but doesn't surface the `skills/` directory at all. Result: an agent group that works on Claude (with skills like `/welcome`, `/self-customize`, etc.) loses all of those when its provider is flipped to codex. The persona stays, the skills vanish — switching providers requires rewriting the agent.
What changes
`container/agent-runner/src/providers/codex.ts` — at agent boot, walk the mounted `/app/skills/` directory, parse each `SKILL.md`'s frontmatter for `name` + `description`, and emit a markdown discovery list as part of `baseInstructions`. The list directs Codex agents to `Read /app/skills//SKILL.md` when a description matches the user's request.
This mirrors the lazy-load full body approach Claude Code uses internally — don't inline tens of KB up front; surface a 1-line description per skill and let the agent fetch the body when it matches a need. Same activation latency, same token cost.
Test plan
`container/agent-runner/src/providers/codex.factory.test.ts` (+69 lines, in-PR):
`bun test` (container suite): 86/86 pass, `tsc --noEmit` clean.
Net effect
Persona, `CLAUDE.local.md`, AND the skill catalog all work the same on Claude or Codex (or any future non-Claude provider that uses the same agent-runner shim). Switching providers is now a config change, not a content rewrite.
🤖 Generated with Claude Code