AC

Auto-Code

Implementation

Automatically implements code from documented requirements, TODO items, or feature specifications. Proactively scans the TODO directory for specs, generates production-ready code, and tracks completion by moving finished specs to the COMPLETE directory.

How It Works

Key Features

Atomic Git Commits Per Task GSD Pattern

MANDATORY: Create atomic, bisectable commits after EACH completed task. Each commit should represent ONE logical unit of work that can be reverted independently, used for git bisect, and understood in isolation.

Atomic Commit Protocol

After completing EACH logical task within a spec:

# Stage only files related to THIS specific task
git add [specific-files]

# Create atomic commit with structured message
git commit -m "$(cat <<'EOF'
[REQ-XXX] Brief description (imperative mood)

Task: [task-id from spec if applicable]
Spec: TODO/[feature-name].md
Agent: auto-code

Changes:
- [Change 1]
- [Change 2]

Verification:
- [x] Tests pass
- [x] No security issues
- [x] Functional verification complete

Co-Authored-By: Claude <noreply@anthropic.com>
EOF
)"

Commit Granularity Guide

Change Type Commit Frequency Example
New file/module Per file "Add TrivyScanner service class"
Function implementation Per function "Implement scanContainer method"
Bug fix Per fix "Fix null pointer in scan result parser"
Configuration change Per config "Add Trivy environment variables"
Test addition Per test file "Add TrivyScanner integration tests"
Refactor Per logical unit "Extract scan result parsing to utility"

Commit Message Format

[REQ-XXX] <type>: <subject> (max 50 chars)

<body - what and why, not how>

Task: <task-id>
Spec: <spec-file>
Agent: auto-code

Types: feat, fix, refactor, test, docs, chore, security

Why Atomic Commits Matter

Bisectable History

git bisect can pinpoint exact commit that introduced a bug

Safe Rollback

Revert single feature without affecting others

Clear Audit Trail

Each commit tells a complete story

Easier Code Review

Smaller commits are easier to review

Fewer Conflicts

Smaller changes = fewer merge conflicts

Anti-Patterns (FORBIDDEN)

# FORBIDDEN: Mega-commits
git add -A && git commit -m "Implement feature"

# FORBIDDEN: WIP commits
git commit -m "WIP" || git commit -m "stuff"

# FORBIDDEN: Mixed concerns
git commit -m "Add scanner and fix bug and update docs"  # Split into 3!

Workflow Integration

Auto-Code operates in Phase 3 of the conductor workflow, after architect has created specs and before final QA validation. It iterates until all quality gates pass.