[#154] Support subagents as a component type#200
Merged
Conversation
- Add `agent` case to ComponentType, CopyFileType, ExternalComponentType, ExternalCopyFileType, and ShorthandKeys with `agent:` shorthand in techpack.yaml - Add agentsDirectory to Environment and agent discovery/export in ConfigurationDiscovery, ManifestBuilder, and ExportCommand - Add tests for shorthand parsing, adapter conversion, doctor checks, manifest round-trip, and project file installation
- Add agent: shorthand section, fileType value, and auto-derived check row to techpack-schema.md - Add Agents subsection, doctor check row, and artifact location to creating-tech-packs.md - Add agent to component type list and per-project paths in architecture.md
There was a problem hiding this comment.
Pull request overview
Adds first-class support for Claude Code custom subagents (.claude/agents/*.md) as a tech pack component type, aligning with the existing CopyFileType-driven install/export pipeline.
Changes:
- Introduces
agentas aComponentType+CopyFileType, including global (~/.claude/agents/) and project (.claude/agents/) target directories. - Extends external manifest parsing and shorthand YAML support to accept
agent:andtype: agent/fileType: agent. - Updates export discovery, interactive selection, and manifest building/rendering to include agent files; adds/updates tests accordingly.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Sources/mcs/Core/Environment.swift | Adds agentsDirectory to the environment path set. |
| Sources/mcs/TechPack/Component.swift | Adds .agent to ComponentType and CopyFileType, wiring directory resolution for install/doctor. |
| Sources/mcs/ExternalPack/ExternalPackManifest.swift | Adds agent component type + agent: shorthand resolution and ExternalCopyFileType.agent. |
| Sources/mcs/Export/ConfigurationDiscovery.swift | Discovers agent files from agents/ for both global and project scopes. |
| Sources/mcs/Export/ManifestBuilder.swift | Includes agent files in build specs, YAML rendering, and doctor hint comments. |
| Sources/mcs/Commands/ExportCommand.swift | Adds agents to discovery summary and interactive/non-interactive selection, passing through to BuildOptions. |
| Tests/MCSTests/ManifestBuilderTests.swift | Ensures manifest building includes agent components and updates expected component/file copy counts. |
| Tests/MCSTests/ExternalPackManifestTests.swift | Verifies YAML deserialization and agent: shorthand behavior for external manifests. |
| Tests/MCSTests/ExternalPackAdapterTests.swift | Verifies adapter converts external agent copyPackFile components to internal definitions. |
| Tests/MCSTests/DerivedDoctorCheckTests.swift | Verifies derived file existence paths cover .agent correctly. |
| Tests/MCSTests/ComponentExecutorTests.swift | Verifies project-scoped install places agent files under .claude/agents/. |
Comments suppressed due to low confidence (1)
Sources/mcs/ExternalPack/ExternalPackManifest.swift:316
- The shorthand-key doc comment above this type still lists
hook,command,skill, etc. but notagent. Sinceagentis now supported, update that comment so the manifest authoring guide stays accurate.
case hook // Map — CopyFileShorthand (fileType: .hook)
case command // Map — CopyFileShorthand (fileType: .command)
case skill // Map — CopyFileShorthand (fileType: .skill)
case agent // Map — CopyFileShorthand (fileType: .agent)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3d26924 to
73720f4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent:shorthand support intechpack.yamlfor Claude Code custom subagents (.mdfiles in.claude/agents/)CopyFileTypepattern used byskill:,hook:, andcommand:— zero changes needed in executor, doctor, dry-run display, or artifact tracking (all generic)Test plan
swift buildcompiles cleanlyswift test— all 593 tests pass (5 new tests added)agent:shorthand and runmcs sync --dry-runmcs syncand verify.mdfiles land in.claude/agents/mcs doctorand verify agent file check passesmcs exportand verify agents are discovered and round-trip correctlyCloses #154