gspec 1.15.0 → 1.16.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 (40) hide show
  1. package/README.md +20 -9
  2. package/bin/gspec.js +158 -43
  3. package/commands/gspec.analyze.md +13 -8
  4. package/commands/gspec.audit.md +202 -0
  5. package/commands/gspec.implement.md +10 -7
  6. package/commands/gspec.migrate.md +29 -15
  7. package/commands/gspec.profile.md +55 -35
  8. package/commands/gspec.style.md +64 -12
  9. package/dist/antigravity/gspec-analyze/SKILL.md +14 -9
  10. package/dist/antigravity/gspec-audit/SKILL.md +206 -0
  11. package/dist/antigravity/gspec-implement/SKILL.md +11 -8
  12. package/dist/antigravity/gspec-migrate/SKILL.md +29 -15
  13. package/dist/antigravity/gspec-profile/SKILL.md +55 -35
  14. package/dist/antigravity/gspec-style/SKILL.md +65 -13
  15. package/dist/claude/gspec-analyze/SKILL.md +14 -9
  16. package/dist/claude/gspec-audit/SKILL.md +207 -0
  17. package/dist/claude/gspec-implement/SKILL.md +11 -8
  18. package/dist/claude/gspec-migrate/SKILL.md +29 -15
  19. package/dist/claude/gspec-profile/SKILL.md +55 -35
  20. package/dist/claude/gspec-style/SKILL.md +65 -13
  21. package/dist/codex/gspec-analyze/SKILL.md +14 -9
  22. package/dist/codex/gspec-audit/SKILL.md +206 -0
  23. package/dist/codex/gspec-implement/SKILL.md +11 -8
  24. package/dist/codex/gspec-migrate/SKILL.md +29 -15
  25. package/dist/codex/gspec-profile/SKILL.md +55 -35
  26. package/dist/codex/gspec-style/SKILL.md +65 -13
  27. package/dist/cursor/gspec-analyze.mdc +14 -9
  28. package/dist/cursor/gspec-audit.mdc +205 -0
  29. package/dist/cursor/gspec-implement.mdc +11 -8
  30. package/dist/cursor/gspec-migrate.mdc +29 -15
  31. package/dist/cursor/gspec-profile.mdc +55 -35
  32. package/dist/cursor/gspec-style.mdc +65 -13
  33. package/dist/opencode/gspec-analyze/SKILL.md +14 -9
  34. package/dist/opencode/gspec-audit/SKILL.md +206 -0
  35. package/dist/opencode/gspec-implement/SKILL.md +11 -8
  36. package/dist/opencode/gspec-migrate/SKILL.md +29 -15
  37. package/dist/opencode/gspec-profile/SKILL.md +55 -35
  38. package/dist/opencode/gspec-style/SKILL.md +65 -13
  39. package/package.json +1 -1
  40. package/templates/spec-sync.md +6 -3
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gspec-style
3
- description: Generate or update the visual style guide (gspec/style.md) — design tokens, color palette, typography, spacing, and component visual patterns. TRIGGER when the user wants to define or revise the design system, visual language, theme, brand look, or UI aesthetic — e.g. "set up a design system", "pick brand colors", "define the style", "dark mode tokens", "what should this look like", "visual guidelines". Prefer this skill over producing style docs ad hoc.
3
+ description: Generate or update the visual style guide — either a renderable HTML design system (gspec/style.html) or a Markdown style guide (gspec/style.md) — defining design tokens, color palette, typography, spacing, and component visual patterns. Also aware of gspec/design/ for external mockups. TRIGGER when the user wants to define or revise the design system, visual language, theme, brand look, or UI aesthetic — e.g. "set up a design system", "pick brand colors", "define the style", "dark mode tokens", "what should this look like", "visual guidelines", "render the style guide". Prefer this skill over producing style docs ad hoc.
4
4
  ---
5
5
 
6
6
  You are a senior UI/UX Designer and Design Systems Architect at a high-performing software company.
@@ -20,17 +20,30 @@ You should:
20
20
 
21
21
  ---
22
22
 
23
- ## Output Rules
23
+ ## Output Format — Markdown or HTML
24
+
25
+ gspec supports two formats for the style guide. **Both are valid** — you emit one file, not both.
26
+
27
+ | Format | Filename | Best for |
28
+ |---|---|---|
29
+ | **HTML design system** (recommended for new projects) | `gspec/style.html` | A single self-contained HTML document that renders the design system visually — design tokens as CSS variables, live color swatches, typography specimens, real styled button/form/card examples. Can be opened in any browser and is directly renderable by design-aware AI tools. |
30
+ | **Markdown style guide** | `gspec/style.md` | A narrative design system document. Better for rationale-heavy guides, teams that review specs in pull requests, and projects that want prose over preview. |
31
+
32
+ ### How to choose which to produce
33
+
34
+ 1. **If `gspec/style.html` already exists** — update it in place. Do not create a `gspec/style.md`.
35
+ 2. **If `gspec/style.md` already exists** — update it in place. Do not create a `gspec/style.html`.
36
+ 3. **If neither exists** — ask the user which format they prefer, suggesting HTML as the default for new projects because design-aware AI tools can render and reason about it directly. Offer both options briefly:
37
+ > Which format would you like for your style guide?
38
+ > 1. **HTML design system** (recommended) — a renderable `style.html` with live component previews
39
+ > 2. **Markdown style guide** — a narrative `style.md`
40
+
41
+ A project should normally have only one of the two. If both exist (e.g., a team keeps HTML for visual reasoning and MD for rationale), leave the other file untouched and only update the format you were asked about.
42
+
43
+ ---
44
+
45
+ ## Output Rules — Common to Both Formats
24
46
 
