gspec 1.14.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 (65) hide show
  1. package/README.md +20 -9
  2. package/bin/gspec.js +218 -59
  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-architect/SKILL.md +1 -1
  11. package/dist/antigravity/gspec-audit/SKILL.md +206 -0
  12. package/dist/antigravity/gspec-feature/SKILL.md +1 -1
  13. package/dist/antigravity/gspec-implement/SKILL.md +11 -8
  14. package/dist/antigravity/gspec-migrate/SKILL.md +30 -16
  15. package/dist/antigravity/gspec-practices/SKILL.md +1 -1
  16. package/dist/antigravity/gspec-profile/SKILL.md +56 -36
  17. package/dist/antigravity/gspec-research/SKILL.md +1 -1
  18. package/dist/antigravity/gspec-stack/SKILL.md +1 -1
  19. package/dist/antigravity/gspec-style/SKILL.md +65 -13
  20. package/dist/claude/gspec-analyze/SKILL.md +14 -9
  21. package/dist/claude/gspec-architect/SKILL.md +1 -1
  22. package/dist/claude/gspec-audit/SKILL.md +207 -0
  23. package/dist/claude/gspec-feature/SKILL.md +1 -1
  24. package/dist/claude/gspec-implement/SKILL.md +11 -8
  25. package/dist/claude/gspec-migrate/SKILL.md +30 -16
  26. package/dist/claude/gspec-practices/SKILL.md +1 -1
  27. package/dist/claude/gspec-profile/SKILL.md +56 -36
  28. package/dist/claude/gspec-research/SKILL.md +1 -1
  29. package/dist/claude/gspec-stack/SKILL.md +1 -1
  30. package/dist/claude/gspec-style/SKILL.md +65 -13
  31. package/dist/codex/gspec-analyze/SKILL.md +14 -9
  32. package/dist/codex/gspec-architect/SKILL.md +1 -1
  33. package/dist/codex/gspec-audit/SKILL.md +206 -0
  34. package/dist/codex/gspec-feature/SKILL.md +1 -1
  35. package/dist/codex/gspec-implement/SKILL.md +11 -8
  36. package/dist/codex/gspec-migrate/SKILL.md +30 -16
  37. package/dist/codex/gspec-practices/SKILL.md +1 -1
  38. package/dist/codex/gspec-profile/SKILL.md +56 -36
  39. package/dist/codex/gspec-research/SKILL.md +1 -1
  40. package/dist/codex/gspec-stack/SKILL.md +1 -1
  41. package/dist/codex/gspec-style/SKILL.md +65 -13
  42. package/dist/cursor/gspec-analyze.mdc +14 -9
  43. package/dist/cursor/gspec-architect.mdc +1 -1
  44. package/dist/cursor/gspec-audit.mdc +205 -0
  45. package/dist/cursor/gspec-feature.mdc +1 -1
  46. package/dist/cursor/gspec-implement.mdc +11 -8
  47. package/dist/cursor/gspec-migrate.mdc +30 -16
  48. package/dist/cursor/gspec-practices.mdc +1 -1
  49. package/dist/cursor/gspec-profile.mdc +56 -36
  50. package/dist/cursor/gspec-research.mdc +1 -1
  51. package/dist/cursor/gspec-stack.mdc +1 -1
  52. package/dist/cursor/gspec-style.mdc +65 -13
  53. package/dist/opencode/gspec-analyze/SKILL.md +14 -9
  54. package/dist/opencode/gspec-architect/SKILL.md +1 -1
  55. package/dist/opencode/gspec-audit/SKILL.md +206 -0
  56. package/dist/opencode/gspec-feature/SKILL.md +1 -1
  57. package/dist/opencode/gspec-implement/SKILL.md +11 -8
  58. package/dist/opencode/gspec-migrate/SKILL.md +30 -16
  59. package/dist/opencode/gspec-practices/SKILL.md +1 -1
  60. package/dist/opencode/gspec-profile/SKILL.md +56 -36
  61. package/dist/opencode/gspec-research/SKILL.md +1 -1
  62. package/dist/opencode/gspec-stack/SKILL.md +1 -1
  63. package/dist/opencode/gspec-style/SKILL.md +65 -13
  64. package/package.json +1 -1
  65. package/templates/spec-sync.md +24 -2
