@massa-ai/cursor-plugin 1.6.0

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.
Files changed (172) hide show
  1. package/.cursor-plugin/plugin.json +5 -0
  2. package/README.md +87 -0
  3. package/agents/massa-ai-architecture-specialist.md +65 -0
  4. package/agents/massa-ai-audit-specialist.md +81 -0
  5. package/agents/massa-ai-builder.md +67 -0
  6. package/agents/massa-ai-context-curator.md +67 -0
  7. package/agents/massa-ai-documentation-agent.md +65 -0
  8. package/agents/massa-ai-furps-analyst.md +71 -0
  9. package/agents/massa-ai-investigator.md +68 -0
  10. package/agents/massa-ai-mobile-specialist.md +82 -0
  11. package/agents/massa-ai-navigator.md +75 -0
  12. package/agents/massa-ai-plan-critic.md +90 -0
  13. package/agents/massa-ai-planner.md +65 -0
  14. package/agents/massa-ai-requirements-analyst.md +64 -0
  15. package/agents/massa-ai-reviewer.md +66 -0
  16. package/agents/massa-ai-test-engineer.md +66 -0
  17. package/agents/massa-ai-verification-agent.md +65 -0
  18. package/hooks/hooks.json +26 -0
  19. package/hooks/massa-ai-hook +298 -0
  20. package/install.sh +413 -0
  21. package/package.json +30 -0
  22. package/skills/agents/architecture-specialist/SKILL.md +69 -0
  23. package/skills/agents/audit-specialist/SKILL.md +85 -0
  24. package/skills/agents/builder/SKILL.md +71 -0
  25. package/skills/agents/context-curator/SKILL.md +71 -0
  26. package/skills/agents/documentation-agent/SKILL.md +69 -0
  27. package/skills/agents/furps-analyst/SKILL.md +74 -0
  28. package/skills/agents/investigator/SKILL.md +72 -0
  29. package/skills/agents/mobile-specialist/SKILL.md +86 -0
  30. package/skills/agents/navigator/SKILL.md +79 -0
  31. package/skills/agents/plan-critic/SKILL.md +93 -0
  32. package/skills/agents/planner/SKILL.md +69 -0
  33. package/skills/agents/requirements-analyst/SKILL.md +68 -0
  34. package/skills/agents/reviewer/SKILL.md +70 -0
  35. package/skills/agents/test-engineer/SKILL.md +70 -0
  36. package/skills/agents/verification-agent/SKILL.md +69 -0
  37. package/skills/def/SKILL.md +17 -0
  38. package/skills/find/SKILL.md +19 -0
  39. package/skills/graph/SKILL.md +16 -0
  40. package/skills/index/SKILL.md +19 -0
  41. package/skills/map/SKILL.md +24 -0
  42. package/skills/massa-ai/SKILL.md +315 -0
  43. package/skills/massa-ai/personas/README.md +35 -0
  44. package/skills/massa-ai/personas/ai-native-nodejs-cli-architect.md +76 -0
  45. package/skills/massa-ai/personas/catalog.json +157 -0
  46. package/skills/massa-ai/personas/context-skill-harness-engineer-architect.md +74 -0
  47. package/skills/massa-ai/personas/product-manager.md +67 -0
  48. package/skills/massa-ai/personas/senior-mobile-engineer.md +74 -0
  49. package/skills/massa-ai/personas/senior-mobile-qa-automation-engineer.md +75 -0
  50. package/skills/massa-ai/references/adr-authoring.md +189 -0
  51. package/skills/massa-ai/references/agent-orchestration.md +221 -0
  52. package/skills/massa-ai/references/architecture-coupling-lens.md +239 -0
  53. package/skills/massa-ai/references/architecture-deepening-lens.md +136 -0
  54. package/skills/massa-ai/references/architecture-domain-lens.md +186 -0
  55. package/skills/massa-ai/references/architecture-lenses.md +108 -0
  56. package/skills/massa-ai/references/audit-report-io.md +459 -0
  57. package/skills/massa-ai/references/audit-scope.md +103 -0
  58. package/skills/massa-ai/references/code-annotation.md +111 -0
  59. package/skills/massa-ai/references/codebase-investigation.md +96 -0
  60. package/skills/massa-ai/references/context-firewall.md +62 -0
  61. package/skills/massa-ai/references/conversation-feedback.md +104 -0
  62. package/skills/massa-ai/references/debug-diagnosis-loop.md +140 -0
  63. package/skills/massa-ai/references/decision-engine.md +73 -0
  64. package/skills/massa-ai/references/evidence-gate.md +53 -0
  65. package/skills/massa-ai/references/furps/analyst-role.md +49 -0
  66. package/skills/massa-ai/references/furps/checklist.md +92 -0
  67. package/skills/massa-ai/references/furps/intake.md +104 -0
  68. package/skills/massa-ai/references/furps/report-contract.md +140 -0
  69. package/skills/massa-ai/references/hook-enforcement.md +137 -0
  70. package/skills/massa-ai/references/implementation-delivery.md +101 -0
  71. package/skills/massa-ai/references/installation.md +110 -0
  72. package/skills/massa-ai/references/lessons.md +119 -0
  73. package/skills/massa-ai/references/maestro/artifacts-reports.md +69 -0
  74. package/skills/massa-ai/references/maestro/cli-device.md +65 -0
  75. package/skills/massa-ai/references/maestro/cloud.md +67 -0
  76. package/skills/massa-ai/references/maestro/config-env-output.md +76 -0
  77. package/skills/massa-ai/references/maestro/fact-ledger.md +71 -0
  78. package/skills/massa-ai/references/maestro/js-scripting.md +70 -0
  79. package/skills/massa-ai/references/maestro/mcp.md +59 -0
  80. package/skills/massa-ai/references/maestro/patterns.md +96 -0
  81. package/skills/massa-ai/references/maestro/selectors.md +91 -0
  82. package/skills/massa-ai/references/maestro/workspace-execution.md +81 -0
  83. package/skills/massa-ai/references/maestro/yaml-commands.md +203 -0
  84. package/skills/massa-ai/references/maestro.md +47 -0
  85. package/skills/massa-ai/references/mcp-tools.md +296 -0
  86. package/skills/massa-ai/references/memory-policy.md +103 -0
  87. package/skills/massa-ai/references/mobile-context.md +113 -0
  88. package/skills/massa-ai/references/mobile-diagnosis.md +106 -0
  89. package/skills/massa-ai/references/mobile-figma-matcher/ATTRIBUTION.md +5 -0
  90. package/skills/massa-ai/references/mobile-figma-matcher/android-compose.md +13 -0
  91. package/skills/massa-ai/references/mobile-figma-matcher/android-views.md +13 -0
  92. package/skills/massa-ai/references/mobile-figma-matcher/core.md +117 -0
  93. package/skills/massa-ai/references/mobile-figma-matcher/ios-swiftui.md +12 -0
  94. package/skills/massa-ai/references/mobile-figma-matcher/ios-uikit.md +12 -0
  95. package/skills/massa-ai/references/mobile-figma-matcher/kmp-compose-multiplatform.md +14 -0
  96. package/skills/massa-ai/references/mobile-figma-matcher/repository-detection.md +77 -0
  97. package/skills/massa-ai/references/naming-standards.md +47 -0
  98. package/skills/massa-ai/references/pr-task-fix.md +80 -0
  99. package/skills/massa-ai/references/project-context.md +76 -0
  100. package/skills/massa-ai/references/rfc/ATTRIBUTION.md +5 -0
  101. package/skills/massa-ai/references/rfc/discovery-and-sizing.md +120 -0
  102. package/skills/massa-ai/references/rfc/document-contract.md +85 -0
  103. package/skills/massa-ai/references/rfc/quality-and-lifecycle.md +101 -0
  104. package/skills/massa-ai/references/root-cause-scripts.md +97 -0
  105. package/skills/massa-ai/references/spec-driven/artifact-store.md +98 -0
  106. package/skills/massa-ai/references/spec-driven/code-analysis.md +119 -0
  107. package/skills/massa-ai/references/spec-driven/coding-principles.md +80 -0
  108. package/skills/massa-ai/references/spec-driven/context-limits.md +64 -0
  109. package/skills/massa-ai/references/spec-driven/design.md +257 -0
  110. package/skills/massa-ai/references/spec-driven/discuss.md +182 -0
  111. package/skills/massa-ai/references/spec-driven/execute.md +471 -0
  112. package/skills/massa-ai/references/spec-driven/lessons.md +5 -0
  113. package/skills/massa-ai/references/spec-driven/memory.md +214 -0
  114. package/skills/massa-ai/references/spec-driven/specify.md +283 -0
  115. package/skills/massa-ai/references/spec-driven/sub-agents.md +151 -0
  116. package/skills/massa-ai/references/spec-driven/tasks.md +494 -0
  117. package/skills/massa-ai/references/spec-driven/validate.md +397 -0
  118. package/skills/massa-ai/references/subagent-design.md +132 -0
  119. package/skills/massa-ai/references/synapse-policy.md +160 -0
  120. package/skills/massa-ai/references/tdd/calibrated-examples.md +54 -0
  121. package/skills/massa-ai/references/tdd/discovery-and-sizing.md +83 -0
  122. package/skills/massa-ai/references/tdd/document-contract.md +136 -0
  123. package/skills/massa-ai/references/tdd/quality-and-lifecycle.md +83 -0
  124. package/skills/massa-ai/references/the-fool/cognitive-bias-inventory.md +103 -0
  125. package/skills/massa-ai/references/the-fool/dialectic-synthesis.md +170 -0
  126. package/skills/massa-ai/references/the-fool/evidence-audit.md +202 -0
  127. package/skills/massa-ai/references/the-fool/mode-selection-guide.md +113 -0
  128. package/skills/massa-ai/references/the-fool/pre-mortem-analysis.md +200 -0
  129. package/skills/massa-ai/references/the-fool/red-team-adversarial.md +206 -0
  130. package/skills/massa-ai/references/the-fool/socratic-questioning.md +153 -0
  131. package/skills/massa-ai/references/ticket/atlassian-fix.md +130 -0
  132. package/skills/massa-ai/references/ticket/intake-and-sources.md +65 -0
  133. package/skills/massa-ai/references/ticket/templates-and-quality.md +129 -0
  134. package/skills/massa-ai/references/verification-ladder.md +62 -0
  135. package/skills/massa-ai/scripts/lessons.py +590 -0
  136. package/skills/massa-ai/workflows/adr.md +33 -0
  137. package/skills/massa-ai/workflows/architecture/architecture-audit.md +125 -0
  138. package/skills/massa-ai/workflows/architecture/architecture-fix.md +110 -0
  139. package/skills/massa-ai/workflows/bugs/bugs-audit.md +113 -0
  140. package/skills/massa-ai/workflows/bugs/bugs-fix.md +97 -0
  141. package/skills/massa-ai/workflows/code-quality/code-quality-audit.md +154 -0
  142. package/skills/massa-ai/workflows/code-quality/code-quality-fix.md +99 -0
  143. package/skills/massa-ai/workflows/commit.md +61 -0
  144. package/skills/massa-ai/workflows/debug.md +86 -0
  145. package/skills/massa-ai/workflows/design.md +54 -0
  146. package/skills/massa-ai/workflows/exploration.md +119 -0
  147. package/skills/massa-ai/workflows/feature.md +52 -0
  148. package/skills/massa-ai/workflows/general.md +46 -0
  149. package/skills/massa-ai/workflows/implementation/implementation-audit.md +87 -0
  150. package/skills/massa-ai/workflows/implementation/implementation-fix.md +90 -0
  151. package/skills/massa-ai/workflows/long-session.md +44 -0
  152. package/skills/massa-ai/workflows/maestro/maestro-audit.md +56 -0
  153. package/skills/massa-ai/workflows/maestro/maestro-fix.md +74 -0
  154. package/skills/massa-ai/workflows/maestro/maestro.md +68 -0
  155. package/skills/massa-ai/workflows/mobile-figma/mobile-figma-audit.md +68 -0
  156. package/skills/massa-ai/workflows/mobile-figma/mobile-figma-fix.md +74 -0
  157. package/skills/massa-ai/workflows/onboarding.md +23 -0
  158. package/skills/massa-ai/workflows/refactor.md +47 -0
  159. package/skills/massa-ai/workflows/refinement/furps-refinement.md +81 -0
  160. package/skills/massa-ai/workflows/requirements/requirements-audit.md +114 -0
  161. package/skills/massa-ai/workflows/requirements/requirements-fix.md +93 -0
  162. package/skills/massa-ai/workflows/rfc.md +55 -0
  163. package/skills/massa-ai/workflows/security/security-audit.md +113 -0
  164. package/skills/massa-ai/workflows/security/security-fix.md +97 -0
  165. package/skills/massa-ai/workflows/spec-driven.md +217 -0
  166. package/skills/massa-ai/workflows/tdd.md +71 -0
  167. package/skills/massa-ai/workflows/tests/tests-audit.md +114 -0
  168. package/skills/massa-ai/workflows/tests/tests-fix.md +96 -0
  169. package/skills/massa-ai/workflows/the-fool.md +82 -0
  170. package/skills/massa-ai/workflows/ticket.md +42 -0
  171. package/skills/persona-router/SKILL.md +158 -0
  172. package/skills/status/SKILL.md +15 -0
