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
@@ -25,9 +25,10 @@ Before proposing any updates, read all available gspec documents in this order:
25
25
  1. `gspec/profile.md` — Product identity and scope
26
26
  2. `gspec/epics/*.md` — Epic structure and feature dependencies
27
27
  3. `gspec/features/*.md` — Individual feature requirements
28
- 4. `gspec/stack.md` — Technology choices and architecture
29
- 5. `gspec/style.md` — Visual design system
30
- 6. `gspec/practices.md` — Development standards and conventions
28
+ 4. `gspec/stack.md` — Technology choices
29
+ 5. `gspec/architecture.md` — Technical architecture: project structure, data model, API design, component architecture, environment setup
30
+ 6. `gspec/style.md` — Visual design system
31
+ 7. `gspec/practices.md` — Development standards and conventions
31
32
 
32
33
  If any files are missing, note what is missing and proceed with what is available. 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 what needs recording constitutes an entirely new feature.
33
34
 
@@ -61,10 +62,14 @@ Systematically evaluate which gspec documents need updating. Apply this decision
61
62
  |---|---|---|
62
63
  | New user-facing capability | `gspec/features/<relevant>.md` | Add capability to existing PRD, or create new PRD if entirely new feature |
63
64
  | Modified capability behavior | `gspec/features/<relevant>.md` | Update the affected capability description |
64
- | Removed or deprecated capability | `gspec/features/<relevant>.md` | Move to Non-Goals or Future Considerations, note deprecation |
65
+ | Removed or deprecated capability | `gspec/features/<relevant>.md` | Move to Scope section (out-of-scope or deferred), note deprecation |
65
66
  | New technology or dependency added | `gspec/stack.md` | Add to appropriate section with rationale |
66
67
  | Technology or dependency removed | `gspec/stack.md` | Remove and note why |
67
68
  | Technology version changed | `gspec/stack.md` | Update version |
69
+ | New data entity or changed data model | `gspec/architecture.md` | Update Data Model section with new/changed entities |
70
+ | New API endpoint or changed route | `gspec/architecture.md` | Update API Design section with new/changed routes |
71
+ | Project structure change (new directory, reorganization) | `gspec/architecture.md` | Update Project Structure section |
72
+ | Environment variable added or changed | `gspec/architecture.md` | Update Environment & Configuration section |
68
73
  | 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 |
69
74
  | 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 |
70
75
  | Development practice change (testing, code org, conventions) | `gspec/practices.md` | Update affected practice |
@@ -111,16 +116,15 @@ After approval, write the spec updates:
111
116
  2. **Preserve format** — Match the existing document's style, heading structure, and tone exactly
112
117
  3. **Add change context where valuable** — Where appropriate, add a brief parenthetical note indicating the change (e.g., "*(Updated: switched from REST to GraphQL)*"). Do not over-annotate — use judgment about when a note adds value vs. noise.
113
118
  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:
114
- - Overview (name, summary, objective)
115
- - Problem & Context
116
- - Goals & Non-Goals
119
+ - Overview (name, summary, problem being solved and why it matters now)
117
120
  - Users & Use Cases
118
- - Assumptions & Open Questions
119
- - Capabilities (with P0/P1/P2 priority levels)
121
+ - Scope (in-scope goals, out-of-scope items, deferred ideas)
122
+ - Capabilities (with P0/P1/P2 priority levels, each with 2-4 **acceptance criteria** as a sub-list)
123
+ - Dependencies (on other features or external services)
124
+ - Assumptions & Risks (assumptions, open questions, key risks and mitigations — note in assumptions that this feature was recorded during iterative development)
120
125
  - Success Metrics
121
- - Risks & Mitigations
122
- - Future Considerations
123
- - Note in the Assumptions section that this feature was recorded during iterative development
126
+ - Begin the file with YAML frontmatter: `---\ngspec-version: <<<VERSION>>>\n---`
127
+ - **Also update `gspec/architecture.md`** if the new feature introduces data entities, API endpoints, or new components — add them to the appropriate architecture sections
124
128
 
125
129
  ### Phase 6: Verify — Confirm Consistency
126
130
 
@@ -148,6 +152,8 @@ After writing spec updates:
148
152
 
149
153
  **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.
150
154
 
