Documentation
Complete reference for the gspec workflow and all 12 commands.
Workflow Overview
gspec organizes product specification into a structured workflow. Each stage builds on the previous, giving your AI coding tools progressively deeper context.
Only Define and Build are required. The four Define commands (profile, style, stack, practices) establish your product foundation. The implement command reads all specs and builds software. Everything in between adds optional depth — use what your project needs.
Most specs are Markdown files stored in a gspec/ directory in your repository. The style guide can alternatively be a self-contained HTML design system (style.html) that renders tokens and component previews directly in a browser — useful for design-aware AI tools. An optional gspec/design/ folder holds mockups (HTML, SVG, PNG, JPG) exported from external design tools; the implement command reads them as authoritative visual guidance. All files are version-controlled, human-readable, and automatically kept in sync through gspec's spec-sync system.
Save & Restore
Once you've built specs you're happy with, save them to ~/.gspec/ for reuse across projects. Bundle multiple specs into playbooks for one-command project setup.
Save a spec
Run gspec save to save any spec from your current project. You give it a name and optional description, and it's stored in ~/.gspec/ organized by type (profiles, stacks, styles, practices, features).
Restore a spec
Run gspec restore to interactively pick a saved spec, or pass the path directly: gspec restore stacks/my-stack. The spec is copied into your project's gspec/ directory.
Playbooks
Run gspec playbook to bundle multiple saved specs — profile, stack, practices, style, and features — into a single restorable package. Restore an entire playbook with gspec restore playbook/my-starter.
Install flow
When you run npx gspec in a new project, the installer checks ~/.gspec/ for saved specs. If playbooks exist, you're offered them first. Otherwise, you can pick individual specs from each category. If ~/.gspec/ is empty, the installer skips straight to post-install guidance.
See the full save & restore documentation for detailed examples.
Extensions
Extensions are user-authored skills that install alongside the built-in gspec commands. They live in ~/.gspec/extensions/ as Markdown files with frontmatter, and are auto-installed into every project the next time you run npx gspec.
An extension is a complete skill — same shape as anything in gspec's own commands/ folder. Use them for organization-specific or project-class-specific commands you want available everywhere without forking gspec or copy-pasting into each project.
Authoring
Write an extension as a Markdown file with two required frontmatter fields:
---
name: my-deploy
description: Trigger and manage deploy workflows. Run after tests pass.
---
You are a Deployment Engineer.
... rest of the skill body ...
The name must be lowercase letters, digits, and hyphens, and must not collide with a built-in gspec-* skill. Names like my-deploy, release-notes, or jira-sync are fine; gspec-implement is rejected.
Manage extensions
gspec extension save ./my-deploy.md # Install into ~/.gspec/extensions/
gspec extension list # See what's installed
gspec extension remove my-deploy # Delete from ~/.gspec/extensions/
Removing an extension only deletes it from ~/.gspec/extensions/ — already-emitted copies in projects (under .claude/skills/, .cursor/commands/, etc.) stay in place. Delete them per-project if desired.
Install behavior
When you run npx gspec in a project, the installer first copies the built-in skills, then scans ~/.gspec/extensions/ and emits each valid extension into the same install directory using the same per-platform formatting as core skills. Invalid extensions (missing frontmatter, name collisions, malformed names) are skipped with a warning. Two extensions claiming the same name resolve last-write-wins, also with a warning.
profile Business Strategist
What it does
Defines what your product is, who it serves, and why it exists. This is the foundational spec that all other commands reference — it establishes product identity, target audience, value proposition, and market positioning.
What it produces
A comprehensive product profile saved to gspec/profile.md. Includes product overview, target audience with pain points, value proposition, use cases, competitive landscape, and key messaging.
Example invocation
/profile Key questions
The command guides you through a conversation covering:
- Product name, tagline, and category
- Target audience and their pain points
- Core value proposition and differentiation
- Key use cases and scenarios
- Market context and competitive landscape
Best practices
- Run this first — it's the foundation everything else builds on
- Be specific about your target audience; vague audiences produce vague specs
- Include real pain points you've observed, not hypothetical ones
- Keep the tagline under 10 words and the elevator pitch under 2 sentences
Common pitfalls
- Skipping the profile and jumping to style or stack — downstream specs lack context
- Being too broad with the target audience ("all developers" tells the AI nothing)
- Filling in aspirational features as if they exist today
Related commands
style UI Designer
What it does
Generates a visual design system with colors, typography, spacing, component patterns, and design tokens. Adopts the perspective of a UI Designer to create a cohesive visual language for your product. Supports two output formats: a renderable HTML design system (style.html) — a single self-contained file with live swatches, type specimens, and styled component previews, readable by design-aware AI tools — or a Markdown style guide (style.md). Either format is valid; gspec consumers read whichever is present. A complementary gspec/design/ folder can hold mockups (HTML, SVG, PNG, JPG) from external design tools like Figma, v0, or Framer AI, which the implement command reads as authoritative visual guidance.
What it produces
A single style guide saved as gspec/style.html (recommended — a renderable HTML design system with design tokens as CSS variables, color swatches, typography specimens, and live styled component examples for light and dark mode) or gspec/style.md (a Markdown style guide with the same structured content as prose). In both formats: color palette with hex/RGB/HSL values, typography scale, spacing system, component specifications (buttons, cards, forms), theme tokens for dark/light mode, and accessibility guidelines.
Example invocation
/style Key questions
The command guides you through a conversation covering:
- Preferred output format (HTML renderable design system or Markdown style guide)
- Design vision and visual personality (minimal, bold, playful, etc.)
- Target platforms (web, mobile, desktop)
- Brand colors or color preferences
- Typography preferences
- Dark mode, light mode, or both
Best practices
- Run profile first so the style command can align design with brand personality
- Provide a clear visual personality direction — "clean and minimal" produces better results than "nice"
- Review the generated color palette for accessibility compliance (WCAG AA contrast ratios)
- Prefer style.html when your workflow includes design-aware AI tools — they can render and reason about it directly
- Drop mockups from external design tools into gspec/design/ so /gspec-implement can match their layouts
- The style guide is consumed by implement — keep it structured and specific
Common pitfalls
- Generating a style guide without a profile — the design won't reflect your product's personality
- Maintaining both style.html and style.md for the same project — pick one as the source of truth
- Over-specifying in the conversation and constraining the Designer role too much
- Ignoring accessibility requirements in the output — check contrast ratios
Related commands
stack Solutions Architect
What it does
Defines your technology choices — frameworks, languages, runtime, database, hosting, and key libraries. Documents every decision with rationale so your AI tools make consistent technology choices.
What it produces
A technology stack definition saved to gspec/stack.md. Includes core languages, runtime environment, frontend and backend frameworks, database, hosting, CI/CD, package management, and technology-specific practices.
Example invocation
/stack Key questions
The command guides you through a conversation covering:
- Programming languages and runtime environment
- Frontend framework and styling approach
- Backend framework and API style
- Database and data storage
- Hosting, deployment, and CI/CD
- Key libraries and third-party integrations
Best practices
- Run profile first — the stack should match your audience and scale requirements
- Document the "why" behind each technology choice, not just the "what"
- Include version constraints (e.g., "Node 20 LTS") to prevent AI tools from using incompatible versions
- Note anti-patterns specific to your stack (e.g., "Don't use CSS-in-JS alongside Tailwind")
Common pitfalls
- Listing technologies without rationale — the AI can't make good tradeoff decisions without context
- Forgetting to specify development tools (linters, formatters) that affect code style
- Not mentioning infrastructure constraints that impact architecture decisions
Related commands
practices Engineering Lead
What it does
Establishes development standards — testing conventions, code quality rules, git workflow, error handling, documentation requirements, and your definition of done. Ensures your AI produces code that meets your team's standards.
What it produces
A development practices guide saved to gspec/practices.md. Includes testing standards (unit, E2E, when to write tests), code quality rules, naming conventions, git practices, error handling patterns, security practices, and definition of done.
Example invocation
/practices Key questions
The command guides you through a conversation covering:
- Team size and collaboration model
- Testing philosophy and frameworks
- Code review process and standards
- Git branching strategy and commit conventions
- Error handling and logging patterns
- Security practices and vulnerability prevention
Best practices
- Be specific about testing expectations — "test important logic" is less useful than "unit test all non-trivial functions, E2E for critical user flows"
- Include naming conventions for files, variables, and functions
- Document your definition of done as a checklist the AI can reference
- Mention what NOT to test — this prevents the AI from over-testing trivial code
Common pitfalls
- Writing aspirational practices that your team doesn't actually follow
- Being too vague — "write good tests" gives the AI no guidance
- Forgetting to mention your error handling philosophy (fail fast vs. graceful degradation)
Related commands
research Market Analyst
What it does
Analyzes competitors based on your product profile and produces a competitive analysis with feature matrix, strengths/weaknesses, and gap identification. Helps you understand the landscape before committing to features.
What it produces
A competitive analysis saved to gspec/research.md. Includes competitor profiles, feature comparison matrix, strengths/weaknesses analysis, market gaps, and strategic recommendations.
Example invocation
/research Key questions
The command guides you through a conversation covering:
- Known competitors or similar products
- Specific areas to investigate (features, pricing, market positioning)
- Your product's intended differentiation
Best practices
- Run profile first — research uses your product identity to identify relevant competitors
- Name specific competitors if you know them; the AI will also discover others
- Focus the research on your product's differentiating areas, not every possible feature
- Use research findings to inform feature prioritization
Common pitfalls
- Running research without a profile — the AI doesn't know what market you're in
- Taking the competitive analysis as exhaustive truth — verify key claims
- Feature-stuffing your roadmap based on what competitors have rather than what your audience needs
Related commands
feature Product Manager
What it does
Writes one or more product requirements documents (PRDs) for features. Handles both single features and larger bodies of work — if the scope is large enough, it proposes a multi-feature breakdown for your approval before generating individual PRDs.
What it produces
One or more feature PRDs saved to gspec/features/<feature-name>.md. Each includes overview, user stories, scope (in/out/deferred), prioritized capabilities with acceptance criteria, dependencies, assumptions and risks, and success metrics.
Example invocation
/feature "Task board with drag-and-drop columns" Key questions
The command guides you through a conversation covering:
- Feature description and user need it addresses
- Target users and their workflows
- Scope boundaries — what's in and what's explicitly out
- For large requests: how to decompose into independent features
- Edge cases and error scenarios
- Dependencies on other features or systems
Best practices
- Describe the user need, not the solution — let the Product Manager role shape the requirements
- Be explicit about scope boundaries to prevent feature creep
- P0 capabilities should be the minimum for the feature to be useful
- For large initiatives, review the proposed feature breakdown before the PRDs are generated
Common pitfalls
- Describing implementation details instead of user needs in the feature description
- Making everything P0 — if everything is critical, nothing is prioritized
- Over-decomposing small work into multiple features — only split when sub-features deliver independent user value
Related commands
architect Technical Architect
What it does
Designs the technical architecture — project structure, data model, API design, component architecture, and environment configuration. Reads your stack, practices, and feature PRDs to produce a comprehensive blueprint.
What it produces
A technical architecture document saved to gspec/architecture.md. Includes project structure with directory layout, data model, API design, component architecture, environment configuration, CI/CD setup, and a technical gap analysis.
Example invocation
/architect Key questions
The command guides you through a conversation covering:
- Architectural patterns and preferences
- Data model requirements
- API style and endpoint structure
- Component organization and relationships
- Deployment and environment concerns
Best practices
- Run after defining features — the architect needs requirements to design against
- Run after stack — the architect needs technology constraints
- Review the gap analysis section carefully — it identifies contradictions between specs
- The architecture document is the most influential spec for implement — invest time reviewing it
Common pitfalls
- Running architect before feature PRDs exist — produces a generic architecture
- Skipping the gap analysis review — contradictions between specs cause confused implementation
- Over-constraining the architecture for a simple project — not every project needs a detailed data model
Related commands
-
stack— Architect reads stack for technology constraints and patterns -
feature— Architect reads feature PRDs to design the technical structure -
analyze— Run analyze after architect to catch cross-spec contradictions -
implement— Implement reads architecture for project structure, data model, and APIs
plan Engineering Lead
What it does
Decomposes a feature PRD into an ordered, dependency-aware plan with explicit parallel-execution markers. Sits between feature (the 'what') and implement (the 'how'). Reads the PRD plus the architecture and stack for ordering signals, then proposes 1–N concrete tasks per capability with stable IDs, deps lines, and [P] markers for tasks that are safe to run in parallel. When a plan file exists, implement skips its own plan-mode step and executes the plan directly.
What it produces
A sibling file at gspec/features/<feature>.plan.md with YAML frontmatter linking it back to the PRD, plus a single ## Plan section containing ordered, checkboxed tasks. Each task carries a priority (P0/P1/P2), an optional [P] marker, a deps: line listing prerequisite task IDs, and a covers: line quoting the PRD capability text the task contributes to.
Example invocation
/plan "home-page" Key questions
The command guides you through a conversation covering:
- Which feature PRD to decompose (if multiple PRDs exist)
- Whether to regenerate from scratch or extend an existing plan file
Best practices
- Run after feature (and after architect when it exists) so technical context informs the decomposition
- Skip for trivial features — implement's checkbox-driven planning is enough when there's nothing to parallelize and nothing depends on anything
- Keep tasks small enough that a single implementation pass can finish and verify each one
- Prefer to leave [P] off when in doubt — false parallelism causes more pain than missed parallelism
Common pitfalls
- Marking [P] on tasks that write to the same file as a sibling — one will overwrite the other
- Renumbering existing task IDs on regenerate — IDs are stable, append new ones at the next free number
- Inventing acceptance criteria for an underspecified PRD — fix the PRD with /feature first instead
- Treating the plan file as a rewrite of the PRD — capabilities stay in the PRD, execution stays in the plan
Related commands
-
feature— Plan decomposes the PRD that feature produced — every task line traces back to a capability via covers: -
architect— Plan reads architecture for ordering signals (e.g., schema before API, API before UI) -
implement— When a plan file exists for every in-scope feature, implement skips plan mode and executes the plan directly — respecting deps and [P] markers — updating task checkboxes as work completes -
analyze— Analyze validates that every PRD capability is covered by at least one task and that no task references a missing capability
analyze Quality Analyst
What it does
Cross-references gspec documents and identifies discrepancies. Has two modes. (1) All-specs (no argument): scans every spec for contradictions across the full set — stack vs architecture, PRD vs architecture, plan vs PRD, etc. (2) Scoped (pass a feature slug): narrows to one feature's PRD and plan plus the foundation specs, then adds an Ambiguity & Underspecification sweep against the PRD itself, catching missing acceptance criteria, vague verbs, undefined nouns, implicit assumptions, missing edge cases, and unmeasurable success metrics. Findings are presented one at a time with resolution options; the user decides each individually.
What it produces
A list of findings — contradictions, or in scoped mode also ambiguity questions — each presented with the conflicting evidence (or, for ambiguity, the unclear text and a specific question). With your per-finding approval, affected spec files are updated in place. At the end, a summary of resolved, deferred, and skipped findings.
Example invocation
/analyze
# or, scoped to one feature:
/analyze user-authentication Key questions
The command guides you through a conversation covering:
- Optional feature slug — when present, scope to that feature and run the ambiguity sweep; when absent, scan all specs for cross-spec conflicts
- For each finding, whether to update the spec, mark it as a Deferred Decision, or skip
Best practices
- Run all-specs analyze after architect and before implement for the most comprehensive sweep
- Run scoped analyze on each feature PRD before /plan (or before /implement when skipping plan) to catch ambiguity early
- Use scoped mode on aged or imported PRDs that may have accumulated implicit assumptions
- Review findings and accept or reject each recommendation — do not blindly apply all
- Re-run after significant edits to the targeted feature or to any foundation spec
Common pitfalls
- Running all-specs analyze with only one or two specs — it needs multiple specs to find cross-references
- Passing a feature slug that does not match a file in gspec/features/ — analyze will stop and ask you to pick from the available slugs rather than silently fall back
- Skipping the ambiguity sweep on aged PRDs and trusting old documents that no longer reflect implicit team knowledge
- Treating ambiguity questions as errors — they are deliberate prompts; the answer can be "mark this as a Deferred Decision" rather than resolving inline
Related commands
-
feature— Generation-time clarification in /feature catches ambiguity before the PRD is saved; scoped /analyze catches what slipped through or accumulated later -
plan— Run scoped /analyze on a PRD before /plan so the plan is built from a clean spec -
architect— All-specs /analyze catches contradictions between architecture and other specs -
implement— Run /analyze before /implement to ensure specs are consistent and unambiguous -
audit— Analyze compares specs to other specs; audit compares specs to the codebase
audit Specification Auditor
What it does
Reads the specs and inspects the actual codebase, then surfaces drift between what the specs say and what the code does — mismatched dependencies, undocumented routes, stale data models, design tokens that don't match the stylesheet, capability checkboxes that don't reflect reality. Walks you through each discrepancy and — with your approval — updates the specs to match reality. Distinct from analyze, which compares specs against each other rather than against the codebase. Complements always-on spec-sync (which catches drift as code changes happen) by sweeping for accumulated drift that slipped through.
What it produces
A list of findings where each drift is cited with the exact spec statement and the matching evidence in code. With your per-finding approval, affected spec files are updated in place. At the end, a summary of updates made, items deferred, and a code-follow-up list for any drift the user chose to fix in the code rather than the spec.
Example invocation
/audit Key questions
The command guides you through a conversation covering:
- Optional scope hint (e.g., "just audit the stack", "audit the features/ folder") — without a hint, audit sweeps all specs
- Whether to update specs to match code, leave specs alone (and flag code for fix), or defer on a per-finding basis
Best practices
- Run audit before shipping a major release or before handing the project to a new contributor
- Run audit after a long sprint where spec-sync may have missed changes (e.g., rapid iterative sessions)
- Pass a scope hint for large codebases — audit one domain at a time (stack, then architecture, then features)
- Use the code-follow-up list from audit as input for the next /implement run
- Treat profile drift conservatively — the profile is often aspirational, not descriptive
Common pitfalls
- Running audit on a brand-new project with no code — there's nothing to compare specs against
- Blindly choosing "update spec to match code" for every finding — some drift means the code is wrong, not the spec
- Using audit as a substitute for /implement — audit never modifies code
- Auditing a massive codebase in one pass — prefer scoped sweeps for comprehension
Related commands
implement Senior Developer
What it does
Reads all existing gspec documents and implements your software with full project context. Synthesizes profile, style (style.md or style.html), stack, practices, architecture, and feature PRDs, plus any mockups in gspec/design/, to produce code that matches your specifications. When design mockups are present, implement matches their layout and visual hierarchy within the style guide's token constraints.
What it produces
Working code committed to your repository. Updates feature PRD capability checkboxes from [ ] to [x] as each capability is implemented. Produces code that follows your stack, practices, and style specifications.
Example invocation
/implement Key questions
The command guides you through a conversation covering:
- Which feature(s) to implement (if multiple exist)
- Any additional context or constraints for this implementation session
Best practices
- At minimum, have the four Define specs (profile, style, stack, practices) before running implement
- Feature PRDs give the best results — implement works from prioritized capabilities, not vague descriptions
- Run implement incrementally — one feature at a time, reviewing output between runs
- Check the capability checkboxes in your feature PRD to track progress
- If output quality is low, the issue is usually in the specs — improve your specs, not your prompts
Common pitfalls
- Running implement with no specs — produces generic code with no project context
- Implementing everything at once instead of one feature at a time
- Not reviewing the generated code — implement is a tool, not an autopilot
- Blaming implement for poor output when the real issue is vague or contradictory specs
Related commands
-
profile— Implement reads profile for product context and audience -
style— Implement reads the style guide (style.md or style.html) plus any gspec/design/ mockups for all visual and UI decisions -
stack— Implement reads stack for technology choices and patterns -
practices— Implement reads practices for code quality and testing standards -
feature— Implement builds against feature PRD capabilities -
architect— Implement reads architecture for project structure and data model