User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty).
Outline
Locate Feature:
- Extract the feature name from the branch name or user input like
###-feature-name, e.g., 001-feature-name.
- Find the most likely feature in the specs directory, i.e.,
./specs/[###-feature-name]. The feature id and name must be exact match.
Pre-check & Load Feature Documents:
- Make sure the feature directory exists, i.e.,
./specs/[###-feature-name], otherwise ERROR "Feature directory not found: ./specs/[###-feature-name]".
- Make sure the spec file exists, i.e.,
./specs/[###-feature-name]/spec.md, otherwise ERROR "Spec file not found: ./specs/[###-feature-name]/spec.md".
Load Template: Copy the templatetemplates/plan-template.md to the feature directory as specs/[###-feature-name]/plan.md and understand required sections.
Execute plan workflow: Follow the structure in plan.md to:
- Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
- Phase 1: Plan the project structure.
- Phase 2: Plan the data model.
- Phase 3: Plan the algorithm model.
Phases
Phase 1: Plan the project structure
Review the current repository structure:
- Focus on source files
- Analyze the tree view and control the depth
Plan the feature position:
- Concentrate modifications to the least number of files
- All modules must be considered
Phase 2: Plan the data model
Extract data model from feature spec:
- Extract all data models specialized for this feature (even a single variable)
- For each data model, plan its structure, access, and update. Use a small example to illustrate.
- . Avoid code implementation.
Plan each data model:
- For each data model, plan its structure, access, and update. Fill the content in the plan template
- Use simple examples to illustrate all operations.
- Do not use complex code implementation. Use simple APIs instead.
Phase 3: Plan the algorithm model
Extract algorithm model from feature spec:
- Extract all algorithm models specialized for this feature that are not already provided by some packages.
- Summarize the algorithm target.
Plan each algorithm model:
- For each algorithm model, fill the detail of the algorithm in the plan template.
- The structure is not fixed. But each algorithm should have clear results.
- Focus on the algorithm description, not the implementation. Some small examples are required.
Upload to GitHub
The generated plan file requires human review. Ask users whether they want to review the plan in the workspace or on the GitHub. We provide the following steps to push the plan to the GitHub. Ask for permission to execute and wait for response.
- Commit generated files and push this
plan branch to the remote.
- Create a new issue on the GitHub. This issue has the label
Plan. The title is [###-feature-name][Plan] <description>, e.g., [001-add-frontend][Plan] generate plan for the frontend. The body is about this plan.
- Make this
plan issue as the sub-issue of the feature issue. The command is:
gh api graphql -f query='mutation { addSubIssue(input: {issueId: "xxx", subIssueId: "xxx"}) { issue { id title } subIssue { id title } } }'
- Create a Pull Request that merge the current plan branch to main. The first line of the body should be "fix #[plan-issue-number]" to link to the
plan issue.
- Update the
feature issue that add the plan issue id in the body, e.g., - [ ] Plan: #13.
- List all contributors and ask users to choose the reviewers. Note the PR author (i.e., me) cannot be reviewers.
Key rules
- Use absolute paths
- ERROR on gate failures or unresolved clarifications
1---2name: speckit-plan3description: Execute the implementation planning workflow using the plan template to generate design artifacts.4---56## User Input78```text9$ARGUMENTS10```1112You **MUST** consider the user input before proceeding (if not empty).1314## Outline15161. **Locate Feature**:17 - Extract the feature name from the branch name or user input like `###-feature-name`, e.g., `001-feature-name`.18 - Find the most likely feature in the specs directory, i.e., `./specs/[###-feature-name]`. The feature id and name must be exact match.19202. **Pre-check & Load Feature Documents**:21 - Make sure the feature directory exists, i.e., `./specs/[###-feature-name]`, otherwise ERROR "Feature directory not found: ./specs/[###-feature-name]".22 - Make sure the spec file exists, i.e., `./specs/[###-feature-name]/spec.md`, otherwise ERROR "Spec file not found: ./specs/[###-feature-name]/spec.md".23243. **Load Template**: Copy the template`templates/plan-template.md` to the feature directory as `specs/[###-feature-name]/plan.md` and understand required sections.25264. **Execute plan workflow**: Follow the structure in `plan.md` to:27 - Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")28 - Phase 1: Plan the project structure.29 - Phase 2: Plan the data model.30 - Phase 3: Plan the algorithm model.3132## Phases3334### Phase 1: Plan the project structure35361. **Review the current repository structure**:37 - Focus on source files38 - Analyze the tree view and control the depth39402. **Plan the feature position**:41 - Concentrate modifications to the least number of files42 - All modules must be considered4344### Phase 2: Plan the data model45461. **Extract data model from feature spec**:47 - Extract all data models specialized for this feature (even a single variable)48 - For each data model, plan its structure, access, and update. Use a small example to illustrate.49 - . Avoid code implementation.50512. **Plan each data model**:52 - For each data model, plan its structure, access, and update. Fill the content in the plan template53 - Use simple examples to illustrate all operations.54 - Do not use complex code implementation. Use simple APIs instead.5556### Phase 3: Plan the algorithm model57581. **Extract algorithm model from feature spec**:59 - Extract all algorithm models specialized for this feature that are not already provided by some packages.60 - Summarize the algorithm target.61622. **Plan each algorithm model**:63 - For each algorithm model, fill the detail of the algorithm in the plan template.64 - The structure is not fixed. But each algorithm should have clear results.65 - Focus on the algorithm description, not the implementation. Some small examples are required.6667## Upload to GitHub6869The generated plan file requires human review. Ask users whether they want to review the plan in the workspace or on the GitHub. We provide the following steps to push the plan to the GitHub. Ask for permission to execute and wait for response.7071 1. Commit generated files and push this `plan` branch to the remote.72 2. Create a new issue on the GitHub. This issue has the label `Plan`. The title is `[###-feature-name][Plan] <description>`, e.g., `[001-add-frontend][Plan] generate plan for the frontend`. The body is about this plan.73 3. Make this `plan issue` as the sub-issue of the `feature issue`. The command is:74 ```75 gh api graphql -f query='mutation { addSubIssue(input: {issueId: "xxx", subIssueId: "xxx"}) { issue { id title } subIssue { id title } } }'76 ```77 4. Create a Pull Request that merge the current plan branch to main. The first line of the body should be "fix #[plan-issue-number]" to link to the `plan issue`.78 5. Update the `feature issue` that add the `plan issue` id in the body, e.g., `- [ ] Plan: #13`.79 6. List all contributors and ask users to choose the reviewers. Note the PR author (i.e., me) cannot be reviewers.8081## Key rules8283- Use absolute paths84- ERROR on gate failures or unresolved clarifications