Skip to content

fix: correct Copilot extension command registration#1724

Open
ismaelJimenez wants to merge 1 commit intogithub:mainfrom
ismaelJimenez:fix/copilot-extension-registration
Open

fix: correct Copilot extension command registration#1724
ismaelJimenez wants to merge 1 commit intogithub:mainfrom
ismaelJimenez:fix/copilot-extension-registration

Conversation

@ismaelJimenez
Copy link

  • Use .agent.md extension for commands in .github/agents/
  • Generate companion .prompt.md files in .github/prompts/
  • Clean up .prompt.md files on extension removal
  • Add tests for Copilot-specific registration behavior

Bumps version to 0.1.7.

Description

The specify extension add --dev command didn't work correctly for GitHub Copilot projects. Three issues were identified and fixed:

  1. Wrong file extension: Commands were written as .md instead of .agent.md in .github/agents/, so Copilot couldn't discover them as agent files.
  2. Missing companion prompts: Copilot requires a matching .prompt.md file in .github/prompts/ for each agent — these were never generated.
  3. Incomplete cleanup: On specify extension remove, the .prompt.md companion files were not deleted.

The root cause was a mismatch between CommandRegistrar.AGENT_CONFIGS (used by the CLI) and the release packaging script (create-release-packages.sh), which correctly handled all three cases.

Testing

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

107 tests pass. New tests added:

  • test_register_commands_for_copilot — verifies .agent.md extension is used
  • test_copilot_companion_prompt_created — verifies .prompt.md generation
  • test_copilot_aliases_get_companion_prompts — verifies aliases also get prompts
  • test_non_copilot_agent_no_companion_file — verifies no prompts for other agents
  • test_copilot_cleanup_removes_prompt_files — verifies cleanup of prompt files

AI Disclosure

  • I did use AI assistance (describe below)

GitHub Copilot (Claude Opus 4.6) was used to investigate the bug, implement the fix, and write the tests. All changes were reviewed and validated by a human.

- Use .agent.md extension for commands in .github/agents/
- Generate companion .prompt.md files in .github/prompts/
- Clean up .prompt.md files on extension removal
- Add tests for Copilot-specific registration behavior

Bumps version to 0.1.7.
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