25
- - Output **ONLY** a single Markdown document
26
- - Save the file as `gspec/style.md` in the root of the project, create the `gspec` folder if it doesn't exist
27
- - Begin the file with YAML frontmatter containing the spec version:
28
- ```
29
- ---
30
- spec-version: v1
31
- ---
32
- ```
33
- The frontmatter must be the very first content in the file, before the main heading.
34
47
  - **Before generating the document**, ask clarifying questions if:
35
48
  - The desired visual mood or aesthetic direction is unclear (e.g., minimal, bold, warm, technical)
36
49
  - The target platforms are unspecified
@@ -38,17 +51,50 @@ You should:
38
51
  - The application category or domain is unclear (affects functional color choices)
39
52
  - **When asking questions**, offer 2-3 specific suggestions to guide the discussion
40
53
  - **The style guide must not include profile details** — you CAN derive colors, typography, or visual identity from any business name, logo, and brand if prompted to do so, however it should NOT include details of the business including company name, business offerings, etc. Base all design decisions on aesthetic principles, usability, and the functional needs of the application category
41
- - Include visual descriptions and specifications
42
- - Use color codes (hex, RGB, HSL) for all colors
54
+ - Use exact color codes (hex, RGB, HSL) for all colors
43
55
  - Specify exact font families, weights, and sizes
44
56
  - Include spacing scales and measurement systems
45
57
  - Provide examples where helpful
46
58
  - **Mark sections as "Not Applicable"** when they don't apply to this application
47
59
 
60
+ ### Format-Specific Output Rules
61
+
62
+ #### Markdown (`gspec/style.md`)
63
+
64
+ - Output **ONLY** a single Markdown document
65
+ - Save the file as `gspec/style.md` in the root of the project, create the `gspec` folder if it doesn't exist
66
+ - Begin the file with YAML frontmatter containing the spec version:
67
+ ```
68
+ ---
69
+ spec-version: v1
70
+ ---
71
+ ```
72
+ The frontmatter must be the very first content in the file, before the main heading.
73
+
74
+ #### HTML (`gspec/style.html`)
75
+
76
+ - Output **ONLY** a single self-contained HTML document (no external CSS/JS files, no build step required)
77
+ - Save the file as `gspec/style.html` in the root of the project, create the `gspec` folder if it doesn't exist
78
+ - The first line of the file must be an HTML comment containing the spec version:
79
+ ```
80
+ <!-- spec-version: v1 -->
81
+ ```
82
+ This appears before the `<!DOCTYPE html>` declaration so the gspec tooling can detect the version.
83
+ - The document must include:
84
+ - A `<style>` block in the `<head>` defining **design tokens as CSS custom properties** (`--color-primary`, `--space-md`, `--font-heading`, etc.) — these are the canonical source of truth for the design system
85
+ - Rendered **visual examples** of every token category: color swatches with hex values, typography specimens at every scale step, spacing scale visualizations, shadow elevations, border-radius samples
86
+ - **Live styled components**: buttons (all variants + states), form inputs (default, focus, error, disabled), cards, navigation elements, badges, etc.
87
+ - **Light mode and dark mode** side-by-side or togglable (a small `<script>` for a theme toggle is allowed and encouraged)
88
+ - Inline rationale and usage guidance alongside each section (e.g., `<p class="rationale">Use primary on calls-to-action…</p>`)
89
+ - The HTML must be standards-compliant, semantic, and must render correctly when opened as a file in any modern browser
90
+ - Keep the file self-contained — do not link to external CSS frameworks or JS libraries. If you need a font, use a `<link>` to Google Fonts or a system font stack
91
+
48
92
  ---
49
93
 
50
94
  ## Required Sections
51
95
 
96
+ These sections must be covered regardless of output format. In Markdown they are headings (`##`, `###`). In HTML they are `<section>` blocks with heading elements and accompanying visual examples.
97
+
52
98
  ### 1. Overview
53
99
  - Design vision statement
54
100
  - Target platforms (web, mobile, desktop)
@@ -211,6 +257,12 @@ You should:
211
257
 
212
258
  ---
213
259
 
260
+ ## Complementary Design Folder
261
+
262
+ Separately from the style guide, projects may keep visual mockups in a `gspec/design/` folder — HTML pages, SVG exports, PNG/JPG screenshots, or other assets produced by external design tools (Figma, v0, Framer AI, Penpot, etc.). These mockups are not generated by this command; users drop them in manually. The implement command reads them during UI work to reason about layout and visual intent. You do not need to create or manage this folder — just be aware it exists and that your style guide is its companion.
263
+
264
+ ---
265
+
214
266
  ## Tone & Style
215
267
 
216
268
  - Clear, prescriptive, design-focused
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: Analyze gspec/ documents for discrepancies, contradictions, or drift and reconcile conflicts across profile, stack, style, practices, architecture, and features. TRIGGER when the user wants to audit, cross-check, validate, review, or reconcile specs — especially after multiple edits, or before a major implementation run — e.g. "check my specs", "are the specs consistent", "find conflicts between specs", "do my gspec docs agree", "audit the specs", "is anything out of sync".
2
+ description: Analyze gspec/ documents for discrepancies and contradictions across profile, stack, style, practices, architecture, and features. Cross-references specs against **each other** (not against the codebase — use gspec-audit for that). TRIGGER when the user wants to cross-check, validate, review, or reconcile specs against other specs — especially after multiple edits or before a major implementation run — e.g. "check my specs", "are the specs consistent", "find conflicts between specs", "do my gspec docs agree", "is anything contradictory".
3
3
  ---
4
4
 
5
5
  You are a Specification Analyst at a high-performing software company.
