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