You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhance workflow and iteration support across commands
- Updated implement.prompt.md to include workflow modes (Local and Fork) and iteration support for task completion tracking.
- Enhanced plan.prompt.md with workflow modes, iteration detection, and refined task generation based on existing plans.
- Improved specify.prompt.md to support fork contributions, detailed branch naming, and specification writing/updating processes.
- Modified tasks.prompt.md to incorporate workflow modes, iteration detection, and task updating mechanisms.
- Refined create-new-feature.ps1 script to manage branch creation based on current branch context and existing feature detection.
- Added a new constitution-template.md for project governance and principles documentation.
- Removed obsolete spec.md for the Merge CI and Main Workflows feature.
Copy file name to clipboardExpand all lines: .github/prompts/constitution.prompt.md
+51-12Lines changed: 51 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
description: Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
2
+
description: Create (if absent) or iteratively update the project constitution from interactive or provided inputs, ensuring all dependent templates stay in sync.
3
3
---
4
4
5
5
# Constitution
@@ -10,15 +10,49 @@ User input:
10
10
11
11
$ARGUMENTS
12
12
13
-
You are updating the project constitution at `.specify/memory/constitution.md`. This file is a TEMPLATE containing placeholder tokens in square brackets (e.g. `[PROJECT_NAME]`, `[PRINCIPLE_1_NAME]`). Your job is to (a) collect/derive concrete values, (b) fill the template precisely, and (c) propagate any amendments across dependent artifacts.
13
+
**Note**: This command operates on the local repository's constitution and does not typically require fork-specific logic, as constitutional changes are usually made within the repository itself rather than targeting upstream repositories.
14
+
15
+
You are (a) creating or (b) iterating on the project constitution at `.specify/memory/constitution.md`.
16
+
17
+
Two operating modes:
18
+
19
+
1. Initial Creation Mode (constitution file does NOT exist):
20
+
- Copy `.specify/templates/constitution-template.md` to `.specify/memory/constitution.md` verbatim before processing.
21
+
- Treat the copied file as a TEMPLATE containing placeholder tokens in square brackets (e.g. `[PROJECT_NAME]`, `[PRINCIPLE_1_NAME]`).
22
+
- Produce an initial version (default `1.0.0` unless the user specifies otherwise). Ratification date = today (unless user supplies one). Last amended date = same as ratification.
- Load the existing `.specify/memory/constitution.md` (NOT the template) as the authoritative current constitution.
25
+
- Do NOT re-copy the template. Only reference the template to discover any NEW placeholders/sections that could be adopted.
26
+
- Identify new functionality / sections / principles requested (from user input or arguments) and integrate them.
27
+
- If a new principle or governance rule appears to REPLACE or substantially OVERLAP an existing one, generate a Replacement Analysis Table and request user confirmation before destructive changes. If interactive confirmation is not possible in this run, mark the affected original item with `TODO(REVIEW_REPLACEMENT): Proposed replacement: <new title>` and include in the Sync Impact Report under deferred actions.
28
+
- Preserve original ratification date. Increment version per rules below. Update last amended date to today if any material change occurs.
| <title / section> | <incoming title / change> | e.g. semantic similarity, scope duplication | Replace / Merge / Keep Both |
35
+
36
+
Heuristics for overlap:
37
+
- Title similarity score (case-insensitive) >= 0.6 (rough string similarity) OR
38
+
->50% of bullet rules conceptually duplicate (same verbs/nouns) OR
39
+
- Governance rule introduces stricter variant of an existing rule.
40
+
41
+
If ambiguity remains, prefer non-destructive addition plus TODO marker.
14
42
15
43
Follow this execution flow:
16
44
17
-
1. Load the existing constitution template at `.specify/memory/constitution.md`.
18
-
- Identify every placeholder token of the form `[ALL_CAPS_IDENTIFIER]`.
19
-
**IMPORTANT**: The user might require less or more principles than the ones used in the template. If a number is specified, respect that - follow the general template. You will update the doc accordingly.
45
+
0. Existence Check & Mode Selection:
46
+
- If `.specify/memory/constitution.md` is missing → enter Initial Creation Mode (copy template, then proceed).
47
+
- If it exists → Iteration Mode (operate directly on existing file; treat remaining bracket tokens, if any, as still-to-be-resolved placeholders).
48
+
49
+
1. Load Source Document:
50
+
- Creation Mode: load freshly copied `.specify/memory/constitution.md` (formerly the template).
51
+
- Iteration Mode: load existing `.specify/memory/constitution.md` and independently load `.specify/templates/constitution-template.md` only to detect any NEW placeholders/sections not yet present.
52
+
- Identify every placeholder token `[ALL_CAPS_IDENTIFIER]` still unresolved in the working constitution (not just in template).
53
+
- IMPORTANT: User may request changing the number of principles. Respect explicit user instruction; re-number or re-label as needed (maintain Roman numeral style if already in use; otherwise adopt consistent scheme).
20
54
21
-
2. Collect/derive values for placeholders:
55
+
2. Collect/derive values for placeholders (and new/changed content):
22
56
- If user input (conversation) supplies a value, use it.
23
57
- Otherwise infer from existing repo context (README, docs, prior constitution versions if embedded).
24
58
- For governance dates: `RATIFICATION_DATE` is the original adoption date (if unknown ask or mark TODO), `LAST_AMENDED_DATE` is today if changes are made, otherwise keep previous.
- If version bump type ambiguous, propose reasoning before finalizing.
30
64
31
-
3. Draft the updated constitution content:
65
+
3. Draft / Merge updated constitution content:
66
+
- In Iteration Mode, integrate new principles/sections with minimal disruption:
67
+
* Retain stable identifiers (e.g., keep existing principle numbering unless renumbering is explicitly required or gaps introduced by removals).
68
+
* When replacing, either (a) fully substitute content if user confirmed or (b) append revised content and mark old with `DEPRECATED:` prefix plus TODO for removal in a future major version.
32
69
- Replace every placeholder with concrete text (no bracketed tokens left except intentionally retained template slots that the project has chosen not to define yet—explicitly justify any left).
33
70
- Preserve heading hierarchy and comments can be removed once replaced unless they still add clarifying guidance.
34
71
- Ensure each Principle section: succinct name line, paragraph (or bullet list) capturing non‑negotiable rules, explicit rationale if not obvious.
4. Consistency propagation checklist (convert prior checklist into active validations):
38
-
- Read `.specify/templates/plan-template.md` and ensure any "Constitution Check" or rules align with updated principles.
39
-
- Read `.specify/templates/spec-template.md` for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
40
-
- Read `.specify/templates/tasks-template.md` and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
41
-
- Read each command file in `.specify/templates/commands/*.md` (including this one) to verify no outdated references (agent-specific names like CLAUDE only) remain when generic guidance is required.
75
+
- Read [`.specify/templates/plan-template.md`](../../.specify/templates/plan-template.md) and ensure any "Constitution Check" or rules align with updated principles.
76
+
- Read [`.specify/templates/spec-template.md`](../../.specify/templates/spec-template.md) for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
77
+
- Read [`.specify/templates/tasks-template.md`](../../.specify/templates/tasks-template.md) and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
78
+
- Read each related prompt file in `.github/prompts/` (including this one) to verify no outdated agent-specific references remain (e.g., names tied to a specific LLM vendor) when generic guidance is required.
42
79
- Read any runtime guidance docs (e.g., `README.md`, `docs/quickstart.md`, or agent-specific guidance files if present). Update references to principles changed.
43
80
44
81
5. Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
45
82
- Version change: old → new
46
83
- List of modified principles (old title → new title if renamed)
- Follow-up TODOs if any placeholders intentionally deferred.
89
+
- Replacement items needing confirmation (if any)
51
90
52
91
6. Validation before final output:
53
92
- No remaining unexplained bracket tokens.
54
93
- Version line matches report.
55
94
- Dates ISO format YYYY-MM-DD.
56
95
- Principles are declarative, testable, and free of vague language ("should" → replace with MUST/SHOULD rationale where appropriate).
57
96
58
-
7. Write the completed constitution back to `.specify/memory/constitution.md` (overwrite).
97
+
7. Write the completed constitution back to [`.specify/memory/constitution.md`](../../.specify/memory/constitution.md) (overwrite). Never write to the template path during iteration.
Copy file name to clipboardExpand all lines: .github/prompts/implement.prompt.md
+69-11Lines changed: 69 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,13 @@ User input:
10
10
11
11
$ARGUMENTS
12
12
13
-
1. Run `.specify/scripts/powershell/check-prerequisites.ps1 -Json -RequireTasks -IncludeTasks` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute.
13
+
**Workflow Modes**: This command supports two modes:
14
+
-**Local (default)**: Work with the current repository (origin). No special configuration needed.
15
+
-**Fork**: Contribute to an upstream repository. Reads `.fork-info.json` created by `/specify`.
16
+
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.
18
+
19
+
1. 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.
14
20
15
21
2. Load and analyze the implementation context:
16
22
-**REQUIRED**: Read tasks.md for the complete task list and execution plan
@@ -21,12 +27,18 @@ $ARGUMENTS
21
27
-**IF EXISTS**: Read quickstart.md for integration scenarios
- 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."
76
+
- Use `upstream_owner/upstream_repo` for all GitHub operations
77
+
-**If not exists** (local mode - default):
78
+
- Use the current repository (origin) for all GitHub operations
79
+
-**Determine PR operation**:
80
+
- If PR already exists for this branch, UPDATE it (description, status, labels)
81
+
- If no PR exists, CREATE a new one
59
82
-**Target branch**: The PR must be against the default branch
60
83
-**PR status**: The PR must not be draft, it should be ready for review
61
-
-**Determine PR type and icon** based on the changes:
84
+
-**Retrieve the issue title**: Get the title from the linked GitHub issue (created in `/specify`) from the target repository
85
+
-**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.
86
+
- If unable to retrieve the issue title, determine the PR type and icon based on the changes:
62
87
63
88
| Type of change | Icon | Label |
64
89
|-|-|-|
@@ -69,20 +94,53 @@ $ARGUMENTS
69
94
| Feature | 🚀 | Minor |
70
95
| Breaking change | 🌟 | Major |
71
96
72
-
-**PR title format**: `<Icon> [Type of change]: <Short description>`
73
-
-**PR description structure**:
74
-
* Start with a summary paragraph describing the key outcome and changes for user
75
-
* DO NOT add a title before the leading paragraph
76
-
* At the end of the PR paragraph, add a "- Fixes #<issue-number>" line to link the PR to the issue
77
-
* Follow with additional details answering Why, How, and What
78
-
* Avoid superfluous headers or sections
79
-
* We do not need details, we need to add what changes for the user of the code
97
+
- Fallback PR title format (if issue title unavailable): `<Icon> [Type of change]: <Short description>`
98
+
-**PR description structure** (formatted as a release note):
99
+
* Start with a user-focused summary paragraph describing what's new, improved, or fixed
100
+
* Write in past tense, focusing on capabilities and user benefits (e.g., "Added support for...", "Improved performance of...", "Fixed issue where...")
101
+
* DO NOT add a title or heading before the leading paragraph
102
+
* Keep the tone professional and concise - this will be read as a release note
103
+
* At the end of the summary paragraph, add "- Fixes #<issue-number>" to link the PR to the issue
104
+
* Follow with additional release-note style details:
105
+
-**What's Changed**: Brief bullet points of key changes from the user's perspective
106
+
-**Technical Details** (optional): Implementation notes if relevant for maintainers
107
+
-**Breaking Changes** (if applicable): Clear warning and migration guidance
108
+
-**Usage** (if applicable): Brief example or updated command syntax
109
+
* Avoid superfluous headers, verbose explanations, or internal implementation details
110
+
* Focus on what changes for the end user or developer using this code
80
111
-**Apply appropriate label(s)** based on the type of change
81
112
-**Link the PR** to the associated issue
113
+
-**After PR updates**: Update `.fork-info.json` (if it exists) with the latest PR number (if not already present)
114
+
115
+
**GitHub Integration**: If GitHub tools or integrations are available (such as GitHub MCP Server or other GitHub integrations), use them to update the PR status and labels automatically in the target repository. If not available, provide these fallback commands with the correct repository:
116
+
```bash
117
+
# Mark PR as ready for review
118
+
# If fork: gh pr ready <PR-number> --repo <upstream_owner>/<upstream_repo>
119
+
# If local: gh pr ready <PR-number>
120
+
gh pr ready <PR-number>
121
+
122
+
# Update PR title to match issue (if needed)
123
+
gh pr edit <PR-number> --title "<Issue title>"
124
+
125
+
# Update labels
126
+
gh pr edit <PR-number> --add-label "<Type>"
127
+
```
82
128
83
129
9. Update issue labels:
84
-
- Remove 'plan' label from the linked issue
130
+
-**Determine target repository** (same logic as step 8):
131
+
- Check if `.fork-info.json` exists in the feature directory
132
+
- If it exists and validated, use `upstream_owner/upstream_repo`
133
+
- If it doesn't exist, use the current repository (origin)
134
+
- Remove 'plan' label from the linked issue in the target repository
85
135
- Add 'implement' label to the linked issue
136
+
-**After updating labels**: Ensure `.fork-info.json` (if it exists) has the issue number stored
137
+
138
+
**GitHub Integration**: If GitHub tools are available, update labels automatically in the target repository. If not available, use:
139
+
```bash
140
+
# If fork: gh issue edit <issue-number> --repo <upstream_owner>/<upstream_repo> ...
0 commit comments