quantix-mcp 0.3.6 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/agents/copilot-instructions.md +32 -32
- package/.github/copilot-instructions.md +17 -17
- package/.github/workflows/publish.yaml +28 -28
- package/.opencode/command/speckit.analyze.md +184 -184
- package/.opencode/command/speckit.checklist.md +294 -294
- package/.opencode/command/speckit.clarify.md +181 -181
- package/.opencode/command/speckit.constitution.md +84 -84
- package/.opencode/command/speckit.implement.md +135 -135
- package/.opencode/command/speckit.plan.md +89 -89
- package/.opencode/command/speckit.specify.md +258 -258
- package/.opencode/command/speckit.tasks.md +137 -137
- package/.opencode/command/speckit.taskstoissues.md +30 -30
- package/.specify/memory/constitution.md +58 -58
- package/.specify/templates/constitution-template.md +50 -50
- package/.vscode/launch.json +14 -14
- package/CLAUDE.md +64 -64
- package/README.md +176 -176
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/tools/accounts.d.ts.map +1 -1
- package/dist/tools/accounts.js +64 -28
- package/dist/tools/accounts.js.map +1 -1
- package/dist/tools/categories.d.ts.map +1 -1
- package/dist/tools/categories.js +46 -20
- package/dist/tools/categories.js.map +1 -1
- package/dist/tools/credit-cards.d.ts.map +1 -1
- package/dist/tools/credit-cards.js +89 -33
- package/dist/tools/credit-cards.js.map +1 -1
- package/dist/tools/data.d.ts.map +1 -1
- package/dist/tools/data.js +19 -8
- package/dist/tools/data.js.map +1 -1
- package/dist/tools/settings.d.ts.map +1 -1
- package/dist/tools/settings.js +28 -12
- package/dist/tools/settings.js.map +1 -1
- package/dist/tools/summary.d.ts.map +1 -1
- package/dist/tools/summary.js +17 -11
- package/dist/tools/summary.js.map +1 -1
- package/dist/tools/transactions.d.ts.map +1 -1
- package/dist/tools/transactions.js +86 -50
- package/dist/tools/transactions.js.map +1 -1
- package/dist/tools/transfers.d.ts +3 -0
- package/dist/tools/transfers.d.ts.map +1 -0
- package/dist/tools/transfers.js +107 -0
- package/dist/tools/transfers.js.map +1 -0
- package/dist/types/schemas.d.ts +25 -0
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +28 -2
- package/dist/types/schemas.js.map +1 -1
- package/dist/utils/toolHelpers.d.ts +7 -0
- package/dist/utils/toolHelpers.d.ts.map +1 -0
- package/dist/utils/toolHelpers.js +11 -0
- package/dist/utils/toolHelpers.js.map +1 -0
- package/openapi.yaml +2045 -1786
- package/package.json +41 -41
- package/specs/001-mcp-api-integration/checklists/requirements.md +34 -34
- package/specs/001-mcp-api-integration/contracts/openapi.yaml +635 -635
- package/specs/001-mcp-api-integration/data-model.md +106 -106
- package/specs/001-mcp-api-integration/plan.md +73 -73
- package/specs/001-mcp-api-integration/quickstart.md +74 -74
- package/specs/001-mcp-api-integration/research.md +58 -58
- package/specs/001-mcp-api-integration/spec.md +119 -119
- package/specs/001-mcp-api-integration/tasks.md +64 -64
- package/src/config.ts +36 -36
- package/src/index.ts +49 -47
- package/src/services/apiClient.ts +49 -49
- package/src/tools/accounts.ts +140 -111
- package/src/tools/categories.ts +102 -81
- package/src/tools/credit-cards.ts +184 -132
- package/src/tools/data.ts +45 -36
- package/src/tools/settings.ts +64 -51
- package/src/tools/summary.ts +29 -24
- package/src/tools/transactions.ts +157 -128
- package/src/tools/transfers.ts +122 -0
- package/src/types/schemas.ts +260 -230
- package/src/utils/toolHelpers.ts +11 -0
- package/tests/benchmark.test.d.ts +1 -1
- package/tests/benchmark.test.js +32 -32
- package/tests/benchmark.test.ts +38 -38
- package/tests/server.test.d.ts +1 -1
- package/tests/server.test.js +12 -12
- package/tests/server.test.ts +14 -14
- package/tests/setup.d.ts +3 -3
- package/tests/setup.js +16 -16
- package/tests/setup.ts +20 -20
- package/tests/tools/accounts.test.ts +159 -118
- package/tests/tools/categories.test.d.ts +1 -1
- package/tests/tools/categories.test.js +62 -62
- package/tests/tools/categories.test.ts +120 -78
- package/tests/tools/credit-cards.test.d.ts +1 -1
- package/tests/tools/credit-cards.test.js +70 -70
- package/tests/tools/credit-cards.test.ts +131 -89
- package/tests/tools/data.test.ts +100 -0
- package/tests/tools/settings.test.ts +116 -0
- package/tests/tools/summary.test.d.ts +1 -1
- package/tests/tools/summary.test.js +35 -35
- package/tests/tools/summary.test.ts +63 -42
- package/tests/tools/transactions.test.d.ts +1 -1
- package/tests/tools/transactions.test.js +66 -66
- package/tests/tools/transactions.test.ts +133 -82
- package/tests/tools/transfers.test.ts +141 -0
- package/tsconfig.json +52 -52
- package/vitest.config.d.ts +2 -2
- package/vitest.config.js +13 -13
- package/vitest.config.ts +14 -14
|
@@ -1,181 +1,181 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
|
|
3
|
-
handoffs:
|
|
4
|
-
- label: Build Technical Plan
|
|
5
|
-
agent: speckit.plan
|
|
6
|
-
prompt: Create a plan for the spec. I am building with...
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## User Input
|
|
10
|
-
|
|
11
|
-
```text
|
|
12
|
-
$ARGUMENTS
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
You **MUST** consider the user input before proceeding (if not empty).
|
|
16
|
-
|
|
17
|
-
## Outline
|
|
18
|
-
|
|
19
|
-
Goal: Detect and reduce ambiguity or missing decision points in the active feature specification and record the clarifications directly in the spec file.
|
|
20
|
-
|
|
21
|
-
Note: This clarification workflow is expected to run (and be completed) BEFORE invoking `/speckit.plan`. If the user explicitly states they are skipping clarification (e.g., exploratory spike), you may proceed, but must warn that downstream rework risk increases.
|
|
22
|
-
|
|
23
|
-
Execution steps:
|
|
24
|
-
|
|
25
|
-
1. Run `.specify/scripts/powershell/check-prerequisites.ps1 -Json -PathsOnly` from repo root **once** (combined `--json --paths-only` mode / `-Json -PathsOnly`). Parse minimal JSON payload fields:
|
|
26
|
-
- `FEATURE_DIR`
|
|
27
|
-
- `FEATURE_SPEC`
|
|
28
|
-
- (Optionally capture `IMPL_PLAN`, `TASKS` for future chained flows.)
|
|
29
|
-
- If JSON parsing fails, abort and instruct user to re-run `/speckit.specify` or verify feature branch environment.
|
|
30
|
-
- For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
|
|
31
|
-
|
|
32
|
-
2. Load the current spec file. Perform a structured ambiguity & coverage scan using this taxonomy. For each category, mark status: Clear / Partial / Missing. Produce an internal coverage map used for prioritization (do not output raw map unless no questions will be asked).
|
|
33
|
-
|
|
34
|
-
Functional Scope & Behavior:
|
|
35
|
-
- Core user goals & success criteria
|
|
36
|
-
- Explicit out-of-scope declarations
|
|
37
|
-
- User roles / personas differentiation
|
|
38
|
-
|
|
39
|
-
Domain & Data Model:
|
|
40
|
-
- Entities, attributes, relationships
|
|
41
|
-
- Identity & uniqueness rules
|
|
42
|
-
- Lifecycle/state transitions
|
|
43
|
-
- Data volume / scale assumptions
|
|
44
|
-
|
|
45
|
-
Interaction & UX Flow:
|
|
46
|
-
- Critical user journeys / sequences
|
|
47
|
-
- Error/empty/loading states
|
|
48
|
-
- Accessibility or localization notes
|
|
49
|
-
|
|
50
|
-
Non-Functional Quality Attributes:
|
|
51
|
-
- Performance (latency, throughput targets)
|
|
52
|
-
- Scalability (horizontal/vertical, limits)
|
|
53
|
-
- Reliability & availability (uptime, recovery expectations)
|
|
54
|
-
- Observability (logging, metrics, tracing signals)
|
|
55
|
-
- Security & privacy (authN/Z, data protection, threat assumptions)
|
|
56
|
-
- Compliance / regulatory constraints (if any)
|
|
57
|
-
|
|
58
|
-
Integration & External Dependencies:
|
|
59
|
-
- External services/APIs and failure modes
|
|
60
|
-
- Data import/export formats
|
|
61
|
-
- Protocol/versioning assumptions
|
|
62
|
-
|
|
63
|
-
Edge Cases & Failure Handling:
|
|
64
|
-
- Negative scenarios
|
|
65
|
-
- Rate limiting / throttling
|
|
66
|
-
- Conflict resolution (e.g., concurrent edits)
|
|
67
|
-
|
|
68
|
-
Constraints & Tradeoffs:
|
|
69
|
-
- Technical constraints (language, storage, hosting)
|
|
70
|
-
- Explicit tradeoffs or rejected alternatives
|
|
71
|
-
|
|
72
|
-
Terminology & Consistency:
|
|
73
|
-
- Canonical glossary terms
|
|
74
|
-
- Avoided synonyms / deprecated terms
|
|
75
|
-
|
|
76
|
-
Completion Signals:
|
|
77
|
-
- Acceptance criteria testability
|
|
78
|
-
- Measurable Definition of Done style indicators
|
|
79
|
-
|
|
80
|
-
Misc / Placeholders:
|
|
81
|
-
- TODO markers / unresolved decisions
|
|
82
|
-
- Ambiguous adjectives ("robust", "intuitive") lacking quantification
|
|
83
|
-
|
|
84
|
-
For each category with Partial or Missing status, add a candidate question opportunity unless:
|
|
85
|
-
- Clarification would not materially change implementation or validation strategy
|
|
86
|
-
- Information is better deferred to planning phase (note internally)
|
|
87
|
-
|
|
88
|
-
3. Generate (internally) a prioritized queue of candidate clarification questions (maximum 5). Do NOT output them all at once. Apply these constraints:
|
|
89
|
-
- Maximum of 10 total questions across the whole session.
|
|
90
|
-
- Each question must be answerable with EITHER:
|
|
91
|
-
- A short multiple‑choice selection (2–5 distinct, mutually exclusive options), OR
|
|
92
|
-
- A one-word / short‑phrase answer (explicitly constrain: "Answer in <=5 words").
|
|
93
|
-
- Only include questions whose answers materially impact architecture, data modeling, task decomposition, test design, UX behavior, operational readiness, or compliance validation.
|
|
94
|
-
- Ensure category coverage balance: attempt to cover the highest impact unresolved categories first; avoid asking two low-impact questions when a single high-impact area (e.g., security posture) is unresolved.
|
|
95
|
-
- Exclude questions already answered, trivial stylistic preferences, or plan-level execution details (unless blocking correctness).
|
|
96
|
-
- Favor clarifications that reduce downstream rework risk or prevent misaligned acceptance tests.
|
|
97
|
-
- If more than 5 categories remain unresolved, select the top 5 by (Impact * Uncertainty) heuristic.
|
|
98
|
-
|
|
99
|
-
4. Sequential questioning loop (interactive):
|
|
100
|
-
- Present EXACTLY ONE question at a time.
|
|
101
|
-
- For multiple‑choice questions:
|
|
102
|
-
- **Analyze all options** and determine the **most suitable option** based on:
|
|
103
|
-
- Best practices for the project type
|
|
104
|
-
- Common patterns in similar implementations
|
|
105
|
-
- Risk reduction (security, performance, maintainability)
|
|
106
|
-
- Alignment with any explicit project goals or constraints visible in the spec
|
|
107
|
-
- Present your **recommended option prominently** at the top with clear reasoning (1-2 sentences explaining why this is the best choice).
|
|
108
|
-
- Format as: `**Recommended:** Option [X] - <reasoning>`
|
|
109
|
-
- Then render all options as a Markdown table:
|
|
110
|
-
|
|
111
|
-
| Option | Description |
|
|
112
|
-
|--------|-------------|
|
|
113
|
-
| A | <Option A description> |
|
|
114
|
-
| B | <Option B description> |
|
|
115
|
-
| C | <Option C description> (add D/E as needed up to 5) |
|
|
116
|
-
| Short | Provide a different short answer (<=5 words) (Include only if free-form alternative is appropriate) |
|
|
117
|
-
|
|
118
|
-
- After the table, add: `You can reply with the option letter (e.g., "A"), accept the recommendation by saying "yes" or "recommended", or provide your own short answer.`
|
|
119
|
-
- For short‑answer style (no meaningful discrete options):
|
|
120
|
-
- Provide your **suggested answer** based on best practices and context.
|
|
121
|
-
- Format as: `**Suggested:** <your proposed answer> - <brief reasoning>`
|
|
122
|
-
- Then output: `Format: Short answer (<=5 words). You can accept the suggestion by saying "yes" or "suggested", or provide your own answer.`
|
|
123
|
-
- After the user answers:
|
|
124
|
-
- If the user replies with "yes", "recommended", or "suggested", use your previously stated recommendation/suggestion as the answer.
|
|
125
|
-
- Otherwise, validate the answer maps to one option or fits the <=5 word constraint.
|
|
126
|
-
- If ambiguous, ask for a quick disambiguation (count still belongs to same question; do not advance).
|
|
127
|
-
- Once satisfactory, record it in working memory (do not yet write to disk) and move to the next queued question.
|
|
128
|
-
- Stop asking further questions when:
|
|
129
|
-
- All critical ambiguities resolved early (remaining queued items become unnecessary), OR
|
|
130
|
-
- User signals completion ("done", "good", "no more"), OR
|
|
131
|
-
- You reach 5 asked questions.
|
|
132
|
-
- Never reveal future queued questions in advance.
|
|
133
|
-
- If no valid questions exist at start, immediately report no critical ambiguities.
|
|
134
|
-
|
|
135
|
-
5. Integration after EACH accepted answer (incremental update approach):
|
|
136
|
-
- Maintain in-memory representation of the spec (loaded once at start) plus the raw file contents.
|
|
137
|
-
- For the first integrated answer in this session:
|
|
138
|
-
- Ensure a `## Clarifications` section exists (create it just after the highest-level contextual/overview section per the spec template if missing).
|
|
139
|
-
- Under it, create (if not present) a `### Session YYYY-MM-DD` subheading for today.
|
|
140
|
-
- Append a bullet line immediately after acceptance: `- Q: <question> → A: <final answer>`.
|
|
141
|
-
- Then immediately apply the clarification to the most appropriate section(s):
|
|
142
|
-
- Functional ambiguity → Update or add a bullet in Functional Requirements.
|
|
143
|
-
- User interaction / actor distinction → Update User Stories or Actors subsection (if present) with clarified role, constraint, or scenario.
|
|
144
|
-
- Data shape / entities → Update Data Model (add fields, types, relationships) preserving ordering; note added constraints succinctly.
|
|
145
|
-
- Non-functional constraint → Add/modify measurable criteria in Non-Functional / Quality Attributes section (convert vague adjective to metric or explicit target).
|
|
146
|
-
- Edge case / negative flow → Add a new bullet under Edge Cases / Error Handling (or create such subsection if template provides placeholder for it).
|
|
147
|
-
- Terminology conflict → Normalize term across spec; retain original only if necessary by adding `(formerly referred to as "X")` once.
|
|
148
|
-
- If the clarification invalidates an earlier ambiguous statement, replace that statement instead of duplicating; leave no obsolete contradictory text.
|
|
149
|
-
- Save the spec file AFTER each integration to minimize risk of context loss (atomic overwrite).
|
|
150
|
-
- Preserve formatting: do not reorder unrelated sections; keep heading hierarchy intact.
|
|
151
|
-
- Keep each inserted clarification minimal and testable (avoid narrative drift).
|
|
152
|
-
|
|
153
|
-
6. Validation (performed after EACH write plus final pass):
|
|
154
|
-
- Clarifications session contains exactly one bullet per accepted answer (no duplicates).
|
|
155
|
-
- Total asked (accepted) questions ≤ 5.
|
|
156
|
-
- Updated sections contain no lingering vague placeholders the new answer was meant to resolve.
|
|
157
|
-
- No contradictory earlier statement remains (scan for now-invalid alternative choices removed).
|
|
158
|
-
- Markdown structure valid; only allowed new headings: `## Clarifications`, `### Session YYYY-MM-DD`.
|
|
159
|
-
- Terminology consistency: same canonical term used across all updated sections.
|
|
160
|
-
|
|
161
|
-
7. Write the updated spec back to `FEATURE_SPEC`.
|
|
162
|
-
|
|
163
|
-
8. Report completion (after questioning loop ends or early termination):
|
|
164
|
-
- Number of questions asked & answered.
|
|
165
|
-
- Path to updated spec.
|
|
166
|
-
- Sections touched (list names).
|
|
167
|
-
- Coverage summary table listing each taxonomy category with Status: Resolved (was Partial/Missing and addressed), Deferred (exceeds question quota or better suited for planning), Clear (already sufficient), Outstanding (still Partial/Missing but low impact).
|
|
168
|
-
- If any Outstanding or Deferred remain, recommend whether to proceed to `/speckit.plan` or run `/speckit.clarify` again later post-plan.
|
|
169
|
-
- Suggested next command.
|
|
170
|
-
|
|
171
|
-
Behavior rules:
|
|
172
|
-
|
|
173
|
-
- If no meaningful ambiguities found (or all potential questions would be low-impact), respond: "No critical ambiguities detected worth formal clarification." and suggest proceeding.
|
|
174
|
-
- If spec file missing, instruct user to run `/speckit.specify` first (do not create a new spec here).
|
|
175
|
-
- Never exceed 5 total asked questions (clarification retries for a single question do not count as new questions).
|
|
176
|
-
- Avoid speculative tech stack questions unless the absence blocks functional clarity.
|
|
177
|
-
- Respect user early termination signals ("stop", "done", "proceed").
|
|
178
|
-
- If no questions asked due to full coverage, output a compact coverage summary (all categories Clear) then suggest advancing.
|
|
179
|
-
- If quota reached with unresolved high-impact categories remaining, explicitly flag them under Deferred with rationale.
|
|
180
|
-
|
|
181
|
-
Context for prioritization: $ARGUMENTS
|
|
1
|
+
---
|
|
2
|
+
description: Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
|
|
3
|
+
handoffs:
|
|
4
|
+
- label: Build Technical Plan
|
|
5
|
+
agent: speckit.plan
|
|
6
|
+
prompt: Create a plan for the spec. I am building with...
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## User Input
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
$ARGUMENTS
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
You **MUST** consider the user input before proceeding (if not empty).
|
|
16
|
+
|
|
17
|
+
## Outline
|
|
18
|
+
|
|
19
|
+
Goal: Detect and reduce ambiguity or missing decision points in the active feature specification and record the clarifications directly in the spec file.
|
|
20
|
+
|
|
21
|
+
Note: This clarification workflow is expected to run (and be completed) BEFORE invoking `/speckit.plan`. If the user explicitly states they are skipping clarification (e.g., exploratory spike), you may proceed, but must warn that downstream rework risk increases.
|
|
22
|
+
|
|
23
|
+
Execution steps:
|
|
24
|
+
|
|
25
|
+
1. Run `.specify/scripts/powershell/check-prerequisites.ps1 -Json -PathsOnly` from repo root **once** (combined `--json --paths-only` mode / `-Json -PathsOnly`). Parse minimal JSON payload fields:
|
|
26
|
+
- `FEATURE_DIR`
|
|
27
|
+
- `FEATURE_SPEC`
|
|
28
|
+
- (Optionally capture `IMPL_PLAN`, `TASKS` for future chained flows.)
|
|
29
|
+
- If JSON parsing fails, abort and instruct user to re-run `/speckit.specify` or verify feature branch environment.
|
|
30
|
+
- For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
|
|
31
|
+
|
|
32
|
+
2. Load the current spec file. Perform a structured ambiguity & coverage scan using this taxonomy. For each category, mark status: Clear / Partial / Missing. Produce an internal coverage map used for prioritization (do not output raw map unless no questions will be asked).
|
|
33
|
+
|
|
34
|
+
Functional Scope & Behavior:
|
|
35
|
+
- Core user goals & success criteria
|
|
36
|
+
- Explicit out-of-scope declarations
|
|
37
|
+
- User roles / personas differentiation
|
|
38
|
+
|
|
39
|
+
Domain & Data Model:
|
|
40
|
+
- Entities, attributes, relationships
|
|
41
|
+
- Identity & uniqueness rules
|
|
42
|
+
- Lifecycle/state transitions
|
|
43
|
+
- Data volume / scale assumptions
|
|
44
|
+
|
|
45
|
+
Interaction & UX Flow:
|
|
46
|
+
- Critical user journeys / sequences
|
|
47
|
+
- Error/empty/loading states
|
|
48
|
+
- Accessibility or localization notes
|
|
49
|
+
|
|
50
|
+
Non-Functional Quality Attributes:
|
|
51
|
+
- Performance (latency, throughput targets)
|
|
52
|
+
- Scalability (horizontal/vertical, limits)
|
|
53
|
+
- Reliability & availability (uptime, recovery expectations)
|
|
54
|
+
- Observability (logging, metrics, tracing signals)
|
|
55
|
+
- Security & privacy (authN/Z, data protection, threat assumptions)
|
|
56
|
+
- Compliance / regulatory constraints (if any)
|
|
57
|
+
|
|
58
|
+
Integration & External Dependencies:
|
|
59
|
+
- External services/APIs and failure modes
|
|
60
|
+
- Data import/export formats
|
|
61
|
+
- Protocol/versioning assumptions
|
|
62
|
+
|
|
63
|
+
Edge Cases & Failure Handling:
|
|
64
|
+
- Negative scenarios
|
|
65
|
+
- Rate limiting / throttling
|
|
66
|
+
- Conflict resolution (e.g., concurrent edits)
|
|
67
|
+
|
|
68
|
+
Constraints & Tradeoffs:
|
|
69
|
+
- Technical constraints (language, storage, hosting)
|
|
70
|
+
- Explicit tradeoffs or rejected alternatives
|
|
71
|
+
|
|
72
|
+
Terminology & Consistency:
|
|
73
|
+
- Canonical glossary terms
|
|
74
|
+
- Avoided synonyms / deprecated terms
|
|
75
|
+
|
|
76
|
+
Completion Signals:
|
|
77
|
+
- Acceptance criteria testability
|
|
78
|
+
- Measurable Definition of Done style indicators
|
|
79
|
+
|
|
80
|
+
Misc / Placeholders:
|
|
81
|
+
- TODO markers / unresolved decisions
|
|
82
|
+
- Ambiguous adjectives ("robust", "intuitive") lacking quantification
|
|
83
|
+
|
|
84
|
+
For each category with Partial or Missing status, add a candidate question opportunity unless:
|
|
85
|
+
- Clarification would not materially change implementation or validation strategy
|
|
86
|
+
- Information is better deferred to planning phase (note internally)
|
|
87
|
+
|
|
88
|
+
3. Generate (internally) a prioritized queue of candidate clarification questions (maximum 5). Do NOT output them all at once. Apply these constraints:
|
|
89
|
+
- Maximum of 10 total questions across the whole session.
|
|
90
|
+
- Each question must be answerable with EITHER:
|
|
91
|
+
- A short multiple‑choice selection (2–5 distinct, mutually exclusive options), OR
|
|
92
|
+
- A one-word / short‑phrase answer (explicitly constrain: "Answer in <=5 words").
|
|
93
|
+
- Only include questions whose answers materially impact architecture, data modeling, task decomposition, test design, UX behavior, operational readiness, or compliance validation.
|
|
94
|
+
- Ensure category coverage balance: attempt to cover the highest impact unresolved categories first; avoid asking two low-impact questions when a single high-impact area (e.g., security posture) is unresolved.
|
|
95
|
+
- Exclude questions already answered, trivial stylistic preferences, or plan-level execution details (unless blocking correctness).
|
|
96
|
+
- Favor clarifications that reduce downstream rework risk or prevent misaligned acceptance tests.
|
|
97
|
+
- If more than 5 categories remain unresolved, select the top 5 by (Impact * Uncertainty) heuristic.
|
|
98
|
+
|
|
99
|
+
4. Sequential questioning loop (interactive):
|
|
100
|
+
- Present EXACTLY ONE question at a time.
|
|
101
|
+
- For multiple‑choice questions:
|
|
102
|
+
- **Analyze all options** and determine the **most suitable option** based on:
|
|
103
|
+
- Best practices for the project type
|
|
104
|
+
- Common patterns in similar implementations
|
|
105
|
+
- Risk reduction (security, performance, maintainability)
|
|
106
|
+
- Alignment with any explicit project goals or constraints visible in the spec
|
|
107
|
+
- Present your **recommended option prominently** at the top with clear reasoning (1-2 sentences explaining why this is the best choice).
|
|
108
|
+
- Format as: `**Recommended:** Option [X] - <reasoning>`
|
|
109
|
+
- Then render all options as a Markdown table:
|
|
110
|
+
|
|
111
|
+
| Option | Description |
|
|
112
|
+
|--------|-------------|
|
|
113
|
+
| A | <Option A description> |
|
|
114
|
+
| B | <Option B description> |
|
|
115
|
+
| C | <Option C description> (add D/E as needed up to 5) |
|
|
116
|
+
| Short | Provide a different short answer (<=5 words) (Include only if free-form alternative is appropriate) |
|
|
117
|
+
|
|
118
|
+
- After the table, add: `You can reply with the option letter (e.g., "A"), accept the recommendation by saying "yes" or "recommended", or provide your own short answer.`
|
|
119
|
+
- For short‑answer style (no meaningful discrete options):
|
|
120
|
+
- Provide your **suggested answer** based on best practices and context.
|
|
121
|
+
- Format as: `**Suggested:** <your proposed answer> - <brief reasoning>`
|
|
122
|
+
- Then output: `Format: Short answer (<=5 words). You can accept the suggestion by saying "yes" or "suggested", or provide your own answer.`
|
|
123
|
+
- After the user answers:
|
|
124
|
+
- If the user replies with "yes", "recommended", or "suggested", use your previously stated recommendation/suggestion as the answer.
|
|
125
|
+
- Otherwise, validate the answer maps to one option or fits the <=5 word constraint.
|
|
126
|
+
- If ambiguous, ask for a quick disambiguation (count still belongs to same question; do not advance).
|
|
127
|
+
- Once satisfactory, record it in working memory (do not yet write to disk) and move to the next queued question.
|
|
128
|
+
- Stop asking further questions when:
|
|
129
|
+
- All critical ambiguities resolved early (remaining queued items become unnecessary), OR
|
|
130
|
+
- User signals completion ("done", "good", "no more"), OR
|
|
131
|
+
- You reach 5 asked questions.
|
|
132
|
+
- Never reveal future queued questions in advance.
|
|
133
|
+
- If no valid questions exist at start, immediately report no critical ambiguities.
|
|
134
|
+
|
|
135
|
+
5. Integration after EACH accepted answer (incremental update approach):
|
|
136
|
+
- Maintain in-memory representation of the spec (loaded once at start) plus the raw file contents.
|
|
137
|
+
- For the first integrated answer in this session:
|
|
138
|
+
- Ensure a `## Clarifications` section exists (create it just after the highest-level contextual/overview section per the spec template if missing).
|
|
139
|
+
- Under it, create (if not present) a `### Session YYYY-MM-DD` subheading for today.
|
|
140
|
+
- Append a bullet line immediately after acceptance: `- Q: <question> → A: <final answer>`.
|
|
141
|
+
- Then immediately apply the clarification to the most appropriate section(s):
|
|
142
|
+
- Functional ambiguity → Update or add a bullet in Functional Requirements.
|
|
143
|
+
- User interaction / actor distinction → Update User Stories or Actors subsection (if present) with clarified role, constraint, or scenario.
|
|
144
|
+
- Data shape / entities → Update Data Model (add fields, types, relationships) preserving ordering; note added constraints succinctly.
|
|
145
|
+
- Non-functional constraint → Add/modify measurable criteria in Non-Functional / Quality Attributes section (convert vague adjective to metric or explicit target).
|
|
146
|
+
- Edge case / negative flow → Add a new bullet under Edge Cases / Error Handling (or create such subsection if template provides placeholder for it).
|
|
147
|
+
- Terminology conflict → Normalize term across spec; retain original only if necessary by adding `(formerly referred to as "X")` once.
|
|
148
|
+
- If the clarification invalidates an earlier ambiguous statement, replace that statement instead of duplicating; leave no obsolete contradictory text.
|
|
149
|
+
- Save the spec file AFTER each integration to minimize risk of context loss (atomic overwrite).
|
|
150
|
+
- Preserve formatting: do not reorder unrelated sections; keep heading hierarchy intact.
|
|
151
|
+
- Keep each inserted clarification minimal and testable (avoid narrative drift).
|
|
152
|
+
|
|
153
|
+
6. Validation (performed after EACH write plus final pass):
|
|
154
|
+
- Clarifications session contains exactly one bullet per accepted answer (no duplicates).
|
|
155
|
+
- Total asked (accepted) questions ≤ 5.
|
|
156
|
+
- Updated sections contain no lingering vague placeholders the new answer was meant to resolve.
|
|
157
|
+
- No contradictory earlier statement remains (scan for now-invalid alternative choices removed).
|
|
158
|
+
- Markdown structure valid; only allowed new headings: `## Clarifications`, `### Session YYYY-MM-DD`.
|
|
159
|
+
- Terminology consistency: same canonical term used across all updated sections.
|
|
160
|
+
|
|
161
|
+
7. Write the updated spec back to `FEATURE_SPEC`.
|
|
162
|
+
|
|
163
|
+
8. Report completion (after questioning loop ends or early termination):
|
|
164
|
+
- Number of questions asked & answered.
|
|
165
|
+
- Path to updated spec.
|
|
166
|
+
- Sections touched (list names).
|
|
167
|
+
- Coverage summary table listing each taxonomy category with Status: Resolved (was Partial/Missing and addressed), Deferred (exceeds question quota or better suited for planning), Clear (already sufficient), Outstanding (still Partial/Missing but low impact).
|
|
168
|
+
- If any Outstanding or Deferred remain, recommend whether to proceed to `/speckit.plan` or run `/speckit.clarify` again later post-plan.
|
|
169
|
+
- Suggested next command.
|
|
170
|
+
|
|
171
|
+
Behavior rules:
|
|
172
|
+
|
|
173
|
+
- If no meaningful ambiguities found (or all potential questions would be low-impact), respond: "No critical ambiguities detected worth formal clarification." and suggest proceeding.
|
|
174
|
+
- If spec file missing, instruct user to run `/speckit.specify` first (do not create a new spec here).
|
|
175
|
+
- Never exceed 5 total asked questions (clarification retries for a single question do not count as new questions).
|
|
176
|
+
- Avoid speculative tech stack questions unless the absence blocks functional clarity.
|
|
177
|
+
- Respect user early termination signals ("stop", "done", "proceed").
|
|
178
|
+
- If no questions asked due to full coverage, output a compact coverage summary (all categories Clear) then suggest advancing.
|
|
179
|
+
- If quota reached with unresolved high-impact categories remaining, explicitly flag them under Deferred with rationale.
|
|
180
|
+
|
|
181
|
+
Context for prioritization: $ARGUMENTS
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
|
|
3
|
-
handoffs:
|
|
4
|
-
- label: Build Specification
|
|
5
|
-
agent: speckit.specify
|
|
6
|
-
prompt: Implement the feature specification based on the updated constitution. I want to build...
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## User Input
|
|
10
|
-
|
|
11
|
-
```text
|
|
12
|
-
$ARGUMENTS
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
You **MUST** consider the user input before proceeding (if not empty).
|
|
16
|
-
|
|
17
|
-
## Outline
|
|
18
|
-
|
|
19
|
-
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.
|
|
20
|
-
|
|
21
|
-
**Note**: If `.specify/memory/constitution.md` does not exist yet, it should have been initialized from `.specify/templates/constitution-template.md` during project setup. If it's missing, copy the template first.
|
|
22
|
-
|
|
23
|
-
Follow this execution flow:
|
|
24
|
-
|
|
25
|
-
1. Load the existing constitution at `.specify/memory/constitution.md`.
|
|
26
|
-
- Identify every placeholder token of the form `[ALL_CAPS_IDENTIFIER]`.
|
|
27
|
-
**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.
|
|
28
|
-
|
|
29
|
-
2. Collect/derive values for placeholders:
|
|
30
|
-
- If user input (conversation) supplies a value, use it.
|
|
31
|
-
- Otherwise infer from existing repo context (README, docs, prior constitution versions if embedded).
|
|
32
|
-
- 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.
|
|
33
|
-
- `CONSTITUTION_VERSION` must increment according to semantic versioning rules:
|
|
34
|
-
- MAJOR: Backward incompatible governance/principle removals or redefinitions.
|
|
35
|
-
- MINOR: New principle/section added or materially expanded guidance.
|
|
36
|
-
- PATCH: Clarifications, wording, typo fixes, non-semantic refinements.
|
|
37
|
-
- If version bump type ambiguous, propose reasoning before finalizing.
|
|
38
|
-
|
|
39
|
-
3. Draft the updated constitution content:
|
|
40
|
-
- 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).
|
|
41
|
-
- Preserve heading hierarchy and comments can be removed once replaced unless they still add clarifying guidance.
|
|
42
|
-
- Ensure each Principle section: succinct name line, paragraph (or bullet list) capturing non‑negotiable rules, explicit rationale if not obvious.
|
|
43
|
-
- Ensure Governance section lists amendment procedure, versioning policy, and compliance review expectations.
|
|
44
|
-
|
|
45
|
-
4. Consistency propagation checklist (convert prior checklist into active validations):
|
|
46
|
-
- Read `.specify/templates/plan-template.md` and ensure any "Constitution Check" or rules align with updated principles.
|
|
47
|
-
- Read `.specify/templates/spec-template.md` for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
|
|
48
|
-
- Read `.specify/templates/tasks-template.md` and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
|
|
49
|
-
- 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.
|
|
50
|
-
- Read any runtime guidance docs (e.g., `README.md`, `docs/quickstart.md`, or agent-specific guidance files if present). Update references to principles changed.
|
|
51
|
-
|
|
52
|
-
5. Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
|
|
53
|
-
- Version change: old → new
|
|
54
|
-
- List of modified principles (old title → new title if renamed)
|
|
55
|
-
- Added sections
|
|
56
|
-
- Removed sections
|
|
57
|
-
- Templates requiring updates (✅ updated / ⚠ pending) with file paths
|
|
58
|
-
- Follow-up TODOs if any placeholders intentionally deferred.
|
|
59
|
-
|
|
60
|
-
6. Validation before final output:
|
|
61
|
-
- No remaining unexplained bracket tokens.
|
|
62
|
-
- Version line matches report.
|
|
63
|
-
- Dates ISO format YYYY-MM-DD.
|
|
64
|
-
- Principles are declarative, testable, and free of vague language ("should" → replace with MUST/SHOULD rationale where appropriate).
|
|
65
|
-
|
|
66
|
-
7. Write the completed constitution back to `.specify/memory/constitution.md` (overwrite).
|
|
67
|
-
|
|
68
|
-
8. Output a final summary to the user with:
|
|
69
|
-
- New version and bump rationale.
|
|
70
|
-
- Any files flagged for manual follow-up.
|
|
71
|
-
- Suggested commit message (e.g., `docs: amend constitution to vX.Y.Z (principle additions + governance update)`).
|
|
72
|
-
|
|
73
|
-
Formatting & Style Requirements:
|
|
74
|
-
|
|
75
|
-
- Use Markdown headings exactly as in the template (do not demote/promote levels).
|
|
76
|
-
- Wrap long rationale lines to keep readability (<100 chars ideally) but do not hard enforce with awkward breaks.
|
|
77
|
-
- Keep a single blank line between sections.
|
|
78
|
-
- Avoid trailing whitespace.
|
|
79
|
-
|
|
80
|
-
If the user supplies partial updates (e.g., only one principle revision), still perform validation and version decision steps.
|
|
81
|
-
|
|
82
|
-
If critical info missing (e.g., ratification date truly unknown), insert `TODO(<FIELD_NAME>): explanation` and include in the Sync Impact Report under deferred items.
|
|
83
|
-
|
|
84
|
-
Do not create a new template; always operate on the existing `.specify/memory/constitution.md` file.
|
|
1
|
+
---
|
|
2
|
+
description: Create or update the project constitution from interactive or provided principle inputs, ensuring all dependent templates stay in sync.
|
|
3
|
+
handoffs:
|
|
4
|
+
- label: Build Specification
|
|
5
|
+
agent: speckit.specify
|
|
6
|
+
prompt: Implement the feature specification based on the updated constitution. I want to build...
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## User Input
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
$ARGUMENTS
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
You **MUST** consider the user input before proceeding (if not empty).
|
|
16
|
+
|
|
17
|
+
## Outline
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
**Note**: If `.specify/memory/constitution.md` does not exist yet, it should have been initialized from `.specify/templates/constitution-template.md` during project setup. If it's missing, copy the template first.
|
|
22
|
+
|
|
23
|
+
Follow this execution flow:
|
|
24
|
+
|
|
25
|
+
1. Load the existing constitution at `.specify/memory/constitution.md`.
|
|
26
|
+
- Identify every placeholder token of the form `[ALL_CAPS_IDENTIFIER]`.
|
|
27
|
+
**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.
|
|
28
|
+
|
|
29
|
+
2. Collect/derive values for placeholders:
|
|
30
|
+
- If user input (conversation) supplies a value, use it.
|
|
31
|
+
- Otherwise infer from existing repo context (README, docs, prior constitution versions if embedded).
|
|
32
|
+
- 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.
|
|
33
|
+
- `CONSTITUTION_VERSION` must increment according to semantic versioning rules:
|
|
34
|
+
- MAJOR: Backward incompatible governance/principle removals or redefinitions.
|
|
35
|
+
- MINOR: New principle/section added or materially expanded guidance.
|
|
36
|
+
- PATCH: Clarifications, wording, typo fixes, non-semantic refinements.
|
|
37
|
+
- If version bump type ambiguous, propose reasoning before finalizing.
|
|
38
|
+
|
|
39
|
+
3. Draft the updated constitution content:
|
|
40
|
+
- 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).
|
|
41
|
+
- Preserve heading hierarchy and comments can be removed once replaced unless they still add clarifying guidance.
|
|
42
|
+
- Ensure each Principle section: succinct name line, paragraph (or bullet list) capturing non‑negotiable rules, explicit rationale if not obvious.
|
|
43
|
+
- Ensure Governance section lists amendment procedure, versioning policy, and compliance review expectations.
|
|
44
|
+
|
|
45
|
+
4. Consistency propagation checklist (convert prior checklist into active validations):
|
|
46
|
+
- Read `.specify/templates/plan-template.md` and ensure any "Constitution Check" or rules align with updated principles.
|
|
47
|
+
- Read `.specify/templates/spec-template.md` for scope/requirements alignment—update if constitution adds/removes mandatory sections or constraints.
|
|
48
|
+
- Read `.specify/templates/tasks-template.md` and ensure task categorization reflects new or removed principle-driven task types (e.g., observability, versioning, testing discipline).
|
|
49
|
+
- 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.
|
|
50
|
+
- Read any runtime guidance docs (e.g., `README.md`, `docs/quickstart.md`, or agent-specific guidance files if present). Update references to principles changed.
|
|
51
|
+
|
|
52
|
+
5. Produce a Sync Impact Report (prepend as an HTML comment at top of the constitution file after update):
|
|
53
|
+
- Version change: old → new
|
|
54
|
+
- List of modified principles (old title → new title if renamed)
|
|
55
|
+
- Added sections
|
|
56
|
+
- Removed sections
|
|
57
|
+
- Templates requiring updates (✅ updated / ⚠ pending) with file paths
|
|
58
|
+
- Follow-up TODOs if any placeholders intentionally deferred.
|
|
59
|
+
|
|
60
|
+
6. Validation before final output:
|
|
61
|
+
- No remaining unexplained bracket tokens.
|
|
62
|
+
- Version line matches report.
|
|
63
|
+
- Dates ISO format YYYY-MM-DD.
|
|
64
|
+
- Principles are declarative, testable, and free of vague language ("should" → replace with MUST/SHOULD rationale where appropriate).
|
|
65
|
+
|
|
66
|
+
7. Write the completed constitution back to `.specify/memory/constitution.md` (overwrite).
|
|
67
|
+
|
|
68
|
+
8. Output a final summary to the user with:
|
|
69
|
+
- New version and bump rationale.
|
|
70
|
+
- Any files flagged for manual follow-up.
|
|
71
|
+
- Suggested commit message (e.g., `docs: amend constitution to vX.Y.Z (principle additions + governance update)`).
|
|
72
|
+
|
|
73
|
+
Formatting & Style Requirements:
|
|
74
|
+
|
|
75
|
+
- Use Markdown headings exactly as in the template (do not demote/promote levels).
|
|
76
|
+
- Wrap long rationale lines to keep readability (<100 chars ideally) but do not hard enforce with awkward breaks.
|
|
77
|
+
- Keep a single blank line between sections.
|
|
78
|
+
- Avoid trailing whitespace.
|
|
79
|
+
|
|
80
|
+
If the user supplies partial updates (e.g., only one principle revision), still perform validation and version decision steps.
|
|
81
|
+
|
|
82
|
+
If critical info missing (e.g., ratification date truly unknown), insert `TODO(<FIELD_NAME>): explanation` and include in the Sync Impact Report under deferred items.
|
|
83
|
+
|
|
84
|
+
Do not create a new template; always operate on the existing `.specify/memory/constitution.md` file.
|