Skip to content

feat(codex): surface skills + persona to codex agents (parity with Claude)#2475

Open
chiptoe-svg wants to merge 1 commit into
nanocoai:providersfrom
chiptoe-svg:chip/codex-skills-surfacing
Open

feat(codex): surface skills + persona to codex agents (parity with Claude)#2475
chiptoe-svg wants to merge 1 commit into
nanocoai:providersfrom
chiptoe-svg:chip/codex-skills-surfacing

Conversation

@chiptoe-svg
Copy link
Copy Markdown

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):

  • Frontmatter parsing — name + description present
  • Frontmatter parsing — missing description (skill is included with name-only entry)
  • Frontmatter parsing — missing name (skill is excluded)
  • Frontmatter parsing — no frontmatter at all (skill is excluded)
  • Determinism — entries are alphabetically sorted by name
  • Empty `/app/skills` dir → empty section, not crash
  • All-eligible-skills excluded (every SKILL.md missing required fields) → empty section

`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

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant