| name | coding-agent |
| description | Incremental development agent with TDD workflow. Use when implementing features one at a time, following test-driven development, making commits, or resuming development work. |
| version | 1.0.0 |
| category | autonomous-coding |
| layer | core-workflow |
Coding Agent
Incremental development agent that implements features using test-driven development (TDD) in subsequent sessions after initialization.
Quick Start
Start a Coding Session
from scripts.coding_agent import CodingAgent
agent = CodingAgent(project_dir)
context = await agent.start_session()
print(f"Session {context.iteration} started")
Implement Next Feature
feature = await agent.select_next_feature()
result = await agent.implement_feature(feature)
if result.success:
await agent.mark_feature_complete(feature)
await agent.commit_work(f"Implement: {feature.description}")
Session Protocol
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CODING SESSION PROTOCOL โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ 1. RESTORE CONTEXT โ
โ โโ Read claude-progress.txt (quick state) โ
โ โโ Read feature_list.json (work remaining) โ
โ โโ Get git log (recent commits) โ
โ โ
โ 2. ENVIRONMENT CHECK โ
โ โโ Run init.sh if needed โ
โ โโ Verify server running โ
โ โโ Run smoke tests โ
โ โ
โ 3. SELECT FEATURE โ
โ โโ Get highest-priority incomplete feature โ
โ โโ Read feature steps โ
โ โโ Plan implementation โ
โ โ
โ 4. IMPLEMENT WITH TDD โ
โ โโ Write failing test โ
โ โโ Verify test fails โ
โ โโ Implement code โ
โ โโ Verify test passes โ
โ โโ Verify E2E (if applicable) โ
โ โ
โ 5. MARK COMPLETE โ
โ โโ Update feature_list.json (passes: true) โ
โ โโ IMPORTANT: Features only go false โ true โ
โ โ
โ 6. COMMIT WORK โ
โ โโ git add relevant files โ
โ โโ Descriptive commit message โ
โ โโ Reference feature ID โ
โ โ
โ 7. UPDATE PROGRESS โ
โ โโ Append to claude-progress.txt โ
โ โโ List accomplishments and blockers โ
โ โ
โ 8. END SESSION โ
โ โโ Leave code in mergeable state โ
โ โโ Auto-continue or shutdown โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
TDD Workflow
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ TDD CYCLE โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ โโโโโโโโโโโโ โ
โ โ 1. RED โ Write failing test โ
โ โโโโโโฌโโโโโโ โ
โ โ Test fails โ โ
โ โผ โ
โ โโโโโโโโโโโโ โ
โ โ 2. GREEN โ Write minimal code to pass โ
โ โโโโโโฌโโโโโโ โ
โ โ Test passes โ โ
โ โผ โ
โ โโโโโโโโโโโโ โ
โ โ3.REFACTORโ Clean up without breaking tests โ
โ โโโโโโฌโโโโโโ โ
โ โ All tests pass โ โ
โ โผ โ
โ โโโโโโโโโโโโ โ
โ โ 4. E2E โ Verify in browser (if needed) โ
โ โโโโโโฌโโโโโโ โ
โ โ Feature works โ โ
โ โผ โ
โ COMMIT โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Key Rules
- ONE FEATURE PER SESSION: Focus prevents context exhaustion
- TEST FIRST: Always write test before implementation
- VERIFY BEFORE MARKING: Feature must actually pass
- DESCRIPTIVE COMMITS: Reference feature ID and explain changes
- MERGEABLE STATE: Code should always be in working state
Commit Message Format
<type>: <description>
<body - what and why>
Feature: <feature-id>
Example:
feat: implement user signup with email validation
- Added SignupForm component with validation
- Created /api/auth/signup endpoint
- Added email verification check
- Tests: 8 passing
Feature: auth-001
Integration Points
- autonomous-session-manager: Detects CONTINUE session
- context-state-tracker: Provides and updates state
- security-sandbox: Validates commands
- progress-tracker: Tracks completion metrics
References
references/CODING-WORKFLOW.md - Detailed workflow
references/TDD-PATTERNS.md - TDD best practices
references/COMMIT-CONVENTIONS.md - Commit guidelines
Scripts
scripts/coding_agent.py - Main CodingAgent class
scripts/feature_selector.py - Feature prioritization
scripts/implementation_workflow.py - TDD implementation
scripts/commit_workflow.py - Git commit workflow