Plan your work on this @docs/roadmap.md item: 4. Realign GitHub Copilot agent-definition…
- User
Plan your work on this @docs/roadmap.md item: 4. Realign GitHub Copilot agent-definition support with the latest documented on-disk surface.
The current implementation deploys Copilot agent definitions to.github/agents/{name}.agent.md, while the north star now points at a different documented target. Reconcile the path, updateinitdiscovery, and add migration coverage so the implementation does not hard-code an outdated Copilot layout.
Score 8/12 (Architecture 1, Agents 1, OS 1, Confidence 2, Safety 1, Stability 2) - User
--- Content from referenced files ---
- User
Content from @docs/roadmap.md:
- User
- User
--- End of content ---
Assistant
I will start by reading
docs/north-star.mdto identify the correct target path for GitHub Copilot agent definitions.Assistant
I will search for
.github/agentsin the codebase to find where it is currently defined and identify the relevant files for the update.Assistant
I will now check
src/core/adapters/agent-definitions.tsto examine the mapping logic and determine how to update the path.Assistant
I will now check
src/core/capabilities.tsto locate the defined paths for agent definitions.Assistant
I will now examine
src/config/agents.tsto see howAGENT_REGISTRY_BY_IDis defined and how it relates to the agent definition paths.Assistant
I have identified the configuration for
github-copilotinsrc/config/agents.tsand noted the necessary changes to theagentDefinitionsSupportpath. I will now examinesrc/core/init.tsto understand how it discovers these files and if any other logic depends on the.agent.mdsuffix.Assistant
I've analyzed how
AGENT_DEFINITION_SUBDIRSandderiveAgentDefinitionNameinsrc/core/init.tswork. Changing the registry path will update the scanned subdirectories, but I need to address migration for old.github/agents/*.agent.mdfiles. I'll now examinesrc/core/deploy.tsto see how it handlesagentDefinitionsand consider how to incorporate migration or backward compatibility.Assistant
deploy.tsdoesn't have agent-specificagentDefinitionslogic; it relies on the manifest andsrc/core/adapters/agent-definitions.ts, which uses the registry's target path. For migration, I'll updatesrc/core/init.tsto include.github/agentsas a legacy path inAGENT_DEFINITION_SUBDIRSand map it togithub-copilotinagentsForDefinitionSubdir, ensuringinitstill finds old files. I also need to consider "orphaned" files from previous deployments when the target path changes, and I'll examinesrc/core/revert.tsto see how it handles this.Assistant
Revert logic relies on the manifest, so updating it to a new location means
revertwon't clean up the old one. "Migration coverage" likely means the engine should handle cleaning up old locations, so I'll checktest/unit/migration-golden.test.tsfor existing migration tests and logic.Assistant
registerDeploymentincludesmigratedFrom. I'll now checksrc/core/ownership.tsto see how it's supported.Assistant
registerDeploymentusesmigratedFromto clean up old registry entries but doesn't touch disk files. I need to includemigratedFromwhen callingregisterDeploymentindeployFileWrite, specifically foragentDefinitionswhich are compiled insrc/core/adapters/agent-definitions.tsintoFileWriteDeployAction. I'll now check the definition ofFileWriteDeployActioninsrc/types.ts.Assistant
I'll add
migratedFrom?: string[]toFileWriteDeployActionand updatedeployFileWriteinsrc/core/deploy.tsto use it. IncompileAgentDefinitionActions, I'll include the legacy path.github/agents/{name}.agent.mdforgithub-copilotinmigratedFrom. I'll re-examinesrc/core/adapters/agent-definitions.tsto implement this.Assistant
I'll update the registry for
github-copilot, addmigratedFromtoFileWriteDeployActionanddeployFileWrite, and modifycompileAgentDefinitionActionsandinit.tsfor migration. I've confirmed thatderiveAgentDefinitionNamehandles both old and new conventions, and I'll follow the existing pattern of registry-only migration, leaving old files on disk but unmanaged. Finally, I'll update the comments ininit.tsand checktest/unit/adapters.test.tsfor necessary test updates.Assistant
I'll update the
github-copilottest case to reflect the new documented target and include migration verification. I also need to find and updateinittests, which I'll search for, likely intest/unit/cli.test.ts.Assistant
I'll search for
agentDefinitionsintest/unit/cli.test.tsinstead.Assistant
Checking
test/unit/cli.test.ts.Assistant
I'll add two new tests to
cli.test.ts: one to verify thatinitcorrectly discovers legacygithub-copilotagent definitions in.github/agents/and another for the new path in.github/copilot/agents/. I've finalized my plan and am entering plan mode.Assistant
I'll create the plan file now.
Assistant
I'll present the plan.
Assistant
I'll begin by updating the registry in
src/config/agents.ts.Assistant
I'll update
src/types.tsto includemigratedFrominFileWriteDeployAction.Assistant
I'll update
deployFileWriteinsrc/core/deploy.tsto passmigratedFromtoregisterDeployment.Assistant
I'll update
compileAgentDefinitionActionsinsrc/core/adapters/agent-definitions.tsto include the legacy Copilot path inmigratedFrom.Assistant
I'll update
src/core/init.tsfor discovery backward compatibility.Assistant
Updating
agentsForDefinitionSubdirandderiveAgentDefinitionNameinsrc/core/init.ts.Assistant
I likely erred with the
...inold_string. I'll re-read the file for the precise text.Assistant
I'll start with
agentsForDefinitionSubdir, then update thederiveAgentDefinitionNamecomments.Assistant
Updating
deriveAgentDefinitionNamecomments.Assistant
Time to update the tests, starting with
test/unit/adapters.test.ts.Assistant
I'll add the
initdiscovery tests totest/unit/cli.test.ts.Assistant
Implementation and test updates are complete. I'll now run the tests to verify.
Assistant
I've identified a bug in
src/core/adapters/agent-definitions.ts: I passed a string toresolvePlaceholders, which expects an array of segments. I'll now check theresolvePlaceholderssignature insrc/core/resolve.tsto confirm the correct format.Assistant
segmentsis indeedstring[], so I'll update the call insrc/core/adapters/agent-definitions.tsto pass an array of path components instead of a single string. Applying the fix now.Assistant
Rerunning the tests.
Assistant
Tests passed. I've updated the
github-copilotagent definitions' registry target path, addedmigratedFromsupport toFileWriteDeployActionanddeployFileWrite, and ensuredagentDefinitionsandinithandle Copilot migrations and discovery. Tests are verified, and I'm deleting the plan file now.Assistant
Done.
Assistant
I have completed the realignment of GitHub Copilot agent-definition support with the latest documented target (
.github/copilot/agents/{name}.md). This includes:- Registry Update: Updated the target path in
src/config/agents.ts. - Migration Support: Added
migratedFromtoFileWriteDeployActionanddeployFileWritefor registry ownership transfer. - Adapter Update: The
agentDefinitionsadapter now includes the legacy path inmigratedFromfor Copilot. - Init Discovery: Updated
initto discover both legacy (.github/agents/) and new (.github/copilot/agents/) definitions. - Test Coverage: Verified changes with updated and new tests (all 356 passed).
What would you like to do next?
- Registry Update: Updated the target path in
- User
commit your changes
Assistant
I will gather information about the changes and the repository's commit history to prepare a clear and consistent commit message.
Assistant
I will stage the changes and commit them with a message that clearly describes the realignment of GitHub Copilot agent definitions and the added migration support.
Draft Commit Message:
feat: realign GitHub Copilot agent definitions with documented surface - Update GitHub Copilot agent definition target path to `.github/copilot/agents/{name}.md`. - Add `migratedFrom` support to `FileWriteDeployAction` for registry ownership transfer. - Implement backward compatibility for `.github/agents/` discovery in `init`. - Update agent-definitions adapter to include legacy paths in migration metadata. - Add unit and integration tests for new paths and discovery behavior.Assistant
The changes have been committed successfully.
Commit Summary:
- Registry: Updated GitHub Copilot agent-definition target path to
.github/copilot/agents/{name}.md. - Migration: Added
migratedFromsupport toFileWriteDeployActionanddeployFileWritefor registry ownership transfer. - Adapter: Updated
agent-definitionsadapter to include legacy paths in migration metadata. - Init: Implemented backward compatibility for
.github/agents/discovery. - Tests: Added unit and integration tests for new paths and discovery behavior.
All 356 tests passed, and the workspace is clean. What would you like to do next?
- Registry: Updated GitHub Copilot agent-definition target path to