Examine GitHub Spec Kit workflows and optional commands
GitHub Spec Kit is an open-source toolkit that enables spec-driven development (SDD) by integrating specifications with AI coding assistants. Before exploring advanced features, let's review the foundational concepts.
Review GitHub Spec Kit basics
GitHub Spec Kit addresses a fundamental challenge in AI-assisted development: maintaining context and consistency across multiple interactions with coding assistants. It provides three essential capabilities:
- Persistent artifacts: Specifications, plans, and tasks are stored as markdown files in your repository.
- Standardized workflow: A defined process guides you through the four SDD phases: specification, planning, task breakdown, and implementation.
- Reusable commands: Built-in slash commands encapsulate best-practice prompting patterns.
Core components
GitHub Spec Kit implements the following core components:
| Component | Purpose |
|---|---|
specify CLI |
Initializes and manages spec-driven projects. |
| Markdown artifact files | constitution.md, spec.md, plan.md, tasks.md drive development. |
| Slash commands | /speckit.specify, /speckit.plan, /speckit.tasks, /speckit.implement invoke GitHub Spec Kit workflows. |
AI agents
GitHub Spec Kit supports the following AI agents: GitHub Copilot, Claude Code, Cursor, Windsurf, Amazon Q Developer, and others. Each agent receives templates formatted for its specific prompt format while using the same underlying artifact files.
Environment variables for feature tracking
GitHub Spec Kit uses environment variables to track which feature you're currently developing. The SPECIFY_FEATURE variable indicates the active feature directory.
In Git-based workflows, GitHub Spec Kit infers the feature from your branch name. If you're on branch feature/document-upload, GitHub Spec Kit automatically works with the features/document-upload/ directory.
For non-Git workflows or manual feature specification, set the environment variable explicitly:
$env:SPECIFY_FEATURE = "001-document-upload"
This setting tells GitHub Spec Kit to read and write artifacts in the features/001-document-upload/ directory regardless of Git branch.
This feature tracking ensures that when you invoke /speckit.plan, the AI reads the correct spec.md file for your current feature rather than mixing specifications from different features.
Integrate GitHub Spec Kit with Git workflows
GitHub Spec Kit integrates into your existing development practices through several mechanisms.
Version control integration
All GitHub Spec Kit artifacts are plain markdown files stored in your Git repository. This approach provides several advantages:
Change tracking: Every modification to specifications, plans, or tasks creates a Git commit. You can review the history of requirement changes, understand why decisions were made, and revert problematic changes.
Branch-based development: Create feature branches that contain both specification artifacts and implementation code. This approach keeps requirements and implementation synchronized and makes code review comprehensive—reviewers see both what you're building (spec) and how you built it (code).
Pull request workflows: When you submit a pull request for a feature, include spec.md, plan.md, and tasks.md alongside code changes. Reviewers verify that implementation matches specifications and that specifications align with project goals.
For example, if you're implementing a new feature, your feature branch contains:
spec.mddefining upload requirements.plan.mddescribing Azure Blob Storage architecture.tasks.mdlisting implementation steps.- Source code implementing the feature.
- Tests verifying specification compliance.
This complete picture enables thorough review. If a reviewer questions why files are limited to 50 MB, they can reference spec.md and see that this requirement came from stakeholder discussions.
AI assistant integration scenario - GitHub Copilot
GitHub Spec Kit works with GitHub Copilot through Visual Studio Code's chat interface. After you run specify init --ai copilot, the toolkit configures your workspace to recognize /speckit.* commands.
When you open GitHub Copilot Chat and type /speckit.specify, GitHub Copilot accesses predefined templates from the .github/prompts/ directory. These templates help to structure the AI's output to include all necessary specification sections: user stories, acceptance criteria, functional requirements, nonfunctional requirements, and edge cases.
The integration is seamless—you don't manage templates manually. GitHub Spec Kit handles template loading and context injection automatically. Your job is to provide feature descriptions and answer clarifying questions. GitHub Copilot handles specification formatting and completeness.
Project structure conventions
GitHub Spec Kit organizes artifacts using consistent directory structure:
my-project/
├── .github/
│ ├── agents/
│ └── prompts/
├── .specify/
│ ├── memory/
│ │ └── constitution.md
│ ├── scripts/
│ └── templates/
├── SourceCode/
│ └── ...
├── specs/
│ └── 001-document-upload-feature/
│ ├── plan.md
│ ├── spec.md
│ └── tasks.md
This structure separates specification artifacts from implementation code while keeping them in the same repository. Features are numbered sequentially (001, 002, 003) to track development order.
For teams working on multiple features concurrently, each feature has its own directory containing its complete specification, plan, and tasks. This isolation prevents confusion and enables parallel work without conflicts.
Continuous workflow support
GitHub Spec Kit supports iterative development through command chaining. After generating initial specifications, you can refine them progressively:
- Generate initial spec:
/speckit.specify. - Identify gaps:
/speckit.clarify. - Update spec based on answers.
- Create implementation plan:
/speckit.plan. - Verify consistency:
/speckit.analyze. - Generate tasks:
/speckit.tasks. - Implement incrementally:
/speckit.implement.
At any point, if requirements change, you can return to earlier phases, update artifacts, and regenerate downstream artifacts. If a stakeholder changes their mind about file size limits after you generate tasks, you update spec.md, regenerate plan.md to reflect architectural implications, regenerate tasks.md with updated validation steps, then update implementation code.
This flexibility supports real-world development where requirements evolve. The specification-first approach ensures changes propagate systematically rather than being patched into code without updating documentation.
Leverage GitHub Spec Kit's optional enhancement commands
Beyond the core workflow commands, GitHub Spec Kit provides optional commands that enhance specification quality and consistency.
Use /speckit.clarify for gap analysis
The /speckit.clarify command analyzes your specification to identify ambiguities, missing details, and underspecified edge cases. After generating an initial spec, invoke this command to have the AI ask clarifying questions.
The AI reviews your spec and generates questions like:
- "The spec mentions file upload but doesn't specify maximum concurrent uploads. Should there be a limit?"
- "Error handling for network failures isn't specified. What should happen if upload connection is lost?"
- "The spec requires file validation but doesn't specify validation failure messages. What should users see?"
For each question, the AI often provides multiple-choice options for how to address the gap. You select an option or provide a custom answer, and the AI updates the specification accordingly.
This interactive refinement catches issues before implementation begins. It's like having an experienced analyst review your spec and point out what you missed.
Use /speckit.analyze for consistency verification
The /speckit.analyze command performs cross-artifact consistency checking. It verifies that your plan implements all specification requirements, that tasks cover all plan elements, and that everything aligns with the constitution.
Run this command after generating plan.md and tasks.md but before starting implementation. The AI identifies inconsistencies:
- "Plan proposes using PostgreSQL, but constitution requires Azure SQL Database."
- "Specification requires audit logging, but plan doesn't describe logging implementation."
- "Task list omits database migration scripts mentioned in plan."
Each identified inconsistency is an issue that would surface during implementation or code review. Catching them during analysis phase prevents rework.
Use /speckit.checklist for quality validation
The /speckit.checklist command generates custom quality checklists based on your specification. These checklists help verify requirement completeness, clarity, and consistency—like "unit tests for English prose."
The AI analyzes your spec and produces a checklist of verification questions:
- "Does every user story have corresponding acceptance criteria?"
- "Are all error scenarios documented with specific error messages?"
- "Do nonfunctional requirements include measurable success criteria?"
- "Are all external dependencies explicitly listed?"
You work through the checklist, answering each question. Any "no" answers indicate specification gaps that you need to address.
This self-review process improves specification quality before sharing with stakeholders or proceeding to implementation.
Apply GitHub Spec Kit to different development scenarios
GitHub Spec Kit supports various development scenarios beyond building new features from scratch.
Greenfield development
For new projects starting from nothing, GitHub Spec Kit excels at transforming high-level product vision into concrete implementation. You begin with /speckit.constitution to establish project principles, then use /speckit.specify for each feature as you build the application iteratively.
This scenario is GitHub Spec Kit's primary use case—the workflow was designed for 0-to-1 development where you're creating something that doesn't exist yet.
Brownfield enhancement
For existing applications, you can use GitHub Spec Kit to add new features while maintaining consistency with existing codebase. Your constitution documents existing architectural patterns and constraints. New feature specifications reference these established patterns.
When you're adding the document upload feature to an existing employee portal, your specification acknowledges the existing React front end, .NET back end, and Azure infrastructure. The plan shows how the new feature integrates with current architecture rather than proposing a separate implementation.
Refactoring and modernization
GitHub Spec Kit can guide refactoring efforts by treating the desired end state as a specification. You document what the refactored code should achieve (same functionality with improved structure), create a plan for the refactoring approach, and generate tasks for incremental changes.
This structured approach to refactoring prevents the common problem of starting refactoring and getting lost mid-process with partially working code.
Exploratory development
For situations where you're exploring multiple potential approaches, use GitHub Spec Kit to generate multiple plans from the same specification. The stable specification represents what you want to achieve, while different plans explore different technical approaches.
You might generate one plan using Azure Blob Storage and another using Azure Files, both from the same upload specification. Implement both, compare results, and choose the better approach based on actual experience rather than assumptions.
Summary
The GitHub Spec Kit is a powerful toolkit that enables spec-driven development by integrating structured workflows, persistent artifacts, and reusable AI command patterns. It transforms how you work with AI coding assistants like GitHub Copilot by providing a systematic approach to turning specifications into working implementations. By using GitHub Spec Kit, you can ensure alignment between requirements and code, maintain traceability of decisions, and enhance collaboration across development teams.