Spec-Driven Agentic Development — Prompts
Prompt 1: /spec:create — Multi-Agent Codebase Exploration
Source: .claude/commands/spec/create.md
Technique: Complexity-gated parallel agent spawning — the spec creation command first assesses complexity, then spawns 1-3 parallel Explore agents based on the assessment, before generating artifacts.
---
description: Generate context, requirements, and tasks for a feature in a single unified flow.
allowed-tools: Read(*), Write(*), Edit(*), MultiEdit(*), Glob(*), Grep(*), Bash(*),
TodoWrite, AskUserQuestion, Task
---
# Unified Feature Specification (Enhanced)
Generate complete feature specification with deep codebase exploration using Task agents.
## Phase 0: Triage
Quickly assess feature complexity to determine how many Explore agents to spawn.
**Complexity Matrix:**
| Indicator | Low | Medium | High |
|-----------|-----|--------|------|
| Description keywords | Simple CRUD, basic | Auth, API, data | Integration, realtime, complex |
| Existing features | 0 | 1-3 | 4+ |
| Source files | < 20 | 20-100 | > 100 |
**Agent Count Decision:**
- **Low complexity**: 1 Explore agent (comprehensive)
- **Medium complexity**: 2 Explore agents (patterns + similar features)
- **High complexity**: 3 Explore agents (patterns, similar features, tech stack)
## Phase 1: Explore Agents
Use the `Task` tool with `subagent_type: "Explore"` to spawn codebase exploration agents.
Run all applicable agents **in parallel**.
### Agent 1: Patterns & Conventions (Always spawn)
[Explores directory structure, naming conventions, code organization, error handling, config]
### Agent 2: Similar Features (Medium/High complexity)
[Finds overlapping functionality, structure patterns, shared utilities]
### Agent 3: Tech Stack & Dependencies (High complexity only)
[Analyzes tech stack, relevant dependencies, integration points]
Notable technique: Complexity-triage-gated parallel agent spawning — the number of Explore agents scales dynamically with perceived task complexity. This is the most sophisticated exploration pattern in this batch.
Source: .claude/commands/spec/create.md (requirements generation phase)
Technique: Structured format enforcement for requirement statements, preventing ambiguity.
From the README-described output format:
# Requirements
## Functional Requirements
### Authentication
- When the user submits valid credentials, the system shall authenticate and
return a JWT token.
- When the user submits invalid credentials, the system shall return a 401
error with a descriptive message.
- While a user session is active, the system shall validate the JWT on each
protected endpoint call.
EARS (Easy Approach to Requirements Syntax) templates used:
- "When [condition], the system shall [behavior]"
- "While [condition], the system shall [behavior]"
- "The [feature] shall [behavior]"