Skip to content

Conversation

@terry-li-hm
Copy link
Contributor

@terry-li-hm terry-li-hm commented Jan 24, 2026

Summary

Adds comprehensive content transformation to the Codex converter, bridging syntax differences between Claude Code and Codex.

Problem

Claude Code and Codex have different syntax for invoking commands, agents, and referencing other features:

Feature Claude Code Codex
Subagents Task agent-name(args) Use $skill to: args
Commands /command-name /prompts:command-name
Agent refs @agent-name $skill-name skill

The converter was transforming structure (commands → prompts, agents → skills) but not content references within those files.

Solution

Added transformContentForCodex() function that handles all content mappings:

  1. Task agent calls → skill references
  2. Slash commands/prompts: namespace
  3. Agent references$skill syntax

Applied to both skill and prompt files during conversion.

Testing

  • All 34 tests pass
  • Verified with Codex CLI 0.89.0
  • /prompts:workflows-plan now correctly invokes /prompts:deepen-plan (instead of failing with "no such file or directory: /deepen-plan")

Before/After

Task calls:

- Task repo-research-analyst(feature_description)
+ Use the $repo-research-analyst skill to: feature_description

Slash commands:

- Run /deepen-plan to enhance
+ Run /prompts:deepen-plan to enhance

Agent references:

- Have @kieran-rails-reviewer check this
+ Have $kieran-rails-reviewer skill check this

🤖 Generated with Claude Code

@terry-li-hm
Copy link
Contributor Author

Tested and Working ✅

Verified locally with Codex CLI 0.89.0:

  1. Ran converter: bun run convert plugins/compound-engineering --to codex --codex-home ~/.codex
  2. Confirmed both skill and prompt files have correct syntax:
    - Use the $repo-research-analyst skill to: feature_description
    - Use the $learnings-researcher skill to: feature_description
    
  3. Ran /prompts:workflows-plan in Codex
  4. Codex correctly:
    • Found and read the referenced skill (Read SKILL.md)
    • Executed the skill instructions manually ("I'll run repository research steps manually")

This is the expected behavior - Codex doesn't have subagent spawning like Claude Code, so it reads the skill and executes instructions in the main thread.

Note: During testing, found and fixed an additional bug where the prompt files weren't being transformed (only skill files were). Both are now correctly transformed.

Adds comprehensive content transformation for Codex compatibility:

1. Task agent calls: `Task agent-name(args)` → `Use the $agent-name skill to: args`
2. Slash commands: `/command-name` → `/prompts:command-name`
3. Agent references: `@agent-name` → `$agent-name skill`

This bridges the syntax gap between Claude Code and Codex:
- Claude Code uses Task tool with subagent_types
- Codex uses skills and /prompts: namespace

Transformations are applied to both skill and prompt files during conversion.

Tested with Codex CLI 0.89.0 - all transformations working correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@terry-li-hm terry-li-hm force-pushed the fix/codex-task-to-skill-transform branch from a2c2019 to dc834a4 Compare January 24, 2026 00:54
@terry-li-hm
Copy link
Contributor Author

Full End-to-End Test Passed ✅

Tested the complete workflow in Codex CLI 0.89.0:

  1. Ran /prompts:workflows-plan → Created plan successfully
  2. Selected option 2 (/deepen-plan) → Skill loaded successfully
  3. No more "no such file or directory: /deepen-plan" error

The /command/prompts:command transformation is working correctly. Codex can now chain commands as intended.

Ready for review.

@kieranklaassen
Copy link
Collaborator

TY!! you are the best

@kieranklaassen
Copy link
Collaborator

I'll add CI here as well so we can see it pass on PRs

@kieranklaassen kieranklaassen merged commit 1dea33c into EveryInc:main Jan 24, 2026
@terry-li-hm
Copy link
Contributor Author

These are actually my first open-source contributions — made using Claude Code + compound-engineering itself. Thanks for building this!

@kieranklaassen
Copy link
Collaborator

Love this!

@terry-li-hm terry-li-hm deleted the fix/codex-task-to-skill-transform branch January 26, 2026 01:15
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.

2 participants