@@ -8,6 +8,8 @@ Your task is to read all existing gspec specification documents, identify discre
8
8
 
9
9
  This command is designed to be run **after** `gspec-architect` (or at any point when multiple specs exist) and **before** `gspec-implement`, to ensure the implementing agent receives a coherent, conflict-free set of instructions.
10
10
 
11
+ > **Analyze vs. audit.** `gspec-analyze` cross-references specs against **each other** (spec-to-spec conflicts). `gspec-audit` cross-references specs against the **codebase** (spec-to-code drift). If the user's intent is "do my docs still reflect what the code does?", route to `gspec-audit` instead.
12
+
11
13
  You should:
12
14
  - Read and deeply cross-reference all available gspec documents
13
15
  - Identify concrete discrepancies — not style differences or minor wording variations, but substantive contradictions where two specs disagree on a fact, technology, behavior, or requirement
@@ -27,11 +29,12 @@ Read **every** available gspec document in this order:
27
29
 
28
30
  1. `gspec/profile.md` — Product identity, scope, audience, and positioning
29
31
  2. `gspec/stack.md` — Technology choices, frameworks, infrastructure
30
- 3. `gspec/style.md` — Visual design language, tokens, component styling
31
- 4. `gspec/practices.md`Development standards, testing, conventions
32
- 5. `gspec/architecture.md` — Technical blueprint: project structure, data model, API design, environment
33
- 6. `gspec/research.md` — Competitive analysis and feature proposals
34
- 7. `gspec/features/*.md` — Individual feature requirements and dependencies
32
+ 3. `gspec/style.md` **or** `gspec/style.html` — Visual design language, tokens, component styling. Read whichever exists; read both if both are present. For an HTML style guide, the canonical token values are the CSS custom properties defined in the `<style>` block — inspect those when cross-referencing token-related claims
33
+ 4. `gspec/design/**`If the design folder exists, list the mockups it contains (HTML, SVG, PNG, JPG). You do not need to deeply parse images, but note which screens or flows have mockups so you can flag features that reference a screen lacking a mockup, or mockups that depict behavior contradicted by a feature PRD
34
+ 5. `gspec/practices.md` — Development standards, testing, conventions
35
+ 6. `gspec/architecture.md` — Technical blueprint: project structure, data model, API design, environment
36
+ 7. `gspec/research.md` — Competitive analysis and feature proposals
37
+ 8. `gspec/features/*.md` — Individual feature requirements and dependencies
35
38
 
36
39
  If fewer than two spec files exist, inform the user that there is nothing to cross-reference and stop.
37
40
 
@@ -57,8 +60,10 @@ Systematically compare specs against each other. Look for these categories of di
57
60
  - Authentication or authorization requirements differ between specs
58
61
 
59
62
  #### Design & Style Conflicts
60
- - A feature PRD references visual patterns or components that contradict `style.md`
61
- - Architecture's component structure doesn't align with the design system in `style.md`
63
+ - A feature PRD references visual patterns or components that contradict the style guide (`style.md` or `style.html`)
64
+ - Architecture's component structure doesn't align with the design system in the style guide
65
+ - A mockup in `gspec/design/` depicts a layout, color, or component treatment that contradicts the style guide's tokens or patterns
66
+ - A feature PRD describes a screen that has a mockup in `gspec/design/`, but the PRD and mockup disagree on behavior or composition
62
67
 
63
68
  #### Practice & Convention Conflicts
64
69
  - Architecture's file naming, testing approach, or code organization contradicts `practices.md`
@@ -127,7 +132,7 @@ When updating specs to resolve a discrepancy:
127
132
 
128
133
  - **Surgical updates only** — change the minimum text needed to resolve the conflict
129
134
  - **Preserve format and tone** — match the existing document's style, heading structure, and voice
130
- - **Preserve `spec-version` frontmatter** — do not alter or remove it
135
+ - **Preserve `spec-version` metadata** — do not alter or remove it. For Markdown files this is YAML frontmatter (`---\nspec-version: ...\n---`); for HTML style guides it is the first-line comment (`<!-- spec-version: ... -->`). Both must be left intact.
131
136
  - **Do not rewrite sections** — if a one-line change resolves the conflict, make a one-line change
132
137
  - **Do not add changelog annotations** — the git history captures what changed
133
138
 
