Skip to content

Commit e488fa9

Browse files
fix(prompt): correct punctuation and formatting in implementation instructions
1 parent 7242662 commit e488fa9

File tree

1 file changed

+154
-195
lines changed

1 file changed

+154
-195
lines changed

.github/prompts/implement.prompt.md

Lines changed: 154 additions & 195 deletions
Original file line numberDiff line numberDiff line change
@@ -4,215 +4,174 @@ description: Execute the implementation plan by processing and executing all tas
44

55
# Implement
66

7-
The user input can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
7+
The user input can be provided directly by the agent or as a command argument you **MUST** consider it before proceeding with the prompt (if not empty).
88

9-
User input:
9+
**User input:**
10+
11+
```
1012
1113
$ARGUMENTS
1214
15+
````
16+
17+
---
18+
1319
**Workflow Modes**: This command supports two modes:
20+
1421
- **Local (default)**: Work with the current repository (origin). No special configuration needed.
1522
- **Fork**: Contribute to an upstream repository. Reads `.fork-info.json` created by `/specify`.
1623
17-
**Iteration Support**: This command supports iterative implementation - you can run it multiple times to complete remaining tasks, fix issues, or add refinements. Task completion state is tracked in tasks.md with [X] markers.
24+
**Iteration Support**: This command supports iterative implementation — you can run it multiple times to complete remaining tasks, fix issues, or add refinements. Task completion state is tracked in `tasks.md` with `[X]` markers.
25+
26+
---
27+
28+
## Workflow Steps
1829
19-
1. **Set Implementing label immediately**:
30+
1. **Set Implementing label immediately**
2031
- **Determine target repository**:
21-
- Check if `.fork-info.json` exists in the feature directory
32+
- Check if `.fork-info.json` exists in the feature directory.
2233
- If it exists:
23-
- Validate required fields: `is_fork` (true), `upstream_owner` (non-empty), `upstream_repo` (non-empty)
24-
- Use `upstream_owner/upstream_repo` for all GitHub operations
25-
- If it doesn't exist, use the current repository (origin)
26-
- Get the issue number associated with the current feature branch
27-
- **Add 'Implementing' label** to the issue and PR immediately in the target repository
28-
- **Remove 'Planning' label** from the issue and PR
34+
- Validate required fields: `is_fork` (true), `upstream_owner` (non-empty), `upstream_repo` (non-empty).
35+
- Use `upstream_owner/upstream_repo` for all GitHub operations.
36+
- If it doesn't exist, use the current repository (origin).
37+
- Get the issue number associated with the current feature branch.
38+
- **Add `Implementing` label** to the issue and PR immediately in the target repository.
39+
- **Remove `Planning` label** from the issue and PR.
40+
2941
**GitHub Integration**: If GitHub tools are available, update labels automatically in the target repository. If not available, use:
42+
3043
```bash
3144
# If fork: gh issue edit <issue-number> --repo <upstream_owner>/<upstream_repo> --remove-label "Planning" --add-label "Implementing"
3245
# If local: gh issue edit <issue-number> --remove-label "Planning" --add-label "Implementing"
3346
gh issue edit <issue-number> --remove-label "Planning" --add-label "Implementing"
47+
````
48+
49+
2. **Run prerequisites**
50+
Run [`check-prerequisites.ps1`](../../.specify/scripts/powershell/check-prerequisites.ps1) from repo root:
51+
52+
```powershell
53+
.specify/scripts/powershell/check-prerequisites.ps1 -Json -RequireTasks -IncludeTasks
3454
```
35-
2. Run [`.specify/scripts/powershell/check-prerequisites.ps1 -Json -RequireTasks -IncludeTasks`](../../.specify/scripts/powershell/check-prerequisites.ps1) from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute.
36-
3. Load and analyze the implementation context:
37-
- **REQUIRED**: Read tasks.md for the complete task list and execution plan
38-
- **REQUIRED**: Read plan.md for tech stack, architecture, and file structure
39-
- **IF EXISTS**: Read data-model.md for entities and relationships
40-
- **IF EXISTS**: Read contracts/ for API specifications and test requirements
41-
- **IF EXISTS**: Read research.md for technical decisions and constraints
42-
- **IF EXISTS**: Read quickstart.md for integration scenarios
43-
4. Parse tasks.md structure and extract:
44-
- **Detect iteration state**: Check task completion markers
45-
- Tasks marked [X] are complete - skip unless user requests changes
46-
- Tasks marked [ ] are pending - these need implementation
47-
- If all tasks are complete, check if user input requests additional work
48-
- **Task phases**: Setup, Tests, Core, Integration, Polish
49-
- **Task dependencies**: Sequential vs parallel execution rules
50-
- **Task details**: ID, description, file paths, parallel markers [P]
51-
- **Execution flow**: Order and dependency requirements
52-
5. Execute implementation following the task plan:
53-
- **Skip completed tasks**: Don't re-implement tasks marked [X] unless explicitly requested
54-
- **Resume from last incomplete task**: Start with first [ ] task found
55-
- **Phase-by-phase execution**: Complete each phase before moving to the next
56-
- **Respect dependencies**: Run sequential tasks in order, parallel tasks [P] can run together
57-
- **Follow TDD approach**: Execute test tasks before their corresponding implementation tasks
58-
- **File-based coordination**: Tasks affecting the same files must run sequentially
59-
- **Validation checkpoints**: Verify each phase completion before proceeding
60-
6. Implementation execution rules:
61-
- **Setup first**: Initialize project structure, dependencies, and configuration
62-
- **Tests before code**: If you need to write tests for contracts, entities, and integration scenarios
63-
- **Core development**: Implement models, services, CLI commands, and endpoints
64-
- **Integration work**: Database connections, middleware, logging, and external services
65-
- **Polish and validation**: Unit tests, performance optimization, and documentation
66-
7. Progress tracking and error handling:
67-
- Report progress after each completed task
68-
- Halt execution if any non-parallel task fails
69-
- For parallel tasks [P], continue with successful tasks and report failed ones
70-
- Provide clear error messages with context for debugging
71-
- Suggest next steps if implementation cannot proceed
72-
- **CRITICAL - Update task status immediately after completion**:
73-
* After completing each task, mark it as [X] in tasks.md
74-
* Update the PR description to mark the corresponding task checkbox from `- [ ] T###:` to `- [X] T###:`
75-
* This MUST be done task-by-task as you progress, not at the end
76-
* If GitHub tools are available, use them to update the PR description
77-
* If not available, use: `gh pr edit <PR-number> --body "<updated-description>"`
78-
* Ensure task progress is visible in real-time to users watching the PR
79-
8. Completion validation:
80-
- Verify all required tasks are completed
81-
- Check that implemented features match the original specification
82-
- Validate that tests pass and coverage meets requirements
83-
- Confirm the implementation follows the technical plan
84-
- Report final status with summary of completed work
85-
9. Update the constitution:
86-
- Read the [Constitution](../../.specify/memory/constitution.md) file.
87-
- Read the [constitution prompt](./constitution.prompt.md) for guidance on how to update the constitution.
88-
- Update the constitution file with details on what has been implemented in this PR
89-
- Document the functionality that was added or changed, remove the sections that are no longer relevant
90-
- Ensure the constitution reflects the current state of the codebase
91-
10. Update the CHANGELOG:
92-
- **Locate or create CHANGELOG.md** in the repository root
93-
- **Add a new entry** for this feature/change following the Keep a Changelog format
94-
- **Structure the entry** with:
95-
- Version header (use `[Unreleased]` if version isn't determined yet)
96-
- Date (current date)
97-
- Category sections as applicable:
98-
- `### Added` - for new features
99-
- `### Changed` - for changes in existing functionality
100-
- `### Deprecated` - for soon-to-be removed features
101-
- `### Removed` - for now removed features
102-
- `### Fixed` - for any bugfixes
103-
- `### Security` - for vulnerability fixes
104-
- Write entries from the user's perspective, focusing on what changed and why it matters
105-
- Include brief usage examples where helpful
106-
- Link to the PR or issue: `[#<issue-number>]`
107-
- **Keep it concise**: Focus on user-impacting changes, not internal refactoring details
108-
11. Final commit and push:
109-
- **Stage all implemented changes** including:
110-
- All source code files created or modified
111-
- Updated tasks.md with completed task markers [X]
112-
- Updated CHANGELOG.md
113-
- Updated constitution.md
114-
- Any configuration or documentation files
115-
- **Create a descriptive commit message**:
116-
- Use conventional commit format: `<type>(<scope>): <description>`
117-
- Types: feat, fix, docs, refactor, test, chore
118-
- Include reference to issue: `Fixes #<issue-number>`
119-
- **Push the branch** to remote
120-
- Verify the push completed successfully
121-
12. Update PR description with release notes:
122-
- **Determine workflow mode and target repository**:
123-
- Check if `.fork-info.json` exists in the feature directory (same directory as spec.md)
124-
- **If exists** (fork mode):
125-
- Validate required fields: `is_fork` (true), `upstream_owner` (non-empty), `upstream_repo` (non-empty)
126-
- If validation fails, halt and instruct user: "Invalid fork configuration in `.fork-info.json`. Please run `/specify` again with complete fork information: upstream owner, upstream repo."
127-
- Use `upstream_owner/upstream_repo` for all GitHub operations
128-
- **If not exists** (local mode - default):
129-
- Use the current repository (origin) for all GitHub operations
130-
- **Determine PR operation**:
131-
- If PR already exists for this branch, UPDATE it (description, status, labels)
132-
- If no PR exists, CREATE a new one
133-
- **Target branch**: The PR must be against the default branch
134-
- **PR status**: The PR must not be draft, it should be ready for review
135-
- **Retrieve the issue title**: Get the title from the linked GitHub issue (created in `/specify`) from the target repository
136-
- **Use the same title for the PR**: Verify the PR title matches the issue title exactly. If they differ, update the PR title to match the issue.
137-
- If unable to retrieve the issue title, determine the PR type and icon based on the changes:
138-
139-
| Type of change | Icon | Label |
140-
|-|-|-|
141-
| Docs | 📖 | Docs |
142-
| Fix | 🪲 | Fix, Patch |
143-
| Security fix | ⚠️ | Fix |
144-
| Patch | 🩹 | Patch |
145-
| Feature | 🚀 | Minor |
146-
| Breaking change | 🌟 | Major |
147-
148-
- Fallback PR title format (if issue title unavailable): `<Icon> [Type of change]: <Short description>`
149-
- **REPLACE the entire PR description with release notes**:
150-
- **IMPORTANT**: Clear the existing PR description completely (including task list) and replace it with the release notes
151-
- This ensures the PR description is ready to be used as GitHub Release notes when merged to main
152-
- **Opening summary** (1-2 paragraphs):
153-
- Start with what was accomplished in user-focused language
154-
- Write in past tense: "Added...", "Improved...", "Fixed..."
155-
- Focus on the "why" - what problem does this solve or what capability does it enable?
156-
- Mention the user impact - who benefits and how?
157-
- At the end, add: "Fixes #<issue-number>"
158-
- **What's Changed** section:
159-
- 3-5 bullet points highlighting key changes from the user's perspective
160-
- Focus on capabilities, not implementation details
161-
- Example: "✨ Added support for custom templates" not "Created new Template class"
162-
- **Usage** section (if applicable):
163-
- Brief example showing how to use the new functionality
164-
- Keep it minimal - just enough to get started
165-
- Use code blocks for commands or code snippets
166-
- **Breaking Changes** section (if applicable):
167-
- Clear warning about what breaks
168-
- Migration guidance for users
169-
- What they need to change in their code
170-
- **Technical Notes** section (optional, for maintainers):
171-
- Brief implementation notes if relevant for reviewers
172-
- Dependencies added or updated
173-
- Architecture decisions
174-
- **Tone and style**:
175-
- Professional and concise
176-
- Avoid jargon and internal terminology
177-
- Write for the end user, not just developers
178-
- This description will be used in release notes
179-
- **Apply appropriate label(s)** based on the type of change
180-
- **Link the PR** to the associated issue
181-
- **Update `.fork-info.json`** (if it exists) with the latest PR number (if not already present)
182-
**GitHub Integration**: If GitHub tools or integrations are available (such as GitHub MCP Server or other GitHub integrations), use them to update the PR description in the target repository. If not available, provide this fallback command:
183-
184-
```bash
185-
# Replace PR description with release notes
186-
# If fork: gh pr edit <PR-number> --repo <upstream_owner>/<upstream_repo> --body "<release-note-description>"
187-
# If local: gh pr edit <PR-number> --body "<release-note-description>"
188-
gh pr edit <PR-number> --body "<release-note-description>"
189-
```
190-
191-
13. Mark PR as ready for review:
192-
- **Determine target repository** (same logic as step 12):
193-
- Check if `.fork-info.json` exists in the feature directory
194-
- If it exists and validated, use `upstream_owner/upstream_repo`
195-
- If it doesn't exist, use the current repository (origin)
196-
- **Remove 'Implementing' label** from the linked issue and the PR in the target repository
197-
- **Mark PR as ready for review** (no longer draft)
198-
- **After updates**: Ensure `.fork-info.json` (if it exists) has both issue and PR numbers stored
199-
**GitHub Integration**: If GitHub tools are available, update labels and PR status automatically in the target repository. If not available, use:
200-
201-
```bash
202-
# Mark PR as ready for review
203-
# If fork: gh pr ready <PR-number> --repo <upstream_owner>/<upstream_repo>
204-
# If local: gh pr ready <PR-number>
205-
gh pr ready <PR-number>
206-
207-
# Remove Implementing label from issue
208-
# If fork: gh issue edit <issue-number> --repo <upstream_owner>/<upstream_repo> --remove-label "Implementing"
209-
# If local: gh issue edit <issue-number> --remove-label "Implementing"
210-
gh issue edit <issue-number> --remove-label "Implementing"
211-
212-
# Remove Implementing label from PR
213-
# If fork: gh pr edit <PR-number> --repo <upstream_owner>/<upstream_repo> --remove-label "Implementing"
214-
# If local: gh pr edit <PR-number> --remove-label "Implementing"
215-
gh pr edit <PR-number> --remove-label "Implementing"
216-
```
217-
218-
Note: This command assumes a complete task breakdown exists in tasks.md. If tasks are incomplete or missing, suggest running `/tasks` first to regenerate the task list.
55+
56+
Parse `FEATURE_DIR` and `AVAILABLE_DOCS` list. All paths must be absolute.
57+
58+
3. **Load and analyze the implementation context**
59+
60+
* **REQUIRED**: Read `tasks.md` for the complete task list and execution plan.
61+
* **REQUIRED**: Read `plan.md` for tech stack, architecture, and file structure.
62+
* **IF EXISTS**: Read `data-model.md` for entities and relationships.
63+
* **IF EXISTS**: Read `contracts/` for API specifications and test requirements.
64+
* **IF EXISTS**: Read `research.md` for technical decisions and constraints.
65+
* **IF EXISTS**: Read `quickstart.md` for integration scenarios.
66+
67+
4. **Parse `tasks.md` structure and extract**
68+
69+
* Detect iteration state (completed `[X]`, pending `[ ]`).
70+
* Identify task phases: Setup, Tests, Core, Integration, Polish.
71+
* Capture dependencies: sequential vs parallel (`[P]`).
72+
* Build execution flow based on order and requirements.
73+
74+
5. **Execute implementation following the task plan**
75+
76+
* Skip completed `[X]` tasks.
77+
* Resume from first `[ ]` task.
78+
* Execute phase-by-phase, respecting dependencies.
79+
* Follow TDD: tests before implementation.
80+
* Coordinate tasks by file access.
81+
* Add validation checkpoints.
82+
83+
6. **Implementation execution rules**
84+
85+
* Setup first (dependencies, configs).
86+
* Tests before code.
87+
* Core development.
88+
* Integration (DB, middleware, logging, external services).
89+
* Polish (tests, performance, docs).
90+
91+
7. **Progress tracking and error handling**
92+
93+
* Report progress after each task.
94+
* Halt on failed sequential tasks; continue parallel `[P]` where possible.
95+
* Provide clear error messages and next-step suggestions.
96+
* **Update task status immediately after completion**:
97+
98+
* Mark as `[X]` in `tasks.md`.
99+
* Update PR task list (`- [ ] T###:``- [X] T###:`).
100+
* Use `gh pr edit <PR-number> --body "<updated-description>"` if needed.
101+
102+
8. **Completion validation**
103+
104+
* Verify required tasks.
105+
* Confirm spec compliance.
106+
* Ensure tests pass and coverage is met.
107+
* Check against `plan.md`.
108+
* Report final status.
109+
110+
9. **Update the constitution**
111+
112+
* Read [Constitution](../../.specify/memory/constitution.md).
113+
* Read [constitution prompt](./constitution.prompt.md).
114+
* Update constitution with implemented details.
115+
* Remove obsolete sections.
116+
117+
10. **Update the CHANGELOG**
118+
119+
* Use `CHANGELOG.md` in root.
120+
* Add entry in [Keep a Changelog](https://keepachangelog.com) format.
121+
* Categories: Added, Changed, Deprecated, Removed, Fixed, Security.
122+
* Keep user-focused and concise.
123+
* Example:
124+
125+
```markdown
126+
## [Unreleased] - 2025-10-03
127+
128+
### Added
129+
- Support for new implementation workflow [#123]
130+
```
131+
132+
11. **Final commit and push**
133+
134+
* Stage all changes (`tasks.md`, `CHANGELOG.md`, `constitution.md`, code, configs).
135+
* Commit using Conventional Commit format:
136+
137+
```
138+
<type>(<scope>): <description>
139+
Fixes #<issue-number>
140+
```
141+
* Push branch to remote.
142+
143+
12. **Update PR description with release notes**
144+
145+
* Replace PR body entirely with release notes.
146+
* Ensure title matches issue.
147+
* Release note structure:
148+
149+
* Opening summary (what, why, impact).
150+
* **What's Changed** (3–5 bullets).
151+
* **Usage** (if needed).
152+
* **Breaking Changes** (if any).
153+
* **Technical Notes** (optional).
154+
155+
**Fallback command:**
156+
157+
```bash
158+
gh pr edit <PR-number> --body "<release-note-description>"
159+
```
160+
161+
13. **Mark PR as ready for review**
162+
163+
* Remove `Implementing` label.
164+
* Ensure PR is not draft.
165+
* Sync `.fork-info.json` with issue + PR numbers.
166+
167+
**Fallback commands:**
168+
169+
```bash
170+
gh pr ready <PR-number>
171+
gh issue edit <issue-number> --remove-label "Implementing"
172+
gh pr edit <PR-number> --remove-label "Implementing"
173+
```
174+
175+
---
176+
177+
**Note**: This command assumes a complete task breakdown exists in `tasks.md`. If missing, run `/tasks` first to regenerate.

0 commit comments

Comments
 (0)