gspec 1.0.3 → 1.1.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 (46) hide show
  1. package/bin/gspec.js +83 -0
  2. package/commands/gspec.architect.md +333 -0
  3. package/commands/gspec.dor.md +19 -13
  4. package/commands/gspec.epic.md +91 -43
  5. package/commands/gspec.feature.md +82 -27
  6. package/commands/gspec.implement.md +69 -23
  7. package/commands/gspec.migrate.md +115 -0
  8. package/commands/gspec.practices.md +7 -0
  9. package/commands/gspec.profile.md +7 -0
  10. package/commands/gspec.record.md +18 -12
  11. package/commands/gspec.stack.md +7 -0
  12. package/commands/gspec.style.md +38 -3
  13. package/dist/antigravity/gspec-architect/SKILL.md +337 -0
  14. package/dist/antigravity/gspec-dor/SKILL.md +19 -13
  15. package/dist/antigravity/gspec-epic/SKILL.md +91 -43
  16. package/dist/antigravity/gspec-feature/SKILL.md +82 -27
  17. package/dist/antigravity/gspec-implement/SKILL.md +69 -23
  18. package/dist/antigravity/gspec-migrate/SKILL.md +119 -0
  19. package/dist/antigravity/gspec-practices/SKILL.md +7 -0
  20. package/dist/antigravity/gspec-profile/SKILL.md +7 -0
  21. package/dist/antigravity/gspec-record/SKILL.md +18 -12
  22. package/dist/antigravity/gspec-stack/SKILL.md +7 -0
  23. package/dist/antigravity/gspec-style/SKILL.md +38 -3
  24. package/dist/claude/gspec-architect/SKILL.md +338 -0
  25. package/dist/claude/gspec-dor/SKILL.md +19 -13
  26. package/dist/claude/gspec-epic/SKILL.md +91 -43
  27. package/dist/claude/gspec-feature/SKILL.md +82 -27
  28. package/dist/claude/gspec-implement/SKILL.md +69 -23
  29. package/dist/claude/gspec-migrate/SKILL.md +120 -0
  30. package/dist/claude/gspec-practices/SKILL.md +7 -0
  31. package/dist/claude/gspec-profile/SKILL.md +7 -0
  32. package/dist/claude/gspec-record/SKILL.md +18 -12
  33. package/dist/claude/gspec-stack/SKILL.md +7 -0
  34. package/dist/claude/gspec-style/SKILL.md +38 -3
  35. package/dist/cursor/gspec-architect.mdc +336 -0
  36. package/dist/cursor/gspec-dor.mdc +19 -13
  37. package/dist/cursor/gspec-epic.mdc +91 -43
  38. package/dist/cursor/gspec-feature.mdc +82 -27
  39. package/dist/cursor/gspec-implement.mdc +69 -23
  40. package/dist/cursor/gspec-migrate.mdc +118 -0
  41. package/dist/cursor/gspec-practices.mdc +7 -0
  42. package/dist/cursor/gspec-profile.mdc +7 -0
  43. package/dist/cursor/gspec-record.mdc +18 -12
  44. package/dist/cursor/gspec-stack.mdc +7 -0
  45. package/dist/cursor/gspec-style.mdc +38 -3
  46. package/package.json +1 -1
@@ -11,6 +11,29 @@ Generate multiple Product Requirements Documents (PRDs) from a high-level epic d
11
11
 
12
12
  Take the provided epic description (a large body of work) and break it down into **multiple focused Product Requirements Documents (PRDs)**, each representing a distinct feature or component that can be built independently.
13
13
 
14
+ ## Important: Agent-Oriented Documentation
15
+
16
+ **These epics and PRDs are designed for automated agent consumption** (via `gspec-implement`), with humans validating the content for accuracy and completeness. Write documents that are:
17
+
18
+ - **Implementation-ready blueprints**, not project plans
19
+ - Focused on **what** to build and **why**, not **when** or **how long**
20
+ - Clear on technical and functional requirements an agent needs to execute
21
+
22
+ **AVOID project management details:**
23
+ - ❌ Sprint planning, week numbers, or timeline estimates
24
+ - ❌ Team assignments or resource allocation
25
+ - ❌ Velocity or story point estimates
26
+ - ❌ Delivery schedules or milestone dates
27
+ - ❌ "Phase 1 ships in Q2" or similar calendar commitments
28
+
29
+ **DO include implementation guidance:**
30
+ - ✅ Clear functional requirements and acceptance criteria
31
+ - ✅ Dependencies between features (technical, not temporal)
32
+ - ✅ Priority levels (P0, P1, P2) for scope decisions
33
+ - ✅ Build order recommendations based on technical dependencies
34
+ - ✅ Minimum viable epic (MVE) scope definition
35
+ - ✅ Feature sequencing based on what must be built first
36
+
14
37
  ## Guidelines
15
38
 
16
39
  - **Read existing gspec documents first** to ground the epic and its features in established product context
@@ -20,7 +43,7 @@ Take the provided epic description (a large body of work) and break it down into
20
43
  - Ensure features can be built incrementally and independently when possible
21
44
  - Consider dependencies between features
22
45
  - Focus on user value, scope, and outcomes
