Getting Started
This guide will help you set up LeanSpec and adopt the SDD workflow for your project. It takes about 5 minutes.
- Node.js: Version 20 or higher. Download from nodejs.org.
- AI Coding Tool: Set up your preferred tool (e.g., VS Code GitHub Copilot, Claude Code, etc.)
Installation
Install LeanSpec globally using npm:
npm install -g lean-spec
This makes the lean-spec command available system-wide.
Initialize Your Project
Navigate to your project directory and run:
lean-spec init -y
After initialization, your project will have:
your-project/
├── .lean-spec/ # LeanSpec configuration
├── specs/ # All your specs live here
├── AGENTS.md # System prompts for AI agents
└── ... (your project files)
Create Your First Spec
In your AI tool, prompt:
Create a new spec for the feature "my-feature" following these requirements:
- [Requirement 1]
- [Requirement 2]
- ...
Or simply:
Create a new spec for "my-feature".
The AI will use the CLI or MCP (if configured) to create and populate the spec.
This creates:
specs/001-my-feature/folder (flat structure with sequential numbering)README.mdwith template content and frontmatter metadata- Spec details filled out by AI (no manual editing needed)
The spec content looks like this:
---
status: planned
created: '2025-11-02'
priority: medium
---
# My Feature
> **Status**: 📅 Planned · **Priority**: Medium · **Created**: 2025-11-02
(... spec details filled out by AI ...)
Implement the Spec
Once the spec is created, review it and implement the feature according to the spec details.
In your AI tool, ask:
Implement the feature "my-feature".
Or simply:
Implement spec 1.
The AI will read the spec and start implementing based on the requirements.
In a typical agentic workflow, the AI will:
- Read the spec details
- Analyze the codebase
- Generate code changes to implement the feature
- Summarize changes and document progress in the spec
While not required, we strongly recommend using advanced LLMs like Claude Sonnet 4.5, GPT-5.1, or Gemini 3 for the best results with LeanSpec.
After Implementation
Once the AI completes implementation, you can:
- Review: Review the progress (reported by AI) and test the feature
- Continue: If incomplete, start a new chat session and ask the AI to continue
- Feedback: If unsatisfied with the implementation, provide feedback to the AI for improvements
What's Next?
Now that you have LeanSpec set up, you can:
Try the Tutorials:
- Your First Feature with AI - Build a complete feature (10 min)
- Managing Multiple Features - Work with related specs (15 min)
- Refactoring with Specs - Document architectural changes (15 min)
Learn the Fundamentals:
- Spec Concept - Essential SDD terms explained
- First Principles - The 5 foundational principles
- Understanding LeanSpec - Core concepts and when to use
- Context Engineering - Managing AI working memory
Start Using LeanSpec:
- Creating and Managing Specs - Basic operations
- Finding Specs - Search and discovery
- Spec Structure - Organizing your specs
AI Integration:
- MCP Integration - Connect AI tools
- AI Coding Workflow - Best practices
- AI-Assisted Spec Writing - Co-create with AI
Need Help?
- FAQ - Frequently asked questions
- GitHub Issues - Report bugs or request features
- Community Discussions - Ask questions and share ideas