AI Engineering

GitHub Spec Kit Tutorial: Complete Guide from Installation to Implementation

A hands-on walkthrough of GitHub Spec Kit — installation, slash commands, project structure, and building a food delivery platform with Spec-Driven Development.

Abhishek Das11 min read
Spec KitGitHub Spec KitSpec-Driven DevelopmentCursor AIClaude Code

In Spec-Driven Development Explained, I covered why AI coding needs structured specifications—not just longer prompts. For the planning mindset behind that workflow, read Before You Build an AI-Powered Application first. Today, we are getting hands-on.

From my observations working with various AI coding tools, Spec Kit is currently the most robust framework for orchestrating AI development. It centers around a series of slash commands that progressively refine a feature from an idea into working, bug-free code.

Here is my complete, practical guide to installing, configuring, and building software with GitHub Spec Kit.


What is Spec Kit?

Spec Kit is a Spec-Driven Development (SDD) workflow designed to sit on top of AI coding agents like Claude Code, Codex CLI, Copilot, Gemini CLI, Cursor, and Windsurf. By enforcing a step-by-step process—Specification, Planning, Task Breakdown, and Implementation—it ensures your AI stays on track, maintains context, and writes better code.


Installation and Initialization

Installing Spec Kit is straightforward. Depending on your package manager, you can initialize it directly in your project root.

# Using uvx
uvx specify init my-project

# Or using specify directly
specify init my-project

During initialization, Spec Kit will ask you to select your preferred AI integration (e.g., Codex or Copilot). This ensures the correct command files and configurations are generated for your specific agent.

Understanding the Project Structure

Once initialized, you will notice a new .specify/ directory in your project. Here is what it contains:

  • .specify/templates/: Contains the markdown templates that guide the AI's outputs for plans, tasks, and specs. You can customize these using presets and extensions.
  • .specify/memory/: The "brain" of the project where past decisions and context are stored.
  • .specify/scripts/: Executable scripts that power the slash commands.
  • .specify/specs/: Where your actual generated Markdown specifications will live.

The Spec Kit Command Workflow

The magic of Spec Kit lies in its slash commands. You must run these in order to build the perfect context for your AI.

1. /speckit.constitution

This command establishes your project's foundational principles. It acts as the governing guidance for all later stages.

Example output:

Always use TypeScript with strict mode enabled. Write unit tests for all business logic. Accessibility (a11y) is a primary requirement, not an afterthought. Performance matters: minimize third-party dependencies.

2. /speckit.specify

This creates your requirements.md file. It turns your rough idea into concrete user stories, acceptance criteria, and edge cases.

3. /speckit.clarify

This is arguably the most important step. Instead of assuming what you want, the AI pauses and asks you questions about the specification.

Example AI questions:

"Should user login support OAuth (Google/GitHub) or just email/password?" "Do users need to verify their email before ordering?" "Do we allow guest checkout?"

4. /speckit.plan

Once clarified, this command generates plan.md. This file locks in the architecture, libraries, folder structure, database schemas, API routes, and tech stack.

This creates a quality assurance checklist before any code is written, ensuring security and performance standards are met.

6. /speckit.tasks

This translates the plan into a highly structured tasks.md file. Instead of telling the AI to "Build the app," you get a prioritized list. Spec Kit orders tasks, tracks dependencies, marks parallelizable work, and can include test-first tasks.

Task 1: Create database schema (Users, Orders, Items). Task 2: Implement JWT Authentication. Task 3: Build backend REST API. Task 4: Develop frontend UI components. Task 5: End-to-end testing.

7. /speckit.analyze (Optional)

This command acts as an auditor. It checks your generated specs against your plan and tasks to look for missing requirements, conflicting architectural choices, or gaps in test coverage.

8. /speckit.implement

Finally, the AI writes the code. Because it is armed with a constitution, clarified requirements, a solid plan, and step-by-step tasks, the implementation phase is incredibly smooth and remarkably bug-free.


Full Walkthrough: Building a Food Delivery Platform

Let's see it in action. You want to build a food delivery app.

Without Spec Kit:

Prompt → Prompt → Prompt → Fix Bugs → Prompt → Refactor → Lost Context / Spaghetti Code.

With Spec Kit:

  1. You run /speckit.specify Build a food delivery platform targeting local universities.
  2. Spec Kit generates spec.md with user personas (Students, Drivers, Restaurants).
  3. You run /speckit.clarify. The AI asks: "Do we need real-time GPS tracking for drivers?" You answer yes.
  4. You run /speckit.plan. It outputs plan.md, deciding on WebSockets for real-time tracking and PostgreSQL for relational data.
  5. You run /speckit.tasks. It generates tasks.md, isolating the WebSocket server setup as Task 3.
  6. You run /speckit.implement.

The AI implements exactly what was agreed upon, step-by-step.


Advanced Spec Kit Features

As you get comfortable with the basics, Spec Kit offers advanced features for professional teams:

  • Agent Compatibility: Whether you use the CLI-based Claude Code, the IDE-integrated Cursor, or Gemini CLI, Spec Kit's markdown artifacts are universally readable by any agent with workspace context.
  • Git Branch Tracking: Spec Kit intelligently uses Git branches to track feature specifications. You can draft a feature spec on a new branch, get it reviewed by human peers, and only merge it to main when the team agrees on the architecture.
  • Custom Templates: You can customize the .specify/templates/ to enforce your company's specific compliance frameworks (like SOC2 or HIPAA) right into the AI's planning stage.

Spec Kit turns AI from a chaotic code-generator into a disciplined software engineer. By forcing the AI to think before it types, you save time, money, and your own sanity.

It's the same discipline behind the production systems I've built — explicit contracts before code, whether the plan comes from Spec Kit or a client conversation.

Continue reading


Credits & Further Reading: This workflow methodology and toolset is based on the official documentation provided by GitHub Spec Kit. For the most up-to-date installation instructions and advanced configurations, visit the official docs at github.github.io/spec-kit.