gspec 1.6.0 → 1.10.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 (82) hide show
  1. package/README.md +4 -7
  2. package/bin/gspec.js +275 -8
  3. package/commands/gspec.analyze.md +2 -4
  4. package/commands/gspec.architect.md +2 -3
  5. package/commands/gspec.feature.md +37 -7
  6. package/commands/gspec.implement.md +14 -19
  7. package/commands/gspec.migrate.md +1 -2
  8. package/commands/gspec.practices.md +3 -1
  9. package/commands/gspec.research.md +1 -1
  10. package/commands/gspec.stack.md +11 -6
  11. package/commands/gspec.style.md +18 -23
  12. package/dist/antigravity/gspec-analyze/SKILL.md +2 -4
  13. package/dist/antigravity/gspec-architect/SKILL.md +3 -4
  14. package/dist/antigravity/gspec-feature/SKILL.md +39 -9
  15. package/dist/antigravity/gspec-implement/SKILL.md +15 -20
  16. package/dist/antigravity/gspec-migrate/SKILL.md +6 -7
  17. package/dist/antigravity/gspec-practices/SKILL.md +4 -2
  18. package/dist/antigravity/gspec-profile/SKILL.md +1 -1
  19. package/dist/antigravity/gspec-research/SKILL.md +4 -4
  20. package/dist/antigravity/gspec-stack/SKILL.md +12 -7
  21. package/dist/antigravity/gspec-style/SKILL.md +19 -24
  22. package/dist/claude/gspec-analyze/SKILL.md +2 -4
  23. package/dist/claude/gspec-architect/SKILL.md +3 -4
  24. package/dist/claude/gspec-feature/SKILL.md +39 -9
  25. package/dist/claude/gspec-implement/SKILL.md +15 -20
  26. package/dist/claude/gspec-migrate/SKILL.md +6 -7
  27. package/dist/claude/gspec-practices/SKILL.md +4 -2
  28. package/dist/claude/gspec-profile/SKILL.md +1 -1
  29. package/dist/claude/gspec-research/SKILL.md +4 -4
  30. package/dist/claude/gspec-stack/SKILL.md +12 -7
  31. package/dist/claude/gspec-style/SKILL.md +19 -24
  32. package/dist/codex/gspec-analyze/SKILL.md +2 -4
  33. package/dist/codex/gspec-architect/SKILL.md +3 -4
  34. package/dist/codex/gspec-feature/SKILL.md +39 -9
  35. package/dist/codex/gspec-implement/SKILL.md +15 -20
  36. package/dist/codex/gspec-migrate/SKILL.md +6 -7
  37. package/dist/codex/gspec-practices/SKILL.md +4 -2
  38. package/dist/codex/gspec-profile/SKILL.md +1 -1
  39. package/dist/codex/gspec-research/SKILL.md +4 -4
  40. package/dist/codex/gspec-stack/SKILL.md +12 -7
  41. package/dist/codex/gspec-style/SKILL.md +19 -24
  42. package/dist/cursor/gspec-analyze.mdc +2 -4
  43. package/dist/cursor/gspec-architect.mdc +3 -4
  44. package/dist/cursor/gspec-feature.mdc +39 -9
  45. package/dist/cursor/gspec-implement.mdc +15 -20
  46. package/dist/cursor/gspec-migrate.mdc +6 -7
  47. package/dist/cursor/gspec-practices.mdc +4 -2
  48. package/dist/cursor/gspec-profile.mdc +1 -1
  49. package/dist/cursor/gspec-research.mdc +4 -4
  50. package/dist/cursor/gspec-stack.mdc +12 -7
  51. package/dist/cursor/gspec-style.mdc +19 -24
  52. package/dist/opencode/gspec-analyze/SKILL.md +168 -0
  53. package/dist/opencode/gspec-architect/SKILL.md +361 -0
  54. package/dist/opencode/gspec-feature/SKILL.md +204 -0
  55. package/dist/opencode/gspec-implement/SKILL.md +200 -0
  56. package/dist/opencode/gspec-migrate/SKILL.md +118 -0
  57. package/dist/opencode/gspec-practices/SKILL.md +137 -0
  58. package/dist/opencode/gspec-profile/SKILL.md +221 -0
  59. package/dist/opencode/gspec-research/SKILL.md +302 -0
  60. package/dist/opencode/gspec-stack/SKILL.md +305 -0
  61. package/dist/opencode/gspec-style/SKILL.md +224 -0
  62. package/package.json +3 -1
  63. package/starters/features/about-page.md +98 -0
  64. package/starters/features/contact-form.md +147 -0
  65. package/starters/features/contact-page.md +103 -0
  66. package/starters/features/home-page.md +103 -0
  67. package/starters/features/responsive-navbar.md +113 -0
  68. package/starters/features/services-page.md +103 -0
  69. package/starters/features/site-footer.md +121 -0
  70. package/starters/features/theme-switcher.md +124 -0
  71. package/starters/practices/tdd-pipeline-first.md +192 -0
  72. package/starters/stacks/astro-tailwind-github-pages.md +283 -0
  73. package/starters/stacks/nextjs-supabase-vercel.md +319 -0
  74. package/starters/stacks/nextjs-vercel-typescript.md +264 -0
  75. package/starters/styles/clean-professional.md +316 -0
  76. package/starters/styles/dark-minimal-developer.md +442 -0
  77. package/templates/spec-sync.md +2 -2
  78. package/commands/gspec.epic.md +0 -228
  79. package/dist/antigravity/gspec-epic/SKILL.md +0 -232
  80. package/dist/claude/gspec-epic/SKILL.md +0 -233
  81. package/dist/codex/gspec-epic/SKILL.md +0 -232
  82. package/dist/cursor/gspec-epic.mdc +0 -231
