CodexModule
Create or review Forge modules so they work reliably in Codex.
Reference: Core/docs/CodexModuleCompatibility.md
Workflow Routing
| Workflow | Trigger | Use |
|---|---|---|
scaffold | "create", "scaffold", "set up Codex support" | Generate missing module artifacts for Codex compatibility |
audit | "review", "validate", "check compatibility" | Inspect existing module and report gaps |
Instructions
Step 1: Select workflow and scope
Identify:
- •target module path
- •workflow (
scaffoldoraudit) - •whether to include tests/docs updates in the same change
Scaffold Workflow
Use this when Codex compatibility artifacts are missing or incomplete.
Step S1: Scaffold module essentials
Ensure module has:
- •
module.yamlwith accurateevents - •
skills/<SkillName>/SKILL.mdwith valid frontmatter - •optional runtime scripts/binaries only when behavior requires them
Step S2: Scaffold Codex-facing compatibility
Create or update:
- •skill descriptions with explicit
USE WHENtriggers - •fallback behavior for Claude-specific primitives (for example
AskUserQuestion) - •tool-agnostic shell env resolution (
FORGE_MODULE_ROOT, fallbackCLAUDE_PLUGIN_ROOT)
Step S3: Scaffold verification coverage
Create or update module verification checks for:
- •skill discovery via
bash Core/bin/list-skills.sh - •Codex adapter sync via
bash Core/bin/forge-update.sh --platform codex - •dangling symlink check:
bash
find "$CODEX_HOME/skills" -type l ! -exec test -e {} \; -print
Step S4: Scaffold-safe adapter rules
If touching Adapters/codex/install.sh, enforce:
- •preserve unmanaged directories
- •manage only
.forge-sourcedirectories - •remove managed symlinks before relinking companions
- •keep updates idempotent
- •never write undocumented Codex
config.tomlkeys
Audit Workflow
Use this for compatibility reviews without broad feature work.
Step A1: Check structural compatibility
Verify module contains:
- •
module.yamlwith accurateevents - •
skills/<SkillName>/SKILL.mdfiles with valid frontmatter - •hooks and binaries only where required
Step A2: Check skill runtime portability
For each skill:
- •Ensure
descriptionincludesUSE WHENtriggers. - •Check for Claude-only hard dependencies.
- •Keep strict requirements (for example
MUST use AskUserQuestion) and add equivalent fallback for runtimes where the primitive is unavailable. - •Prefer
FORGE_MODULE_ROOTwithCLAUDE_PLUGIN_ROOTfallback in shell snippets.
Step A3: Check Codex adapter impact
If work touches Adapters/codex/install.sh:
- •Preserve unmanaged directories.
- •Manage only
.forge-sourcedirectories. - •Remove managed symlinks before relinking companions.
- •Keep updates idempotent.
- •Do not write undocumented Codex
config.tomlkeys.
Step 2: Verify end-to-end
Run:
bash
make check bash Core/bin/forge-update.sh --platform codex bash Core/bin/list-skills.sh
If module has Rust:
bash
cargo test --manifest-path Modules/<module>/Cargo.toml
Then check Codex skill links:
bash
find "$CODEX_HOME/skills" -type l ! -exec test -e {} \; -print
No output means no dangling symlinks.
Step 3: Report findings
Provide:
- •workflow used (
scaffoldoraudit) - •compatibility verdict (
compatible,compatible with caveats,not compatible) - •files created/updated (scaffold) or issues found (audit)
- •commands run and key outcomes
- •any follow-up tasks
Constraints
- •Do not assume Codex supports Claude hook schema/config keys.
- •Treat Codex compatibility as skill-first unless documented runtime hooks exist.
- •Keep changes narrow: fix compatibility defects without unrelated refactors.