Agentic development with PROMPT files — craft, execute, or resume Dev Loop sessions
Dev Loop — Agentic Development (Level 2) with structured iteration and intelligent routing.
# Craft a new PROMPT (prompt-crafter guides you)
/dev "I want to build a date parser"
/dev "Add caching to the API"
# Execute an existing PROMPT
/dev tasks/PROMPT_DATE_PARSER.md
/dev tasks/PROMPT_CACHE.md --mode afk
# Resume an interrupted session
/dev tasks/PROMPT_CACHE.md --resume
# Validate without executing
/dev tasks/PROMPT_AUTH.md --dry-run
# List available PROMPTs
/dev --list
The /dev command intelligently routes between two modes:
┌─────────────────────────────────────────────────────────────────────────────────┐
│ /dev COMMAND ROUTING │
├─────────────────────────────────────────────────────────────────────────────────┤
│ │
│ User Input Action │
│ ────────── ────── │
│ │
│ /dev "description" → prompt-crafter (ask questions, build PROMPT) │
│ /dev tasks/PROMPT_*.md → dev-loop-executor (execute the PROMPT) │
│ /dev --list → Show available PROMPTs │
│ │
└─────────────────────────────────────────────────────────────────────────────────┘
When you provide a description (not a file path), the prompt-crafter agent:
/dev "I want to create a Redis caching layer"
Output:
PROMPT CRAFTER
==============
I'll help you create a ready-to-execute PROMPT for: Redis caching layer
Let me explore the codebase and ask a few questions...
[Questions about scope, quality, integration, verification]
✅ PROMPT CREATED
=================
File: .claude/dev/tasks/PROMPT_REDIS_CACHE.md
Tasks: 6 (🔴2 🟡3 🟢1)
To execute:
/dev tasks/PROMPT_REDIS_CACHE.md
When you provide a PROMPT file path, the dev-loop-executor agent:
/dev tasks/PROMPT_REDIS_CACHE.md
Options:
--mode afk # Autonomous execution (no pauses)
--mode hitl # Human-in-the-loop (default)
--max N # Override max iterations
--dry-run # Validate without executing
| Argument | Description |
|---|---|
"description" | Natural language request → triggers prompt-crafter |
tasks/PROMPT_*.md | Path to PROMPT file → triggers executor |
--list | List available PROMPTs in .claude/dev/tasks/ |
--mode | Execution mode: hitl (default) or afk |
--resume | Resume from existing PROGRESS file (memory bridge) |
--dry-run | Validate and show plan without executing |
--max N | Override max iterations (default: 30) |
1. /dev "I want to build X" # Craft phase
↓
2. [Questions and clarifications] # Interactive
↓
3. PROMPT.md generated # Ready to execute
↓
4. /dev tasks/PROMPT_X.md # Execute phase
↓
5. [Loop with verification] # Automated
↓
6. EXIT_COMPLETE # Done
# Copy template and edit manually
cp .claude/dev/templates/PROMPT_TEMPLATE.md \
.claude/dev/tasks/PROMPT_MY_TASK.md
# Then execute
/dev tasks/PROMPT_MY_TASK.md
┌─────────────────────────────────────────────────────────────────────────────────┐
│ DEVELOPMENT SPECTRUM │
├─────────────────────────────────────────────────────────────────────────────────┤
│ │
│ LEVEL 1 LEVEL 2 LEVEL 3 │
│ Vibe Coding Agentic Development Spec-Driven Dev │
│ ─────────── ──────────────────── ─────────────── │
│ │
│ • Just prompts • PROMPT.md driven • 8-phase pipeline │
│ • No structure • Verification loops • Full traceability │
│ • Hope it works • Agent leverage • Quality gates │
│ • Quick fixes • Memory bridge • Enterprise audit │
│ • Question-first • ADRs and specs │
│ │
│ Command: (none) Command: /dev Command: /build-feature │
│ Time: < 30 min Time: 1-4 hours Time: Multi-day │
│ │
└─────────────────────────────────────────────────────────────────────────────────┘
# Start with a description
/dev "I need a date parser that handles multiple formats"
# Answer questions about scope, quality, verification
# Get a generated PROMPT
# Execute
/dev tasks/PROMPT_DATE_PARSER.md
/dev "Create a Redis knowledge base"
# Questions about topics, depth, examples
# Generated PROMPT with @kb-architect tasks
/dev tasks/PROMPT_REDIS_KB.md
/dev "Refactor the authentication module to use JWT"
# Questions about backward compatibility, tests
# Generated PROMPT with risky tasks first
/dev tasks/PROMPT_AUTH_REFACTOR.md --mode hitl
# Dry run to see task breakdown and verify structure
/dev tasks/PROMPT_COMPLEX_FEATURE.md --dry-run
# Output shows:
# - Task summary (🔴 RISKY, 🟡 CORE, 🟢 POLISH counts)
# - Agent references (@python-developer, @test-generator)
# - Verification commands
# - Any validation issues
# Session was interrupted (context rot, timeout, etc.)
# Progress was saved to: .claude/dev/progress/PROGRESS_REDIS_CACHE.md
# Resume from where you left off
/dev tasks/PROMPT_REDIS_CACHE.md --resume
# Executor will:
# - Load completed tasks from PROGRESS file
# - Skip already-done work
# - Continue from next incomplete task
# - Preserve key decisions and context
The memory bridge system ensures no work is lost:
┌─────────────────────────────────────────────────────────────────────────────────┐
│ SESSION RECOVERY FLOW │
├─────────────────────────────────────────────────────────────────────────────────┤
│ │
│ Session 1 (Interrupted) Session 2 (Resumed) │
│ ──────────────────────── ────────────────────── │
│ │
│ /dev tasks/PROMPT_X.md /dev tasks/PROMPT_X.md --resume │
│ │ │ │
│ ▼ ▼ │
│ ┌─────────────┐ ┌─────────────┐ │
│ │ Task 1 ✅ │ │ Load │ │
│ │ Task 2 ✅ │ ──── saves ────→ │ PROGRESS.md │ │
│ │ Task 3 🔄 │ progress └──────┬──────┘ │
│ │ [TIMEOUT] │ │ │
│ └─────────────┘ ▼ │
│ ┌─────────────┐ │
│ │ Skip 1, 2 │ │
│ │ Continue 3 │ │
│ │ Task 4... │ │
│ └─────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────────┘
| File | Purpose |
|---|---|
progress/PROGRESS_{NAME}.md | Tracks completed tasks, key decisions, iteration log |
logs/LOG_{NAME}_{TS}.md | Final execution report with statistics |
.claude/dev/
├── _index.md # Documentation
├── tasks/ # Your PROMPT files (active work)
│ └── PROMPT_*.md
├── progress/ # Memory bridge (auto-managed)
│ └── PROGRESS_*.md
├── logs/ # Execution logs
│ └── LOG_*.md
└── templates/ # Templates and examples
├── PROMPT_TEMPLATE.md # Blank template
├── PROGRESS_TEMPLATE.md # Progress file template
├── PROMPT_EXAMPLE_FEATURE.md # Example: Python utility
└── PROMPT_EXAMPLE_KB.md # Example: KB domain
| Resource | Path |
|---|---|
| Level 2 Overview | .claude/dev/_index.md |
| Prompt Crafter Agent | .claude/agents/dev/prompt-crafter.md |
| Dev Loop Executor | .claude/agents/dev/dev-loop-executor.md |
| PROMPT Template | .claude/dev/templates/PROMPT_TEMPLATE.md |
| Level 3 (SDD) | .claude/sdd/_index.md |
Dev Loop v1.1 — Ask first, execute perfectly, recover gracefully