Spec Task System
The Spec Task System is agentcmd's implementation of spec-driven development—a structured approach to managing feature specifications with built-in lifecycle tracking and workflow automation.
What is a Spec?
A spec is a markdown file with metadata about a feature:
# User Authentication Feature
**Status**: todo
**Created**: 2025-01-15
**Complexity**: 35 points
**Phases**: 4
## Overview
Implement JWT-based authentication...
## Tasks
- [ ] Create auth service
- [ ] Add login endpoint
- [ ] Implement token validationSpecs live in .agent/specs/{folder}/{timestamp-id}-{name}/spec.md and are organized by status folder (backlog, todo, done).
Spec Lifecycle
Specs flow through a simple workflow:
backlog/- Future work, not prioritizedtodo/- Ready to work ondoing- Currently implementing (stays in todo/ folder)done/- Completed
Move specs between folders:
/cmd:move-spec auth-system todo
/cmd:move-spec auth-system doneSpec Types
agentcmd supports three built-in spec types:
| Type | Purpose | Use Case |
|---|---|---|
| Feature | New functionality | New features, enhancements, capabilities |
| Bug | Bug fixes | Error corrections, defect fixes, issue resolutions |
| Issue | General issues | Refactoring, tech debt, performance, documentation |
Creating Custom Spec Types
You can extend the system with custom spec types for your project's unique needs (e.g., "Refactor", "Documentation", "Performance", "Security").
How to Create:
- Create a file in
.claude/commands/cmd/with pattern:generate-{type}-spec.md - Add front matter with description
- Add a header and description paragraph
- Write the spec generation instructions
File Format:
---
description: Brief description shown in command list
argument-hint: [context?]
---
# Display Name
Short description shown in UI dropdown (first paragraph after header).
## Instructions
Your detailed instructions for generating this spec type...Example - Custom "Refactor" Spec Type:
Create .claude/commands/cmd/generate-refactor-spec.md:
---
description: Generate refactoring spec with code analysis and migration plan
argument-hint: [context?]
---
# Code Refactoring
Generate a detailed refactoring spec with impact analysis, migration steps, and rollback plan.
## Instructions
Generate a comprehensive refactoring specification including:
- Current state analysis
- Proposed changes and architecture
- Step-by-step migration tasks with complexity
- Rollback strategy
- Testing requirements
...Naming Convention:
- Filename:
generate-{type}-spec.md - Type ID: Extracted from filename (e.g.,
refactorfromgenerate-refactor-spec.md) - Display Name: First
#header in file - Command: Auto-generated as
/cmd:generate-{type}-spec
Where They Appear:
Custom spec types automatically show up in:
- Workflow Run Form - "Type" dropdown when using "From Planning Session" or "Write Custom" tabs
- Spec File Selector - When selecting existing spec files
- Command Palette - Available as
/cmd:generate-{type}-spec
The dropdown displays:
- Name (from
#header) - Command (e.g.,
/cmd:generate-refactor-spec) - Description (first paragraph after header)
The system auto-discovers all generate-*-spec.md files on startup. No configuration needed.
Generating Specs
There are two ways to generate specs:
1. Via Slash Commands
Generate specs directly from CLI:
# Feature Spec
/cmd:generate-feature-spec "User authentication system"
# Bug Spec
/cmd:generate-bug-spec "Login page crashes on mobile"
# Issue Spec
/cmd:generate-issue-spec "Refactor auth service for better testability"2. Write Custom (UI)
Create spec inline with markdown editor:
- In UI, click "New Workflow Run"
- Select "Write Custom" tab
- Select spec type (feature, bug, issue)
- Write spec content in markdown
- Click "Run"
The agent generates full spec from your content.
Implementing Specs
Manual Implementation
# 1. Move spec to todo (if not already there)
/cmd:move-spec auth-system todo
# 2. Implement according to spec
# (code, test, etc.)
# 3. Move to done
/cmd:move-spec auth-system doneSystem Architecture
Behind the scenes, agentcmd maintains:
- Spec folders - Organized by status (backlog/todo/done)
- Index file - JSON registry tracking all specs for fast lookup
- Metadata - Complexity scores, timestamps, package info
- Tasks - Markdown checkboxes for progress tracking
See Spec System Reference for technical details on folder structure, metadata format, complexity scoring, and the index.json schema.