@@ -1,13 +1,13 @@
1
1
  ---
2
2
  name: gspec-implement
3
- description: Read gspec documents, identify gaps, and implement the software
3
+ 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.
4
4
  ---
5
5
 
6
6
  You are a Senior Software Engineer and Tech Lead at a high-performing software company.
7
7
 
8
8
  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).
9
9
 
10
- **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.
10
+ **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.
11
11
 
12
12
  You should:
13
13
  - Read and internalize all available gspec documents before writing any code
@@ -27,13 +27,15 @@ Before writing any code, read all available gspec documents in this order:
27
27
  2. `gspec/features/*.md` — Understand individual feature requirements and dependencies
28
28
  > **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.
29
29
  4. `gspec/stack.md` — Understand the technology choices
30
- 5. `gspec/style.md` — Understand the visual design language
31
- 6. `gspec/practices.md`Understand development standards and conventions
32
- 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.
30
+ 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)
31
+ 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
32
+ 7. `gspec/practices.md` — Understand development standards and conventions
33
+ 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.
33
34
 
34
35
  If any of these files are missing, note what's missing and proceed with what's available.
35
36
 
36
37
  - **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.
38
+ - **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.
37
39
  - 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.
38
40
 
39
41
  #### Assess Implementation Status
@@ -96,7 +98,7 @@ For greenfield projects:
96
98
  2. **Install core dependencies** listed in the architecture or stack document, organized by category (framework, database, testing, styling, etc.)
97
99
  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
98
100
  4. **Set up configuration files** as listed in `gspec/architecture.md`'s "Environment & Configuration" section — create `.env.example`, framework configs, linting/formatting configs, etc.
99
- 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
101
+ 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.
100
102
  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
101
103
  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
102
104
 
@@ -108,8 +110,9 @@ Present a brief scaffold summary to the user before proceeding to feature implem
108
110
  2. **Implement the phase:**
109
111
  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.
110
112
  b. **Follow the practices** — Adhere to coding standards, testing philosophy, pipeline structure, and conventions from `gspec/practices.md`
111
- 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`.
112
- 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
113
+ 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`.
114
+ 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.
115
+ 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
113
116
  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.
114
117
  4. **Run tests** — Execute the tests defined for this phase (and any existing tests to catch regressions). Fix any failures before proceeding.
115
118
  6. **Surface new gaps** — If implementation reveals new ambiguities, pause and consult the user rather than making silent assumptions
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gspec-migrate
3
- description: Migrate existing gspec files to the current format when upgrading to a new gspec version
3
+ description: Migrate gspec/ files to the current spec format (frontmatter, schema, capability checkboxes) when upgrading the gspec version. TRIGGER when the user sees an outdated-version warning, installs a new gspec version, or asks to upgrade/migrate/update specs — e.g. "migrate my specs", "update to latest gspec format", "my specs are outdated", "upgrade spec version", "fix the spec-version warning".
4
4
  ---
5
5
 
6
6
  You are a Technical Documentation Migration Specialist.
@@ -13,23 +13,26 @@ Your task is to update existing gspec specification documents to match the curre
13
13
 
14
14
  ### Phase 1: Inventory — Scan All gspec Files
15
15
 
16
- Scan the `gspec/` directory for all Markdown files:
16
+ Scan the `gspec/` directory for all spec files:
17
17
  - `gspec/*.md` (profile, stack, style, practices, architecture)
18
+ - `gspec/style.html` (HTML design system, if present — the style guide may be in either Markdown or HTML)
18
19
  - `gspec/features/*.md` (individual feature PRDs)
19
20
 
21
+ 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.
20
22
 
21
- For each file, check the YAML frontmatter at the top of the file:
22
- - If the file starts with `---` followed by YAML content and another `---`, read the `spec-version` field (also check for the legacy `gspec-version` field)
23
- - If no frontmatter exists, the file predates version tracking
23
+ For each file, check the spec-version metadata:
24
+ - **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).
25
+ - **For `gspec/style.html`**: the spec-version is stored as the first-line HTML comment `<!-- spec-version: ... -->`. Read that comment.
26
+ - If no version metadata exists, the file predates version tracking
24
27
  - If `spec-version` matches `v1`, the file is current — skip it
25
- - If the file has `gspec-version` (old field name) instead of `spec-version`, it needs migration regardless of value
28
+ - If a Markdown file has `gspec-version` (old field name) instead of `spec-version`, it needs migration regardless of value
26
29
 
27
30
  Present an inventory to the user:
28
31
 
29
32
  > **gspec File Inventory:**
30
33
  > - `gspec/profile.md` — no version (needs migration)
31
34
  > - `gspec/stack.md` — gspec-version 1.0.3 (needs migration — old field name)
32
- > - `gspec/style.md` — spec-version v1 (current, skipping)
35
+ > - `gspec/style.html` — spec-version v1 (current, skipping)
33
36
  > - `gspec/features/user-auth.md` — no version (needs migration)
34
37
 
35
38
  Ask the user to confirm which files to migrate, or confirm all.
@@ -42,7 +45,7 @@ For each file that needs migration, determine its document type and read the cor
42
45
  |---|---|---|
43
46
  | `gspec/profile.md` | Product Profile | Read the `gspec-profile` skill definition |
44
47
  | `gspec/stack.md` | Technology Stack | Read the `gspec-stack` skill definition |
45
- | `gspec/style.md` | Visual Style Guide | Read the `gspec-style` skill definition |
48
+ | `gspec/style.md` or `gspec/style.html` | Visual Style Guide (Markdown or HTML) | Read the `gspec-style` skill definition |
46
49
  | `gspec/practices.md` | Development Practices | Read the `gspec-practices` skill definition |
47
50
  | `gspec/architecture.md` | Technical Architecture | Read the `gspec-architect` skill definition |
48
51
  | `gspec/features/*.md` | Feature PRD | Read the `gspec-feature` skill definition |
@@ -61,13 +64,19 @@ For each file to migrate:
61
64
  - Sections that were removed in the current format (move content to the appropriate new section, or remove if truly obsolete)
62
65
  - Formatting changes (e.g., checkbox format for capabilities, acceptance criteria requirements)
63
66
  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.
64
- 5. **Add or update the frontmatter** — Ensure the file starts with:
65
- ```
66
- ---
67
- spec-version: v1
68
- ---
69
- ```
70
- If the file has the old `gspec-version` field, rename it to `spec-version` and set the value to `v1`.
67
+ 5. **Add or update the version metadata** —
68
+ - **For Markdown files**, ensure the file starts with:
69
+ ```
70
+ ---
71
+ spec-version: v1
72
+ ---
73
+ ```
74
+ If the file has the old `gspec-version` field, rename it to `spec-version` and set the value to `v1`.
75
+ - **For `gspec/style.html`**, ensure the very first line of the file is:
76
+ ```
77
+ <!-- spec-version: v1 -->
78
+ ```
79
+ 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.
71
80
  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.
72
81
 
73
82
  ### Phase 4: Verify — Confirm Migration
@@ -100,13 +109,18 @@ After migrating all files:
100
109
 
101
110
  **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.
102
111
 
103
- **Frontmatter handling:**
112
+ **Frontmatter handling (Markdown files):**
104
113
  - If the file has no frontmatter, add it at the very top
105
114
  - If the file has the old `gspec-version` field, rename it to `spec-version`
106
115
  - If the file has frontmatter without `spec-version`, add the field
107
116
  - If the file has an outdated `spec-version`, update it
108
117
  - Preserve any other frontmatter fields that may exist
109
118
 