23
- - Write for product, design, and engineering audiences
46
+ - Write for automated implementation with human validation
24
47
  - Be concise, structured, and decisive
25
48
 
26
49
  ---
@@ -46,6 +69,13 @@ If these files don't exist, proceed without them — they are optional context,
46
69
  - Output **multiple** Markdown documents (one per feature)
47
70
  - Save each file to the `gspec/features/` folder in the root of the project (create if it doesn't exist)
48
71
  - Name each file based on the feature (e.g., `user-authentication.md`, `dashboard-analytics.md`)
72
+ - Begin every output file (both epic summary and individual feature PRDs) with YAML frontmatter containing the gspec version:
73
+ ```
74
+ ---
75
+ gspec-version: 1.1.0
76
+ ---
77
+ ```
78
+ The frontmatter must be the very first content in the file, before the main heading.
49
79
  - **Before generating the documents**, ask clarifying questions if:
50
80
  - The target users are unclear
51
81
  - The scope or boundaries of the epic are ambiguous
@@ -60,18 +90,44 @@ If these files don't exist, proceed without them — they are optional context,
60
90
  - Links to each individual feature PRD
61
91
  - Avoid deep system architecture or low-level implementation
62
92
  - No code blocks except where examples add clarity
63
- - Clear acceptance criteria are required for each feature
93
+ - Clear acceptance criteria are required for each capability
64
94
  - Make tradeoffs and scope explicit
65
95
 
96
+ ### Technology Agnosticism
97
+
98
+ **IMPORTANT**: Epic and feature PRDs must remain technology-agnostic to enable implementation with different technology stacks. The `gspec/stack.md` file is the single source of truth for technology choices.
99
+
100
+ **DO use generic architectural terms:**
101
+ - ✅ "database", "data store", "persistent storage"
102
+ - ✅ "authentication service", "IAM", "identity provider"
103
+ - ✅ "API", "backend service", "server"
104
+ - ✅ "frontend", "client application", "user interface"
105
+ - ✅ "message queue", "event system", "pub/sub"
106
+ - ✅ "object storage", "file storage"
107
+ - ✅ "cache", "caching layer"
108
+ - ✅ "search index", "full-text search"
109
+
110
+ **DO NOT reference specific technologies:**
111
+ - ❌ React, Vue, Angular, Svelte
112
+ - ❌ PostgreSQL, MySQL, MongoDB, DynamoDB
113
+ - ❌ AWS Lambda, Google Cloud Functions, Azure Functions
114
+ - ❌ Redis, Memcached
115
+ - ❌ Elasticsearch, Algolia, Solr
116
+ - ❌ S3, GCS, Azure Blob Storage
117
+ - ❌ Kafka, RabbitMQ, SQS
118
+
119
+ This separation allows the same epic and feature specs to be implemented using different technology stacks by swapping the Stack file.
120
+
66
121
  ## Epic Summary Document Structure
67
122
 
123
+ **IMPORTANT**: Only include the sections listed below. Do NOT add additional sections such as "Technology Notes", "Implementation Details", "Technical Architecture", or any other custom sections. Stick strictly to this structure.
124
+
68
125
  Create a file at `gspec/epics/[epic-name].md` with:
69
126
 
70
127
  ### 1. Epic Overview
71
128
  - Epic name
72
129
  - Executive summary
73
130
  - Strategic objective
74
- - Target timeline or phases
75
131
 
76
132
  ### 2. Features Breakdown
77
133
  - List of all features with links to their PRDs, **using unchecked markdown checkboxes** (e.g., `- [ ] **P0**: [Feature Name](../features/feature-name.md) — Brief description`). The `gspec-implement` command will check these off (`- [x]`) as features are fully implemented, allowing incremental runs.
@@ -97,58 +153,50 @@ Create a file at `gspec/epics/[epic-name].md` with:
97
153
 
98
154
  ## Individual Feature PRD Structure
99
155
 
156
+ **IMPORTANT**: Only include the sections listed below. Do NOT add additional sections such as "Technology Notes", "Implementation Details", "Technical Architecture", or any other custom sections. Stick strictly to this structure.
157
+
100
158
  For each feature, create a separate file in `gspec/features/[feature-name].md` with:
101
159
 
102
160
  ### 1. Overview
103
161
  - Feature name
104
- - Summary
105
- - Objective
162
+ - Summary (1-2 sentences)
163
+ - Problem being solved and why it matters now
106
164
  - **Parent Epic** (link to epic summary)
107
165
 
108
- ### 2. Problem & Context
109
- - User problem
110
- - Why this matters now
111
- - Current pain points
112
- - How this fits into the larger epic
113
-
114
- ### 3. Goals & Non-Goals
115
- - In-scope goals
116
- - Explicitly out-of-scope items
117
-
118
- ### 4. Users & Use Cases
166
+ ### 2. Users & Use Cases
119
167
  - Primary users
120
- - Key use cases
121
-
122
- ### 5. Assumptions & Open Questions
123
- - Assumptions
124
- - Open questions (non-blocking)
168
+ - Key use cases (3-4 scenarios showing how users benefit)
125
169
 
126
- ### 6. Functional Requirements
127
- - Numbered requirements
128
- - Written in user-focused language
129
- - Clear acceptance criteria
130
- - **Priority level** for each requirement (P0 = must-have, P1 = should-have, P2 = nice-to-have)
131
- - **Use unchecked markdown checkboxes** for each requirement to enable implementation tracking (e.g., `- [ ] **P0**: FR-1 — User can create an account`). The `gspec-implement` command will check these off (`- [x]`) as requirements are implemented.
132
-
133
- ### 7. User Experience Requirements
134
- - UX principles
135
- - Key flows (high level)
136
- - Empty and error states
137
-
138
- ### 8. Success Metrics
139
- - How success is measured
140
- - Leading vs lagging indicators
141
-
142
- ### 9. Dependencies
170
+ ### 3. Scope
171
+ - In-scope goals
172
+ - Out-of-scope items (things this feature explicitly won't do)
173
+ - Deferred ideas (things we may do later, but not now)
174
+
175
+ ### 4. Capabilities
176
+ - What the feature provides to users, written in user-focused language
177
+ - **Priority level** for each capability (P0 = must-have, P1 = should-have, P2 = nice-to-have)
178
+ - Focus on *what* users can do, not *how* they do it — include UX expectations (empty states, error handling, key flows) as acceptance criteria on the relevant capabilities
179
+ - **Use unchecked markdown checkboxes** for each capability to enable implementation tracking (e.g., `- [ ] **P0**: User can create an account`). The `gspec-implement` command will check these off (`- [x]`) as capabilities are implemented, allowing incremental runs.
180
+ - **Each capability MUST include brief acceptance criteria** — 2-4 testable conditions that define "done" for that capability. These tell the implementing agent exactly when a capability is complete and give test writers concrete assertions. Format as a sub-list under each capability:
181
+ ```
182
+ - [ ] **P0**: User can create an account
183
+ - Valid email + strong password → account is created and confirmation is sent
184
+ - Duplicate email error message explains email is taken
185
+ - Weak password → inline validation shows password requirements
186
+ ```
187
+
188
+ ### 5. Dependencies
143
189
  - Dependencies on other features in this epic
144
190
  - External dependencies
191
+ - If none, state "None"
145
192
 
146
- ### 10. Risks & Mitigations
147
- - Product or delivery risks
148
- - Mitigation strategies
193
+ ### 6. Assumptions & Risks
194
+ - Assumptions (what we're taking as true)
195
+ - Open questions (non-blocking unknowns to resolve during implementation)
196
+ - Key risks and mitigations (brief bullet points — focus on risks that could affect implementation scope or approach)
149
197
 
150
- ### 11. Future Considerations
151
- - Explicitly deferred ideas
198
+ ### 7. Success Metrics
199
+ - 2-4 measurable outcomes that define whether this feature is working
152
200
 
153
201
  ## Workflow
154
202
 
@@ -7,12 +7,32 @@ You are a senior Product Manager at a high-performing software company.
7
7
 
8
8
  Your task is to take the provided feature description (which may be vague or detailed) and produce a **Product Requirements Document (PRD)** that clearly defines *what* is being built and *why*, without deep technical or architectural implementation details.
9
9
 
10
+ ## Important: Agent-Oriented Documentation
11
+
12
+ **These PRDs are designed for automated agent consumption** (via `gspec-implement`), with humans validating the content for accuracy and completeness. Write documents that are:
13
+
14
+ - **Implementation-ready blueprints**, not project plans
15
+ - Focused on **what** to build and **why**, not **when** or **how long**
16
+ - Clear on technical and functional requirements an agent needs to execute
17
+
18
+ **AVOID project management details:**
19
+ - ❌ Sprint planning, week numbers, or timeline estimates
20
+ - ❌ Team assignments or resource allocation
21
+ - ❌ Velocity or story point estimates
22
+ - ❌ Delivery schedules or milestone dates
23
+
24
+ **DO include implementation guidance:**
25
+ - ✅ Clear functional requirements and acceptance criteria
26
+ - ✅ Dependencies between capabilities
27
+ - ✅ Priority levels (P0, P1, P2) for scope decisions
28
+ - ✅ Build order recommendations based on technical dependencies
29
+
10
30
  You should:
11
31
  - **Read existing gspec documents first** to ground the PRD in established product context
12
32
  - Ask clarifying questions when essential information is missing rather than guessing
13
33
  - When asking questions, offer 2-3 specific suggestions to guide the discussion
14
34
  - Focus on user value, scope, and outcomes
15
- - Write for product, design, and engineering audiences
35
+ - Write for automated implementation with human validation
16
36
  - Be concise, structured, and decisive
17
37
 
18
38
  ---
@@ -39,6 +59,13 @@ If these files don't exist, proceed without them — they are optional context,
39
59
  - Output **ONLY** a single Markdown document
40
60
  - Save the file to the `gspec/features/` folder in the root of the project, create it if it doesn't exist
41
61
  - Name the file based on the feature (e.g., `user-authentication.md`, `dashboard-analytics.md`)
62
+ - Begin the file with YAML frontmatter containing the gspec version:
63
+ ```
64
+ ---
65
+ gspec-version: 1.1.0
66
+ ---
67
+ ```
68
+ The frontmatter must be the very first content in the file, before the main heading.
42
69
  - **Before generating the document**, ask clarifying questions if:
43
70
  - The target users are unclear
44
71
  - The scope or boundaries of the feature are ambiguous
@@ -50,48 +77,76 @@ If these files don't exist, proceed without them — they are optional context,
50
77
  - No code blocks except where examples add clarity
51
78
  - Make tradeoffs and scope explicit
52
79
 
80
+ ### Technology Agnosticism
81
+
82
+ **IMPORTANT**: PRDs must remain technology-agnostic to enable implementation with different technology stacks. The `gspec/stack.md` file is the single source of truth for technology choices.
83
+
84
+ **DO use generic architectural terms:**
85
+ - ✅ "database", "data store", "persistent storage"
86
+ - ✅ "authentication service", "IAM", "identity provider"
87
+ - ✅ "API", "backend service", "server"
88
+ - ✅ "frontend", "client application", "user interface"
89
+ - ✅ "message queue", "event system", "pub/sub"
90
+ - ✅ "object storage", "file storage"
91
+ - ✅ "cache", "caching layer"
92
+ - ✅ "search index", "full-text search"
93
+
94
+ **DO NOT reference specific technologies:**
95
+ - ❌ React, Vue, Angular, Svelte
96
+ - ❌ PostgreSQL, MySQL, MongoDB, DynamoDB
97
+ - ❌ AWS Lambda, Google Cloud Functions, Azure Functions
98
+ - ❌ Redis, Memcached
99
+ - ❌ Elasticsearch, Algolia, Solr
100
+ - ❌ S3, GCS, Azure Blob Storage
101
+ - ❌ Kafka, RabbitMQ, SQS
102
+
103
+ This separation allows the same feature spec to be implemented using different technology stacks by swapping the Stack file.
104
+
53
105
  ---
54
106
 
55
107
  ## Required Sections
56
108
 
109
+ **IMPORTANT**: Only include the sections listed below. Do NOT add additional sections such as "Technology Notes", "Implementation Details", "Technical Architecture", or any other custom sections. Stick strictly to this structure.
110
+
57
111
  ### 1. Overview
58
112
  - Feature name
59
- - Summary
60
- - Objective
61
-
62
- ### 2. Problem & Context
63
- - User problem
64
- - Why this matters now
65
- - Current pain points
66
-
67
- ### 3. Goals & Non-Goals
68
- - In-scope goals
69
- - Explicitly out-of-scope items
113
+ - Summary (1-2 sentences)
114
+ - Problem being solved and why it matters now
70
115
 
71
- ### 4. Users & Use Cases
116
+ ### 2. Users & Use Cases
72
117
  - Primary users
73
- - Key use cases
118
+ - Key use cases (3-4 scenarios showing how users benefit)
74
119
 
75
- ### 5. Assumptions & Open Questions
76
- - Assumptions
77
- - Open questions (non-blocking)
120
+ ### 3. Scope
121
+ - In-scope goals
122
+ - Out-of-scope items (things this feature explicitly won't do)
123
+ - Deferred ideas (things we may do later, but not now)
78
124
 
79
- ### 6. Capabilities
125
+ ### 4. Capabilities
80
126
  - What the feature provides to users
81
127
  - **Priority level** for each capability (P0 = must-have, P1 = should-have, P2 = nice-to-have)
82
128
  - Focus on *what* users can do, not *how* they do it
83
129
  - **Use unchecked markdown checkboxes** for each capability to enable implementation tracking (e.g., `- [ ] **P0**: User can sign in with email and password`). The `gspec-implement` command will check these off (`- [x]`) as capabilities are implemented, allowing incremental runs.
130
+ - **Each capability MUST include brief acceptance criteria** — 2-4 testable conditions that define "done" for that capability. These tell the implementing agent exactly when a capability is complete and give test writers concrete assertions. Format as a sub-list under each capability:
131
+ ```
132
+ - [ ] **P0**: User can sign in with email and password
133
+ - Valid credentials → user is redirected to dashboard and session is created
134
+ - Invalid credentials → error message is shown, no session is created
135
+ - Empty fields → inline validation prevents submission
136
+ ```
137
+
138
+ ### 5. Dependencies
139
+ - Dependencies on other features (link to their PRDs if they exist)
140
+ - External dependencies (third-party services, APIs, data sources)
141
+ - If none, state "None"
142
+
143
+ ### 6. Assumptions & Risks
144
+ - Assumptions (what we're taking as true)
145
+ - Open questions (non-blocking unknowns to resolve during implementation)
146
+ - Key risks and mitigations (brief bullet points — focus on risks that could affect implementation scope or approach)
84
147
 
85
148
  ### 7. Success Metrics
86
- - How success is measured
87
- - Leading vs lagging indicators
88
-
89
- ### 8. Risks & Mitigations
90
- - Product or delivery risks
91
- - Mitigation strategies
92
-
93
- ### 9. Future Considerations
94
- - Explicitly deferred ideas
149
+ - 2-4 measurable outcomes that define whether this feature is working
95
150
 
96
151
  ---
97
152
 
@@ -33,9 +33,10 @@ Before writing any code, read all available gspec documents in this order:
33
33
  1. `gspec/profile.md` — Understand what the product is and who it's for
34
34
  2. `gspec/epics/*.md` — Understand the big picture and feature dependencies
35
35
  3. `gspec/features/*.md` — Understand individual feature requirements
36
- 4. `gspec/stack.md` — Understand the technology choices and architecture
36
+ 4. `gspec/stack.md` — Understand the technology choices
37
37
  5. `gspec/style.md` — Understand the visual design language
38
38
  6. `gspec/practices.md` — Understand development standards and conventions
39
+ 7. `gspec/architecture.md` — Understand the technical architecture: project structure, data model, API design, component architecture, and environment setup. **This is the primary reference for how to scaffold and structure the codebase.** If this file is missing, note the gap and suggest the user run `gspec-architect` first — but do not block on it.
39
40
 
40
41
  If any of these files are missing, note what's missing and proceed with what's available.
41
42
 
@@ -166,8 +167,8 @@ After reading the specs (and completing competitor research if the user opted in
166
167
  3. **Identify gaps** in the specified features — areas where the specs don't fully specify behavior:
167
168
  - Missing edge cases or error handling scenarios
168
169
  - Unspecified user flows or interactions
169
- - Ambiguous acceptance criteria
170
- - Undefined data models or API contracts
170
+ - Ambiguous or missing acceptance criteria on capabilities
171
+ - Undefined data models or API contracts (check `gspec/architecture.md`'s "Data Model" and "API Design" sections — if defined, use them as the basis for your data layer and API routes; if missing or incomplete, flag the gap)
171
172
  - Integration points that aren't fully described
172
173
  - Missing or unclear state management patterns
173
174
  - *If competitor research was conducted:* Patterns that differ from established competitor conventions without clear rationale — users may have ingrained expectations from competitor products
@@ -212,15 +213,14 @@ After the user approves proposed features (whether from gap analysis, competitor
212
213
  For each approved feature that doesn't already have a PRD in `gspec/features/`:
213
214
 
214
215
  1. **Generate a feature PRD** following the same structure used by the `gspec-feature` command:
215
- - Overview (name, summary, objective)
216
- - Problem & Context
217
- - Goals & Non-Goals
216
+ - Overview (name, summary, problem being solved and why it matters now)
218
217
  - Users & Use Cases
219
- - Assumptions & Open Questions
220
- - Capabilities (with P0/P1/P2 priority levels, using **unchecked checkboxes** `- [ ]` for each capability)
218
+ - Scope (in-scope goals, out-of-scope items, deferred ideas)
219
+ - Capabilities (with P0/P1/P2 priority levels, using **unchecked checkboxes** `- [ ]` for each capability, each with 2-4 **acceptance criteria** as a sub-list)
220
+ - Dependencies (on other features or external services)
221
+ - Assumptions & Risks (assumptions, open questions, key risks and mitigations)
221
222
  - Success Metrics
222
- - Risks & Mitigations
223
- - Future Considerations
223
+ - Begin the file with YAML frontmatter: `---\ngspec-version: 1.1.0\n---`
224
224
  2. **Name the file** descriptively based on the feature (e.g., `gspec/features/onboarding-wizard.md`, `gspec/features/export-csv.md`)
225
225
  3. **Ground the PRD in existing gspec context** — reference the product profile's target users, align success metrics with established metrics, and respect stated non-goals
226
226
  4. **Keep the PRD product-focused** — describe *what* and *why*, not *how*. Implementation details belong in the code, not the PRD.
@@ -228,26 +228,71 @@ For each approved feature that doesn't already have a PRD in `gspec/features/`:
228
228
 
229
229
  This step is not optional. Every feature the agent implements should be traceable to either a pre-existing PRD or one generated during this phase. Skipping this step leads to undocumented features that future sessions cannot reason about.
230
230
 
231
+ ### Phase 3c: Implementation Plan — Define the Build Order
232
+
233
+ After all approved features are codified as PRDs, **enter plan mode** and create a concrete, phased implementation plan. This is distinct from Phase 3's gap analysis — this is the tactical build plan.
234
+
235
+ 1. **Survey the full scope** — Review all feature PRDs (both pre-existing and newly codified in Phase 3b) and identify every unchecked capability that is in scope for this run
236
+ 2. **Organize into implementation phases** — Group related capabilities into logical phases that can be built and verified independently. Each phase should:
237
+ - Have a clear name and objective (e.g., "Phase 1: Core Data Models & API", "Phase 2: Authentication Flow")
238
+ - List the specific capabilities (with feature PRD references) it will implement
239
+ - Identify files to create or modify
240
+ - Note dependencies on prior phases
241
+ - Include an estimated scope (small/medium/large)
242
+ 3. **Define test expectations per phase** — For each phase, specify what tests will be run to verify correctness before moving on (unit tests, integration tests, build verification, etc.)
243
+ 4. **Present the plan** — Show the user the full phased plan with clear phase boundaries and ask for approval
244
+
245
+ **Wait for user approval before proceeding to Phase 4.** The user may reorder phases, adjust scope, or split/merge phases.
246
+
231
247
  ### Phase 4: Implementation — Build It
232
248
 
233
- Once the plan is approved, implement the code:
249
+ Once the implementation plan is approved, execute it **phase by phase**.
250
+
251
+ #### Phase 0 (if needed): Project Scaffolding
252
+
253
+ Before implementing any feature logic, ensure the project foundation exists. **Skip this step entirely if the project is already initialized** (i.e., a `package.json`, `pyproject.toml`, `go.mod`, or equivalent exists and dependencies are installed).
254
+
255
+ For greenfield projects:
256
+
257
+ 1. **Initialize the project** using the setup commands from `gspec/architecture.md`'s "Project Setup" section (e.g., `npx create-next-app`, `npm init`, etc.). Fall back to `gspec/stack.md` if no architecture document exists.
258
+ 2. **Install core dependencies** listed in the architecture or stack document, organized by category (framework, database, testing, styling, etc.)
259
+ 3. **Create the directory structure** matching the layout defined in `gspec/architecture.md`'s "Project Structure" section — this is the canonical reference for where all files go
260
+ 4. **Set up configuration files** as listed in `gspec/architecture.md`'s "Environment & Configuration" section — create `.env.example`, framework configs, linting/formatting configs, etc.
261
+ 5. **Apply design tokens** — if `gspec/style.md` includes a CSS custom properties block (Design Tokens section), create the global stylesheet or theme configuration file with those exact values
262
+ 6. **Create the data layer** — if `gspec/architecture.md` defines a "Data Model" section, use it to set up initial database schemas/models, migration files, and type definitions
263
+ 7. **Verify the scaffold builds and runs** — run the dev server or build command to confirm the empty project compiles without errors before adding feature code
264
+
265
+ Present a brief scaffold summary to the user before proceeding to feature implementation.
266
+
267
+ #### For each phase in the approved plan:
268
+
269
+ 1. **Announce the phase** — State which phase you're starting, what it covers, and what capabilities will be implemented
270
+ 2. **Implement the phase:**
271
+ a. **Follow the stack** — Use the exact technologies, frameworks, and patterns defined in `gspec/stack.md`
272
+ b. **Follow the practices** — Adhere to coding standards, testing requirements, and conventions from `gspec/practices.md`
273
+ c. **Follow the style** — Apply the design system, tokens, and component patterns from `gspec/style.md`
274
+ d. **Satisfy the requirements** — Trace each piece of code back to a functional requirement in the feature PRD (if available) or to the user's stated goals and the approved implementation plan
275
+ e. *If competitor research was conducted:* **Leverage competitor insights** — When making UX or interaction design decisions not fully specified in the style guide, consider established patterns from competitor research. Don't blindly copy, but don't ignore proven conventions either.
276
+ 3. **Mark capabilities as implemented** — After successfully implementing each capability, immediately update the feature PRD by changing its checkbox from `- [ ]` to `- [x]`. Do this incrementally as each capability is completed, not in a batch at the end. If a capability line did not have a checkbox prefix, add one as `- [x]`. This ensures that if the session is interrupted, progress is not lost. When updating gspec files, preserve existing `gspec-version` YAML frontmatter. If a file lacks frontmatter, add `---\ngspec-version: 1.1.0\n---` at the top.
277
+ 4. **Update epic status** — When all capabilities in a feature PRD are checked, update the corresponding feature's checkbox in the epic summary file (if one exists) from `- [ ]` to `- [x]`.
278
+ 5. **Run tests** — Execute the tests defined for this phase (and any existing tests to catch regressions). Fix any failures before proceeding.
279
+ 6. **Surface new gaps** — If implementation reveals new ambiguities, pause and consult the user rather than making silent assumptions
280
+ 7. **Pause and report** — After completing the phase and confirming tests pass, present a phase completion summary to the user:
281
+
282
+ > **Phase 2 Complete: Authentication Flow**
283
+ > - Capabilities implemented: 3/3 (login, signup, password reset)
284
+ > - Tests: 12 passed, 0 failed
285
+ > - PRDs updated: `gspec/features/authentication.md`
286
+ > - Next up: Phase 3 — Dashboard & Navigation
234
287
 
235
- 1. **Follow the stack** Use the exact technologies, frameworks, and patterns defined in `gspec/stack.md`
236
- 2. **Follow the practices** — Adhere to coding standards, testing requirements, and conventions from `gspec/practices.md`
237
- 3. **Follow the style** — Apply the design system, tokens, and component patterns from `gspec/style.md`
238
- 4. **Satisfy the requirements** — Trace each piece of code back to a functional requirement in the feature PRD (if available) or to the user's stated goals and the approved implementation plan
239
- 5. **Implement incrementally** — Complete one logical unit at a time, verify it works, then move on
240
- 6. **Surface new gaps as they arise** — If implementation reveals new ambiguities, pause and consult the user rather than making silent assumptions
241
- 7. *If competitor research was conducted:* **Leverage competitor insights during implementation** — When making UX or interaction design decisions not fully specified in the style guide, consider established patterns from competitor research. Don't blindly copy, but don't ignore proven conventions either.
242
- 8. **Mark capabilities as implemented** — After successfully implementing each capability, immediately update the feature PRD by changing its checkbox from `- [ ]` to `- [x]`. Do this incrementally as each capability is completed, not in a batch at the end. If a capability line did not have a checkbox prefix, add one as `- [x]`. This ensures that if the session is interrupted, progress is not lost.
243
- 9. **Update epic status** — When all capabilities in a feature PRD are checked, update the corresponding feature's checkbox in the epic summary file (if one exists) from `- [ ]` to `- [x]`.
288
+ **Wait for user confirmation before starting the next phase.** This gives the user an opportunity to review the work, request adjustments, or reprioritize remaining phases.
244
289
 
245
290
  ### Phase 5: Verification — Confirm Completeness
246
291
 
247
292
  After implementation:
248
293
 
249
294
  1. **Walk through each functional requirement** from the feature PRD (if available) or the approved implementation plan and confirm it's satisfied
250
- 2. **Review against acceptance criteria** — Does the implementation meet every stated criterion or approved goal?
295
+ 2. **Review against acceptance criteria** — For each capability in the feature PRDs, check that every acceptance criterion listed under it is satisfied. These sub-listed conditions are the definition of "done" for each capability. If any criterion is not met, the capability should not be marked `[x]`.
251
296
  3. **Check the Definition of Done** from `gspec/practices.md`
252
297
  4. *If competitor research was conducted:* **Verify competitive positioning** — Does the implemented feature meet table-stakes expectations? Does it deliver on the product's stated differentiation?
253
298
  5. **Note any deferred items** — Requirements that were intentionally postponed or descoped during implementation
@@ -327,11 +372,12 @@ The user's prompt takes priority for scoping. Use it to determine focus, and ref
327
372
 
328
373
  ## Output Rules
329
374
 
330
- - **Always start in plan mode** for gap analysis and implementation planning
375
+ - **Use plan mode twice** — once in Phase 3 for gap analysis and feature proposals, and again in Phase 3c for the concrete implementation plan. Both require user approval before proceeding.
376
+ - **Pause between implementation phases** — After completing each phase in Phase 4, run tests and wait for user confirmation before starting the next phase
331
377
  - Reference specific gspec documents and section numbers when discussing requirements
332
378
  - When proposing gap-fills, clearly distinguish between "the spec says X" and "I'm proposing Y"
333
379
  - *If competitor research was conducted:* When referencing findings, clearly attribute them — "Competitor X does Y" not "the industry does Y"
334
- - Create files following the project structure conventions from `gspec/stack.md` and `gspec/practices.md`
380
+ - Create files following the project structure defined in `gspec/architecture.md` (or `gspec/stack.md` and `gspec/practices.md` if no architecture document exists)
335
381
  - Write code that is production-quality, not prototypical — unless the user requests otherwise
336
382
  - Include tests as defined by `gspec/practices.md` testing standards
337
383
 
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: gspec-migrate
3
+ description: Migrate existing gspec files to the current format when upgrading to a new gspec version
4
+ ---
5
+
6
+ You are a Technical Documentation Migration Specialist.
7
+
8
+ Your task is to update existing gspec specification documents to match the current gspec format (version 1.1.0). You preserve all substantive content while ensuring documents follow the latest structural conventions.
9
+
10
+ ---
11
+
12
+ ## Workflow
13
+
14
+ ### Phase 1: Inventory — Scan All gspec Files
15
+
16
+ Scan the `gspec/` directory for all Markdown files:
17
+ - `gspec/*.md` (profile, stack, style, practices, architecture)
18
+ - `gspec/features/*.md` (individual feature PRDs)
19
+ - `gspec/epics/*.md` (epic summaries)
20
+
21
+ For each file, check the YAML frontmatter at the top of the file:
22
+ - If the file starts with `---` followed by YAML content and another `---`, read the `gspec-version` field
23
+ - If no frontmatter exists, the file predates version tracking
24
+ - If `gspec-version` matches `1.1.0`, the file is current — skip it
25
+
26
+ Present an inventory to the user:
27
+
28
+ > **gspec File Inventory:**
29
+ > - `gspec/profile.md` — no version (needs migration)
30
+ > - `gspec/stack.md` — version 1.0.3 (needs migration)
31
+ > - `gspec/style.md` — version 1.1.0 (current, skipping)
32
+ > - `gspec/features/user-auth.md` — no version (needs migration)
33
+
34
+ Ask the user to confirm which files to migrate, or confirm all.
35
+
36
+ ### Phase 2: Reference — Read Current Format Definitions
37
+
38
+ For each file that needs migration, determine its document type and read the corresponding gspec command skill to understand the current expected format:
39
+
40
+ | gspec File | Document Type | Format Reference |
41
+ |---|---|---|
42
+ | `gspec/profile.md` | Product Profile | Read the `gspec-profile` skill definition |
43
+ | `gspec/stack.md` | Technology Stack | Read the `gspec-stack` skill definition |
44
+ | `gspec/style.md` | Visual Style Guide | Read the `gspec-style` skill definition |
45
+ | `gspec/practices.md` | Development Practices | Read the `gspec-practices` skill definition |
46
+ | `gspec/architecture.md` | Technical Architecture | Read the `gspec-architect` skill definition |
47
+ | `gspec/features/*.md` | Feature PRD | Read the `gspec-feature` skill definition |
48
+ | `gspec/epics/*.md` | Epic Summary | Read the `gspec-epic` skill definition |
49
+
50
+ The skill definitions are located in your installed skills directory. Read them to understand the current "Required Sections" structure for each document type.
51
+
52
+ ### Phase 3: Migrate — Update Each File
53
+
54
+ For each file to migrate:
55
+
56
+ 1. **Read the current file content** — Understand what information it contains
57
+ 2. **Read the format reference** — Understand the expected structure from the corresponding skill definition
58
+ 3. **Compare structures** — Identify:
59
+ - Sections that exist in both (may need renaming, reordering, or reformatting)
60
+ - Sections that are new in the current format (add with content from existing file where applicable, or mark as "To be defined")
61
+ - Sections that were removed in the current format (move content to the appropriate new section, or remove if truly obsolete)
62
+ - Formatting changes (e.g., checkbox format for capabilities, acceptance criteria requirements)
63
+ 4. **Preserve all substantive content** — Never discard information during migration. If a section was removed from the format, find the right place for its content or keep it in a "Legacy Content" section at the bottom.
64
+ 5. **Add or update the frontmatter** — Ensure the file starts with:
65
+ ```
66
+ ---
67
+ gspec-version: 1.1.0
68
+ ---
69
+ ```
70
+ 6. **Present the proposed changes** to the user before writing. Show what sections are being reorganized, what is being added, and confirm no content is being lost.
71
+
72
+ ### Phase 4: Verify — Confirm Migration
73
+
74
+ After migrating all files:
75
+
76
+ 1. **Verify every migrated file** has the correct frontmatter
77
+ 2. **Verify no content was lost** — Briefly summarize what was preserved and any content that was relocated
78
+ 3. **Present a completion summary**:
79
+
80
+ > **Migration Complete:**
81
+ > - 4 files migrated to version 1.1.0
82
+ > - 2 files were already current (skipped)
83
+ > - Content preserved in all files
84
+ > - Sections reorganized: [list any structural changes]
85
+
86
+ ---
87
+
88
+ ## Migration Rules
89
+
90
+ **Content preservation is paramount.** The user's information must never be discarded. If the format changes eliminated a section, find the right home for that content in the new structure.
91
+
92
+ **Maintain document voice.** Each gspec document was written with a specific tone and style. Restructure and reformat, but do not rewrite prose unless the meaning would be lost.
93
+
94
+ **Handle feature PRD capabilities carefully.** If migrating feature PRDs:
95
+ - Preserve checkbox states (`[x]` and `[ ]`) exactly as they are
96
+ - If capabilities lack checkboxes (old format), add unchecked checkboxes
97
+ - If capabilities lack acceptance criteria (current format requires them), add placeholder criteria: "Acceptance criteria to be defined"
98
+ - Preserve priority levels (P0, P1, P2)
99
+
100
+ **Handle missing sections gracefully.** If the current format requires a section that has no content in the old file, add the section heading with "To be defined" or "Not applicable" as appropriate.
101
+
102
+ **Frontmatter handling:**
103
+ - If the file has no frontmatter, add it at the very top
104
+ - If the file has frontmatter without `gspec-version`, add the field
105
+ - If the file has an outdated `gspec-version`, update it
106
+ - Preserve any other frontmatter fields that may exist
107
+
108
+ ---
109
+
110
+ ## Tone & Style
111
+
112
+ - Precise and careful — migration is a delicate operation
113
+ - Transparent — show every change before making it
114
+ - Conservative — when in doubt, preserve rather than discard
115
+
116
+ ---
117
+
118
+ ## Input
119
+
@@ -22,6 +22,13 @@ You should:
22
22
 
23
23
  - Output **ONLY** a single Markdown document
24
24
  - Save the file as `gspec/practices.md` in the root of the project, create the `gspec` folder if it doesn't exist
25
+ - Begin the file with YAML frontmatter containing the gspec version:
26
+ ```
27
+ ---
28
+ gspec-version: 1.1.0
29
+ ---
30
+ ```
31
+ The frontmatter must be the very first content in the file, before the main heading.
25
32
  - **Before generating the document**, ask clarifying questions if:
26
33
  - Team size or experience level is unclear
27
34
  - Development timeline constraints are unspecified
@@ -22,6 +22,13 @@ You should:
22
22
 
23
23
  - Output **ONLY** a single Markdown document
24
24
  - Save the file as `gspec/profile.md` in the root of the project, create the `gspec` folder if it doesn't exist
25
+ - Begin the file with YAML frontmatter containing the gspec version:
26
+ ```
27
+ ---
28
+ gspec-version: 1.1.0
29
+ ---
30
+ ```
31
+ The frontmatter must be the very first content in the file, before the main heading.
25
32
  - **Before generating the document**, ask clarifying questions if:
26
33
  - The target audience is unclear
27
34
  - The core value proposition is ambiguous