kspec

Spec-driven development workflow for Kiro CLI with context management and verification at every step

Quick Start

# Install globally
npm install -g kspec
# Initialize project
kspec init
# Analyze codebase
kspec analyse
# Create your first spec
kspec spec "User Authentication"
# Or use inside kiro-cli (recommended)
/agent swap kspec-spec

Two Ways to Use kspec

CLI Mode

Run kspec commands from your terminal:

kspec init
kspec spec "Feature"
kspec tasks
kspec build

Agent Mode Recommended

Stay inside kiro-cli, switch agents:

> /agent swap kspec-spec
Build a todo app with categories
→ Creates spec.md, spec-lite.md, updates context
> /agent swap kspec-tasks
→ Reads CONTEXT.md, generates tasks

Context Management

Never lose context again. kspec maintains state across sessions and survives AI context compression.

# .kspec/CONTEXT.md (auto-generated)
Current Spec: 2026-01-24-user-auth
Task: 3/12 - Implement JWT validation
Requirements Summary:
- OAuth2 with Google/GitHub
- JWT tokens with 24h expiry
- Role-based access control

Agents read CONTEXT.md first, automatically restoring state after context compression.

Contracts

Beta

Enforce structured outputs and non-negotiable checks in your spec. Prevent context loss and regression by ensuring specific files and patterns exist.

## Contract
{
"output_files": ["package.json"],
"checks": [
{ "type": "contains", "file": "README.md", "text": "kspec" }
]
}

Powers

System

Modular knowledge files that enhance AI agent capabilities. Install powers for TDD, documentation, and code intelligence.

contract-Enforce checks
document-Docs best practices
tdd-TDD workflows
code-review-Quality standards
code-intelligence-Tree-sitter & LSP

Development Workflow

1

init

Interactive setup

2

analyse

Analyse codebase

3

spec

Create specification

4

verify-spec

Verify spec completeness

5

tasks

Generate tasks

6

verify-tasks

Verify task coverage

7

build

Execute with TDD

8

verify

Verify implementation

9

done

Complete & harvest memory

Specialized Agents

Seven pre-configured agents with keyboard shortcuts for rapid workflow

kspec-analyseCtrl+Shift+A

Codebase analysis

kspec-specCtrl+Shift+S

Specification creation

kspec-tasksCtrl+Shift+T

Task generation

kspec-buildCtrl+Shift+B

TDD implementation

kspec-verifyCtrl+Shift+V

Implementation verification

kspec-reviewCtrl+Shift+R

Code review

kspec-jiraCtrl+Shift+J

Jira integration

ACP Integration

Agent Client Protocol

Connect Kiro's powerful agents directly to your favorite IDEs. ACP enables seamless two-way communication between the specialized agents and JetBrains IDEs (IntelliJ, WebStorm, PyCharm) or Zed editor.

IntelliJ IDEA
WebStorm
PyCharm
Zed
// ~/.jetbrains/acp.json
"agent_servers": {
"Kiro Agent": {
"command": "/path/to/kiro-cli",
"args": ["acp"]
}
}

Key Features

Spec-Driven Development

Create detailed specifications before implementation with automated verification at every step.

Context Management

Auto-generated CONTEXT.md preserves state across sessions, surviving AI context compression.

TDD Workflow

Built-in Test-Driven Development workflow with automated task generation and verification.

Agent Mode

Work inside kiro-cli with specialized agents. Switch agents seamlessly without losing context.

Automated Analysis

Intelligent codebase analysis and project memory harvesting for continuous improvement.

Auto-Updates

Automatic update checks notify you when new versions are available.

Contracts (Beta)

Enforce structural requirements and validation rules to prevent regressions.

Powers System

Modular knowledge system for TDD, documentation, and code intelligence.

ACP Integration

Seamless integration with JetBrains IDEs via Agent Client Protocol.

Jira Integration

Pull requirements from Jira, sync specs back, and create subtasks via Atlassian MCP.

Command Reference

kspec init
Interactive setup
kspec spec "Name"
Create specification
kspec tasks
Generate tasks
kspec build
Execute with TDD
kspec verify
Verify implementation
kspec done
Complete & harvest memory
kspec context
View/refresh context
kspec status
Show progress
kspec analyse
Analyse codebase
Jira Integration (requires Atlassian MCP)
kspec spec --jira PROJ-123
Create spec from Jira
kspec sync-jira
Push spec to Jira
kspec jira-subtasks
Create Jira subtasks

Jira Integration

Bridge the gap between BAs, PMs, and developers. Pull requirements from Jira, create specs, and sync back for approval.

Pull from Jira

kspec spec --jira PROJ-123

Fetch Jira stories, extract acceptance criteria, create unified spec

Push to Jira

kspec sync-jira

Create or update Jira issues with spec content for BA review

Create Subtasks

kspec jira-subtasks

Generate Jira subtasks from tasks.md for PM visibility

Requires Atlassian MCP configured in ~/.kiro/mcp.json

Seamless Kiro Integration

kspec works seamlessly with Kiro CLI and Kiro IDE, combining structured workflow automation with interactive development assistance for the ultimate development experience.

kspec provides:

  • Structured spec creation and task generation
  • Context management that survives compression
  • Automated analysis and verification steps
  • TDD workflow enforcement

Kiro CLI provides:

  • Interactive implementation assistance
  • Real-time code help and debugging
  • Advanced AI-powered development tools
  • Agent switching with /agent swap