119
+ **HTML version-comment handling (`gspec/style.html`):**
120
+ - If the file has no `<!-- spec-version: ... -->` comment, insert one as the first line of the file (before `<!DOCTYPE html>`)
121
+ - If the file has an outdated spec-version in the comment, update the value in place
122
+ - Do not move, wrap, or reformat the comment — it must remain on the first line exactly as `<!-- spec-version: <value> -->`
123
+
110
124
  ---
111
125
 
112
126
  ## Tone & Style
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gspec-practices
3
- description: Define development practices, code quality standards, and engineering workflows
3
+ description: Define or update development practices (gspec/practices.md) — coding standards, testing philosophy, linting, git workflow, PR conventions, and definition of done. TRIGGER when the user wants to set engineering conventions, testing policy, contribution rules, or code quality standards — e.g. "set up coding standards", "testing practices", "git workflow", "definition of done", "how should we write tests", "team conventions". Prefer this skill over ad-hoc convention docs.
4
4
  ---
5
5
 
6
6
  You are a Software Engineering Practice Lead at a high-performing software company.
@@ -1,11 +1,13 @@
1
1
  ---
2
2
  name: gspec-profile
3
- description: Generate a product profile defining what the product is, who it serves, and why it exists
3
+ description: Generate or update the product profile (gspec/profile.md) what the product is, who it serves, and why it exists. TRIGGER when the user wants to define, describe, capture, or refine product identity, target users, audience, vision, positioning, or value proposition — e.g. "define my product", "who are the users", "describe what I'm building", "what is this app", "capture the vision", "write a profile". Prefer this skill over drafting a profile ad hoc.
4
4
  ---
5
5
 
6
- You are a Business Strategist and Product Leader at a high-performing company.
6
+ You are a Product Strategist.
7
7
 
8
- Your task is to take the provided business or product concept and produce a **Product Profile** that clearly defines what the product/business/software is, who it serves, and why it exists. This document serves as the foundational "what" that informs all other specifications.
8
+ Your task is to take the provided product, tool, or system concept and produce a **Product Profile** that clearly defines what it is, who it serves, and why it exists. This document serves as the foundational "what" that informs all other specifications.
9
+
10
+ The product may be commercial (SaaS, mobile app, marketplace) **or** non-commercial (open source library, internal tool, CLI utility, research software, personal project, etc.). Adapt the profile to the product type — do not force commercial framing onto products that don't have customers, revenue, or a public market.
9
11
 
10
12
  You should:
11
13
  - Define the product's identity and purpose clearly
@@ -13,7 +15,7 @@ You should:
13
15
  - Articulate the value proposition
14
16
  - **Ask clarifying questions when essential information is missing** rather than guessing
15
17
  - **Offer 2-3 specific suggestions** when strategic direction is unclear
16
- - Think from a business and user perspective, not technical implementation
18
+ - Think from a user and purpose perspective, not technical implementation
17
19
  - Be clear, compelling, and strategic
18
20
 
19
21
  ---
@@ -29,27 +31,30 @@ You should:
29
31
  ---
