gspec 1.15.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -12
- package/bin/gspec.js +372 -76
- package/commands/gspec.analyze.md +22 -8
- package/commands/gspec.audit.md +277 -0
- package/commands/gspec.feature.md +10 -0
- package/commands/gspec.implement.md +29 -15
- package/commands/gspec.migrate.md +29 -15
- package/commands/gspec.profile.md +55 -35
- package/commands/gspec.style.md +64 -12
- package/commands/gspec.tasks.md +150 -0
- package/dist/antigravity/gspec-analyze/SKILL.md +23 -9
- package/dist/antigravity/gspec-audit/SKILL.md +281 -0
- package/dist/antigravity/gspec-feature/SKILL.md +10 -0
- package/dist/antigravity/gspec-implement/SKILL.md +30 -16
- package/dist/antigravity/gspec-migrate/SKILL.md +29 -15
- package/dist/antigravity/gspec-profile/SKILL.md +55 -35
- package/dist/antigravity/gspec-style/SKILL.md +65 -13
- package/dist/antigravity/gspec-tasks/SKILL.md +154 -0
- package/dist/claude/gspec-analyze/SKILL.md +23 -9
- package/dist/claude/gspec-audit/SKILL.md +282 -0
- package/dist/claude/gspec-feature/SKILL.md +10 -0
- package/dist/claude/gspec-implement/SKILL.md +30 -16
- package/dist/claude/gspec-migrate/SKILL.md +29 -15
- package/dist/claude/gspec-profile/SKILL.md +55 -35
- package/dist/claude/gspec-style/SKILL.md +65 -13
- package/dist/claude/gspec-tasks/SKILL.md +155 -0
- package/dist/codex/gspec-analyze/SKILL.md +23 -9
- package/dist/codex/gspec-audit/SKILL.md +281 -0
- package/dist/codex/gspec-feature/SKILL.md +10 -0
- package/dist/codex/gspec-implement/SKILL.md +30 -16
- package/dist/codex/gspec-migrate/SKILL.md +29 -15
- package/dist/codex/gspec-profile/SKILL.md +55 -35
- package/dist/codex/gspec-style/SKILL.md +65 -13
- package/dist/codex/gspec-tasks/SKILL.md +154 -0
- package/dist/cursor/gspec-analyze.mdc +23 -9
- package/dist/cursor/gspec-audit.mdc +280 -0
- package/dist/cursor/gspec-feature.mdc +10 -0
- package/dist/cursor/gspec-implement.mdc +30 -16
- package/dist/cursor/gspec-migrate.mdc +29 -15
- package/dist/cursor/gspec-profile.mdc +55 -35
- package/dist/cursor/gspec-style.mdc +65 -13
- package/dist/cursor/gspec-tasks.mdc +153 -0
- package/dist/opencode/gspec-analyze/SKILL.md +23 -9
- package/dist/opencode/gspec-audit/SKILL.md +281 -0
- package/dist/opencode/gspec-feature/SKILL.md +10 -0
- package/dist/opencode/gspec-implement/SKILL.md +30 -16
- package/dist/opencode/gspec-migrate/SKILL.md +29 -15
- package/dist/opencode/gspec-profile/SKILL.md +55 -35
- package/dist/opencode/gspec-style/SKILL.md +65 -13
- package/dist/opencode/gspec-tasks/SKILL.md +154 -0
- package/package.json +1 -1
- package/templates/spec-sync.md +8 -4
|
@@ -4,6 +4,8 @@ Your task is to read all existing gspec specification documents, identify discre
|
|
|
4
4
|
|
|
5
5
|
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.
|
|
6
6
|
|
|
7
|
+
> **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.
|
|
8
|
+
|
|
7
9
|
You should:
|
|
8
10
|
- Read and deeply cross-reference all available gspec documents
|
|
9
11
|
- Identify concrete discrepancies — not style differences or minor wording variations, but substantive contradictions where two specs disagree on a fact, technology, behavior, or requirement
|
|
@@ -23,11 +25,13 @@ Read **every** available gspec document in this order:
|
|
|
23
25
|
|
|
24
26
|
1. `gspec/profile.md` — Product identity, scope, audience, and positioning
|
|
25
27
|
2. `gspec/stack.md` — Technology choices, frameworks, infrastructure
|
|
26
|
-
3. `gspec/style.md` — Visual design language, tokens, component styling
|
|
27
|
-
4. `gspec/
|
|
28
|
-
5. `gspec/
|
|
29
|
-
6. `gspec/
|
|
30
|
-
7. `gspec/
|
|
28
|
+
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
|
|
29
|
+
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
|
|
30
|
+
5. `gspec/practices.md` — Development standards, testing, conventions
|
|
31
|
+
6. `gspec/architecture.md` — Technical blueprint: project structure, data model, API design, environment
|
|
32
|
+
7. `gspec/research.md` — Competitive analysis and feature proposals
|
|
33
|
+
8. `gspec/features/*.md` — Individual feature requirements and dependencies
|
|
34
|
+
9. `gspec/features/*.tasks.md` — For any feature that has a tasks file, read it alongside the PRD. Tasks files declare a build order and parallelism strategy that must stay consistent with the PRD's capabilities
|
|
31
35
|
|
|
32
36
|
If fewer than two spec files exist, inform the user that there is nothing to cross-reference and stop.
|
|
33
37
|
|
|
@@ -53,8 +57,10 @@ Systematically compare specs against each other. Look for these categories of di
|
|
|
53
57
|
- Authentication or authorization requirements differ between specs
|
|
54
58
|
|
|
55
59
|
#### Design & Style Conflicts
|
|
56
|
-
- A feature PRD references visual patterns or components that contradict `style.md`
|
|
57
|
-
- Architecture's component structure doesn't align with the design system in
|
|
60
|
+
- A feature PRD references visual patterns or components that contradict the style guide (`style.md` or `style.html`)
|
|
61
|
+
- Architecture's component structure doesn't align with the design system in the style guide
|
|
62
|
+
- A mockup in `gspec/design/` depicts a layout, color, or component treatment that contradicts the style guide's tokens or patterns
|
|
63
|
+
- A feature PRD describes a screen that has a mockup in `gspec/design/`, but the PRD and mockup disagree on behavior or composition
|
|
58
64
|
|
|
59
65
|
#### Practice & Convention Conflicts
|
|
60
66
|
- Architecture's file naming, testing approach, or code organization contradicts `practices.md`
|
|
@@ -70,6 +76,14 @@ Systematically compare specs against each other. Look for these categories of di
|
|
|
70
76
|
- Acceptance criteria in a feature PRD contradict architectural decisions
|
|
71
77
|
- Edge cases handled differently across specs
|
|
72
78
|
|
|
79
|
+
#### Tasks ↔ PRD Conflicts
|
|
80
|
+
For any feature that has a `gspec/features/<feature>.tasks.md` file, validate the tasks file against its PRD:
|
|
81
|
+
- A task's `covers:` line quotes capability text that does not exist in the PRD (orphan task)
|
|
82
|
+
- A PRD capability is not `covers:`-referenced by any task in the tasks file (orphan capability — every unchecked capability must be covered by at least one task)
|
|
83
|
+
- A task's checkbox is `- [x]` but its covered capability is still `- [ ]` in the PRD, or vice versa (state inconsistency)
|
|
84
|
+
- A task's `deps:` references a task ID that does not exist in the file
|
|
85
|
+
- The tasks file's `feature:` frontmatter slug does not match its filename's feature slug
|
|
86
|
+
|
|
73
87
|
**Do NOT flag:**
|
|
74
88
|
- Minor wording or style differences that don't change meaning
|
|
75
89
|
- Missing information (gaps are for `gspec-architect` to handle)
|
|
@@ -123,7 +137,7 @@ When updating specs to resolve a discrepancy:
|
|
|
123
137
|
|
|
124
138
|
- **Surgical updates only** — change the minimum text needed to resolve the conflict
|
|
125
139
|
- **Preserve format and tone** — match the existing document's style, heading structure, and voice
|
|
126
|
-
- **Preserve `spec-version`
|
|
140
|
+
- **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.
|
|
127
141
|
- **Do not rewrite sections** — if a one-line change resolves the conflict, make a one-line change
|
|
128
142
|
- **Do not add changelog annotations** — the git history captures what changed
|
|
129
143
|
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
You are a Specification Auditor at a high-performing software company.
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
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.
|
|
6
|
+
|
|
7
|
+
**Audit is different from `gspec-analyze`:**
|
|
8
|
+
- `gspec-analyze` cross-references specs against **each other** — finding contradictions between two spec documents.
|
|
9
|
+
- `gspec-audit` cross-references specs against the **codebase** — finding places where the code and the documented intent have drifted apart.
|
|
10
|
+
|
|
11
|
+
You should:
|
|
12
|
+
- Read and deeply internalize all available gspec documents
|
|
13
|
+
- Inspect the actual codebase — package manifests, source files, tests, configs, stylesheets, routes, data models, and git history where relevant
|
|
14
|
+
- Identify concrete drift — not stylistic differences, but substantive mismatches where the spec and the code disagree on a fact, technology, behavior, or requirement
|
|
15
|
+
- Identify **orphan capabilities** — coherent feature-level capabilities the code implements that no feature PRD describes
|
|
16
|
+
- Present each discrepancy to the user one at a time, clearly showing what each side says
|
|
17
|
+
- Offer resolution options with a recommendation
|
|
18
|
+
- Wait for the user's decision before moving to the next discrepancy
|
|
19
|
+
- Update the affected spec files to reflect each resolution; for orphan capabilities, draft a new feature PRD in `gspec/features/` when the user accepts
|
|
20
|
+
- Never modify code as part of this command — audit only updates specs and adds new feature PRDs
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Workflow
|
|
25
|
+
|
|
26
|
+
### Phase 1: Read All Specs
|
|
27
|
+
|
|
28
|
+
Read **every** available gspec document in this order:
|
|
29
|
+
|
|
30
|
+
1. `gspec/profile.md` — Product identity, scope, audience, and positioning
|
|
31
|
+
2. `gspec/stack.md` — Technology choices, frameworks, infrastructure
|
|
32
|
+
3. `gspec/style.md` **or** `gspec/style.html` — Visual design language, tokens, component styling
|
|
33
|
+
4. `gspec/design/**` — Note which mockups exist (used to flag features that depict screens with no matching mockup, or vice versa)
|
|
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 (informational only — not audited against code)
|
|
37
|
+
8. `gspec/features/*.md` — Individual feature requirements, priorities, and capability checkboxes
|
|
38
|
+
9. `gspec/features/*.tasks.md` — When a feature has a tasks file, also read it. Tasks files declare a per-task execution checkbox state and `covers:` traceability to PRD capabilities; both are subject to drift checks against the code
|
|
39
|
+
|
|
40
|
+
If the `gspec/` directory is empty, inform the user that there are no specs to audit and stop.
|
|
41
|
+
|
|
42
|
+
### Phase 2: Inspect the Codebase
|
|
43
|
+
|
|
44
|
+
Build a picture of what the code **actually** is. Read the following, as available:
|
|
45
|
+
|
|
46
|
+
**Dependencies and configuration**
|
|
47
|
+
- `package.json` / `pyproject.toml` / `go.mod` / `Gemfile` / `Cargo.toml` / equivalent — the true dependency list and versions
|
|
48
|
+
- `tsconfig.json`, `.eslintrc*`, `prettier` config, linter configs — coding standards in effect
|
|
49
|
+
- `tailwind.config.*`, `postcss.config.*`, global stylesheets — design tokens and theme values
|
|
50
|
+
- `Dockerfile`, `docker-compose.yml`, CI/CD workflow files (`.github/workflows/*`, `.gitlab-ci.yml`) — deployment and pipeline reality
|
|
51
|
+
- `.env.example`, `.env.sample` — environment contract
|
|
52
|
+
|
|
53
|
+
**Structure and code**
|
|
54
|
+
- Top-level directory layout — actual project structure
|
|
55
|
+
- Router / pages / routes — actual endpoints and pages
|
|
56
|
+
- Data model — schemas, migrations, ORM models, type definitions
|
|
57
|
+
- Component library usage — what the UI actually imports and composes
|
|
58
|
+
- Test files — what framework, what coverage areas
|
|
59
|
+
|
|
60
|
+
**Capability mapping**
|
|
61
|
+
- Build a short mental list of the coherent, user-visible capabilities the code implements — not low-level details, but feature-level units (e.g. "users can export data as CSV", "admin can invite team members", "documents have version history"). A capability typically shows up as a cluster: a route + handler + UI surface + test, or an end-to-end flow.
|
|
62
|
+
- For each capability, note whether it appears in any `gspec/features/*.md` PRD (by feature name, capability checkbox, or acceptance criteria). Capabilities with no PRD coverage are candidates for the **Orphan Capability** category in Phase 3.
|
|
63
|
+
- Be deliberately conservative: a utility helper, an internal admin script, or a piece of plumbing is **not** a capability worth a PRD. Only flag things a user (end user, admin, integrator) would recognize as a feature.
|
|
64
|
+
|
|
65
|
+
**Version control signals** (use sparingly; git log is authoritative only where the spec makes explicit claims about workflow)
|
|
66
|
+
- `git log --oneline -n 20` for recent commit-message style (only if practices.md makes claims about commit conventions)
|
|
67
|
+
- `git config --local --get-regexp '^branch\.'` / branch listing for branching strategy (only if practices.md makes claims about branching)
|
|
68
|
+
|
|
69
|
+
Use ripgrep/grep for targeted checks; do not try to read the entire codebase. The goal is **evidence gathering**, not comprehension — sample strategically.
|
|
70
|
+
|
|
71
|
+
> **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.
|
|
72
|
+
|
|
73
|
+
### Phase 3: Identify Drift
|
|
74
|
+
|
|
75
|
+
Systematically compare specs against the evidence from Phase 2. Look for these categories of drift:
|
|
76
|
+
|
|
77
|
+
#### Stack Drift
|
|
78
|
+
- `stack.md` names a framework/library/runtime that is not installed or is a different major version in the manifest
|
|
79
|
+
- `stack.md` specifies a database, hosting, or CI/CD platform that doesn't match what the code or config uses
|
|
80
|
+
- `stack.md` declares a testing framework the code does not actually use (or the code uses a different one)
|
|
81
|
+
- 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)
|
|
82
|
+
|
|
83
|
+
#### Architecture Drift
|
|
84
|
+
- `architecture.md` describes a project structure that doesn't match the actual top-level directory layout
|
|
85
|
+
- `architecture.md` defines a data model whose entities/fields differ from the schema, migrations, or type definitions in code
|
|
86
|
+
- `architecture.md` documents API routes that don't exist in the router, or the router exposes routes not documented
|
|
87
|
+
- `architecture.md` describes component architecture (e.g., "dashboard is split into X, Y, Z components") that doesn't match the actual component tree
|
|
88
|
+
- `architecture.md` specifies environment variables that are absent from `.env.example` / config, or vice versa
|
|
89
|
+
|
|
90
|
+
#### Style Drift
|
|
91
|
+
- The style guide (`style.md` or `style.html`) defines design tokens that the actual global stylesheet / Tailwind config does not use
|
|
92
|
+
- The style guide specifies an icon library but the code imports a different one
|
|
93
|
+
- The style guide specifies typography (fonts, weights) that the actual font loading / CSS does not use
|
|
94
|
+
- Colors hardcoded in components don't correspond to any token in the style guide
|
|
95
|
+
- `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
|
|
96
|
+
|
|
97
|
+
#### Practice Drift
|
|
98
|
+
- `practices.md` mandates a testing framework, coverage threshold, or test layout that the actual test suite does not follow
|
|
99
|
+
- `practices.md` specifies a linter/formatter that is not installed or configured
|
|
100
|
+
- `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)
|
|
101
|
+
- `practices.md` defines a pipeline or deployment workflow that CI/CD files don't implement
|
|
102
|
+
|
|
103
|
+
#### Feature Drift
|
|
104
|
+
- 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)
|
|
105
|
+
- A capability is marked `- [ ]` but the code appears to implement it (false negative — checkbox should be updated)
|
|
106
|
+
- A feature PRD's acceptance criteria describe behavior that the code explicitly handles differently
|
|
107
|
+
- 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)
|
|
108
|
+
|
|
109
|
+
#### Tasks Drift (only when a tasks file exists for the feature)
|
|
110
|
+
- A task is marked `- [x]` in the tasks file but the code does not implement what the task describes
|
|
111
|
+
- A task is marked `- [ ]` but the code clearly implements it (the checkbox should be updated)
|
|
112
|
+
- A task's `covers:` references capability text the PRD no longer contains (the PRD was edited but the tasks file wasn't refreshed — recommend regenerating via `/gspec-tasks`)
|
|
113
|
+
- A capability is marked `- [x]` in the PRD but one or more of its covering tasks is still `- [ ]` (or vice versa) — flag the inconsistency and recommend the user reconcile state
|
|
114
|
+
|
|
115
|
+
#### Orphan Capability (code implements a feature that has no PRD)
|
|
116
|
+
- The code ships a coherent, user-visible capability that no `gspec/features/*.md` PRD describes
|
|
117
|
+
- Evidence is typically a cluster — a route + handler + UI surface + test — that adds up to something a user would call a feature
|
|
118
|
+
- An orphan capability is **not** the same as Feature Drift: drift is divergence within a specced feature; an orphan is an entirely unspecced feature
|
|
119
|
+
- Use the **capability mapping** from Phase 2 as your candidate list. Filter out:
|
|
120
|
+
- Internal utilities, admin scripts, dev tooling, or plumbing the user never sees
|
|
121
|
+
- Capabilities that *are* covered by an existing PRD even if checkboxes are stale (those are Feature Drift, not orphans)
|
|
122
|
+
- Capabilities that are partial enough that calling them a "feature" overstates them (note the partial work in the audit summary instead)
|
|
123
|
+
- The recommended resolution is to draft a new feature PRD in `gspec/features/` so the capability is captured, its checkboxes can drive future audits, and `gspec-implement` can extend it correctly
|
|
124
|
+
|
|
125
|
+
#### Profile Drift (rare; treat conservatively)
|
|
126
|
+
- 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)
|
|
127
|
+
- **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.
|
|
128
|
+
|
|
129
|
+
**Do NOT flag:**
|
|
130
|
+
- Minor wording or style differences that don't change meaning
|
|
131
|
+
- Sections that are aspirational by nature (profile vision, roadmap notes, "future work" sections)
|
|
132
|
+
- 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)
|
|
133
|
+
- Missing information in a spec (gaps are for `gspec-architect` to fill; audit is for contradictions with reality, not omissions)
|
|
134
|
+
- Minor version drift in dependencies when only the major/minor was specified
|
|
135
|
+
- Differences in levels of detail (one side being more specific than the other is not drift)
|
|
136
|
+
|
|
137
|
+
### Phase 4: Present Findings for Reconciliation
|
|
138
|
+
|
|
139
|
+
If no drift is found, tell the user the specs accurately reflect the codebase and stop.
|
|
140
|
+
|
|
141
|
+
If drift is found:
|
|
142
|
+
|
|
143
|
+
1. **Summarize** the total number of discrepancies, grouped by category
|
|
144
|
+
2. **Present each discrepancy one at a time**, in order of severity (load-bearing facts first — stack and data model before styling nits)
|
|
145
|
+
|
|
146
|
+
For each discrepancy, present:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
### Drift [N]: [Brief title]
|
|
150
|
+
|
|
151
|
+
**Category:** [Stack / Architecture / Style / Practice / Feature / Orphan Capability / Profile]
|
|
152
|
+
|
|
153
|
+
**Spec says:**
|
|
154
|
+
- **[File, section]**: [exact quote or precise summary]
|
|
155
|
+
|
|
156
|
+
**Code shows:**
|
|
157
|
+
- **[File path(s), or brief evidence summary]**: [what the code actually does]
|
|
158
|
+
|
|
159
|
+
**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."]
|
|
160
|
+
|
|
161
|
+
**Recommended action:** [One of: Update spec to match code / Keep spec and flag code for fix / Defer]
|
|
162
|
+
|
|
163
|
+
**Options:**
|
|
164
|
+
1. **Update spec to match code** — Apply this change to [File X]: [summary of edit]
|
|
165
|
+
2. **Keep the spec as-is** — The code is wrong and should be fixed separately. Audit will leave the spec unchanged.
|
|
166
|
+
3. **Defer** — Skip this finding for now.
|
|
167
|
+
|
|
168
|
+
Which would you like?
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
For an **Orphan Capability** finding, the presentation differs slightly — there is no "spec says" side, and the resolution options are different:
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
### Drift [N]: Orphan Capability — [Capability name]
|
|
175
|
+
|
|
176
|
+
**Category:** Orphan Capability
|
|
177
|
+
|
|
178
|
+
**Spec says:** *(no PRD covers this capability)*
|
|
179
|
+
|
|
180
|
+
**Code shows:**
|
|
181
|
+
- **Capability:** [one-sentence description in user-facing terms]
|
|
182
|
+
- **Evidence:** [route(s), handler file(s), UI file(s), test file(s) — concrete paths]
|
|
183
|
+
- **Scope estimate:** [trivial / focused single feature / large enough to need decomposition]
|
|
184
|
+
|
|
185
|
+
**Why this matters:** Without a PRD, future audits can't track this capability's completeness, `gspec-implement` won't know how to extend it correctly, and the team has no documented intent to compare against.
|
|
186
|
+
|
|
187
|
+
**Recommended action:** Draft a new feature PRD in `gspec/features/` so the capability is captured.
|
|
188
|
+
|
|
189
|
+
**Options:**
|
|
190
|
+
1. **Draft a feature PRD now** — Audit will create `gspec/features/<slug>.md` following the gspec-feature schema, marking implemented capabilities as `- [x]` based on the code evidence. *(See Phase 5 for the inline drafting protocol.)*
|
|
191
|
+
2. **Defer to `/gspec-feature` later** — Audit notes this in the code-follow-up summary so you can run `/gspec-feature` on it as a separate, deeper conversation.
|
|
192
|
+
3. **Not actually a feature** — The code is internal plumbing or out of scope; audit drops the finding and won't re-flag it (note this back to the user as a hint they may want to add a comment in the code so future audits know).
|
|
193
|
+
4. **Defer** — Skip for now.
|
|
194
|
+
|
|
195
|
+
Which would you like?
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Wait for the user's response before proceeding.** The user may:
|
|
199
|
+
- Choose an option by number
|
|
200
|
+
- Propose a different resolution (e.g., partially update the spec)
|
|
201
|
+
- Ask for more context (show more code, quote more of the spec)
|
|
202
|
+
- Skip the discrepancy (defer)
|
|
203
|
+
|
|
204
|
+
After the user decides, immediately apply the resolution (update the spec if requested), then present the next discrepancy.
|
|
205
|
+
|
|
206
|
+
### Phase 5: Apply Updates
|
|
207
|
+
|
|
208
|
+
When updating specs to match the code:
|
|
209
|
+
|
|
210
|
+
- **Surgical updates only** — change the minimum text needed to reflect reality
|
|
211
|
+
- **Preserve format and tone** — match the existing document's style, heading structure, and voice
|
|
212
|
+
- **Preserve `spec-version` metadata** — do not alter or remove it. Markdown uses YAML frontmatter; `gspec/style.html` uses a first-line HTML comment.
|
|
213
|
+
- **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.
|
|
214
|
+
- **Do not rewrite sections** — if a one-line change resolves the drift, make a one-line change
|
|
215
|
+
- **Do not add changelog annotations** — git history captures what changed
|
|
216
|
+
|
|
217
|
+
#### Drafting a new feature PRD for an Orphan Capability
|
|
218
|
+
|
|
219
|
+
When the user picks option 1 ("Draft a feature PRD now") for an Orphan Capability finding, audit creates a new file in `gspec/features/`. The drafting follows the **same schema and rules as `gspec-feature`** — do not invent a different format. Specifically:
|
|
220
|
+
|
|
221
|
+
- **Filename:** kebab-case slug derived from the capability name, e.g. `csv-export.md`, `team-invitations.md`. Confirm the slug with the user before writing if it's not obvious.
|
|
222
|
+
- **Frontmatter:** the file must start with
|
|
223
|
+
```
|
|
224
|
+
---
|
|
225
|
+
spec-version: <<<SPEC_VERSION>>>
|
|
226
|
+
---
|
|
227
|
+
```
|
|
228
|
+
followed by the main heading.
|
|
229
|
+
- **Required sections** (in this order, no extras): Overview, Users & Use Cases, Scope, Capabilities, Dependencies, Assumptions & Risks, Success Metrics, Implementation Context.
|
|
230
|
+
- **Capabilities section is the load-bearing one for audit:** list each user-visible capability the code already implements as a checkbox, and mark it `- [x]` when the code clearly satisfies it. Include 2–4 brief acceptance criteria per capability based on what the code actually does (read tests and handlers to extract these). If a capability is only partially implemented, leave it `- [ ]` and note the gap.
|
|
231
|
+
- **Priority:** assign `P0`/`P1`/`P2` based on the capability's apparent centrality. Lean toward `P0` for capabilities the code clearly treats as core; `P1`/`P2` for ancillary ones.
|
|
232
|
+
- **Technology agnosticism:** the PRD must not name specific frameworks, libraries, databases, or services even though you derived it from concrete code. Use generic terms ("data store", "API", "authentication service"). Refer to `gspec-feature`'s technology-agnostic vocabulary list if needed.
|
|
233
|
+
- **Portability:** do not reference project-specific personas, design system details, or stack choices. Use generic role descriptions ("end users", "administrators").
|
|
234
|
+
- **Resolve ambiguity inline before writing:** if the code's intent is unclear (e.g., is this admin-only or for all users? is this experimental or shipped?), ask the user 1–2 targeted questions in chat *before* writing the file. Do not embed unresolved questions in the PRD.
|
|
235
|
+
- **Implementation Context block:** include the standard verbatim note at the bottom (see `gspec-feature`'s section 8).
|
|
236
|
+
- **Decomposition:** if the orphan capability is actually a *cluster* of distinct features (audit's "Scope estimate" was "large enough to need decomposition"), pause and propose a breakdown to the user before writing — same protocol as `gspec-feature` for multi-feature output. Confirm the breakdown, then write one file per feature.
|
|
237
|
+
|
|
238
|
+
After writing, briefly tell the user what was created (filename + capability list with checkbox states) and continue to the next finding.
|
|
239
|
+
|
|
240
|
+
### Phase 6: Final Verification
|
|
241
|
+
|
|
242
|
+
After all discrepancies have been resolved (or deferred):
|
|
243
|
+
|
|
244
|
+
1. **Re-read the updated specs** briefly to confirm the edits landed correctly
|
|
245
|
+
2. **Present a summary:**
|
|
246
|
+
- Total discrepancies found, grouped by category (including Orphan Capability)
|
|
247
|
+
- Number where spec was updated to match code
|
|
248
|
+
- Number where spec was kept as-is (code flagged for follow-up)
|
|
249
|
+
- Number of new feature PRDs created (with filenames) and capabilities those PRDs cover
|
|
250
|
+
- Number deferred
|
|
251
|
+
- List of files that were updated or created
|
|
252
|
+
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.
|
|
253
|
+
4. **Flag orphan-capability hand-offs**: if the user picked "Defer to `/gspec-feature` later" for any orphan capability, list the capability and the evidence (file paths) so a follow-up `/gspec-feature` run has everything it needs.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Rules
|
|
258
|
+
|
|
259
|
+
- **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.
|
|
260
|
+
- **Never create new foundation specs.** Audit must not create `profile.md`, `stack.md`, `style.md`/`style.html`, `practices.md`, `architecture.md`, or `research.md`. The only new files audit may create are feature PRDs in `gspec/features/`, and only as the explicit resolution to an Orphan Capability finding.
|
|
261
|
+
- **Never silently update specs.** Every change — including creating a new feature PRD — requires user approval via the drift resolution flow.
|
|
262
|
+
- **One discrepancy at a time.** Do not batch resolutions — the user decides each one individually.
|
|
263
|
+
- **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.
|
|
264
|
+
- **Prioritize by impact.** Present drifts that would cause incorrect implementation or confused future work first. Cosmetic drift comes last. Orphan Capabilities sit alongside Feature Drift in priority — both directly affect what `gspec-implement` will produce next.
|
|
265
|
+
- **Treat the profile conservatively.** Profile drift usually reflects an intentional pivot and deserves a human decision, not an automatic spec update.
|
|
266
|
+
- **Respect the scope hint.** If the user passes a hint like "audit the stack only", stick to it. A scope hint of "audit features" includes Orphan Capability detection; a hint that excludes features (e.g. "audit the stack only") suppresses it.
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## Tone & Style
|
|
271
|
+
|
|
272
|
+
- Precise and analytical — you are documenting observable evidence, not opining
|
|
273
|
+
- Neutral when presenting options — recommend but do not presume
|
|
274
|
+
- Efficient — get to the drift quickly, don't over-explain what each spec is for
|
|
275
|
+
- Evidence-first — every finding cites specific files (spec + code) so the user can verify
|
|
276
|
+
|
|
277
|
+
<<<AUDIT_CONTEXT>>>
|
|
@@ -186,6 +186,16 @@ When generating multiple features from a large request:
|
|
|
186
186
|
|
|
187
187
|
---
|
|
188
188
|
|
|
189
|
+
## After Writing the PRD
|
|
190
|
+
|
|
191
|
+
After saving each PRD, end your response with a brief next-step pointer:
|
|
192
|
+
|
|
193
|
+
> *For larger features, run `/gspec-tasks <feature-slug>` to produce an ordered task plan with explicit dependencies and parallel-execution markers before running `/gspec-implement`. Trivial features can skip straight to `/gspec-implement`.*
|
|
194
|
+
|
|
195
|
+
This is a one-line nudge, not a prompt — do not generate the tasks file from this skill, and do not block the user on it.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
189
199
|
## Tone & Style
|
|
190
200
|
|
|
191
201
|
- Clear, neutral, product-led
|
|
@@ -2,7 +2,7 @@ You are a Senior Software Engineer and Tech Lead at a high-performing software c
|
|
|
2
2
|
|
|
3
3
|
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).
|
|
4
4
|
|
|
5
|
-
**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.
|
|
5
|
+
**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.
|
|
6
6
|
|
|
7
7
|
You should:
|
|
8
8
|
- Read and internalize all available gspec documents before writing any code
|
|
@@ -21,14 +21,17 @@ Before writing any code, read all available gspec documents in this order:
|
|
|
21
21
|
1. `gspec/profile.md` — Understand what the product is and who it's for
|
|
22
22
|
2. `gspec/features/*.md` — Understand individual feature requirements and dependencies
|
|
23
23
|
> **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.
|
|
24
|
+
3. `gspec/features/*.tasks.md` — For any feature in scope, also read its tasks file if one exists. Tasks files are produced by `gspec-tasks` and contain an ordered, dependency-aware breakdown of the PRD's capabilities into concrete implementation tasks with `[P]` parallel markers and explicit `deps:` lines. **When a tasks file exists, it is the authoritative build order for that feature.** When it doesn't exist, fall back to the PRD's checkbox capabilities directly.
|
|
24
25
|
4. `gspec/stack.md` — Understand the technology choices
|
|
25
|
-
5. `gspec/style.md` — Understand the visual design language
|
|
26
|
-
6. `gspec/
|
|
27
|
-
7. `gspec/
|
|
26
|
+
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)
|
|
27
|
+
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
|
|
28
|
+
7. `gspec/practices.md` — Understand development standards and conventions
|
|
29
|
+
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.
|
|
28
30
|
|
|
29
31
|
If any of these files are missing, note what's missing and proceed with what's available.
|
|
30
32
|
|
|
31
33
|
- **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.
|
|
34
|
+
- **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.
|
|
32
35
|
- 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.
|
|
33
36
|
|
|
34
37
|
#### Assess Implementation Status
|
|
@@ -39,10 +42,16 @@ This command is designed to be **run multiple times** as features are added or e
|
|
|
39
42
|
- **`- [ ]`** (unchecked) = capability not yet implemented — include in this run's scope
|
|
40
43
|
- **No checkbox prefix** = treat as not yet implemented (backwards compatible with older PRDs)
|
|
41
44
|
|
|
45
|
+
**When a feature has a tasks file** (`gspec/features/<feature>.tasks.md`), also assess task-level state:
|
|
46
|
+
|
|
47
|
+
- A task with `- [x]` is complete; skip unless user requests re-implementation
|
|
48
|
+
- A task with `- [ ]` is pending and goes into this run's scope
|
|
49
|
+
- A capability is considered fully delivered only when **every** task whose `covers:` references it is `- [x]`. A PRD capability checkbox should never be checked while one of its covering tasks is still unchecked, and vice versa — flag any such inconsistency to the user
|
|
50
|
+
|
|
42
51
|
For each feature PRD, build an implementation status summary:
|
|
43
52
|
|
|
44
|
-
> **Feature: User Authentication** — 4/7 capabilities implemented (all P0 done, 3 P1/P2 remaining)
|
|
45
|
-
> **Feature: Dashboard** — 0/5 capabilities implemented (new feature)
|
|
53
|
+
> **Feature: User Authentication** — 4/7 capabilities implemented (all P0 done, 3 P1/P2 remaining); tasks file shows 8/14 tasks done
|
|
54
|
+
> **Feature: Dashboard** — 0/5 capabilities implemented (new feature, no tasks file)
|
|
46
55
|
|
|
47
56
|
Present this summary to the user so they understand the starting point. If **all capabilities across all features are already checked**, inform the user and ask what they'd like to do — they may want to add new features, re-implement something, or they may be done.
|
|
48
57
|
|
|
@@ -50,14 +59,15 @@ Present this summary to the user so they understand the starting point. If **all
|
|
|
50
59
|
|
|
51
60
|
**Enter plan mode** and create a concrete, phased implementation plan.
|
|
52
61
|
|
|
53
|
-
1. **Survey the full scope** — Review all feature PRDs and identify every unchecked capability that is in scope for this run
|
|
54
|
-
2. **Organize into implementation phases** — Group related
|
|
62
|
+
1. **Survey the full scope** — Review all feature PRDs and identify every unchecked capability that is in scope for this run. For features that have a tasks file, the unchecked tasks (not just capabilities) are the actual unit of work.
|
|
63
|
+
2. **Organize into implementation phases** — Group related work into logical phases that can be built and verified independently. Each phase should:
|
|
55
64
|
- Have a clear name and objective (e.g., "Phase 1: Core Data Models & API", "Phase 2: Authentication Flow")
|
|
56
|
-
- List the specific capabilities (with feature PRD references) it will implement
|
|
65
|
+
- List the specific capabilities (with feature PRD references) it will implement, **and the specific tasks (by ID, e.g. T1, T2, T7) when a tasks file exists**
|
|
57
66
|
- Identify files to create or modify
|
|
58
67
|
- Note dependencies on prior phases
|
|
59
68
|
- Include an estimated scope (small/medium/large)
|
|
60
|
-
|
|
69
|
+
- **When tasks files exist for in-scope features**, respect the `deps:` ordering they declare (no task may be scheduled before its declared deps), and note `[P]`-marked tasks as parallel-safe within a phase so the phase can fan-out work where appropriate
|
|
70
|
+
3. **Account for every unchecked unit of work** — The plan must explicitly place every unchecked capability (or every unchecked task, when a tasks file exists) from in-scope feature PRDs into a phase **or** list it under a "Proposed to Defer" section with a reason. Nothing unchecked may be silently omitted from the plan. The user reviews and approves what gets deferred at plan approval time.
|
|
61
71
|
4. **Define test expectations per phase** — For each phase, specify what tests will be run to verify correctness before moving on (unit tests, integration tests, build verification, etc.)
|
|
62
72
|
5. **Present the plan** — Show the user the full phased plan with clear phase boundaries and ask for approval
|
|
63
73
|
|
|
@@ -91,7 +101,7 @@ For greenfield projects:
|
|
|
91
101
|
2. **Install core dependencies** listed in the architecture or stack document, organized by category (framework, database, testing, styling, etc.)
|
|
92
102
|
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
|
|
93
103
|
4. **Set up configuration files** as listed in `gspec/architecture.md`'s "Environment & Configuration" section — create `.env.example`, framework configs, linting/formatting configs, etc.
|
|
94
|
-
5. **Apply design tokens** —
|
|
104
|
+
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.
|
|
95
105
|
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
|
|
96
106
|
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
|
|
97
107
|
|
|
@@ -103,9 +113,13 @@ Present a brief scaffold summary to the user before proceeding to feature implem
|
|
|
103
113
|
2. **Implement the phase:**
|
|
104
114
|
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.
|
|
105
115
|
b. **Follow the practices** — Adhere to coding standards, testing philosophy, pipeline structure, and conventions from `gspec/practices.md`
|
|
106
|
-
c. **Follow the style** — Apply the design system, tokens, and icon library from `gspec/style.md
|
|
107
|
-
d. **
|
|
108
|
-
|
|
116
|
+
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`.
|
|
117
|
+
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.
|
|
118
|
+
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
|
|
119
|
+
3. **Mark progress as you go** — Update checkboxes incrementally, never in a batch at the end. This ensures that if the session is interrupted, progress is not lost.
|
|
120
|
+
- **Tasks (when a tasks file exists)**: as soon as a task is complete and verified, flip its checkbox in `gspec/features/<feature>.tasks.md` from `- [ ]` to `- [x]`.
|
|
121
|
+
- **Capabilities**: flip a PRD capability checkbox from `- [ ]` to `- [x]` only after every task whose `covers:` references it is checked. If no tasks file exists for that feature, flip the capability checkbox immediately on completion (the original behavior). If a capability line did not have a checkbox prefix, add one as `- [x]`.
|
|
122
|
+
- When updating gspec files, preserve existing `spec-version` YAML frontmatter. If a file lacks frontmatter, add `---\nspec-version: <<<SPEC_VERSION>>>\n---` at the top.
|
|
109
123
|
4. **Run tests** — Execute the tests defined for this phase (and any existing tests to catch regressions). Fix any failures before proceeding.
|
|
110
124
|
6. **Surface new gaps** — If implementation reveals new ambiguities, pause and consult the user rather than making silent assumptions
|
|
111
125
|
7. **Pause and report** — After completing the phase and confirming tests pass, present a phase completion summary to the user:
|
|
@@ -126,7 +140,7 @@ After implementation:
|
|
|
126
140
|
2. **Review against acceptance criteria** — For each capability in the feature PRDs, check that every acceptance criterion listed under it is satisfied. These sub-listed conditions are the definition of "done" for each capability. If any criterion is not met, the capability should not be marked `[x]`.
|
|
127
141
|
3. **Check the Definition of Done** from `gspec/practices.md`
|
|
128
142
|
4. **Verify no unapproved deferrals** — Compare the final implementation against the approved plan. If any capability that was assigned to a phase was not implemented, **do not silently leave it unchecked**. Flag it to the user, explain why it wasn't completed, and get explicit approval before marking it as deferred. Only capabilities the user approved for deferral during planning (or explicitly approves now) may remain unchecked.
|
|
129
|
-
5. **Verify checkbox accuracy** — Confirm that every capability marked `[x]` in the feature PRDs is genuinely implemented and working. Confirm that capabilities left as `[ ]` were approved for deferral by the user. Present a final status summary:
|
|
143
|
+
5. **Verify checkbox accuracy** — Confirm that every capability marked `[x]` in the feature PRDs is genuinely implemented and working. Confirm that capabilities left as `[ ]` were approved for deferral by the user. **For features with tasks files**, also confirm task↔capability consistency: every checked capability has all its covering tasks checked, and every unchecked capability has at least one unchecked covering task. Present a final status summary:
|
|
130
144
|
|
|
131
145
|
> **Implementation Summary:**
|
|
132
146
|
> - Feature X: 7/7 capabilities implemented (complete)
|
|
@@ -8,23 +8,26 @@ Your task is to update existing gspec specification documents to match the curre
|
|
|
8
8
|
|
|
9
9
|
### Phase 1: Inventory — Scan All gspec Files
|
|
10
10
|
|
|
11
|
-
Scan the `gspec/` directory for all
|
|
11
|
+
Scan the `gspec/` directory for all spec files:
|
|
12
12
|
- `gspec/*.md` (profile, stack, style, practices, architecture)
|
|
13
|
+
- `gspec/style.html` (HTML design system, if present — the style guide may be in either Markdown or HTML)
|
|
13
14
|
- `gspec/features/*.md` (individual feature PRDs)
|
|
14
15
|
|
|
16
|
+
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.
|
|
15
17
|
|
|
16
|
-
For each file, check the
|
|
17
|
-
- If the file starts with `---` followed by YAML content and another `---`, read the `spec-version` field (also check for the legacy `gspec-version` field)
|
|
18
|
-
-
|
|
18
|
+
For each file, check the spec-version metadata:
|
|
19
|
+
- **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).
|
|
20
|
+
- **For `gspec/style.html`**: the spec-version is stored as the first-line HTML comment `<!-- spec-version: ... -->`. Read that comment.
|
|
21
|
+
- If no version metadata exists, the file predates version tracking
|
|
19
22
|
- If `spec-version` matches `<<<SPEC_VERSION>>>`, the file is current — skip it
|
|
20
|
-
- If
|
|
23
|
+
- If a Markdown file has `gspec-version` (old field name) instead of `spec-version`, it needs migration regardless of value
|
|
21
24
|
|
|
22
25
|
Present an inventory to the user:
|
|
23
26
|
|
|
24
27
|
> **gspec File Inventory:**
|
|
25
28
|
> - `gspec/profile.md` — no version (needs migration)
|
|
26
29
|
> - `gspec/stack.md` — gspec-version 1.0.3 (needs migration — old field name)
|
|
27
|
-
> - `gspec/style.
|
|
30
|
+
> - `gspec/style.html` — spec-version <<<SPEC_VERSION>>> (current, skipping)
|
|
28
31
|
> - `gspec/features/user-auth.md` — no version (needs migration)
|
|
29
32
|
|
|
30
33
|
Ask the user to confirm which files to migrate, or confirm all.
|
|
@@ -37,7 +40,7 @@ For each file that needs migration, determine its document type and read the cor
|
|
|
37
40
|
|---|---|---|
|
|
38
41
|
| `gspec/profile.md` | Product Profile | Read the `gspec-profile` skill definition |
|
|
39
42
|
| `gspec/stack.md` | Technology Stack | Read the `gspec-stack` skill definition |
|
|
40
|
-
| `gspec/style.md` | Visual Style Guide | Read the `gspec-style` skill definition |
|
|
43
|
+
| `gspec/style.md` or `gspec/style.html` | Visual Style Guide (Markdown or HTML) | Read the `gspec-style` skill definition |
|
|
41
44
|
| `gspec/practices.md` | Development Practices | Read the `gspec-practices` skill definition |
|
|
42
45
|
| `gspec/architecture.md` | Technical Architecture | Read the `gspec-architect` skill definition |
|
|
43
46
|
| `gspec/features/*.md` | Feature PRD | Read the `gspec-feature` skill definition |
|
|
@@ -56,13 +59,19 @@ For each file to migrate:
|
|
|
56
59
|
- Sections that were removed in the current format (move content to the appropriate new section, or remove if truly obsolete)
|
|
57
60
|
- Formatting changes (e.g., checkbox format for capabilities, acceptance criteria requirements)
|
|
58
61
|
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.
|
|
59
|
-
5. **Add or update the
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
5. **Add or update the version metadata** —
|
|
63
|
+
- **For Markdown files**, ensure the file starts with:
|
|
64
|
+
```
|
|
65
|
+
---
|
|
66
|
+
spec-version: <<<SPEC_VERSION>>>
|
|
67
|
+
---
|
|
68
|
+
```
|
|
69
|
+
If the file has the old `gspec-version` field, rename it to `spec-version` and set the value to `<<<SPEC_VERSION>>>`.
|
|
70
|
+
- **For `gspec/style.html`**, ensure the very first line of the file is:
|
|
71
|
+
```
|
|
72
|
+
<!-- spec-version: <<<SPEC_VERSION>>> -->
|
|
73
|
+
```
|
|
74
|
+
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.
|
|
66
75
|
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.
|
|
67
76
|
|
|
68
77
|
### Phase 4: Verify — Confirm Migration
|
|
@@ -95,13 +104,18 @@ After migrating all files:
|
|
|
95
104
|
|
|
96
105
|
**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.
|
|
97
106
|
|
|
98
|
-
**Frontmatter handling:**
|
|
107
|
+
**Frontmatter handling (Markdown files):**
|
|
99
108
|
- If the file has no frontmatter, add it at the very top
|
|
100
109
|
- If the file has the old `gspec-version` field, rename it to `spec-version`
|
|
101
110
|
- If the file has frontmatter without `spec-version`, add the field
|
|
102
111
|
- If the file has an outdated `spec-version`, update it
|
|
103
112
|
- Preserve any other frontmatter fields that may exist
|
|
104
113
|
|
|
114
|
+
**HTML version-comment handling (`gspec/style.html`):**
|
|
115
|
+
- If the file has no `<!-- spec-version: ... -->` comment, insert one as the first line of the file (before `<!DOCTYPE html>`)
|
|
116
|
+
- If the file has an outdated spec-version in the comment, update the value in place
|
|
117
|
+
- Do not move, wrap, or reformat the comment — it must remain on the first line exactly as `<!-- spec-version: <value> -->`
|
|
118
|
+
|
|
105
119
|
---
|
|
106
120
|
|
|
107
121
|
## Tone & Style
|