155
+ **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: <<<VERSION>>>\n---` as the very first content before the main heading.
156
+
151
157
  **No code changes.** This command never creates, modifies, or deletes code files. If the user needs code changes alongside spec updates, suggest using `gspec-dor` instead.
152
158
 
153
159
  ---
@@ -17,6 +17,13 @@ You should:
17
17
 
18
18
  - Output **ONLY** a single Markdown document
19
19
  - Save the file as `gspec/stack.md` in the root of the project, create the `gspec` folder if it doesn't exist
20
+ - Begin the file with YAML frontmatter containing the gspec version:
21
+ ```
22
+ ---
23
+ gspec-version: <<<VERSION>>>
24
+ ---
25
+ ```
26
+ The frontmatter must be the very first content in the file, before the main heading.
20
27
  - **Before generating the document**, ask clarifying questions if:
21
28
  - The project type is unclear (web app, mobile, API, CLI, etc.)
22
29
  - Scale requirements are not specified
@@ -17,6 +17,13 @@ You should:
17
17
 
18
18
  - Output **ONLY** a single Markdown document
19
19
  - Save the file as `gspec/style.md` in the root of the project, create the `gspec` folder if it doesn't exist
20
+ - Begin the file with YAML frontmatter containing the gspec version:
21
+ ```
22
+ ---
23
+ gspec-version: <<<VERSION>>>
24
+ ---
25
+ ```
26
+ The frontmatter must be the very first content in the file, before the main heading.
20
27
  - **Before generating the document**, ask clarifying questions if:
21
28
  - The brand personality or visual direction is unclear
22
29
  - Existing brand assets or guidelines are not mentioned (logos, colors, fonts)
@@ -196,9 +203,37 @@ You should:
196
203
  ### 12. Design Tokens
197
204
 
198
205
  #### Token Structure
199
- - Naming conventions
200
- - Token categories
201
- - Example token definitions (CSS variables, JSON, etc.)
206
+ - Naming conventions (e.g., `--color-primary-500`, `--spacing-md`, `--font-size-lg`)
207
+ - Token categories (color, typography, spacing, shadow, border-radius, animation)
208
+
209
+ #### Token Definitions
210
+ - **Output a complete, machine-parseable token map** as a CSS custom properties code block that the implementing agent can copy directly into the codebase. This is the single source of truth for all design values — every color, spacing value, font size, shadow, and radius defined in earlier sections must appear here as a named token.
211
+ - Example format:
212
+ ```css
213
+ :root {
214
+ /* Colors — Primary */
215
+ --color-primary-50: #eff6ff;
216
+ --color-primary-500: #3b82f6;
217
+ --color-primary-900: #1e3a5f;
218
+ /* Colors — Semantic */
219
+ --color-success: #22c55e;
220
+ --color-error: #ef4444;
221
+ /* Typography */
222
+ --font-family-heading: 'Inter', sans-serif;
223
+ --font-size-h1: 2.25rem;
224
+ --font-weight-bold: 700;
225
+ /* Spacing */
226
+ --spacing-xs: 0.25rem;
227
+ --spacing-sm: 0.5rem;
228
+ --spacing-md: 1rem;
229
+ /* Shadows */
230
+ --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
231
+ /* Border Radius */
232
+ --radius-md: 0.375rem;
233
+ }
234
+ ```
235
+ - If the project uses a utility-first CSS framework (check `gspec/stack.md` if it exists), also provide the framework-specific configuration (e.g., Tailwind `theme.extend` values) that maps to these tokens
236
+ - For dark mode, provide the overridden token values under a separate selector or media query
202
237
 
203
238
  ### 13. Usage Examples
204
239
 
@@ -0,0 +1,337 @@
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
+
@@ -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
 
@@ -82,10 +83,14 @@ After code changes are complete, systematically evaluate which gspec documents n
82
83
  |---|---|---|
83
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 |
84
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 |
85
- | 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 |
86
87
  | New technology or dependency added | `gspec/stack.md` | Add to appropriate section with rationale |
87
88
  | Technology or dependency removed | `gspec/stack.md` | Remove and note why |
88
89
  | Technology version changed | `gspec/stack.md` | Update version |
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 |
89
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 |
90
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 |
91
96
  | Development practice change (testing, code org, conventions) | `gspec/practices.md` | Update affected practice |
@@ -132,16 +137,15 @@ After approval, write the spec updates:
132
137
  2. **Preserve format** — Match the existing document's style, heading structure, and tone exactly
133
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.
134
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:
135
- - Overview (name, summary, objective)
136
- - Problem & Context
137
- - Goals & Non-Goals
140
+ - Overview (name, summary, problem being solved and why it matters now)
138
141
  - Users & Use Cases
139
- - Assumptions & Open Questions
140
- - 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)
141
146
  - Success Metrics
142
- - Risks & Mitigations
143
- - Future Considerations
144
- - 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
145
149
 
146
150
  ### Phase 7: Verify — Confirm Consistency
147
151
 
@@ -173,6 +177,8 @@ After writing spec updates:
173
177
 
174
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.
175
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
+
176
182
  ---
177
183
 
178
184
  ## Gap-Filling Guidelines
@@ -202,7 +208,7 @@ After writing spec updates:
202
208
  - Present code changes and spec updates as separate, sequential activities
203
209
  - Reference specific gspec documents and section names when discussing spec impacts
204
210
  - Clearly distinguish between "the spec currently says X" and "I propose updating it to Y"
205
- - 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)
206
212
  - Write production-quality code unless the user requests otherwise
207
213
  - Include tests as defined by `gspec/practices.md` testing standards
208
214