Add universal initialization for multiple AI Agents #1505
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.
Universal Initialization Feature for Spec Kit
Summary
This PR implements universal initialization functionality that allows
specify initto set up multiple AI agents simultaneously. Users can now initialize projects with all 17 supported agents at once, or select specific subsets of agents, providing maximum flexibility for multi-agent development workflows.Motivation
Previously,
specify initonly supported initializing one AI agent at a time. Users working with multiple agents had to:specify initmultiple times in different directoriesThis feature enables:
Implementation Details
Architecture Decision
Approach: Download and merge individual agent templates
spec-kit-template-{agent}-{script}-*.zipfilesRejected Alternative: Pre-built "all-agents" templates (would require build system changes, less flexible)
Key Components
1. New CLI Options (lines 1202-1204)
2. Helper Functions Added
parse_agent_list(): Validates and parses comma-separated agent names_merge_directory(): Recursively merges directories with special handling for.vscode/settings.json_handle_agents_md_conflict(): Merges AGENTS.md from multiple agents into single filedownload_and_extract_multi_agent_templates(): Main multi-agent download and merge logic3. Core Logic Updates
--ai,--universal,--all-agents, or--agentsis usedUsage Examples
Key Features
✅ Backward Compatible - All existing single-agent functionality unchanged
✅ Flexible - Support for all agents, specific subsets, or single agent
✅ Intelligent Merging - Handles
.specify/directory and AGENTS.md conflicts✅ Progress Tracking - Clear feedback during multi-agent downloads
✅ Smart CLI Checks - Non-blocking notices for multi-agent, strict for single-agent
✅ Error Handling - Validates agent names, shows helpful error messages
Files Changed
src/specify_cli/__init__.py: Core implementation (added ~250 lines)README.md: Updated with universal initialization examplesBreaking Changes
None. This is a purely additive feature that maintains full backward compatibility.
AI Assistance
This implementation was developed with assistance from Claude Code, which was utilized for both the technical implementation and the creation of this pull request description.