@@ -0,0 +1,361 @@
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
+ Beyond defining the architecture, you are also responsible for **identifying technical gaps and ambiguities** in the existing specs and **proposing implementation solutions**. This is the place in the gspec workflow where underspecified technical behavior is surfaced and resolved — so that `gspec-implement` can focus on building rather than making architectural decisions.
11
+
12
+ This command is meant to be run **after** the foundation specs (profile, stack, style, practices) and feature specs are defined, and **before** `gspec-implement`.
13
+
14
+ You should:
15
+ - Read all existing gspec documents first — this architecture must serve the product, stack, style, and features already defined
16
+ - Translate product requirements into concrete technical decisions
17
+ - **Identify technical gaps** in the specs — missing edge cases, unspecified behaviors, undefined data models, ambiguous integration points, unclear state management patterns
18
+ - **Propose solutions** for each gap — offer 2-3 concrete options when multiple approaches are viable, recommend a preferred approach with rationale
19
+ - Be specific and prescriptive — this document tells the implementing agent exactly where files go, what the data looks like, and how components connect
20
+ - Reference specific technologies from `gspec/stack.md` — unlike feature PRDs, this document is technology-aware
21
+ - Map every architectural element back to the feature(s) it serves
22
+ - Ask clarifying questions when technical decisions cannot be inferred from existing specs
23
+ - When asking questions, offer 2-3 specific options with tradeoffs
24
+
25
+ ---
26
+
27
+ ## Context Discovery
28
+
29
+ Before generating the architecture document, read **all** existing gspec documents:
30
+
31
+ 1. **`gspec/profile.md`** — Product identity, scope, and use cases. Use this to understand the system's purpose and boundaries.
32
+ 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.
33
+ 3. **`gspec/style.md`** — Design system and tokens. Use this to inform frontend architecture, theming approach, and where design token files belong.
34
+ 4. **`gspec/practices.md`** — Development standards. Use this to align file organization, testing patterns, and code structure with team conventions.
35
+ 5. **`gspec/features/*.md`** — Individual feature requirements and dependencies. Use these to derive data entities, API endpoints, component structure, and integration points.
36
+
37
+ 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.
38
+
39
+ ---
40
+
41
+ ## Output Rules
42
+
43
+ - Output **ONLY** a single Markdown document
44
+ - Save the file as `gspec/architecture.md` in the root of the project, create the `gspec` folder if it doesn't exist
45
+ - Begin the file with YAML frontmatter containing the gspec version:
46
+ ```
47
+ ---
48
+ gspec-version: 1.10.0
49
+ ---
50
+ ```
51
+ The frontmatter must be the very first content in the file, before the main heading.
52
+ - **Before generating the document**, ask clarifying questions if:
53
+ - Feature requirements suggest conflicting data models
54
+ - The stack leaves ambiguous choices that affect architecture (e.g., REST vs GraphQL not decided)
55
+ - Scale requirements affect architectural patterns (e.g., need for caching, queuing, sharding)
56
+ - Multi-tenancy, real-time, or offline requirements are unclear
57
+ - Feature PRDs have capabilities that imply infrastructure not covered in the stack
58
+ - **When asking questions**, offer 2-3 specific options with tradeoffs
59
+ - Be concrete and specific — use actual file paths, entity names, and endpoint paths
60
+ - Reference technologies from `gspec/stack.md` by name — this document IS technology-aware
61
+ - **Mark sections as "Not Applicable"** when they don't apply (e.g., no API for a static site, no frontend for a CLI tool)
62
+ - Include code blocks for directory trees, schema definitions, and configuration snippets
63
+ - **Do NOT duplicate product-level information** from feature PRDs — reference capabilities by name, don't restate them
64
+
65
+ ---
66
+
67
+ ## Required Sections
68
+
69
+ ### 1. Overview
70
+ - Architecture summary (1-2 paragraphs)
71
+ - Key architectural patterns chosen (e.g., MVC, clean architecture, feature-sliced design, etc.)
72
+ - System boundaries — what's in-scope vs. external services
73
+ - How this architecture serves the features defined in `gspec/features/`
74
+
75
+ ### 2. Project Structure
76
+
77
+ #### Directory Layout
78
+ - **Complete directory tree** showing 3-4 levels deep with inline comments explaining each directory's purpose
79
+ - Use the actual framework conventions from the stack (e.g., Next.js `app/` router, Rails `app/models/`, Django `apps/`)
80
+ - Show where feature modules, shared components, utilities, styles, tests, and configuration live
81
+ - Example format:
82
+ ```
83
+ project-root/
84
+ ├── src/
85
+ │ ├── app/ # Next.js app router pages
86
+ │ │ ├── (auth)/ # Auth route group
87
+ │ │ ├── dashboard/ # Dashboard pages
88
+ │ │ └── layout.tsx # Root layout
89
+ │ ├── components/ # Shared UI components
90
+ │ │ ├── ui/ # Base design system components
91
+ │ │ └── forms/ # Form components
92
+ │ ├── features/ # Feature modules
93
+ │ │ └── auth/
94
+ │ │ ├── components/ # Feature-specific components
95
+ │ │ ├── hooks/ # Feature-specific hooks
96
+ │ │ ├── services/ # API calls and business logic
97
+ │ │ └── types.ts # Feature types
98
+ │ ├── lib/ # Shared utilities and config
99
+ │ └── styles/ # Global styles and design tokens
100
+ ├── tests/ # Test files (if not co-located)
101
+ ├── gspec/ # Specification documents
102
+ └── public/ # Static assets
103
+ ```
104
+
105
+ #### File Naming Conventions
106
+ - Component files (e.g., `PascalCase.tsx`, `kebab-case.vue`)
107
+ - Utility files (e.g., `camelCase.ts`, `kebab-case.ts`)
108
+ - Test files (e.g., `*.test.ts` co-located, or `__tests__/` directory, or top-level `tests/` mirror)
109
+ - Style files (e.g., `*.module.css`, `*.styles.ts`)
110
+ - Type/interface files
111
+
112
+ #### Key File Locations
113
+ - Entry point(s)
114
+ - Router/route definitions
115
+ - Database schema/migration files
116
+ - Global configuration files
117
+ - Design token / theme files (reference `gspec/style.md`)
118
+
119
+ ### 3. Data Model
120
+
121
+ #### Entity Relationship Diagram
122
+ - **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.
123
+ - Include field types and key constraints directly in the diagram using Mermaid's attribute syntax.
124
+ - Example format:
125
+ ```mermaid
126
+ erDiagram
127
+ User ||--o{ Session : "has many"
128
+ User ||--o{ Post : "has many"
129
+ Post ||--o{ Comment : "has many"
130
+ User ||--o{ Comment : "has many"
131
+
132
+ User {
133
+ UUID id PK
134
+ string email "unique, indexed"
135
+ string password "hashed"
136
+ string displayName
137
+ timestamp createdAt
138
+ timestamp updatedAt
139
+ }
140
+ Session {
141
+ UUID id PK
142
+ UUID userId FK
143
+ string token "unique"
144
+ string deviceInfo
145
+ timestamp expiresAt
146
+ }
147
+ Post {
148
+ UUID id PK
149
+ UUID authorId FK
150
+ string title
151
+ text body
152
+ enum status "draft, published, archived"
153
+ timestamp createdAt
154
+ timestamp updatedAt
155
+ }
156
+ Comment {
157
+ UUID id PK
158
+ UUID postId FK
159
+ UUID authorId FK
160
+ text body
161
+ timestamp createdAt
162
+ }
163
+ ```
164
+
165
+ #### Entity Details
166
+ 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.
167
+
168
+ Example format:
169
+ ```
170
+ ### User
171
+ | Field | Type | Constraints |
172
+ |-------------|-----------|----------------------------|
173
+ | id | UUID | Primary key, auto-generated |
174
+ | email | string | Required, unique, indexed |
175
+ | password | string | Required, hashed |
176
+ | displayName | string | Required |
177
+ | createdAt | timestamp | Auto-set |
178
+ | updatedAt | timestamp | Auto-updated |
179
+
180
+ Introduced by: [User Authentication](../features/user-authentication.md)
181
+ ```
182
+
183
+ #### Relationship Notes
184
+ - Document any patterns that need extra explanation: polymorphic associations, junction/join tables for many-to-many relationships, soft deletes, or tenant-scoping
185
+ - Note any entities that are shared across multiple features — these are integration points the implementing agent should build carefully
186
+
187
+ ### 4. API Design
188
+ **Mark as N/A if no API layer exists**
189
+
190
+ #### Route Map
191
+ - Complete list of API endpoints/routes grouped by feature or resource
192
+ - For each endpoint: method, path, purpose, and auth requirement
193
+ - Example format:
194
+ ```
195
+ ## Authentication
196
+ POST /api/auth/register # Create new account (public)
197
+ POST /api/auth/login # Sign in (public)
198
+ POST /api/auth/logout # Sign out (authenticated)
199
+ GET /api/auth/me # Get current user (authenticated)
200
+
201
+ ## Posts
202
+ GET /api/posts # List posts (authenticated)
203
+ POST /api/posts # Create post (authenticated)
204
+ GET /api/posts/:id # Get single post (authenticated)
205
+ PUT /api/posts/:id # Update post (owner only)
206
+ DELETE /api/posts/:id # Delete post (owner only)
207
+ ```
208
+
209
+ #### Request/Response Conventions
210
+ - Standard response envelope (e.g., `{ data, error, meta }`)
211
+ - Error response format with error codes
212
+ - Pagination format (cursor-based, offset-based)
213
+ - Common headers
214
+
215
+ #### Validation Patterns
216
+ - Where input validation happens (middleware, service layer, both)
217
+ - Validation library or approach (from stack)
218
+ - Common validation rules referenced across features
219
+
220
+ ### 5. Page & Component Architecture
221
+ **Mark as N/A if no frontend exists**
222
+
223
+ #### Page Map
224
+ - List of pages/routes in the application with their purpose
225
+ - Which feature each page belongs to
226
+ - **Output a Mermaid `graph`** showing layout nesting and page hierarchy so the implementing agent can see how routes and layouts compose at a glance:
227
+ ```mermaid
228
+ graph TD
229
+ RootLayout["Root Layout (app/layout.tsx)"]
230
+ RootLayout --> AuthLayout["Auth Layout (app/(auth)/layout.tsx)"]
231
+ RootLayout --> AppLayout["App Layout (app/(app)/layout.tsx)"]
232
+ AuthLayout --> Login["/login"]
233
+ AuthLayout --> Register["/register"]
234
+ AppLayout --> Dashboard["/dashboard"]
235
+ AppLayout --> Settings["/settings"]
236
+ AppLayout --> PostDetail["/posts/:id"]
237
+ ```
238
+
239
+ #### Shared Components
240
+ - List of reusable UI components the application needs (derived from style guide and feature requirements)
241
+ - For each: name, purpose, and which features use it
242
+
243
+ #### Component Patterns
244
+ - How to structure feature-specific vs. shared components
245
+ - Data fetching pattern (server components, client hooks, SWR/React Query, etc.)
246
+ - Form handling approach
247
+ - Error boundary and loading state patterns
248
+
249
+ ### 6. Service & Integration Architecture
250
+ **Mark as N/A if not applicable**
251
+
252
+ #### Internal Services
253
+ - How business logic is organized (service layer, use cases, repositories, etc.)
254
+ - Shared services (auth, email, file upload, etc.)
255
+ - Service communication patterns
256
+
257
+ #### External Integrations
258
+ - Third-party services and how they're consumed
259
+ - API client patterns
260
+ - Webhook handling (if applicable)
261
+
262
+ #### Background Jobs / Events (if applicable)
263
+ - Async processing patterns
264
+ - Event-driven flows between features
265
+ - Queue/worker architecture
266
+
267
+ ### 7. Authentication & Authorization Architecture
268
+ **Mark as N/A if no auth required**
269
+
270
+ - Session/token management approach
271
+ - Route/endpoint protection pattern
272
+ - Role/permission model (if applicable)
273
+ - Where auth checks happen in the code (middleware, guards, decorators, etc.)
274
+ - **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:
275
+ ```mermaid
276
+ sequenceDiagram
277
+ actor U as User
278
+ participant C as Client
279
+ participant A as API
280
+ participant DB as Database
281
+
282
+ U->>C: Submit login form
283
+ C->>A: POST /api/auth/login
284
+ A->>DB: Look up user by email
285
+ DB-->>A: User record
286
+ A->>A: Verify password hash
287
+ A->>DB: Create session
288
+ A-->>C: Set session cookie + return user
289
+ C-->>U: Redirect to /dashboard
290
+ ```
291
+
292
+ ### 8. Environment & Configuration
293
+
294
+ #### Environment Variables
295
+ - Complete list of required environment variables with descriptions and example values
296
+ - Group by category (database, auth, external services, app config)
297
+ - Mark which are secrets vs. non-secret
298
+ - Example `.env` format:
299
+ ```
300
+ # Database
301
+ DATABASE_URL=postgresql://user:pass@localhost:5432/myapp
302
+
303
+ # Authentication
304
+ JWT_SECRET=your-secret-key
305
+ SESSION_EXPIRY=86400
306
+
307
+ # External Services
308
+ SMTP_HOST=smtp.example.com
309
+ ```
310
+
311
+ #### Configuration Files
312
+ - List of configuration files the project needs with their purposes
313
+ - Key settings that differ from framework defaults
314
+ - Example snippets for non-obvious configuration
315
+
316
+ #### Project Setup
317
+ - Step-by-step commands to initialize and run the project from scratch
318
+ - Key packages to install by category
319
+ - Database setup (create, migrate, seed)
320
+ - Local development startup command
321
+
322
+ ### 9. Technical Gap Analysis
323
+
324
+ This section captures gaps and ambiguities found in the existing specs during architecture design, along with the proposed or resolved solutions. This ensures `gspec-implement` has clear guidance and doesn't need to make architectural decisions during implementation.
325
+
326
+ #### Identified Gaps
327
+ For each gap found in the feature PRDs, profile, or other specs:
328
+ - **What's missing or ambiguous** — describe the gap clearly
329
+ - **Why it matters** — what breaks or is unclear without resolving this
330
+ - **Proposed solution** — your recommended approach (with 2-3 options when multiple approaches are viable)
331
+ - **Resolution** — whether the user approved the solution, chose an alternative, or deferred the decision
332
+
333
+ Examples of gaps to look for:
334
+ - Missing edge cases or error handling scenarios
335
+ - Unspecified user flows or interactions
336
+ - Ambiguous or missing acceptance criteria on capabilities
337
+ - Undefined data models or API contracts not covered elsewhere in this document
338
+ - Integration points that aren't fully described
339
+ - Missing or unclear state management patterns
340
+ - Patterns that differ from established conventions without clear rationale
341
+
342
+ #### Assumptions
343
+ - Technical decisions that were inferred rather than explicitly specified in existing specs
344
+
345
+ ### 10. Open Decisions
346
+ - Areas where the architecture may need to evolve as features are implemented
347
+ - Questions that should be resolved before or during implementation
348
+
349
+ ---
350
+
351
+ ## Tone & Style
352
+
353
+ - Concrete and prescriptive — tell the implementing agent exactly what to do, not what to consider
354
+ - Technology-specific — use actual library names, file paths, and code patterns from the stack
355
+ - Feature-traceable — connect every architectural decision back to the features it serves
356
+ - Designed for direct consumption by an implementing agent
357
+
358
+ ---
359
+
360
+ ## Input
361
+
@@ -0,0 +1,204 @@
1
+ ---
2
+ name: gspec-feature
3
+ description: Generate one or more product requirements documents (PRDs) for features
4
+ ---
5
+
6
+ You are a senior Product Manager at a high-performing software company.
7
+
8
+ Your task is to take the provided feature description (which may be vague or detailed, small or large) and produce **one or more Product Requirements Documents (PRDs)** that clearly define *what* is being built and *why*, without deep technical or architectural implementation details.
9
+
10
+ ## Scope Assessment
11
+
12
+ Before writing anything, assess whether the user's description is:
13
+
14
+ 1. **A single feature** — a focused piece of functionality that can be captured in one PRD (e.g., "user authentication", "CSV export", "dark mode support")
15
+ 2. **A large body of work** — something broad enough that it should be decomposed into multiple independent features (e.g., "a complete onboarding experience", "a full e-commerce checkout flow", "social features for the app")
16
+
17
+ **If it's a single feature**, produce one PRD and save it to `gspec/features/`.
18
+
19
+ **If it's large enough to warrant multiple features:**
20
+
21
+ 1. Propose a breakdown — list the distinct features you'd create, with a one-line description of each and their dependencies on each other
22
+ 2. **Ask the user to confirm, adjust, or reprioritize** the breakdown before writing any specs
23
+ 3. Once confirmed, generate a separate PRD for each feature in `gspec/features/`
24
+
25
+ When in doubt, lean toward fewer features. Don't over-decompose — a feature should only be split out if it delivers independent user value and has a meaningfully different scope.
26
+
27
+ ## Important: Agent-Oriented Documentation
28
+
29
+ **These PRDs are designed for automated agent consumption** (via `gspec-implement`), with humans validating the content for accuracy and completeness. Write documents that are:
30
+
31
+ - **Implementation-ready blueprints**, not project plans
32
+ - Focused on **what** to build and **why**, not **when** or **how long**
33
+ - Clear on technical and functional requirements an agent needs to execute
34
+
35
+ **AVOID project management details:**
36
+ - ❌ Sprint planning, week numbers, or timeline estimates
37
+ - ❌ Team assignments or resource allocation
38
+ - ❌ Velocity or story point estimates
39
+ - ❌ Delivery schedules or milestone dates
40
+
41
+ **DO include implementation guidance:**
42
+ - ✅ Clear functional requirements and acceptance criteria
43
+ - ✅ Dependencies between capabilities
44
+ - ✅ Priority levels (P0, P1, P2) for scope decisions
45
+ - ✅ Build order recommendations based on technical dependencies
46
+
47
+ You should:
48
+ - **Read existing feature PRDs** in `gspec/features/` to understand already-specified features and avoid overlap
49
+ - **Ask all clarifying questions in the chat before writing the spec** — never embed unresolved questions in the generated document
50
+ - When asking questions, offer 2-3 specific suggestions to guide the discussion
51
+ - Focus on user value, scope, and outcomes
52
+ - Write for automated implementation with human validation
53
+ - Be concise, structured, and decisive
54
+
55
+ ---
56
+
57
+ ## Portability
58
+
59
+ Feature PRDs are designed to be **portable across projects**. A feature spec written for one project should be reusable in a different project with a different profile, design system, tech stack, and development practices. Project-specific context is resolved at implementation time by `gspec-implement`, which reads all gspec documents (profile, style, stack, practices) alongside the feature PRDs.
60
+
61
+ **To maintain portability, DO NOT read or incorporate context from:**
62
+ - `gspec/profile.md` — Do not reference project-specific personas, competitive landscape, or positioning
63
+ - `gspec/style.md` — Do not reference a specific design system or component library
64
+ - `gspec/stack.md` — Do not reference specific technologies (already covered by Technology Agnosticism)
65
+ - `gspec/practices.md` — Do not reference project-specific development standards
66
+
67
+ **DO read existing feature PRDs** in `gspec/features/` to:
68
+ - Avoid duplicating or contradicting already-specified features
69
+ - Identify cross-feature dependencies
70
+ - Ensure consistent scope boundaries
71
+
72
+ **Write in generic, portable terms:**
73
+ - Use relative role descriptions ("primary users", "administrators", "content creators") not project-specific persona names
74
+ - Justify priorities based on the feature's intrinsic user value, not competitive landscape
75
+ - Describe desired UX behavior generically ("clear error feedback", "responsive layout") without referencing a specific design system
76
+ - Define success metrics in terms of the feature's own outcomes, not project-level KPIs
77
+
78
+ ---
79
+
80
+ ## Output Rules
81
+
82
+ - Output one or more Markdown documents — **one per feature**
83
+ - Save each file to the `gspec/features/` folder in the root of the project, create it if it doesn't exist
84
+ - Name each file based on the feature (e.g., `user-authentication.md`, `dashboard-analytics.md`)
85
+ - Begin each file with YAML frontmatter containing the gspec version:
86
+ ```
87
+ ---
88
+ gspec-version: 1.10.0
89
+ ---
90
+ ```
91
+ The frontmatter must be the very first content in the file, before the main heading.
92
+ - **Before generating any document, you MUST resolve ambiguities through conversation.** Ask clarifying questions in the chat if:
93
+ - The target users are unclear
94
+ - The scope or boundaries of the feature are ambiguous
95
+ - The breakdown into multiple features is not obvious (for large requests)
96
+ - Success criteria cannot be determined from the description
97
+ - Priority or urgency is unspecified
98
+ - Any assumption would materially change the shape of the spec
99
+ - **When asking questions**, offer 2-3 specific suggestions to guide the discussion
100
+ - **Do NOT embed unresolved questions in the generated spec.** All questions about scope, users, priorities, capabilities, and feature boundaries must be resolved through conversation before writing the document. The spec should reflect decisions, not open debates.
101
+ - Avoid deep system architecture or low-level implementation
102
+ - Avoid detailed workflows or step-by-step descriptions of how the feature functions
103
+ - No code blocks except where examples add clarity
104
+ - Make tradeoffs and scope explicit
105
+
106
+ ### Technology Agnosticism
107
+
108
+ **IMPORTANT**: PRDs must remain technology-agnostic to enable implementation with different technology stacks. The `gspec/stack.md` file is the single source of truth for technology choices.
109
+
110
+ **DO use generic architectural terms:**
111
+ - ✅ "database", "data store", "persistent storage"
112
+ - ✅ "authentication service", "IAM", "identity provider"
113
+ - ✅ "API", "backend service", "server"
114
+ - ✅ "frontend", "client application", "user interface"
115
+ - ✅ "message queue", "event system", "pub/sub"
116
+ - ✅ "object storage", "file storage"
117
+ - ✅ "cache", "caching layer"
118
+ - ✅ "search index", "full-text search"
119
+
120
+ **DO NOT reference specific technologies:**
121
+ - ❌ React, Vue, Angular, Svelte
122
+ - ❌ PostgreSQL, MySQL, MongoDB, DynamoDB
123
+ - ❌ AWS Lambda, Google Cloud Functions, Azure Functions
124
+ - ❌ Redis, Memcached
125
+ - ❌ Elasticsearch, Algolia, Solr
126
+ - ❌ S3, GCS, Azure Blob Storage
127
+ - ❌ Kafka, RabbitMQ, SQS
128
+
129
+ This separation — combined with the portability principles above — allows the same feature spec to be reused across projects with different technology stacks, design systems, and product contexts.
130
+
131
+ ---
132
+
133
+ ## Required Sections (per feature PRD)
134
+
135
+ **IMPORTANT**: Only include the sections listed below. Do NOT add additional sections such as "Technology Notes", "Implementation Details", "Technical Architecture", or any other custom sections. Stick strictly to this structure.
136
+
137
+ ### 1. Overview
138
+ - Feature name
139
+ - Summary (1-2 sentences)
140
+ - Problem being solved and why it matters now
141
+
142
+ ### 2. Users & Use Cases
143
+ - Primary users (use generic role descriptions like "end users", "administrators", "content managers" — not project-specific persona names)
144
+ - Key use cases (3-4 scenarios showing how users benefit)
145
+
146
+ ### 3. Scope
147
+ - In-scope goals
148
+ - Out-of-scope items (things this feature explicitly won't do)
149
+ - Deferred ideas (things we may do later, but not now)
150
+
151
+ ### 4. Capabilities
152
+ - What the feature provides to users
153
+ - **Priority level** for each capability (P0 = must-have, P1 = should-have, P2 = nice-to-have)
154
+ - Focus on *what* users can do, not *how* they do it
155
+ - **Use unchecked markdown checkboxes** for each capability to enable implementation tracking (e.g., `- [ ] **P0**: User can sign in with email and password`). The `gspec-implement` command will check these off (`- [x]`) as capabilities are implemented, allowing incremental runs.
156
+ - **Each capability MUST include brief acceptance criteria** — 2-4 testable conditions that define "done" for that capability. These tell the implementing agent exactly when a capability is complete and give test writers concrete assertions. Format as a sub-list under each capability:
157
+ ```
158
+ - [ ] **P0**: User can sign in with email and password
159
+ - Valid credentials → user is redirected to dashboard and session is created
160
+ - Invalid credentials → error message is shown, no session is created
161
+ - Empty fields → inline validation prevents submission
162
+ ```
163
+
164
+ ### 5. Dependencies
165
+ - Dependencies on other features (link to their PRDs if they exist)
166
+ - External dependencies (third-party services, APIs, data sources)
167
+ - If none, state "None"
168
+
169
+ ### 6. Assumptions & Risks
170
+ - Assumptions (what we're taking as true)
171
+ - Open questions — **only** unknowns that genuinely cannot be answered until implementation or real-world usage begins (e.g., performance thresholds pending benchmarking, exact rate limits pending load testing). Questions about scope, users, priorities, or feature design must be asked and resolved in the chat before the spec is written. If there are no open questions, omit this sub-section.
172
+ - Key risks and mitigations (brief bullet points — focus on risks that could affect implementation scope or approach)
173
+
174
+ ### 7. Success Metrics
175
+ - 2-4 measurable outcomes that define whether this feature is working
176
+
177
+ ### 8. Implementation Context
178
+ - Include the following standard note verbatim:
179
+ > This feature PRD is portable and project-agnostic. During implementation, consult the project's `gspec/profile.md` (target users, positioning), `gspec/style.md` (design system), `gspec/stack.md` (technology choices), and `gspec/practices.md` (development standards) to resolve project-specific context.
180
+
181
+ ---
182
+
183
+ ## Multi-Feature Output
184
+
185
+ When generating multiple features from a large request:
186
+
187
+ - **Cross-reference dependencies** — each feature's Dependencies section should link to sibling features when applicable
188
+ - **Maintain consistent terminology** — use the same terms for shared concepts across all generated PRDs
189
+ - **Assign priorities holistically** — P0/P1/P2 levels should be consistent across the set (don't make everything P0)
190
+ - **Suggest a build order** — after generating all PRDs, briefly note the recommended implementation sequence based on dependencies (e.g., "Build `user-authentication` first, then `user-profiles`, then `social-connections`")
191
+
192
+ ---
193
+
194
+ ## Tone & Style
195
+
196
+ - Clear, neutral, product-led
197
+ - No fluff, no jargon
198
+ - Designed to be skimmed
199
+ - Consistent across all generated documents
200
+
201
+ ---
202
+
203
+ ## Input Feature Description
204
+