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
The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
9
-
10
-
User input:
11
-
12
-
`$ARGUMENTS
13
-
`
14
-
Goal: Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/tasks` has successfully produced a complete `tasks.md`.
15
-
16
-
STRICTLY READ-ONLY: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
17
-
18
-
Constitution Authority: The project constitution (`/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/analyze`.
19
-
20
-
Execution steps:
21
-
22
-
1. Run `{SCRIPT}` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
23
-
- SPEC = FEATURE_DIR/spec.md
24
-
- PLAN = FEATURE_DIR/plan.md
25
-
- TASKS = FEATURE_DIR/tasks.md
26
-
Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
- Load constitution `/memory/constitution.md` for principle validation.
33
-
34
-
3. Build internal semantic models:
35
-
- Requirements inventory: Each functional + non-functional requirement with a stable key (derive slug based on imperative phrase; e.g., "User can upload file" -> `user-can-upload-file`).
36
-
- User story/action inventory.
37
-
- Task coverage mapping: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases).
38
-
- Constitution rule set: Extract principle names and any MUST/SHOULD normative statements.
39
-
40
-
4. Detection passes:
41
-
A. Duplication detection:
42
-
- Identify near-duplicate requirements. Mark lower-quality phrasing for consolidation.
7. At end of report, output a concise Next Actions block:
91
-
- If CRITICAL issues exist: Recommend resolving before `/implement`.
92
-
- If only LOW/MEDIUM: User may proceed, but provide improvement suggestions.
93
-
- Provide explicit command suggestions: e.g., "Run /specify with refinement", "Run /plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'".
94
-
95
-
8. Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
96
-
97
-
Behavior rules:
98
-
- NEVER modify files.
99
-
- NEVER hallucinate missing sections—if absent, report them.
100
-
- KEEP findings deterministic: if rerun without changes, produce consistent IDs and counts.
101
-
- LIMIT total findings in the main table to 50; aggregate remainder in a summarized overflow note.
102
-
- If zero issues found, emit a success report with coverage statistics and proceed recommendation.
103
-
104
-
Context: {ARGS}
8
+
## User Input
9
+
10
+
```text
11
+
$ARGUMENTS
12
+
```
13
+
14
+
You **MUST** consider the user input before proceeding (if not empty).
15
+
16
+
## Goal
17
+
18
+
Identify inconsistencies, duplications, ambiguities, and underspecified items across the three core artifacts (`spec.md`, `plan.md`, `tasks.md`) before implementation. This command MUST run only after `/tasks` has successfully produced a complete `tasks.md`.
19
+
20
+
## Operating Constraints
21
+
22
+
**STRICTLY READ-ONLY**: Do **not** modify any files. Output a structured analysis report. Offer an optional remediation plan (user must explicitly approve before any follow-up editing commands would be invoked manually).
23
+
24
+
**Constitution Authority**: The project constitution (`/memory/constitution.md`) is **non-negotiable** within this analysis scope. Constitution conflicts are automatically CRITICAL and require adjustment of the spec, plan, or tasks—not dilution, reinterpretation, or silent ignoring of the principle. If a principle itself needs to change, that must occur in a separate, explicit constitution update outside `/analyze`.
25
+
26
+
## Execution Steps
27
+
28
+
### 1. Initialize Analysis Context
29
+
30
+
Run `{SCRIPT}` once from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS. Derive absolute paths:
31
+
32
+
- SPEC = FEATURE_DIR/spec.md
33
+
- PLAN = FEATURE_DIR/plan.md
34
+
- TASKS = FEATURE_DIR/tasks.md
35
+
36
+
Abort with an error message if any required file is missing (instruct the user to run missing prerequisite command).
37
+
38
+
### 2. Load Artifacts (Progressive Disclosure)
39
+
40
+
Load only the minimal necessary context from each artifact:
41
+
42
+
**From spec.md:**
43
+
44
+
- Overview/Context
45
+
- Functional Requirements
46
+
- Non-Functional Requirements
47
+
- User Stories
48
+
- Edge Cases (if present)
49
+
50
+
**From plan.md:**
51
+
52
+
- Architecture/stack choices
53
+
- Data Model references
54
+
- Phases
55
+
- Technical constraints
56
+
57
+
**From tasks.md:**
58
+
59
+
- Task IDs
60
+
- Descriptions
61
+
- Phase grouping
62
+
- Parallel markers [P]
63
+
- Referenced file paths
64
+
65
+
**From constitution:**
66
+
67
+
- Load `/memory/constitution.md` for principle validation
68
+
69
+
### 3. Build Semantic Models
70
+
71
+
Create internal representations (do not include raw artifacts in output):
72
+
73
+
-**Requirements inventory**: Each functional + non-functional requirement with a stable key (derive slug based on imperative phrase; e.g., "User can upload file" → `user-can-upload-file`)
74
+
-**User story/action inventory**: Discrete user actions with acceptance criteria
75
+
-**Task coverage mapping**: Map each task to one or more requirements or stories (inference by keyword / explicit reference patterns like IDs or key phrases)
76
+
-**Constitution rule set**: Extract principle names and MUST/SHOULD normative statements
At end of report, output a concise Next Actions block:
158
+
159
+
- If CRITICAL issues exist: Recommend resolving before `/implement`
160
+
- If only LOW/MEDIUM: User may proceed, but provide improvement suggestions
161
+
- Provide explicit command suggestions: e.g., "Run /specify with refinement", "Run /plan to adjust architecture", "Manually edit tasks.md to add coverage for 'performance-metrics'"
162
+
163
+
### 8. Offer Remediation
164
+
165
+
Ask the user: "Would you like me to suggest concrete remediation edits for the top N issues?" (Do NOT apply them automatically.)
166
+
167
+
## Operating Principles
168
+
169
+
### Context Efficiency
170
+
171
+
-**Minimal high-signal tokens**: Focus on actionable findings, not exhaustive documentation
172
+
-**Progressive disclosure**: Load artifacts incrementally; don't dump all content into analysis
173
+
-**Token-efficient output**: Limit findings table to 50 rows; summarize overflow
174
+
-**Deterministic results**: Rerunning without changes should produce consistent IDs and counts
175
+
176
+
### Analysis Guidelines
177
+
178
+
-**NEVER modify files** (this is read-only analysis)
179
+
-**NEVER hallucinate missing sections** (if absent, report them accurately)
180
+
-**Prioritize constitution violations** (these are always CRITICAL)
181
+
-**Use examples over exhaustive rules** (cite specific instances, not generic patterns)
182
+
-**Report zero issues gracefully** (emit success report with coverage statistics)
The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
8
+
## User Input
9
9
10
-
User input:
10
+
```text
11
+
$ARGUMENTS
12
+
```
13
+
14
+
You **MUST** consider the user input before proceeding (if not empty).
11
15
12
-
`$ARGUMENTS
13
-
`
14
16
## Execution Steps
15
17
16
18
1.**Setup**: Run `{SCRIPT}` from repo root and parse JSON for FEATURE_DIR and AVAILABLE_DOCS list.
The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
8
+
## User Input
9
9
10
-
User input:
10
+
```text
11
+
$ARGUMENTS
12
+
```
11
13
12
-
`$ARGUMENTS`
14
+
You **MUST** consider the user input before proceeding (if not empty).
15
+
16
+
## Outline
13
17
14
18
Goal: Detect and reduce ambiguity or missing decision points in the active feature specification and record the clarifications directly in the spec file.
Copy file name to clipboardExpand all lines: templates/commands/constitution.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,15 @@
2
2
description: Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
3
3
---
4
4
5
-
The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
5
+
## User Input
6
6
7
-
User input:
7
+
```text
8
+
$ARGUMENTS
9
+
```
8
10
9
-
`$ARGUMENTS`
11
+
You **MUST** consider the user input before proceeding (if not empty).
12
+
13
+
## Outline
10
14
11
15
You are updating the project constitution at `/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.
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).
8
+
## User Input
9
9
10
-
User input:
10
+
```text
11
+
$ARGUMENTS
12
+
```
11
13
12
-
`$ARGUMENTS`
14
+
You **MUST** consider the user input before proceeding (if not empty).
15
+
16
+
## Outline
13
17
14
18
1. Run `{SCRIPT}` from repo root and parse FEATURE_DIR and AVAILABLE_DOCS list. All paths must be absolute.
The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
11
+
## User Input
12
12
13
-
User input:
13
+
```text
14
+
$ARGUMENTS
15
+
```
14
16
15
-
`$ARGUMENTS`
17
+
You **MUST** consider the user input before proceeding (if not empty).
16
18
17
-
## Execution Steps
19
+
## Outline
18
20
19
21
1.**Setup**: Run `{SCRIPT}` from repo root and parse JSON for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH.
20
22
- Before proceeding: Check FEATURE_SPEC has `## Clarifications` section. If missing or ambiguous, instruct user to run `/clarify` first.
The user input to you can be provided directly by the agent or as a command argument - you **MUST** consider it before proceeding with the prompt (if not empty).
8
+
## User Input
9
9
10
-
User input:
10
+
```text
11
+
$ARGUMENTS
12
+
```
11
13
12
-
`$ARGUMENTS`
14
+
You **MUST** consider the user input before proceeding (if not empty).
15
+
16
+
## Outline
13
17
14
18
The text the user typed after `/specify` in the triggering message **is** the feature description. Assume you always have it available in this conversation even if `{ARGS}` appears literally below. Do not ask the user to repeat it unless they provided an empty command.
0 commit comments