@@ -0,0 +1,257 @@
1
+ # Design
2
+
3
+ Use this reference when the spec-driven flow includes a Design phase. The output is `.specs/features/<slug>/design.md`. **Goal**: define HOW to build it — architecture, components, what to reuse.
4
+
5
+ **Skip this phase when:** The change is straightforward — no architectural decisions, no new patterns, no component interactions to plan. For simple features, design happens inline during Execute.
6
+
7
+ ## Include Design When
8
+
9
+ - Architecture or module boundaries change.
10
+ - Interfaces, API contracts, data models, migrations, or public compatibility change.
11
+ - Security, privacy, auth, tenant, permission, or irreversible behavior is involved.
12
+ - A reusable pattern, shared abstraction, or cross-component integration must be selected.
13
+ - Multiple implementation approaches are plausible and the choice affects maintainability or verification.
14
+ - Large/Complex work needs approach exploration before implementation.
15
+
16
+ ## Inputs
17
+
18
+ - Approved `.specs/features/<slug>/spec.md`.
19
+ - `.specs/features/<slug>/context.md` when present (locked decisions and Agent's Discretion decisions).
20
+ - Current codebase patterns and contracts.
21
+ - Relevant local docs, tests, and validation assets.
22
+ - Active `.specs/project/STATE.md` decisions — read the `## Decisions` section before any architectural choice.
23
+ - Existing lessons only when lesson artifacts already exist.
24
+
25
+ ## Process
26
+
27
+ ### 1. Load Context
28
+
29
+ Read `.specs/features/<slug>/spec.md` before designing. If `.specs/features/<slug>/context.md` exists, load it too — it contains implementation decisions that constrain the design (layout choices, behavior preferences, interaction patterns). Decisions marked as "Agent's Discretion" are yours to decide.
30
+
31
+ **Mandatory: read `.specs/project/STATE.md` `## Decisions` now.** This MUST happen before any architectural choices are made. Every `active` `AD-NNN` entry is a project-level constraint this design must conform to. If a decision from a prior feature conflicts with what is best for this feature, you have two options — both require an explicit choice:
32
+
33
+ 1. **Conform** — Design within the active constraint.
34
+ 2. **Supersede** — Append a new `AD-NNN` entry to `.specs/project/STATE.md` `## Decisions` that supersedes the old one (set the old entry's `status` to `superseded by AD-NNN`) and document the reason. The new decision becomes the project standard going forward.
35
+
36
+ Silently ignoring an active decision is not an option — it creates invisible inconsistency across features.
37
+
38
+ **Also load confirmed lessons** relevant to this feature: `python3 skills/massa-ai/scripts/lessons.py list --status confirmed` (filter with `--scope`/`--query`). These are past verification failures distilled into guidance — apply them while designing. Load only `confirmed`. Skip silently if no store or no code tool. See [lessons.md](lessons.md).
39
+
40
+ ### 1.5. Research (Optional but Recommended)
41
+
42
+ If the feature involves unfamiliar technology, patterns, or integrations, research before designing. Document findings briefly in the design doc or as inline notes. This prevents incorrect assumptions from propagating into tasks.
43
+
44
+ Follow the **Knowledge Verification Chain** (see SKILL.md) in strict order:
45
+
46
+ ```
47
+ Codebase → Project docs → Context7 MCP → Web search → Flag as uncertain
48
+ ```
49
+
50
+ When verifying codebase claims, prefer the massa-ai tool chain FIRST — `list_projects`, `search`, `project_map`, `optimized_context` — before falling back to ast-grep / ripgrep / grep. Apply freshness and source-precedence rules: current source code overrides a stale index, and a stale index or durable memory never overrides current evidence. When uncertain about index freshness, read the live file directly.
51
+
52
+ **CRITICAL: NEVER assume or fabricate information.** If you cannot find an answer through the chain, explicitly say "I don't know" or "I couldn't find documentation for this". Inventing an API, a pattern, or a behavior that doesn't exist is far worse than admitting uncertainty. Wrong assumptions propagate through design → tasks → implementation and cause cascading failures.
53
+
54
+ Good triggers for research: new libraries, unfamiliar APIs, performance-sensitive features, security-sensitive features, patterns you haven't used in this codebase before.
55
+
56
+ **Concern flagging (MUST do while reading code):** While walking the codebase via the Knowledge Verification Chain, flag any concerns you encounter in the areas this feature touches. Capture each finding in the `## Risks & Concerns` section of `design.md`:
57
+
58
+ - **Fragile code** — tight coupling, large functions, implicit state
59
+ - **Tech debt** — hacks, workarounds, deprecated APIs
60
+ - **Security risks** — unvalidated input, auth gaps, exposed secrets
61
+ - **Performance bottlenecks** — N+1 queries, unbounded loops, missing indexes
62
+ - **Test coverage gaps** — untested paths the feature depends on
63
+
64
+ Every flagged concern MUST include a mitigation — how the design (or a follow-up task) addresses it.
65
+
66
+ ### 2. Define Architecture
67
+
68
+ **Large/Complex only — approach exploration:** Before committing to a single architecture, present 2–3 viable approaches with trade-offs and a recommendation. Lead with the recommendation to avoid analysis paralysis. All approaches must deliver the same scoped thing (no alternative scopes). Confirm the chosen approach with the user before detailing components. Medium features: skip — design inline.
69
+
70
+ Overview of how components interact. Use mermaid diagrams when helpful.
71
+
72
+ ### 3. Identify Code Reuse
73
+
74
+ **CRITICAL**: What existing code can we leverage? This saves tokens and reduces errors.
75
+
76
+ Flag any concerns found here per step 1.5 into `## Risks & Concerns`.
77
+
78
+ ### 4. Define Components and Interfaces
79
+
80
+ Each component: Purpose, Location, Interfaces, Dependencies, What it reuses.
81
+
82
+ ### 5. Define Data Models
83
+
84
+ If the feature involves data, define models before implementation.
85
+
86
+ ---
87
+
88
+ ## Required Sections
89
+
90
+ `design.md` must include:
91
+
92
+ - Design summary.
93
+ - Requirements traceability by ID.
94
+ - Current codebase evidence: files, symbols, conventions, and tests inspected.
95
+ - Proposed structure and ownership.
96
+ - Interface, data, migration, security/privacy, and compatibility decisions when applicable.
97
+ - Active decision handling: conform to active `AD-NNN` decisions or add a superseding `AD-NNN` entry in `.specs/project/STATE.md`.
98
+ - Artifact-store evidence: active artifact key, version, and checksum after write.
99
+ - Reuse plan and rejected alternatives.
100
+ - Large/Complex approach tradeoffs: 2-3 viable approaches, same scope, recommendation first, user-confirmed chosen approach.
101
+ - Verification design, including how tests or checks prove each high-risk requirement.
102
+ - Risks, concerns, and mitigations.
103
+
104
+ ## Decision Supersession
105
+
106
+ When the design replaces an existing decision, never delete the old entry. Append a new `AD-NNN` entry, update the old entry status to `superseded by AD-NNN`, and record the reason, rejected alternatives, and evidence. The new decision becomes active only after it is written to `.specs/project/STATE.md` or the relevant approved artifact.
107
+
108
+ ## Knowledge Verification
109
+
110
+ Use this order for technical claims:
111
+
112
+ 1. Current codebase.
113
+ 2. Project docs and approved specs.
114
+ 3. Context7 MCP or available local MCP source for current library behavior when relevant.
115
+ 4. Official documentation or primary source when current APIs or external services matter.
116
+ 5. Mark uncertainty explicitly when evidence is unavailable.
117
+
118
+ Never invent APIs, project conventions, or external behavior.
119
+
120
+ ---
121
+
122
+ ## Template: `.specs/features/<slug>/design.md`
123
+
124
+ ````markdown
125
+ # [Feature] Design
126
+
127
+ **Spec**: `.specs/features/<slug>/spec.md`
128
+ **Status**: Draft | Approved
129
+
130
+ ---
131
+
132
+ ## Architecture Overview
133
+
134
+ [Brief description of the architecture approach]
135
+
136
+ ```mermaid
137
+ graph TD
138
+ A[User Action] --> B[Component A]
139
+ B --> C[Service Layer]
140
+ C --> D[Data Store]
141
+ B --> E[Component B]
142
+ ```
143
+ ````
144
+
145
+ ---
146
+
147
+ ## Code Reuse Analysis
148
+
149
+ ### Existing Components to Leverage
150
+
151
+ | Component | Location | How to Use |
152
+ | -------------------- | ------------------- | ------------------------- |
153
+ | [Existing Component] | `src/path/to/file` | [Extend/Import/Reference] |
154
+ | [Existing Utility] | `src/utils/file` | [How it helps] |
155
+ | [Existing Pattern] | `src/patterns/file` | [Apply same pattern] |
156
+
157
+ ### Integration Points
158
+
159
+ | System | Integration Method |
160
+ | -------------- | --------------------------------------- |
161
+ | [Existing API] | [How new feature connects] |
162
+ | [Database] | [How data connects to existing schemas] |
163
+
164
+ ---
165
+
166
+ ## Components
167
+
168
+ ### [Component Name]
169
+
170
+ - **Purpose**: [What this component does - one sentence]
171
+ - **Location**: `src/path/to/component/`
172
+ - **Interfaces**:
173
+ - `methodName(param: Type): ReturnType` - [description]
174
+ - `methodName(param: Type): ReturnType` - [description]
175
+ - **Dependencies**: [What it needs to function]
176
+ - **Reuses**: [Existing code this builds upon]
177
+
178
+ ### [Component Name]
179
+
180
+ - **Purpose**: [What this component does]
181
+ - **Location**: `src/path/to/component/`
182
+ - **Interfaces**:
183
+ - `methodName(param: Type): ReturnType`
184
+ - **Dependencies**: [Dependencies]
185
+ - **Reuses**: [Existing code]
186
+
187
+ ---
188
+
189
+ ## Data Models (if applicable)
190
+
191
+ ### [Model Name]
192
+
193
+ ```typescript
194
+ interface ModelName {
195
+ id: string
196
+ field1: string
197
+ field2: number
198
+ createdAt: Date
199
+ }
200
+ ```
201
+
202
+ **Relationships**: [How this relates to other models]
203
+
204
+ ### [Model Name]
205
+
206
+ ```typescript
207
+ interface AnotherModel {
208
+ id: string
209
+ // ...
210
+ }
211
+ ```
212
+
213
+ ---
214
+
215
+ ## Error Handling Strategy
216
+
217
+ | Error Scenario | Handling | User Impact |
218
+ | -------------- | ------------- | ---------------- |
219
+ | [Scenario 1] | [How handled] | [What user sees] |
220
+ | [Scenario 2] | [How handled] | [What user sees] |
221
+
222
+ ---
223
+
224
+ ## Risks & Concerns
225
+
226
+ | Concern | Location (file:line) | Impact | Mitigation |
227
+ | ------- | -------------------- | ------ | ---------- |
228
+ | [Fragile code / tech debt / security / perf / test gap] | `src/path/file.ts:42` | [What breaks or degrades] | [How the design or a follow-up task addresses it] |
229
+
230
+ > None found — is a valid entry.
231
+
232
+ ---
233
+
234
+ ## Tech Decisions (only non-obvious ones)
235
+
236
+ | Decision | Choice | Rationale |
237
+ | ----------------- | --------------- | ------------- |
238
+ | [What we decided] | [What we chose] | [Why - brief] |
239
+
240
+ > **Project-level decisions:** If a decision here sets a convention, pattern, or constraint that future features must follow, append it to `.specs/project/STATE.md` `## Decisions` as the next `AD-NNN` entry. Feature-local decisions stay only in this table.
241
+
242
+ ---
243
+
244
+ ## Tips
245
+
246
+ - **Load context first** — If context.md exists, decisions there are locked.
247
+ - **Research when uncertain** — 5 minutes of research prevents hours of rework.
248
+ - **Reuse is king** — Every component should reference existing patterns.
249
+ - **Interfaces first** — Define contracts before implementation.
250
+ - **Keep it visual** — Diagrams save 1000 words.
251
+ - **Small components** — If a component does 3+ things, split it.
252
+ - **Flag concerns inline** — Risks found during research go in Risks & Concerns with a mitigation.
253
+ - **Confirm before Tasks** — User approves design before breaking into tasks.
254
+
255
+ ## Done
256
+
257
+ Design is done when an implementer can execute without inventing architecture or contract decisions, every material requirement or risk has a verification path, the Large/Complex approach choice is confirmed, and active/superseded decisions are explicit.
@@ -0,0 +1,182 @@
1
+ # Spec-Driven Discuss Gray Areas
2
+
3
+ Use this reference inside Specify when gray areas or implicit requirements affect behavior, scope, data, security/privacy, compatibility, or acceptance criteria. It captures HOW the user envisions the feature when the spec has ambiguous areas — it is NOT a separate phase; it triggers within Specify when the agent detects gray areas that need user input.
4
+
5
+ **Goal:** Capture HOW the user envisions the feature when the spec has ambiguous areas. Specifications capture WHAT to build. Design captures the architecture. But neither captures the user's vision for ambiguous areas — layout preferences, interaction patterns, error handling style, content tone. Without this, the agent guesses. With this, the agent builds what the user actually imagined.
6
+
7
+ The output — `.specs/features/<slug>/context.md` — feeds directly into Design and Tasks:
8
+
9
+ - **Design reads it** (`references/spec-driven/design.md`) to know what decisions are locked vs. flexible
10
+ - **Tasks reads it** (`references/spec-driven/tasks.md`) to include specific behaviors in task definitions
11
+
12
+ ## Trigger
13
+
14
+ Automatically when gray areas are detected during spec creation, or explicitly via "discuss feature", "how should this work?", "capture context".
15
+
16
+ **When to trigger (auto-detect):** The spec contains user-facing behavior that could go multiple ways AND the user hasn't expressed a preference. If the spec is clear and unambiguous, skip this entirely.
17
+
18
+ **When NOT to trigger:** Genuinely trivial features — a pure read endpoint, a config tweak, features with no [implicit-requirement dimensions](specify.md#implicit-requirement-dimensions) present.
19
+
20
+ ### Trigger Signals
21
+
22
+ Run Discuss when the request involves any of the following — i.e. a requirement dimension that cannot be honestly marked `N/A because <reason>`:
23
+
24
+ - persistence/state
25
+ - external calls
26
+ - auth
27
+ - payments
28
+ - concurrency
29
+ - state transitions
30
+ - user-visible workflows
31
+ - permission boundaries
32
+ - migration
33
+ - data loss
34
+ - ambiguous ownership
35
+ - multiple plausible interpretations
36
+ - a requirement dimension not honestly `N/A`
37
+
38
+ When any dimension is present, trigger discuss. When the dimension is honestly `N/A because <reason>`, mark it so and proceed.
39
+
40
+ ## Process
41
+
42
+ ### 1. Analyze the Feature
43
+
44
+ Read `.specs/features/<slug>/spec.md` and identify the domain:
45
+
46
+ | Domain | Gray areas to explore |
47
+ | ------------------------------ | ------------------------------------------------------------- |
48
+ | Something users **SEE** | Layout, density, interactions, empty states, visual hierarchy |
49
+ | Something users **CALL** (API) | Response format, errors, auth, versioning, rate limiting |
50
+ | Something users **RUN** (CLI) | Output format, flags, modes, error handling, verbosity |
51
+ | Something users **READ** | Structure, tone, depth, flow, navigation |
52
+ | Something being **ORGANIZED** | Grouping criteria, naming, duplicates, exceptions |
53
+ | Something with **backend / state / contract** | Failure & partial-failure states, idempotency/retry/dedup, auth boundaries & rate limits, data lifecycle/expiry, concurrency/ordering — see [implicit-requirement dimensions](specify.md#implicit-requirement-dimensions) |
54
+
55
+ Generate 3-4 **feature-specific** gray areas. Not generic categories, but concrete decisions for THIS feature.
56
+
57
+ ### 2. Present Gray Areas
58
+
59
+ Present the feature boundary (from `spec.md`) and the gray areas to the user. Let them choose which to discuss. Do NOT include a "skip all" option — the user invoked this phase to discuss.
60
+
61
+ Any gray area the user **declines** to discuss, or that goes undiscussed, is written to the spec's **Assumptions & Open Questions** section (agent's chosen default + rationale) — never silently dropped. This ensures the spec's closure gate can pass: every gray area is either resolved through discussion or recorded as a signed-off assumption.
62
+
63
+ ### 3. Deep-Dive Each Area
64
+
65
+ For each selected area:
66
+
67
+ 1. Ask 3-4 concrete questions with specific options (not vague categories)
68
+ 2. After the questions, check: "More about [area], or move on?"
69
+ 3. If more → ask 3-4 more, check again
70
+ 4. After all areas → "Ready to create context?"
71
+
72
+ **Question design:**
73
+
74
+ - Options should be concrete ("Card layout" not "Option A")
75
+ - Each answer should inform the next question
76
+ - Include "You decide" as an option when reasonable — captures agent discretion
77
+
78
+ ### 4. Scope Guardrail (CRITICAL)
79
+
80
+ The feature boundary from `spec.md` is **fixed**. Discussion clarifies HOW to implement, never WHETHER to add new capabilities.
81
+
82
+ **Allowed:** "How should posts be displayed?" (clarifying ambiguity)
83
+ **Not allowed:** "Should we also add comments?" (new capability)
84
+
85
+ When user suggests scope creep: "That sounds like a separate feature. I'll note it in Deferred Ideas. Back to [current area]."
86
+
87
+ ### 5. Write `context.md`
88
+
89
+ Write `.specs/features/<slug>/context.md` (see template below).
90
+
91
+ ## Output
92
+
93
+ Write `.specs/features/<slug>/context.md` when the discussion is substantial. For small cases, add a compact Discuss section to `spec.md`.
94
+
95
+ Capture:
96
+
97
+ - Question ID.
98
+ - Affected requirement IDs.
99
+ - User-confirmed context, decision, or accepted assumption.
100
+ - Concern or risk raised by the gray area.
101
+ - Rejected alternatives.
102
+ - Out-of-scope boundaries.
103
+ - Follow-up needed before Design, Tasks, or Execute.
104
+
105
+ ## Confirmation Gate
106
+
107
+ Before treating Discuss output as approved context, confirm consequential assumptions with the user or record that the user accepted a default. If the answer changes design, verification, data, security/privacy, or compatibility, update `spec.md` before continuing.
108
+
109
+ **Artifact-store evidence:** when `context.md` is written, record the active artifact key, version, and checksum after write (see `references/spec-driven/artifact-store.md`).
110
+
111
+ ## Closure
112
+
113
+ Discuss is done when every gray area is either resolved with the user, recorded as an accepted assumption, or explicitly out of scope. Do not proceed with hidden assumptions.
114
+
115
+ ---
116
+
117
+ ## Template: `.specs/features/<slug>/context.md`
118
+
119
+ ```markdown
120
+ # [Feature] Context
121
+
122
+ **Gathered:** [date]
123
+ **Spec:** `.specs/features/<slug>/spec.md`
124
+ **Status:** Ready for design
125
+
126
+ ---
127
+
128
+ ## Feature Boundary
129
+
130
+ [Clear statement of what this feature delivers — the scope anchor from spec.md]
131
+
132
+ ---
133
+
134
+ ## Implementation Decisions
135
+
136
+ ### [Area 1 that was discussed]
137
+
138
+ - [Specific decision made]
139
+ - [Another decision if applicable]
140
+
141
+ ### [Area 2 that was discussed]
142
+
143
+ - [Specific decision made]
144
+
145
+ ### [Area 3 that was discussed]
146
+
147
+ - [Specific decision made]
148
+
149
+ ### Agent's Discretion
150
+
151
+ [Areas where user explicitly said "you decide" — agent has flexibility here during design/implementation]
152
+
153
+ ### Declined / Undiscussed Gray Areas → Assumptions
154
+
155
+ [Gray areas the user declined to discuss or that were not covered. Each entry is written to the spec's Assumptions & Open Questions section with the agent's chosen default and rationale — not left silently unresolved.]
156
+
157
+ ---
158
+
159
+ ## Specific References
160
+
161
+ [Any "I want it like X" moments, product references, specific behaviors, interaction patterns mentioned during discussion]
162
+
163
+ [If none: "No specific requirements — open to standard approaches"]
164
+
165
+ ---
166
+
167
+ ## Deferred Ideas
168
+
169
+ [Ideas that came up during discussion but belong in other features/phases. Captured here so they're not lost, but explicitly out of scope]
170
+
171
+ [If none: "None — discussion stayed within feature scope"]
172
+ ```
173
+
174
+ ---
175
+
176
+ ## Tips
177
+
178
+ - **Decisions, not vision** — "Card-based layout with subtle shadows" is a decision. "Should feel modern" is not.
179
+ - **Scope is sacred** — Deferred Ideas captures scope creep without losing ideas
180
+ - **User = visionary, Agent = builder** — Ask about how they imagine it, not about technical implementation
181
+ - **Don't ask about:** Technical architecture, performance, implementation details — that's Design's job
182
+ - **Confirm before Design** — User approves `context.md` before moving to design phase