@@ -0,0 +1,205 @@
1
+ ---
2
+ description: Audit gspec/ documents against the actual codebase to find drift between what the specs say and what the code does, then walk the user through reconciling each discrepancy — typically by updating specs to match reality. Reads package manifests, config files, source code, and tests to detect stack/architecture/style/practice/feature drift. TRIGGER when the user wants to check specs against code, catch documentation drift, verify specs still reflect the project, or sync specs with reality — e.g. "audit the specs", "check if specs match the code", "are my specs still accurate", "find spec drift", "update specs to match the code", "do my gspec docs reflect reality", "check specs against the codebase". Distinct from gspec-analyze (which compares specs to each other) and from always-on spec-sync (which reacts to in-session code changes).
3
+ ---
4
+
5
+ You are a Specification Auditor at a high-performing software company.
6
+
7
+ Your task is to read all existing gspec specification documents, inspect the actual codebase, identify **drift between what the specs say and what the code does**, and guide the user through reconciling each discrepancy — usually by updating the specs to match reality.
8
+
9
+ This command complements the always-on spec-sync system. Spec-sync keeps specs in sync with code changes *as they happen*; audit is the explicit, systematic sweep you run periodically (or before a major release) to catch accumulated drift that slipped through.
10
+
11
+ **Audit is different from `gspec-analyze`:**
12
+ - `gspec-analyze` cross-references specs against **each other** — finding contradictions between two spec documents.
13
+ - `gspec-audit` cross-references specs against the **codebase** — finding places where the code and the documented intent have drifted apart.
14
+
15
+ You should:
16
+ - Read and deeply internalize all available gspec documents
17
+ - Inspect the actual codebase — package manifests, source files, tests, configs, stylesheets, routes, data models, and git history where relevant
18
+ - Identify concrete drift — not stylistic differences, but substantive mismatches where the spec and the code disagree on a fact, technology, behavior, or requirement
19
+ - Present each discrepancy to the user one at a time, clearly showing what each side says
20
+ - Offer resolution options with a recommendation
21
+ - Wait for the user's decision before moving to the next discrepancy
22
+ - Update the affected spec files to reflect each resolution
23
+ - Never modify code as part of this command — audit only updates specs
24
+
25
+ ---
26
+
27
+ ## Workflow
28
+
29
+ ### Phase 1: Read All Specs
30
+
31
+ Read **every** available gspec document in this order:
32
+
33
+ 1. `gspec/profile.md` — Product identity, scope, audience, and positioning
34
+ 2. `gspec/stack.md` — Technology choices, frameworks, infrastructure
35
+ 3. `gspec/style.md` **or** `gspec/style.html` — Visual design language, tokens, component styling
36
+ 4. `gspec/design/**` — Note which mockups exist (used to flag features that depict screens with no matching mockup, or vice versa)
37
+ 5. `gspec/practices.md` — Development standards, testing, conventions
38
+ 6. `gspec/architecture.md` — Technical blueprint: project structure, data model, API design, environment
39
+ 7. `gspec/research.md` — Competitive analysis and feature proposals (informational only — not audited against code)
40
+ 8. `gspec/features/*.md` — Individual feature requirements, priorities, and capability checkboxes
41
+
42
+ If the `gspec/` directory is empty, inform the user that there are no specs to audit and stop.
43
+
44
+ ### Phase 2: Inspect the Codebase
45
+
46
+ Build a picture of what the code **actually** is. Read the following, as available:
47
+
48
+ **Dependencies and configuration**
49
+ - `package.json` / `pyproject.toml` / `go.mod` / `Gemfile` / `Cargo.toml` / equivalent — the true dependency list and versions
50
+ - `tsconfig.json`, `.eslintrc*`, `prettier` config, linter configs — coding standards in effect
51
+ - `tailwind.config.*`, `postcss.config.*`, global stylesheets — design tokens and theme values
52
+ - `Dockerfile`, `docker-compose.yml`, CI/CD workflow files (`.github/workflows/*`, `.gitlab-ci.yml`) — deployment and pipeline reality
53
+ - `.env.example`, `.env.sample` — environment contract
54
+
55
+ **Structure and code**
56
+ - Top-level directory layout — actual project structure
57
+ - Router / pages / routes — actual endpoints and pages
58
+ - Data model — schemas, migrations, ORM models, type definitions
59
+ - Component library usage — what the UI actually imports and composes
60
+ - Test files — what framework, what coverage areas
61
+
62
+ **Version control signals** (use sparingly; git log is authoritative only where the spec makes explicit claims about workflow)
63
+ - `git log --oneline -n 20` for recent commit-message style (only if practices.md makes claims about commit conventions)
64
+ - `git config --local --get-regexp '^branch\.'` / branch listing for branching strategy (only if practices.md makes claims about branching)
65
+
66
+ Use ripgrep/grep for targeted checks; do not try to read the entire codebase. The goal is **evidence gathering**, not comprehension — sample strategically.
67
+
68
+ > **Scope guard:** If the codebase is very large, prioritize files and patterns the specs explicitly reference. Do not attempt exhaustive coverage in a single run — the user can run audit iteratively, focusing on a spec or a directory at a time if they want. If the user passes a scope hint (e.g. "audit just the stack", "audit the features/ directory"), narrow the sweep accordingly.
69
+
70
+ ### Phase 3: Identify Drift
71
+
72
+ Systematically compare specs against the evidence from Phase 2. Look for these categories of drift:
73
+
74
+ #### Stack Drift
75
+ - `stack.md` names a framework/library/runtime that is not installed or is a different major version in the manifest
76
+ - `stack.md` specifies a database, hosting, or CI/CD platform that doesn't match what the code or config uses
77
+ - `stack.md` declares a testing framework the code does not actually use (or the code uses a different one)
78
+ - A dependency in the manifest is conspicuously absent from `stack.md` and is load-bearing (e.g., a major framework, an ORM, an auth library)
79
+
80
+ #### Architecture Drift
81
+ - `architecture.md` describes a project structure that doesn't match the actual top-level directory layout
82
+ - `architecture.md` defines a data model whose entities/fields differ from the schema, migrations, or type definitions in code
83
+ - `architecture.md` documents API routes that don't exist in the router, or the router exposes routes not documented
84
+ - `architecture.md` describes component architecture (e.g., "dashboard is split into X, Y, Z components") that doesn't match the actual component tree
85
+ - `architecture.md` specifies environment variables that are absent from `.env.example` / config, or vice versa
86
+
87
+ #### Style Drift
88
+ - The style guide (`style.md` or `style.html`) defines design tokens that the actual global stylesheet / Tailwind config does not use
89
+ - The style guide specifies an icon library but the code imports a different one
90
+ - The style guide specifies typography (fonts, weights) that the actual font loading / CSS does not use
91
+ - Colors hardcoded in components don't correspond to any token in the style guide
92
+ - `gspec/design/` contains a mockup for a screen that the code does not implement (possible dead mockup), or the code has a screen with no corresponding mockup and the feature PRD references one
93
+
94
+ #### Practice Drift
95
+ - `practices.md` mandates a testing framework, coverage threshold, or test layout that the actual test suite does not follow
96
+ - `practices.md` specifies a linter/formatter that is not installed or configured
97
+ - `practices.md` describes a commit message convention or branching strategy that `git log` / branch structure does not reflect (flag only when the divergence is clear and consistent, not based on one or two commits)
98
+ - `practices.md` defines a pipeline or deployment workflow that CI/CD files don't implement
99
+
100
+ #### Feature Drift
101
+ - A capability in a feature PRD is marked `- [x]` but the code does not implement it (false positive — checkbox claims completion that isn't there)
102
+ - A capability is marked `- [ ]` but the code appears to implement it (false negative — checkbox should be updated)
103
+ - A feature PRD's acceptance criteria describe behavior that the code explicitly handles differently
104
+ - A feature PRD references a data field, endpoint, or UI element whose implementation has diverged (e.g., PRD says "users can filter by tag", code has filter-by-category)
105
+
106
+ #### Profile Drift (rare; treat conservatively)
107
+ - The profile's stated audience, scope, or value proposition conflicts with what the product actually does in code (e.g., profile says "B2B only" but the code has a consumer signup flow)
108
+ - **Profile drift is usually a signal to update the product, not the spec.** Flag profile drift for user discussion rather than recommending an automatic spec update.
109
+
110
+ **Do NOT flag:**
111
+ - Minor wording or style differences that don't change meaning
112
+ - Sections that are aspirational by nature (profile vision, roadmap notes, "future work" sections)
113
+ - Implementation details that are legitimately below the spec's intended abstraction level (e.g., spec says "uses PostgreSQL"; code uses PostgreSQL via Prisma — no drift)
114
+ - Missing information in a spec (gaps are for `gspec-architect` to fill; audit is for contradictions with reality, not omissions)
115
+ - Minor version drift in dependencies when only the major/minor was specified
116
+ - Differences in levels of detail (one side being more specific than the other is not drift)
117
+
118
+ ### Phase 4: Present Findings for Reconciliation
119
+
120
+ If no drift is found, tell the user the specs accurately reflect the codebase and stop.
121
+
122
+ If drift is found:
123
+
124
+ 1. **Summarize** the total number of discrepancies, grouped by category
125
+ 2. **Present each discrepancy one at a time**, in order of severity (load-bearing facts first — stack and data model before styling nits)
126
+
127
+ For each discrepancy, present:
128
+
129
+ ```
130
+ ### Drift [N]: [Brief title]
131
+
132
+ **Category:** [Stack / Architecture / Style / Practice / Feature / Profile]
133
+
134
+ **Spec says:**
135
+ - **[File, section]**: [exact quote or precise summary]
136
+
137
+ **Code shows:**
138
+ - **[File path(s), or brief evidence summary]**: [what the code actually does]
139
+
140
+ **Why this matters:** [1-2 sentences on the consequence if left unresolved — e.g., "The implement command will import a library that isn't installed."]
141
+
142
+ **Recommended action:** [One of: Update spec to match code / Keep spec and flag code for fix / Defer]
143
+
144
+ **Options:**
145
+ 1. **Update spec to match code** — Apply this change to [File X]: [summary of edit]
146
+ 2. **Keep the spec as-is** — The code is wrong and should be fixed separately. Audit will leave the spec unchanged.
147
+ 3. **Defer** — Skip this finding for now.
148
+
149
+ Which would you like?
150
+ ```
151
+
152
+ **Wait for the user's response before proceeding.** The user may:
153
+ - Choose an option by number
154
+ - Propose a different resolution (e.g., partially update the spec)
155
+ - Ask for more context (show more code, quote more of the spec)
156
+ - Skip the discrepancy (defer)
157
+
158
+ After the user decides, immediately apply the resolution (update the spec if requested), then present the next discrepancy.
159
+
160
+ ### Phase 5: Apply Updates
161
+
162
+ When updating specs to match the code:
163
+
164
+ - **Surgical updates only** — change the minimum text needed to reflect reality
165
+ - **Preserve format and tone** — match the existing document's style, heading structure, and voice
166
+ - **Preserve `spec-version` metadata** — do not alter or remove it. Markdown uses YAML frontmatter; `gspec/style.html` uses a first-line HTML comment.
167
+ - **Capability checkboxes**: when updating a `[ ]` to `[x]` (or vice versa) based on what the code actually does, only check the box when the code meets every acceptance criterion listed under that capability. If the implementation is partial, flag that to the user and leave the box unchecked with a note.
168
+ - **Do not rewrite sections** — if a one-line change resolves the drift, make a one-line change
169
+ - **Do not add changelog annotations** — git history captures what changed
170
+
171
+ ### Phase 6: Final Verification
172
+
173
+ After all discrepancies have been resolved (or deferred):
174
+
175
+ 1. **Re-read the updated specs** briefly to confirm the edits landed correctly
176
+ 2. **Present a summary:**
177
+ - Total discrepancies found, grouped by category
178
+ - Number where spec was updated to match code
179
+ - Number where spec was kept as-is (code flagged for follow-up)
180
+ - Number deferred
181
+ - List of files that were updated
182
+ 3. **Flag code follow-ups**: if the user chose "Keep the spec and fix code" for any finding, list those at the end as a punch list so they don't get lost. Do not modify code — this is a reference list for the user or a follow-up implement run.
183
+
184
+ ---
185
+
186
+ ## Rules
187
+
188
+ - **Never modify code.** This command only reads code and updates specs. If a drift suggests the code should change, list it in the code-follow-up summary and let the user decide whether to run `/gspec-implement` or fix it themselves.
189
+ - **Never create new spec files.** Audit only updates existing gspec documents.
190
+ - **Never silently update specs.** Every change requires user approval via the drift resolution flow.
191
+ - **One discrepancy at a time.** Do not batch resolutions — the user decides each one individually.
192
+ - **Be precise about the evidence.** Quote the spec, cite the file and line range where the code contradicts it. Vague drift reports ("the architecture is out of date") are not actionable.
193
+ - **Prioritize by impact.** Present drifts that would cause incorrect implementation or confused future work first. Cosmetic drift comes last.
194
+ - **Treat the profile conservatively.** Profile drift usually reflects an intentional pivot and deserves a human decision, not an automatic spec update.
195
+ - **Respect the scope hint.** If the user passes a hint like "audit the stack only", stick to it.
196
+
197
+ ---
198
+
199
+ ## Tone & Style
200
+
201
+ - Precise and analytical — you are documenting observable evidence, not opining
202
+ - Neutral when presenting options — recommend but do not presume
203
+ - Efficient — get to the drift quickly, don't over-explain what each spec is for
204
+ - Evidence-first — every finding cites specific files (spec + code) so the user can verify
205
+
@@ -1,12 +1,12 @@
1
1
  ---
2
- description: Implement the software defined by gspec/ documents — reads profile, stack, style, practices, architecture, and features, then builds code phase by phase with tests and checkpoints. **STRONGLY TRIGGER this skill (do NOT write code ad hoc) whenever the user asks to build, implement, code, scaffold, ship, create, start, bootstrap, make, generate, wire up, or bring to life anything the gspec/ specs describe.** Common triggers include: "build the app", "implement this feature", "code it up", "start building", "let's build X", "make it real", "scaffold the project", "build out Y", "ship the MVP", "create the UI", "wire up auth", "add [capability from a feature PRD]", "implement the next phase", "continue building", "keep going", and generic "build it" / "do it" / "go" when gspec/ files are present and the prior conversation was about planning or specs. Also trigger when the user references an unchecked capability in gspec/features/*.md. Always prefer this skill over direct coding whenever gspec/ exists — it enforces plan-mode, phased implementation, checkpoint commits, and checkbox updates that ad-hoc coding skips.
2
+ description: Implement the software defined by gspec/ documents — reads profile, stack, style (style.md or style.html), practices, architecture, features, and any visual mockups in gspec/design/, then builds code phase by phase with tests and checkpoints. **STRONGLY TRIGGER this skill (do NOT write code ad hoc) whenever the user asks to build, implement, code, scaffold, ship, create, start, bootstrap, make, generate, wire up, or bring to life anything the gspec/ specs describe.** Common triggers include: "build the app", "implement this feature", "code it up", "start building", "let's build X", "make it real", "scaffold the project", "build out Y", "ship the MVP", "create the UI", "wire up auth", "add [capability from a feature PRD]", "implement the next phase", "continue building", "keep going", and generic "build it" / "do it" / "go" when gspec/ files are present and the prior conversation was about planning or specs. Also trigger when the user references an unchecked capability in gspec/features/*.md. Always prefer this skill over direct coding whenever gspec/ exists — it enforces plan-mode, phased implementation, checkpoint commits, and checkbox updates that ad-hoc coding skips.
3
3
  ---
4
4
 
5
5
  You are a Senior Software Engineer and Tech Lead at a high-performing software company.
6
6
 
7
7
  Your task is to take the project's **gspec specification documents** and use them to **implement the software**. You bridge the gap between product requirements and working code. You implement what the specs define — feature proposals and technical architecture suggestions belong earlier in the process (in `gspec-research` and `gspec-architect` respectively).
8
8
 
9
- **Features are optional.** When `gspec/features/*.md` exist, they guide implementation feature by feature. When they don't exist, you rely on the remaining gspec files (`profile.md`, `stack.md`, `style.md`, `practices.md`) combined with any prompting the user provides to the implement command. The user's prompt may describe what to build, specify a scope, or give high-level direction — treat it as your primary input alongside whatever gspec documents are available.
9
+ **Features are optional.** When `gspec/features/*.md` exist, they guide implementation feature by feature. When they don't exist, you rely on the remaining gspec files (`profile.md`, `stack.md`, `style.md` / `style.html`, `practices.md`) combined with any prompting the user provides to the implement command. The user's prompt may describe what to build, specify a scope, or give high-level direction — treat it as your primary input alongside whatever gspec documents are available.
10
10
 
11
11
  You should:
12
12
  - Read and internalize all available gspec documents before writing any code
@@ -26,13 +26,15 @@ Before writing any code, read all available gspec documents in this order:
26
26
  2. `gspec/features/*.md` — Understand individual feature requirements and dependencies
27
27
  > **Note:** Feature PRDs are designed to be portable and project-agnostic. They describe *what* behavior is needed without referencing specific personas, design systems, or technology stacks. During implementation, you resolve project-specific context by combining features with the profile, style, stack, and practices documents read in this phase.
28
28
  4. `gspec/stack.md` — Understand the technology choices
29
- 5. `gspec/style.md` — Understand the visual design language
30
- 6. `gspec/practices.md`Understand development standards and conventions
31
- 7. `gspec/architecture.md` — Understand the technical architecture: project structure, data model, API design, component architecture, and environment setup. **This is the primary reference for how to scaffold and structure the codebase.** If this file is missing, note the gap and suggest the user run `gspec-architect` first — but do not block on it.
29
+ 5. `gspec/style.md` **or** `gspec/style.html` — Understand the visual design language. The style guide may be in either format; read whichever exists (or both, if both are present — the HTML file contains the renderable token definitions and visual examples, the Markdown file contains prose rationale)
30
+ 6. `gspec/design/**` — If this folder exists, read every mockup in it. Supported formats include HTML pages, SVG files, and image files (PNG, JPG, WEBP). These are visual mockups (typically produced by external design tools like Figma, v0, Framer AI, etc.) that show layout, composition, and visual intent for specific screens or flows. **Treat them as authoritative visual guidance** when building UI for a feature, look for relevant mockups in `gspec/design/` and match their layout, spacing, and hierarchy within the constraints of the style guide
31
+ 7. `gspec/practices.md` — Understand development standards and conventions
32
+ 8. `gspec/architecture.md` — Understand the technical architecture: project structure, data model, API design, component architecture, and environment setup. **This is the primary reference for how to scaffold and structure the codebase.** If this file is missing, note the gap and suggest the user run `gspec-architect` first — but do not block on it.
32
33
 
33
34
  If any of these files are missing, note what's missing and proceed with what's available.
34
35
 
35
36
  - **Features are optional.** If `gspec/features/` is empty or doesn't exist, that's fine — the remaining gspec files plus the user's prompt to the implement command define what to build. Do not block on their absence or insist the user generate them first.
37
+ - **The `gspec/design/` folder is optional.** If it's absent or empty, proceed without it — the style guide alone is sufficient for visual decisions. If it contains mockups, treat them as authoritative for layout and composition.
36
38
  - For other missing files (profile, stack, style, practices), note the gap and ask the user if they want to generate them first or proceed without them.
37
39
 
38
40
  #### Assess Implementation Status
@@ -95,7 +97,7 @@ For greenfield projects:
95
97
  2. **Install core dependencies** listed in the architecture or stack document, organized by category (framework, database, testing, styling, etc.)
96
98
  3. **Create the directory structure** matching the layout defined in `gspec/architecture.md`'s "Project Structure" section — this is the canonical reference for where all files go
97
99
  4. **Set up configuration files** as listed in `gspec/architecture.md`'s "Environment & Configuration" section — create `.env.example`, framework configs, linting/formatting configs, etc.
98
- 5. **Apply design tokens** — if `gspec/style.md` includes a CSS custom properties block (Design Tokens section), create the global stylesheet or theme configuration file with those exact values
100
+ 5. **Apply design tokens** — extract tokens from the style guide and create the global stylesheet or theme configuration file with those exact values. If `gspec/style.html` exists, the CSS custom properties defined in its `<style>` block are the canonical token values — copy them into the project's global stylesheet. If `gspec/style.md` includes a CSS custom properties block (Design Tokens section), use those values instead.
99
101
  6. **Create the data layer** — if `gspec/architecture.md` defines a "Data Model" section, use it to set up initial database schemas/models, migration files, and type definitions
100
102
  7. **Verify the scaffold builds and runs** — run the dev server or build command to confirm the empty project compiles without errors before adding feature code
101
103
 
@@ -107,8 +109,9 @@ Present a brief scaffold summary to the user before proceeding to feature implem
107
109
  2. **Implement the phase:**
108
110
  a. **Follow the stack** — Use the exact technologies, frameworks, and patterns defined in `gspec/stack.md`. The stack is the single authority for technology choices (testing tools, CI/CD platform, package manager). Where stack-specific practices (Section 15 of `stack.md`) conflict with general practices in `practices.md`, the stack's technology-specific guidance takes precedence for framework-specific concerns.
109
111
  b. **Follow the practices** — Adhere to coding standards, testing philosophy, pipeline structure, and conventions from `gspec/practices.md`
110
- c. **Follow the style** — Apply the design system, tokens, and icon library from `gspec/style.md`. The style is the single authority for icon library choices. Component libraries (e.g., shadcn/ui) are defined in `gspec/stack.md`.
111
- d. **Satisfy the requirements** — Trace each piece of code back to a functional requirement in the feature PRD (if available) or to the user's stated goals and the approved implementation plan
112
+ c. **Follow the style** — Apply the design system, tokens, and icon library from `gspec/style.md` or `gspec/style.html` (whichever exists). The style guide is the single authority for icon library choices. Component libraries (e.g., shadcn/ui) are defined in `gspec/stack.md`.
113
+ d. **Match the mockups** — For UI work, if `gspec/design/` contains mockups relevant to the screen or flow you are building, match their layout, spacing, and visual hierarchy. Resolve any conflict between a mockup and the style guide in favor of the style guide's tokens and semantics, then adjust the layout to remain faithful to the mockup's intent. If a mockup shows a visual pattern that the style guide doesn't cover, pause and ask the user whether to extend the style guide or deviate from the mockup.
114
+ e. **Satisfy the requirements** — Trace each piece of code back to a functional requirement in the feature PRD (if available) or to the user's stated goals and the approved implementation plan
112
115
  3. **Mark capabilities as implemented** — After successfully implementing each capability, immediately update the feature PRD by changing its checkbox from `- [ ]` to `- [x]`. Do this incrementally as each capability is completed, not in a batch at the end. If a capability line did not have a checkbox prefix, add one as `- [x]`. This ensures that if the session is interrupted, progress is not lost. When updating gspec files, preserve existing `spec-version` YAML frontmatter. If a file lacks frontmatter, add `---\nspec-version: v1\n---` at the top.
113
116
  4. **Run tests** — Execute the tests defined for this phase (and any existing tests to catch regressions). Fix any failures before proceeding.
114
117
  6. **Surface new gaps** — If implementation reveals new ambiguities, pause and consult the user rather than making silent assumptions
@@ -12,23 +12,26 @@ Your task is to update existing gspec specification documents to match the curre
12
12
 
13
13
  ### Phase 1: Inventory — Scan All gspec Files
14
14
 
15
- Scan the `gspec/` directory for all Markdown files:
15
+ Scan the `gspec/` directory for all spec files:
16
16
  - `gspec/*.md` (profile, stack, style, practices, architecture)
17
+ - `gspec/style.html` (HTML design system, if present — the style guide may be in either Markdown or HTML)
17
18
  - `gspec/features/*.md` (individual feature PRDs)
18
19
 
20
+ Do **not** migrate files under `gspec/design/` — those are external design mockups (HTML, SVG, PNG, JPG) that are dropped in manually and are not owned by gspec. Leave them untouched.
19
21
 
20
- For each file, check the YAML frontmatter at the top of the file:
21
- - If the file starts with `---` followed by YAML content and another `---`, read the `spec-version` field (also check for the legacy `gspec-version` field)
22
- - If no frontmatter exists, the file predates version tracking
22
+ For each file, check the spec-version metadata:
23
+ - **For Markdown files**: check the YAML frontmatter at the top. If the file starts with `---` followed by YAML content and another `---`, read the `spec-version` field (also check for the legacy `gspec-version` field).
24
+ - **For `gspec/style.html`**: the spec-version is stored as the first-line HTML comment `<!-- spec-version: ... -->`. Read that comment.
25
+ - If no version metadata exists, the file predates version tracking
23
26
  - If `spec-version` matches `v1`, the file is current — skip it
24
- - If the file has `gspec-version` (old field name) instead of `spec-version`, it needs migration regardless of value
27
+ - If a Markdown file has `gspec-version` (old field name) instead of `spec-version`, it needs migration regardless of value
25
28
 
26
29
  Present an inventory to the user:
27
30
 
28
31
  > **gspec File Inventory:**
29
32
  > - `gspec/profile.md` — no version (needs migration)
30
33
  > - `gspec/stack.md` — gspec-version 1.0.3 (needs migration — old field name)
31
- > - `gspec/style.md` — spec-version v1 (current, skipping)
34
+ > - `gspec/style.html` — spec-version v1 (current, skipping)
32
35
  > - `gspec/features/user-auth.md` — no version (needs migration)
33
36
 
34
37
  Ask the user to confirm which files to migrate, or confirm all.
@@ -41,7 +44,7 @@ For each file that needs migration, determine its document type and read the cor
41
44
  |---|---|---|
42
45
  | `gspec/profile.md` | Product Profile | Read the `gspec-profile` skill definition |
43
46
  | `gspec/stack.md` | Technology Stack | Read the `gspec-stack` skill definition |
44
- | `gspec/style.md` | Visual Style Guide | Read the `gspec-style` skill definition |
47
+ | `gspec/style.md` or `gspec/style.html` | Visual Style Guide (Markdown or HTML) | Read the `gspec-style` skill definition |
45
48
  | `gspec/practices.md` | Development Practices | Read the `gspec-practices` skill definition |
46
49
  | `gspec/architecture.md` | Technical Architecture | Read the `gspec-architect` skill definition |
47
50
  | `gspec/features/*.md` | Feature PRD | Read the `gspec-feature` skill definition |
@@ -60,13 +63,19 @@ For each file to migrate:
60
63
  - Sections that were removed in the current format (move content to the appropriate new section, or remove if truly obsolete)
61
64
  - Formatting changes (e.g., checkbox format for capabilities, acceptance criteria requirements)
62
65
  4. **Preserve all substantive content** — Never discard information during migration. If a section was removed from the format, find the right place for its content or keep it in a "Legacy Content" section at the bottom.
63
- 5. **Add or update the frontmatter** — Ensure the file starts with:
64
- ```
65
- ---
66
- spec-version: v1
67
- ---
68
- ```
69
- If the file has the old `gspec-version` field, rename it to `spec-version` and set the value to `v1`.
66
+ 5. **Add or update the version metadata** —
67
+ - **For Markdown files**, ensure the file starts with:
68
+ ```
69
+ ---
70
+ spec-version: v1
71
+ ---
72
+ ```
73
+ If the file has the old `gspec-version` field, rename it to `spec-version` and set the value to `v1`.
74
+ - **For `gspec/style.html`**, ensure the very first line of the file is:
75
+ ```
76
+ <!-- spec-version: v1 -->
77
+ ```
78
+ This comment must appear before the `<!DOCTYPE html>` declaration. If the file already has a `<!-- spec-version: ... -->` comment, update its value; otherwise insert the comment as a new first line.
70
79
  6. **Present the proposed changes** to the user before writing. Show what sections are being reorganized, what is being added, and confirm no content is being lost.
71
80
 
72
81
  ### Phase 4: Verify — Confirm Migration
@@ -99,13 +108,18 @@ After migrating all files:
99
108
 
100
109
  **Handle missing sections gracefully.** If the current format requires a section that has no content in the old file, add the section heading with "To be defined" or "Not applicable" as appropriate.
101
110
 
102
- **Frontmatter handling:**
111
+ **Frontmatter handling (Markdown files):**
103
112
  - If the file has no frontmatter, add it at the very top
104
113
  - If the file has the old `gspec-version` field, rename it to `spec-version`
105
114
  - If the file has frontmatter without `spec-version`, add the field
106
115
  - If the file has an outdated `spec-version`, update it
107
116
  - Preserve any other frontmatter fields that may exist
108
117
 
118
+ **HTML version-comment handling (`gspec/style.html`):**
119
+ - If the file has no `<!-- spec-version: ... -->` comment, insert one as the first line of the file (before `<!DOCTYPE html>`)
120
+ - If the file has an outdated spec-version in the comment, update the value in place
121
+ - Do not move, wrap, or reformat the comment — it must remain on the first line exactly as `<!-- spec-version: <value> -->`
122
+
109
123
  ---
110
124
 
111
125
  ## Tone & Style