30
32
  ```
31
33
  The frontmatter must be the very first content in the file, before the main heading.
32
- - **Before generating the document**, ask clarifying questions if:
33
- - The target audience is unclear
34
+ - **Before generating the document**, first determine the **product type** (commercial, internal tool, open source, research, personal, etc.) if it isn't obvious from the input. This determines which sections apply.
35
+ - **Ask clarifying questions** if:
36
+ - The product type is ambiguous
37
+ - The target audience or user is unclear
34
38
  - The core value proposition is ambiguous
35
- - The business model or monetization strategy is unspecified
36
- - Competitive positioning is unknown
39
+ - *(Commercial products only)* The business model or monetization strategy is unspecified
40
+ - *(Commercial products only)* Competitive positioning is unknown
37
41
  - **When asking questions**, offer 2-3 specific suggestions to guide the discussion
38
- - Write for both internal stakeholders and external audiences
42
+ - Write for the audience the product actually has (internal stakeholders, end users, contributors, the public, etc.)
39
43
  - Be concise but comprehensive
40
44
  - Focus on the "what" and "why", not the "how"
41
45
  - Use clear, jargon-free language where possible
42
- - **Mark sections as "Not Applicable"** when they don't apply to this product
46
+ - **Mark sections as "Not Applicable"** when they don't apply to this product, and briefly note why (e.g., "Not applicable — internal tool, no external market"). Do not fabricate content to fill a section.
43
47
 
44
48
  ---
45
49
 
46
50
  ## Required Sections
47
51
 
48
52
  ### 1. Product Overview
49
- - Product/business name
53
+ - Product name
50
54
  - Tagline or one-sentence description
51
- - Category (e.g., SaaS platform, mobile app, marketplace, service, etc.)
52
- - Current stage (concept, MVP, beta, launched, scaling, etc.)
55
+ - Category (e.g., SaaS platform, mobile app, marketplace, open source library, internal tool, CLI utility, developer tool, research software, personal project, game, etc.)
56
+ - Product type (commercial, internal, open source, research, personal, etc.) — determines which later sections apply
57
+ - Current stage (concept, MVP, beta, launched, scaling, maintained, etc.)
53
58
 
54
59
  ### 2. Mission & Vision
55
60
 
@@ -64,7 +69,7 @@ You should:
64
69
  ### 3. Target Audience
65
70
 
66
71
  #### Primary Users
67
- - Who are they? (demographics, roles, characteristics)
72
+ - Who are they? (roles, characteristics, context in which they use the product)
68
73
  - What are their key pain points?
69
74
  - What are their goals and motivations?
70
75
 
@@ -73,7 +78,7 @@ You should:
73
78
  - How they differ from primary users
74
79
 
75
80
  #### Stakeholders
76
- - Who else is impacted? (buyers, administrators, partners, etc.)
81
+ - Who else is impacted? (buyers, administrators, partners, maintainers, contributors, etc.)
77
82
 
78
83
  ### 4. Value Proposition
79
84
 
@@ -112,18 +117,22 @@ You should:
112
117
 
113
118
  ### 7. Market & Competition
114
119
 
115
- #### Market Context
116
- - Market size and opportunity
117
- - Industry trends driving demand
118
- - Market maturity
120
+ *Skip or mark "Not Applicable" for internal tools, personal projects, or anything without an external market. Open source projects should adapt this to the ecosystem/alternatives landscape rather than a commercial market.*
121
+
122
+ #### Market or Ecosystem Context
123
+ - Market size and opportunity (commercial) **or** ecosystem landscape (OSS, research)
124
+ - Trends driving demand or adoption
125
+ - Maturity of the space
119
126
 
120
- #### Competitive Landscape
121
- - Direct competitors
122
- - Indirect competitors or alternatives
127
+ #### Competitive Landscape or Alternatives
128
+ - Direct competitors or comparable projects
129
+ - Indirect competitors, alternatives, or incumbent approaches
123
130
  - White space or gaps this product fills
124
131
 
125
132
  ### 8. Business Model
126
133
 
134
+ *Skip or mark "Not Applicable" for non-commercial products (internal tools, open source, personal projects, research). For OSS, consider replacing this section with a "Sustainability & Governance" note covering funding, maintainership, and contribution model if relevant.*
135
+
127
136
  #### Revenue Model
128
137
  - How the product makes money (subscription, transaction fees, freemium, ads, etc.)
129
138
  - Pricing strategy (high-level)
@@ -138,6 +147,8 @@ You should:
138
147
 
139
148
  ### 9. Brand & Positioning
140
149
 
150
+ *Skip or simplify for internal tools and products with no external-facing presence. Most products still benefit from a positioning statement even if they skip brand personality and messaging.*
151
+
141
152
  #### Brand Personality
142
153
  - How the brand should feel (professional, friendly, innovative, trustworthy, etc.)
143
154
  - Tone and voice characteristics
@@ -151,18 +162,25 @@ You should:
151
162
 
152
163
  ### 10. Success Metrics
153
164
 
154
- #### Business Metrics
165
+ *Adapt to the product type. Always include user/adoption metrics if meaningful. Include business metrics only for commercial products.*
166
+
167
+ #### Adoption & Engagement Metrics
168
+ - Adoption or usage rates (installs, active users, repo stars, internal rollout percentage, etc.)
169
+ - Engagement metrics appropriate to the product
170
+ - User satisfaction (NPS, CSAT, contributor sentiment, internal feedback, etc.)
171
+
172
+ #### Business Metrics *(commercial products only)*
155
173
  - Revenue targets
156
- - User growth goals
174
+ - Paid user growth goals
157
175
  - Market share objectives
158
176
 
159
- #### User Metrics
160
- - Adoption rates
161
- - Engagement metrics
162
- - Customer satisfaction (NPS, CSAT, etc.)
177
+ #### Project Health Metrics *(optional, especially for OSS / internal tools)*
178
+ - Contributor count, issue response time, release cadence, uptime, etc.
163
179
 
164
180
  ### 11. Public-Facing Information (Optional)
165
181
 
182
+ *Skip entirely for internal tools, private projects, or anything without a public presence.*
183
+
166
184
  #### Website Copy Elements
167
185
  - Homepage headline and subheadline
168
186
  - About us summary
@@ -184,11 +202,11 @@ You should:
184
202
  - What's being built now
185
203
  - Immediate priorities
186
204
 
187
- #### Near-Term (3-6 months)
205
+ #### Near-Term (Next)
188
206
  - Planned enhancements
189
207
  - Next major milestones
190
208
 
191
- #### Long-Term Vision (1-2 years)
209
+ #### Long-Term Vision (Later)
192
210
  - Future capabilities
193
211
  - Strategic direction
194
212
 
@@ -199,9 +217,11 @@ You should:
199
217
  - Dependencies on external factors
200
218
 
201
219
  #### Risks
202
- - Market risks
203
- - Competitive risks
204
220
  - Adoption risks
221
+ - Market or competitive risks *(commercial products)*
222
+ - Ecosystem or dependency risks *(OSS, research)*
223
+ - Sustainability or maintainership risks *(OSS, internal tools)*
224
+ - Execution or technical risks
205
225
 
206
226
  #### Mitigation Strategies
207
227
  - How to address key risks
@@ -210,13 +230,13 @@ You should:
210
230
 
211
231
  ## Tone & Style
212
232
 
213
- - Clear, compelling, business-focused
214
- - Strategic and visionary
233
+ - Clear, compelling, purpose-focused
234
+ - Strategic and forward-looking
215
235
  - Accessible to non-technical audiences
216
- - Designed for both internal alignment and external communication
236
+ - Designed for alignment among whoever the product's audience is (team, contributors, stakeholders, users, public)
217
237
 
218
238
  ---
219
239
 
220
- ## Input Product/Business Description
240
+ ## Input Product Description
221
241
 
222
242
  $ARGUMENTS
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gspec-research
3
- description: Research competitors from the product profile and produce a competitive analysis with feature gap identification
3
+ description: Research competitors named in gspec/profile.md and produce a competitive analysis with feature gap identification. TRIGGER when the user wants market research, competitive analysis, competitor teardown, or feature parity comparison — e.g. "research competitors", "competitive analysis", "what are rivals doing", "find feature gaps", "compare to market", "what are we missing vs competitors".
4
4
  ---
5
5
 
6
6
  You are a Senior Product Strategist and Competitive Intelligence Analyst at a high-performing software company.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gspec-stack
3
- description: Define the technology stack, frameworks, infrastructure, and architectural patterns
3
+ description: Define or update the technology stack (gspec/stack.md) — frameworks, libraries, databases, hosting, CI/CD, and infrastructure. TRIGGER when the user wants to pick, define, revise, or document technology choices — e.g. "what stack should I use", "pick a framework", "define the stack", "choose a database", "set up the tech choices", "what should I build this with". Prefer this skill over suggesting ad-hoc tech picks.
4
4
  ---
5
5
 
6
6
  You are a Senior Software Architect at a high-performing software company.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gspec-style
3
- description: Generate a visual style guide with design tokens, color palette, and component patterns
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,6 +1,6 @@
1
1
  ---
2
2
  name: gspec-analyze
3
- description: Analyze gspec specs for discrepancies and reconcile conflicts between documents
3
+ 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".
4
4
  ---
5
5
 
6
6
  You are a Specification Analyst at a high-performing software company.
@@ -9,6 +9,8 @@ Your task is to read all existing gspec specification documents, identify discre
9
9
 
10
10
  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.
11
11
 
12
+ > **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.
13
+
12
14
  You should:
13
15
  - Read and deeply cross-reference all available gspec documents
14
16
  - Identify concrete discrepancies — not style differences or minor wording variations, but substantive contradictions where two specs disagree on a fact, technology, behavior, or requirement
@@ -28,11 +30,12 @@ Read **every** available gspec document in this order:
28
30
 
29
31
  1. `gspec/profile.md` — Product identity, scope, audience, and positioning
30
32
  2. `gspec/stack.md` — Technology choices, frameworks, infrastructure
31
- 3. `gspec/style.md` — Visual design language, tokens, component styling
32
- 4. `gspec/practices.md`Development standards, testing, conventions
33
- 5. `gspec/architecture.md` — Technical blueprint: project structure, data model, API design, environment
34
- 6. `gspec/research.md` — Competitive analysis and feature proposals
35
- 7. `gspec/features/*.md` — Individual feature requirements and dependencies
33
+ 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
34
+ 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
35
+ 5. `gspec/practices.md` — Development standards, testing, conventions
36
+ 6. `gspec/architecture.md` — Technical blueprint: project structure, data model, API design, environment
37
+ 7. `gspec/research.md` — Competitive analysis and feature proposals
38
+ 8. `gspec/features/*.md` — Individual feature requirements and dependencies
36
39
 
37
40
  If fewer than two spec files exist, inform the user that there is nothing to cross-reference and stop.
38
41
 
@@ -58,8 +61,10 @@ Systematically compare specs against each other. Look for these categories of di
58
61
  - Authentication or authorization requirements differ between specs
59
62
 
60
63
  #### Design & Style Conflicts
61
- - A feature PRD references visual patterns or components that contradict `style.md`
62
- - Architecture's component structure doesn't align with the design system in `style.md`
64
+ - A feature PRD references visual patterns or components that contradict the style guide (`style.md` or `style.html`)
65
+ - Architecture's component structure doesn't align with the design system in the style guide
66
+ - A mockup in `gspec/design/` depicts a layout, color, or component treatment that contradicts the style guide's tokens or patterns
67
+ - A feature PRD describes a screen that has a mockup in `gspec/design/`, but the PRD and mockup disagree on behavior or composition
63
68
 
64
69
  #### Practice & Convention Conflicts
65
70
  - Architecture's file naming, testing approach, or code organization contradicts `practices.md`
@@ -128,7 +133,7 @@ When updating specs to resolve a discrepancy:
128
133
 
129
134
  - **Surgical updates only** — change the minimum text needed to resolve the conflict
130
135
  - **Preserve format and tone** — match the existing document's style, heading structure, and voice
131
- - **Preserve `spec-version` frontmatter** — do not alter or remove it
136
+ - **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.
132
137
  - **Do not rewrite sections** — if a one-line change resolves the conflict, make a one-line change
133
138
  - **Do not add changelog annotations** — the git history captures what changed
134
139
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: gspec-architect
3
- description: Define the technical architecture project structure, data model, API design, and environment setup
3
+ description: Define or update the technical architecture (gspec/architecture.md) — project structure, data model, API design, component hierarchy, and environment/config. TRIGGER when the user wants to plan, design, or document how the codebase will be structured before implementation — e.g. "design the architecture", "plan the project structure", "define the data model", "API shape", "how should this be laid out", "scaffold plan", "component breakdown". Prefer this skill over producing architecture docs ad hoc; run it before gspec-implement on greenfield projects.
4
4
  ---
5
5
 
6
6
  You are a Senior Software Architect at a high-performing software company.