Skip to content

Commit 4ab91fb

Browse files
adri4nlmclaude
andauthored
feat: add Codex support for extension command registration (#1767)
* feat: add Codex support for extension command registration * test: add codex command registrar mapping check * test: add codex consistency check to test_agent_config_consistency Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5c0bedb commit 4ab91fb

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

src/specify_cli/extensions.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,12 @@ class CommandRegistrar:
635635
"args": "$ARGUMENTS",
636636
"extension": ".md"
637637
},
638+
"codex": {
639+
"dir": ".codex/prompts",
640+
"format": "markdown",
641+
"args": "$ARGUMENTS",
642+
"extension": ".md"
643+
},
638644
"windsurf": {
639645
"dir": ".windsurf/workflows",
640646
"format": "markdown",

tests/test_agent_config_consistency.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ def test_extension_registrar_uses_kiro_cli_and_removes_q(self):
2828
assert cfg["kiro-cli"]["dir"] == ".kiro/prompts"
2929
assert "q" not in cfg
3030

31+
def test_extension_registrar_includes_codex(self):
32+
"""Extension command registrar should include codex targeting .codex/prompts."""
33+
cfg = CommandRegistrar.AGENT_CONFIGS
34+
35+
assert "codex" in cfg
36+
assert cfg["codex"]["dir"] == ".codex/prompts"
37+
3138
def test_release_agent_lists_include_kiro_cli_and_exclude_q(self):
3239
"""Bash and PowerShell release scripts should agree on agent key set for Kiro."""
3340
sh_text = (REPO_ROOT / ".github" / "workflows" / "scripts" / "create-release-packages.sh").read_text(encoding="utf-8")

tests/test_extensions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,11 @@ def test_kiro_cli_agent_config_present(self):
407407
assert CommandRegistrar.AGENT_CONFIGS["kiro-cli"]["dir"] == ".kiro/prompts"
408408
assert "q" not in CommandRegistrar.AGENT_CONFIGS
409409

410+
def test_codex_agent_config_present(self):
411+
"""Codex should be mapped to .codex/prompts."""
412+
assert "codex" in CommandRegistrar.AGENT_CONFIGS
413+
assert CommandRegistrar.AGENT_CONFIGS["codex"]["dir"] == ".codex/prompts"
414+
410415
def test_parse_frontmatter_valid(self):
411416
"""Test parsing valid YAML frontmatter."""
412417
content = """---

0 commit comments

Comments
 (0)