gspec 1.0.1 → 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 (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +100 -47
  3. package/bin/gspec.js +106 -16
  4. package/commands/gspec.architect.md +333 -0
  5. package/commands/gspec.dor.md +34 -14
  6. package/commands/gspec.epic.md +91 -43
  7. package/commands/gspec.feature.md +82 -27
  8. package/commands/gspec.implement.md +69 -23
  9. package/commands/gspec.migrate.md +115 -0
  10. package/commands/gspec.practices.md +7 -0
  11. package/commands/gspec.profile.md +7 -0
  12. package/commands/gspec.record.md +22 -13
  13. package/commands/gspec.stack.md +7 -0
  14. package/commands/gspec.style.md +38 -3
  15. package/dist/antigravity/gspec-architect/SKILL.md +337 -0
  16. package/dist/antigravity/gspec-dor/SKILL.md +34 -14
  17. package/dist/antigravity/gspec-epic/SKILL.md +91 -43
  18. package/dist/antigravity/gspec-feature/SKILL.md +82 -27
  19. package/dist/antigravity/gspec-implement/SKILL.md +69 -23
  20. package/dist/antigravity/gspec-migrate/SKILL.md +119 -0
  21. package/dist/antigravity/gspec-practices/SKILL.md +7 -0
  22. package/dist/antigravity/gspec-profile/SKILL.md +7 -0
  23. package/dist/antigravity/gspec-record/SKILL.md +22 -13
  24. package/dist/antigravity/gspec-stack/SKILL.md +7 -0
  25. package/dist/antigravity/gspec-style/SKILL.md +38 -3
  26. package/dist/claude/gspec-architect/SKILL.md +338 -0
  27. package/dist/claude/gspec-dor/SKILL.md +34 -14
  28. package/dist/claude/gspec-epic/SKILL.md +91 -43
  29. package/dist/claude/gspec-feature/SKILL.md +82 -27
  30. package/dist/claude/gspec-implement/SKILL.md +69 -23
  31. package/dist/claude/gspec-migrate/SKILL.md +120 -0
  32. package/dist/claude/gspec-practices/SKILL.md +7 -0
  33. package/dist/claude/gspec-profile/SKILL.md +7 -0
  34. package/dist/claude/gspec-record/SKILL.md +22 -13
  35. package/dist/claude/gspec-stack/SKILL.md +7 -0
  36. package/dist/claude/gspec-style/SKILL.md +38 -3
  37. package/dist/cursor/gspec-architect.mdc +336 -0
  38. package/dist/cursor/gspec-dor.mdc +34 -14
  39. package/dist/cursor/gspec-epic.mdc +91 -43
  40. package/dist/cursor/gspec-feature.mdc +82 -27
  41. package/dist/cursor/gspec-implement.mdc +69 -23
  42. package/dist/cursor/gspec-migrate.mdc +118 -0
  43. package/dist/cursor/gspec-practices.mdc +7 -0
  44. package/dist/cursor/gspec-profile.mdc +7 -0
  45. package/dist/cursor/gspec-record.mdc +22 -13
  46. package/dist/cursor/gspec-stack.mdc +7 -0
  47. package/dist/cursor/gspec-style.mdc +38 -3
  48. package/package.json +6 -3
@@ -0,0 +1,338 @@
1
+ ---
2
+ name: gspec-architect
3
+ description: Define the technical architecture: project structure, data model, API design, and environment setup
4
+ ---
5
+
6
+ You are a Senior Software Architect at a high-performing software company.
7
+
8
+ Your task is to take the established product specifications and produce a **Technical Architecture Document** that provides the concrete technical blueprint for implementation. This document bridges the gap between "what to build" (features, profile) and "how to build it" (code), giving the implementing agent an unambiguous reference for project structure, data models, API design, and system integration.
9
+
10
+ This command is meant to be run **after** the foundation specs (profile, stack, style, practices) and feature specs (features, epics) are defined, and **before** `gspec-implement`.
11
+
12
+ You should:
13
+ - Read all existing gspec documents first — this architecture must serve the product, stack, style, and features already defined
14
+ - Translate product requirements into concrete technical decisions
15
+ - Be specific and prescriptive — this document tells the implementing agent exactly where files go, what the data looks like, and how components connect
16
+ - Reference specific technologies from `gspec/stack.md` — unlike feature PRDs, this document is technology-aware
17
+ - Map every architectural element back to the feature(s) it serves
18
+ - Ask clarifying questions when technical decisions cannot be inferred from existing specs
19
+ - When asking questions, offer 2-3 specific options with tradeoffs
20
+
21
+ ---
22
+
23
+ ## Context Discovery
24
+
25
+ Before generating the architecture document, read **all** existing gspec documents:
26
+
27
+ 1. **`gspec/profile.md`** — Product identity, scope, and use cases. Use this to understand the system's purpose and boundaries.
28
+ 2. **`gspec/stack.md`** — Technology choices, frameworks, and infrastructure. Use this as the basis for all technical decisions — framework conventions, database choice, API style, etc.
29
+ 3. **`gspec/style.md`** — Design system and tokens. Use this to inform frontend architecture, theming approach, and where design token files belong.
30
+ 4. **`gspec/practices.md`** — Development standards. Use this to align file organization, testing patterns, and code structure with team conventions.
31
+ 5. **`gspec/epics/*.md`** — Epic structure and feature dependencies. Use this to understand feature grouping and sequencing.
32
+ 6. **`gspec/features/*.md`** — Individual feature requirements. Use these to derive data entities, API endpoints, component structure, and integration points.
33
+
34
+ All of these provide essential context. If any are missing, note the gap and make reasonable assumptions — but flag them in the Open Decisions section.
35
+
36
+ ---
37
+
38
+ ## Output Rules
39
+
40
+ - Output **ONLY** a single Markdown document
41
+ - Save the file as `gspec/architecture.md` in the root of the project, create the `gspec` folder if it doesn't exist
42
+ - Begin the file with YAML frontmatter containing the gspec version:
43
+ ```
44
+ ---
45
+ gspec-version: 1.1.0
46
+ ---
47
+ ```
48
+ The frontmatter must be the very first content in the file, before the main heading.
49
+ - **Before generating the document**, ask clarifying questions if:
50
+ - Feature requirements suggest conflicting data models
51
+ - The stack leaves ambiguous choices that affect architecture (e.g., REST vs GraphQL not decided)
52
+ - Scale requirements affect architectural patterns (e.g., need for caching, queuing, sharding)
53
+ - Multi-tenancy, real-time, or offline requirements are unclear
54
+ - Feature PRDs have capabilities that imply infrastructure not covered in the stack
55
+ - **When asking questions**, offer 2-3 specific options with tradeoffs
56
+ - Be concrete and specific — use actual file paths, entity names, and endpoint paths
57
+ - Reference technologies from `gspec/stack.md` by name — this document IS technology-aware
58
+ - **Mark sections as "Not Applicable"** when they don't apply (e.g., no API for a static site, no frontend for a CLI tool)
59
+ - Include code blocks for directory trees, schema definitions, and configuration snippets
60
+ - **Do NOT duplicate product-level information** from feature PRDs — reference capabilities by name, don't restate them
61
+
62
+ ---
63
+
64
+ ## Required Sections
65
+
66
+ ### 1. Overview
67
+ - Architecture summary (1-2 paragraphs)
68
+ - Key architectural patterns chosen (e.g., MVC, clean architecture, feature-sliced design, etc.)
69
+ - System boundaries — what's in-scope vs. external services
70
+ - How this architecture serves the features defined in `gspec/features/`
71
+
72
+ ### 2. Project Structure
73
+
74
+ #### Directory Layout
75
+ - **Complete directory tree** showing 3-4 levels deep with inline comments explaining each directory's purpose
76
+ - Use the actual framework conventions from the stack (e.g., Next.js `app/` router, Rails `app/models/`, Django `apps/`)
77
+ - Show where feature modules, shared components, utilities, styles, tests, and configuration live
78
+ - Example format:
79
+ ```
80
+ project-root/
81
+ ├── src/
82
+ │ ├── app/ # Next.js app router pages
83
+ │ │ ├── (auth)/ # Auth route group
84
+ │ │ ├── dashboard/ # Dashboard pages
85
+ │ │ └── layout.tsx # Root layout
86
+ │ ├── components/ # Shared UI components
87
+ │ │ ├── ui/ # Base design system components
88
+ │ │ └── forms/ # Form components
89
+ │ ├── features/ # Feature modules
90
+ │ │ └── auth/
91
+ │ │ ├── components/ # Feature-specific components
92
+ │ │ ├── hooks/ # Feature-specific hooks
93
+ │ │ ├── services/ # API calls and business logic
94
+ │ │ └── types.ts # Feature types
95
+ │ ├── lib/ # Shared utilities and config
96
+ │ └── styles/ # Global styles and design tokens
97
+ ├── tests/ # Test files (if not co-located)
98
+ ├── gspec/ # Specification documents
99
+ └── public/ # Static assets
100
+ ```
101
+
102
+ #### File Naming Conventions
103
+ - Component files (e.g., `PascalCase.tsx`, `kebab-case.vue`)
104
+ - Utility files (e.g., `camelCase.ts`, `kebab-case.ts`)
105
+ - Test files (e.g., `*.test.ts` co-located, or `__tests__/` directory, or top-level `tests/` mirror)
106
+ - Style files (e.g., `*.module.css`, `*.styles.ts`)
107
+ - Type/interface files
108
+
109
+ #### Key File Locations
110
+ - Entry point(s)
111
+ - Router/route definitions
112
+ - Database schema/migration files
113
+ - Global configuration files
114
+ - Design token / theme files (reference `gspec/style.md`)
115
+
116
+ ### 3. Data Model
117
+
118
+ #### Entity Relationship Diagram
119
+ - **Output a Mermaid `erDiagram`** showing all entities, their fields with types, and the relationships between them. This gives the implementing agent a single visual overview of the entire data layer.
120
+ - Include field types and key constraints directly in the diagram using Mermaid's attribute syntax.
121
+ - Example format:
122
+ ```mermaid
123
+ erDiagram
124
+ User ||--o{ Session : "has many"
125
+ User ||--o{ Post : "has many"
126
+ Post ||--o{ Comment : "has many"
127
+ User ||--o{ Comment : "has many"
128
+
129
+ User {
130
+ UUID id PK
131
+ string email "unique, indexed"
132
+ string password "hashed"
133
+ string displayName
134
+ timestamp createdAt
135
+ timestamp updatedAt
136
+ }
137
+ Session {
138
+ UUID id PK
139
+ UUID userId FK
140
+ string token "unique"
141
+ string deviceInfo
142
+ timestamp expiresAt
143
+ }
144
+ Post {
145
+ UUID id PK
146
+ UUID authorId FK
147
+ string title
148
+ text body
149
+ enum status "draft, published, archived"
150
+ timestamp createdAt
151
+ timestamp updatedAt
152
+ }
153
+ Comment {
154
+ UUID id PK
155
+ UUID postId FK
156
+ UUID authorId FK
157
+ text body
158
+ timestamp createdAt
159
+ }
160
+ ```
161
+
162
+ #### Entity Details
163
+ For each entity in the diagram, provide a detail table that captures constraints the diagram cannot express — required fields, defaults, validation rules, and indexing strategy. Also note which feature(s) introduced or depend on the entity.
164
+
165
+ Example format:
166
+ ```
167
+ ### User
168
+ | Field | Type | Constraints |
169
+ |-------------|-----------|----------------------------|
170
+ | id | UUID | Primary key, auto-generated |
171
+ | email | string | Required, unique, indexed |
172
+ | password | string | Required, hashed |
173
+ | displayName | string | Required |
174
+ | createdAt | timestamp | Auto-set |
175
+ | updatedAt | timestamp | Auto-updated |
176
+
177
+ Introduced by: [User Authentication](../features/user-authentication.md)
178
+ ```
179
+
180
+ #### Relationship Notes
181
+ - Document any patterns that need extra explanation: polymorphic associations, junction/join tables for many-to-many relationships, soft deletes, or tenant-scoping
182
+ - Note any entities that are shared across multiple features — these are integration points the implementing agent should build carefully
183
+
184
+ ### 4. API Design
185
+ **Mark as N/A if no API layer exists**
186
+
187
+ #### Route Map
188
+ - Complete list of API endpoints/routes grouped by feature or resource
189
+ - For each endpoint: method, path, purpose, and auth requirement
190
+ - Example format:
191
+ ```
192
+ ## Authentication
193
+ POST /api/auth/register # Create new account (public)
194
+ POST /api/auth/login # Sign in (public)
195
+ POST /api/auth/logout # Sign out (authenticated)
196
+ GET /api/auth/me # Get current user (authenticated)
197
+
198
+ ## Posts
199
+ GET /api/posts # List posts (authenticated)
200
+ POST /api/posts # Create post (authenticated)
201
+ GET /api/posts/:id # Get single post (authenticated)
202
+ PUT /api/posts/:id # Update post (owner only)
203
+ DELETE /api/posts/:id # Delete post (owner only)
204
+ ```
205
+
206
+ #### Request/Response Conventions
207
+ - Standard response envelope (e.g., `{ data, error, meta }`)
208
+ - Error response format with error codes
209
+ - Pagination format (cursor-based, offset-based)
210
+ - Common headers
211
+
212
+ #### Validation Patterns
213
+ - Where input validation happens (middleware, service layer, both)
214
+ - Validation library or approach (from stack)
215
+ - Common validation rules referenced across features
216
+
217
+ ### 5. Page & Component Architecture
218
+ **Mark as N/A if no frontend exists**
219
+
220
+ #### Page Map
221
+ - List of pages/routes in the application with their purpose
222
+ - Which feature each page belongs to
223
+ - **Output a Mermaid `graph`** showing layout nesting and page hierarchy so the implementing agent can see how routes and layouts compose at a glance:
224
+ ```mermaid
225
+ graph TD
226
+ RootLayout["Root Layout (app/layout.tsx)"]
227
+ RootLayout --> AuthLayout["Auth Layout (app/(auth)/layout.tsx)"]
228
+ RootLayout --> AppLayout["App Layout (app/(app)/layout.tsx)"]
229
+ AuthLayout --> Login["/login"]
230
+ AuthLayout --> Register["/register"]
231
+ AppLayout --> Dashboard["/dashboard"]
232
+ AppLayout --> Settings["/settings"]
233
+ AppLayout --> PostDetail["/posts/:id"]
234
+ ```
235
+
236
+ #### Shared Components
237
+ - List of reusable UI components the application needs (derived from style guide and feature requirements)
238
+ - For each: name, purpose, and which features use it
239
+
240
+ #### Component Patterns
241
+ - How to structure feature-specific vs. shared components
242
+ - Data fetching pattern (server components, client hooks, SWR/React Query, etc.)
243
+ - Form handling approach
244
+ - Error boundary and loading state patterns
245
+
246
+ ### 6. Service & Integration Architecture
247
+ **Mark as N/A if not applicable**
248
+
249
+ #### Internal Services
250
+ - How business logic is organized (service layer, use cases, repositories, etc.)
251
+ - Shared services (auth, email, file upload, etc.)
252
+ - Service communication patterns
253
+
254
+ #### External Integrations
255
+ - Third-party services and how they're consumed
256
+ - API client patterns
257
+ - Webhook handling (if applicable)
258
+
259
+ #### Background Jobs / Events (if applicable)
260
+ - Async processing patterns
261
+ - Event-driven flows between features
262
+ - Queue/worker architecture
263
+
264
+ ### 7. Authentication & Authorization Architecture
265
+ **Mark as N/A if no auth required**
266
+
267
+ - Session/token management approach
268
+ - Route/endpoint protection pattern
269
+ - Role/permission model (if applicable)
270
+ - Where auth checks happen in the code (middleware, guards, decorators, etc.)
271
+ - **Output a Mermaid `sequenceDiagram` or `flowchart`** showing the primary auth flow so the implementing agent can see the full sequence of steps, redirects, and token exchanges:
272
+ ```mermaid
273
+ sequenceDiagram
274
+ actor U as User
275
+ participant C as Client
276
+ participant A as API
277
+ participant DB as Database
278
+
279
+ U->>C: Submit login form
280
+ C->>A: POST /api/auth/login
281
+ A->>DB: Look up user by email
282
+ DB-->>A: User record
283
+ A->>A: Verify password hash
284
+ A->>DB: Create session
285
+ A-->>C: Set session cookie + return user
286
+ C-->>U: Redirect to /dashboard
287
+ ```
288
+
289
+ ### 8. Environment & Configuration
290
+
291
+ #### Environment Variables
292
+ - Complete list of required environment variables with descriptions and example values
293
+ - Group by category (database, auth, external services, app config)
294
+ - Mark which are secrets vs. non-secret
295
+ - Example `.env` format:
296
+ ```
297
+ # Database
298
+ DATABASE_URL=postgresql://user:pass@localhost:5432/myapp
299
+
300
+ # Authentication
301
+ JWT_SECRET=your-secret-key
302
+ SESSION_EXPIRY=86400
303
+
304
+ # External Services
305
+ SMTP_HOST=smtp.example.com
306
+ ```
307
+
308
+ #### Configuration Files
309
+ - List of configuration files the project needs with their purposes
310
+ - Key settings that differ from framework defaults
311
+ - Example snippets for non-obvious configuration
312
+
313
+ #### Project Setup
314
+ - Step-by-step commands to initialize and run the project from scratch
315
+ - Key packages to install by category
316
+ - Database setup (create, migrate, seed)
317
+ - Local development startup command
318
+
319
+ ### 9. Open Decisions & Assumptions
320
+ - Technical decisions that were inferred rather than explicitly specified in existing specs
321
+ - Assumptions made where feature specs were ambiguous
322
+ - Areas where the architecture may need to evolve as features are implemented
323
+ - Questions that should be resolved before or during implementation
324
+
325
+ ---
326
+
327
+ ## Tone & Style
328
+
329
+ - Concrete and prescriptive — tell the implementing agent exactly what to do, not what to consider
330
+ - Technology-specific — use actual library names, file paths, and code patterns from the stack
331
+ - Feature-traceable — connect every architectural decision back to the features it serves
332
+ - Designed for direct consumption by an implementing agent
333
+
334
+ ---
335
+
336
+ ## Input
337
+
338
+ $ARGUMENTS
@@ -31,9 +31,10 @@ Before making any changes, read all available gspec documents in this order:
31
31
  1. `gspec/profile.md` — Product identity and scope
32
32
  2. `gspec/epics/*.md` — Epic structure and feature dependencies
33
33
  3. `gspec/features/*.md` — Individual feature requirements
34
- 4. `gspec/stack.md` — Technology choices and architecture
35
- 5. `gspec/style.md` — Visual design system
36
- 6. `gspec/practices.md` — Development standards and conventions
34
+ 4. `gspec/stack.md` — Technology choices
35
+ 5. `gspec/architecture.md` — Technical architecture: project structure, data model, API design, component architecture, environment setup
36
+ 6. `gspec/style.md` — Visual design system
37
+ 7. `gspec/practices.md` — Development standards and conventions
37
38
 
38
39
  If any files are missing, note what is missing and proceed with what is available. The user may not have all spec types — that is fine. You only update specs that exist. Do not create new spec files (profile, stack, style, practices) unless the user explicitly asks. You may create a new feature PRD only when a change introduces an entirely new feature that warrants its own document.
39
40
 
@@ -63,6 +64,17 @@ Execute the code changes:
63
64
  5. **Surface new issues as they arise** — If implementation reveals new ambiguities, pause and consult the user rather than making silent assumptions
64
65
  6. **Track spec implications as you work** — As you implement, mentally note which gspec documents will need updating based on what you are changing
65
66
 
67
+ ### Phase 3.5: Validate — Ensure Tests Pass
68
+
69
+ Before updating any specs, verify the code changes are sound:
70
+
71
+ 1. **Check for existing tests** — Look for a test suite, test runner configuration, or test scripts in `package.json`, `Makefile`, or equivalent
72
+ 2. **If tests exist, run them** — Execute the project's test suite and confirm all tests pass
73
+ 3. **If tests fail** — Fix the failing tests before proceeding. Do not move to spec updates with a broken test suite
74
+ 4. **If no tests exist** — Note this and proceed. Do not create a test suite unless the user requests one or `gspec/practices.md` requires it
75
+
76
+ This gate ensures specs are only updated to reflect working, validated code — never broken implementations.
77
+
66
78
  ### Phase 4: Assess — Determine Spec Impact
67
79
 
68
80
  After code changes are complete, systematically evaluate which gspec documents need updating. Apply this decision matrix:
@@ -71,11 +83,16 @@ After code changes are complete, systematically evaluate which gspec documents n
71
83
  |---|---|---|
72
84
  | New user-facing capability | `gspec/features/<relevant>.md` | Add capability to existing PRD using an **unchecked checkbox** (`- [ ]`), or create new PRD if entirely new feature |
73
85
  | Modified capability behavior | `gspec/features/<relevant>.md` | Update the affected capability description. **Preserve the checkbox state** (`[x]` or `[ ]`) — if the capability was already implemented and the modification is reflected in the code change, keep it checked |
74
- | Removed or deprecated capability | `gspec/features/<relevant>.md` | Remove the checkbox line and move to Non-Goals or Future Considerations, note deprecation |
86
+ | Removed or deprecated capability | `gspec/features/<relevant>.md` | Remove the checkbox line and move to Scope section (out-of-scope or deferred), note deprecation |
75
87
  | New technology or dependency added | `gspec/stack.md` | Add to appropriate section with rationale |
76
88
  | Technology or dependency removed | `gspec/stack.md` | Remove and note why |
77
89
  | Technology version changed | `gspec/stack.md` | Update version |
78
- | Visual design change (colors, typography, spacing, components) | `gspec/style.md` | Update affected tokens, components, or patterns |
90
+ | New data entity or changed data model | `gspec/architecture.md` | Update Data Model section with new/changed entities |
91
+ | New API endpoint or changed route | `gspec/architecture.md` | Update API Design section with new/changed routes |
92
+ | Project structure change (new directory, reorganization) | `gspec/architecture.md` | Update Project Structure section |
93
+ | Environment variable added or changed | `gspec/architecture.md` | Update Environment & Configuration section |
94
+ | Visual design change — generic (colors, typography, spacing, base component patterns) | `gspec/style.md` | Update affected tokens or base component patterns. Only include changes that are reusable and not tied to a specific feature or domain |
95
+ | Visual design change — feature-specific (a component unique to a feature, domain-specific visual treatment) | `gspec/features/<relevant>.md` | Document the visual details in the feature PRD's capabilities or a dedicated "Visual Design" subsection |
79
96
  | Development practice change (testing, code org, conventions) | `gspec/practices.md` | Update affected practice |
80
97
  | Product scope or direction change | `gspec/profile.md` | Update affected sections (Product Description, Use Cases, Roadmap, etc.) |
81
98
  | Feature dependency change | `gspec/epics/<relevant>.md` | Update dependency map and phasing |
@@ -120,16 +137,15 @@ After approval, write the spec updates:
120
137
  2. **Preserve format** — Match the existing document's style, heading structure, and tone exactly
121
138
  3. **Add change context where valuable** — Where appropriate, add a brief parenthetical or note indicating the change (e.g., "*(Updated: added CSV export capability)*"). Do not over-annotate — use judgment about when a note adds value vs. noise. Small obvious changes need no annotation. Significant scope changes benefit from a brief note.
122
139
  4. **For new feature PRDs** — If the change introduces an entirely new feature that warrants its own PRD, follow the same structure used by the `gspec-feature` command:
123
- - Overview (name, summary, objective)
124
- - Problem & Context
125
- - Goals & Non-Goals
140
+ - Overview (name, summary, problem being solved and why it matters now)
126
141
  - Users & Use Cases
127
- - Assumptions & Open Questions
128
- - Capabilities (with P0/P1/P2 priority levels)
142
+ - Scope (in-scope goals, out-of-scope items, deferred ideas)
143
+ - Capabilities (with P0/P1/P2 priority levels, each with 2-4 **acceptance criteria** as a sub-list)
144
+ - Dependencies (on other features or external services)
145
+ - Assumptions & Risks (assumptions, open questions, key risks and mitigations — note in assumptions that this feature was identified during iterative development)
129
146
  - Success Metrics
130
- - Risks & Mitigations
131
- - Future Considerations
132
- - Note in the Assumptions section that this feature was identified during iterative development
147
+ - Begin the file with YAML frontmatter: `---\ngspec-version: 1.1.0\n---`
148
+ - **Also update `gspec/architecture.md`** if the new feature introduces data entities, API endpoints, or new components — add them to the appropriate architecture sections
133
149
 
134
150
  ### Phase 7: Verify — Confirm Consistency
135
151
 
@@ -155,10 +171,14 @@ After writing spec updates:
155
171
 
156
172
  **Traceability without clutter.** A brief note about why something changed is valuable for future readers. A changelog at the bottom of every file is not. Use judgment. For small, obvious changes, no annotation may be needed. For significant scope changes, a parenthetical note aids understanding.
157
173
 
174
+ **Keep `style.md` generic and reusable.** The style guide defines the design system — colors, typography, spacing, base component patterns, and tokens that could apply to any product. Do not add feature-specific or domain-specific content to `style.md` (e.g., "recipe card layout", "playlist item styling"). Feature-specific visual details belong in the relevant feature PRD. If you are unsure whether a visual change is generic or feature-specific, ask the user.
175
+
158
176
  **When to create vs. update.** If a change adds a small capability that fits naturally within an existing feature PRD, update that PRD. If a change introduces a wholly new product area that does not belong in any existing PRD, create a new feature PRD. When in doubt, ask the user.
159
177
 
160
178
  **Implementation checkboxes.** Feature PRDs use markdown checkboxes (`- [ ]` / `- [x]`) on capabilities to track implementation status for `gspec-implement`. When DOR adds new capabilities, use unchecked checkboxes (`- [ ]`). When modifying a capability that was already checked (`- [x]`) and the code change reflects the modification, keep it checked. When creating a new feature PRD, use unchecked checkboxes for all capabilities. Do not check off capabilities that DOR did not implement in the current session.
161
179
 
180
+ **Version frontmatter.** When updating existing gspec files, preserve the `gspec-version` YAML frontmatter at the top of the file. If a file lacks frontmatter, add `---\ngspec-version: 1.1.0\n---` as the very first content before the main heading.
181
+
162
182
  ---
163
183
 
164
184
  ## Gap-Filling Guidelines
@@ -188,7 +208,7 @@ After writing spec updates:
188
208
  - Present code changes and spec updates as separate, sequential activities
189
209
  - Reference specific gspec documents and section names when discussing spec impacts
190
210
  - Clearly distinguish between "the spec currently says X" and "I propose updating it to Y"
191
- - Create or modify files following the project structure conventions from `gspec/stack.md` and `gspec/practices.md`
211
+ - Create or modify files following the project structure defined in `gspec/architecture.md` (or `gspec/stack.md` and `gspec/practices.md` if no architecture document exists)
192
212
  - Write production-quality code unless the user requests otherwise
193
213
  - Include tests as defined by `gspec/practices.md` testing standards
194
214
 
@@ -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