Skip to content

feat: add Codex support for extension command registration#1767

Open
adri4nlm wants to merge 2 commits intogithub:mainfrom
adri4nlm:feat/codex-extension-registration
Open

feat: add Codex support for extension command registration#1767
adri4nlm wants to merge 2 commits intogithub:mainfrom
adri4nlm:feat/codex-extension-registration

Conversation

@adri4nlm
Copy link

@adri4nlm adri4nlm commented Mar 6, 2026

Summary

Add Codex support to extension command registration by adding a codex entry to CommandRegistrar.AGENT_CONFIGS in src/specify_cli/extensions.py.

Description

specify init --ai codex creates projects using .codex/prompts/, but specify extension add did not include Codex in the registrar agent map.

This change makes extension command installation target Codex projects as expected:

  • directory: .codex/prompts
  • format: markdown
  • args placeholder: $ARGUMENTS
  • file extension: .md

Testing

  • Tested locally with uv run specify --help
  • Ran existing tests with uv run pytest
  • Tested with a sample project (if applicable)

uv run pytest result:

============================= 120 passed in 2.92s ==============================

AI Disclosure

  • I did not use AI assistance for this contribution
  • I did use AI assistance (describe below)

Used Codex to help prepare and validate this contribution. All final changes were reviewed by a human.

Copilot AI review requested due to automatic review settings March 6, 2026 01:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Codex CLI to the CommandRegistrar.AGENT_CONFIGS map in extensions.py, enabling specify extension add to register extension commands into Codex projects (targeting .codex/prompts/ with Markdown format and $ARGUMENTS placeholder). The codex key was already present in AGENT_CONFIG in __init__.py and in the release packaging scripts, but was missing from the extension command registrar.

Changes:

  • Adds a "codex" entry to CommandRegistrar.AGENT_CONFIGS with dir: .codex/prompts, format: markdown, args: $ARGUMENTS, and extension: .md.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +626 to +631
"codex": {
"dir": ".codex/prompts",
"format": "markdown",
"args": "$ARGUMENTS",
"extension": ".md"
},
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The codebase follows a clear pattern of adding consistency tests whenever a new agent is added to CommandRegistrar.AGENT_CONFIGS. For example, kiro-cli has tests in both tests/test_extensions.py (lines 402–406) and tests/test_agent_config_consistency.py (lines 23–29) that verify the key is present, the directory is correct, and legacy keys are absent.

This PR does not add a test verifying that "codex" is present in CommandRegistrar.AGENT_CONFIGS with the expected "dir": ".codex/prompts". A test analogous to test_kiro_cli_agent_config_present should be added (e.g., in TestCommandRegistrar in tests/test_extensions.py) to pin this mapping and prevent regression.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

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