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