Spec-Driven Development
Spec-Driven Development (SDD) is Kognisant's structured approach to building features. Instead of diving into code immediately, you define requirements, design the architecture, break work into tasks, and then execute methodically. The AI helps at every stage.
The kognisant spec Command
Create a new spec
kognisant spec auth_module
This creates .kognisant/specs/auth_module/ with three template files:
requirements.md - What to build and whydesign.md - How to build it (architecture, data structures, APIs)tasks.md - Step-by-step implementation checklistList all specs
kognisant spec --list
Shows all specs with their current status:
Specs:šØ auth_module BUILD (3/8)
š rate_limiter DESIGN
ā logging DONE (5/5)
Resume an existing spec
kognisant spec auth_module --resume
Kognisant loads the spec and picks up where you left off:
š ļø Spec: auth_moduleStatus: BUILD (3/8 tasks done)
[c] Continue building (auto)
[n] Execute next task only
[s] Show full spec
[q] Save and quit
Check spec status
kognisant spec auth_module --status
Shows detailed progress with completed and remaining tasks.
---
The SDD Workflow
Stage 1: Requirements (DEFINE)
When you create or resume a spec, Kognisant asks you to describe what you want to build. Based on your description, it generates structured requirements:
# Feature Requirements: auth_moduleOverview
JWT-based authentication replacing the current session-based system.
Functional Requirements
Non-Functional Requirements
Success Criteria
All protected routes reject requests without valid JWTs.
Existing tests continue passing after migration.
You review, edit, and approve the requirements before moving on.
Stage 2: Design (DESIGN)
Based on approved requirements, the AI proposes architecture:
# Design Document: auth_moduleArchitecture
Data Structures
Behavior
Interface Contract
Stage 3: Tasks (PLAN)
The design is broken into executable implementation tasks:
# Implementation Tasks: auth_modulePhase 1 - Scaffolding
Phase 2 - Core Logic
Phase 3 - Integration
Stage 4: Build (BUILD)
Now the AI executes tasks one by one (or in parallel via the agent swarm):
/spec auth_module run Execute next task/spec auth_module run all Execute all remaining tasks
/spec auth_module done Mark current task as complete
Each task execution follows the full PERP pipeline (Plan, Execute, Reflect, Persist), with the spec providing focused context.
Stage 5: Verify (VERIFY)
After all tasks are complete, Kognisant validates the implementation against the original requirements:
---
Spec File Structure
All specs live under .kognisant/specs/ in your project:
.kognisant/specs/āāā auth_module/
ā āāā requirements.md
ā āāā design.md
ā āāā tasks.md
āāā rate_limiter/
ā āāā requirements.md
ā āāā design.md
ā āāā tasks.md
āāā logging/
āāā requirements.md
āāā design.md
āāā tasks.md
Each spec is a self-contained directory with exactly three files. You can edit these files directly in your editor, and Kognisant will respect your changes on the next resume.
---
Managing Specs from Chat
Inside kognisant chat, use the /spec command:
/spec list List all specs with status/spec auth_module Load spec context into conversation
/spec auth_module run Execute the next unchecked task
/spec auth_module run all Execute all remaining tasks
/spec auth_module done Mark current task as done
Loading a spec into chat gives the AI full awareness of the feature being built, including requirements, design decisions, and completed/remaining tasks.
---
How Agents Execute Against Specs
When you run /spec auth_module run all, Kognisant:
tasks.mdThe spec acts as a constraint: agents cannot wander beyond what is defined. If a task requires something not in the spec, the agent reports it rather than improvising.
---
When to Use SDD vs. Ad-hoc /agent
| Situation | Approach |
| :--- | :--- |
| Quick bug fix | Just ask in chat |
| Small feature (one file, one function) | /agent or direct chat |
| Multi-file feature with clear scope | SDD - define requirements first |
| Large refactor affecting many modules | SDD - design the migration path |
| Exploratory work (not sure what to build) | Start with chat, upgrade to SDD when scope clarifies |
| Team project with code review | SDD - the spec doubles as documentation |
/agent.
---
Pausing and Resuming
Specs are persistent. You can:
kognisant spec auth_module --resume
The spec remembers:
tasks.md)---
Editing Specs Manually
All spec files are plain markdown. Edit them freely:
vim .kognisant/specs/auth_module/tasks.md
Common reasons to edit manually:
Kognisant respects your edits. If you check off a task manually, it will skip it on the next run.
---
Spec Status in kognisant status
The global status command shows spec progress:
kognisant status
Specs:šØ auth_module BUILD (3/8)
š rate_limiter DESIGN
ā logging DONE (5/5)
Status icons: