Guide

Best Practices

Proven patterns and anti-patterns for Agent Driven Development — so your agents ship faster, your specs stay sharp, and your team avoids the most common pitfalls.

Writing Good Specs

Specs are the contract between you and your agent team. A well-written spec produces well-written code; a vague spec produces chaos. Every minute spent on spec clarity saves ten minutes of rework.

Tip: The best specs read like a contract. If an AC is ambiguous, the agent will ask during the /add:spec interview. Let the interview do its job — answer thoroughly, and the spec writes itself.

Acceptance Criteria That Work

Acceptance criteria are the atomic unit of verification. Each one becomes a test, and each test becomes a guarantee. Get these right and everything downstream improves.

Good AC: “AC-001: Given a valid email and password, when the user submits the login form, then they receive a JWT token and are redirected to /dashboard”
Bad AC: “AC-001: Login works correctly” — What does “correctly” mean? What constitutes “login”? This AC is untestable because it specifies nothing.

Edge Cases

The difference between a prototype and a production system is edge case handling. Always include these categories in your specs:

Tip: Use a mental checklist: “What if it’s empty? What if it’s huge? What if two happen at once? What if the network dies?” Cover those four and you handle most edge cases.

TDD Discipline

ADD enforces a strict four-phase TDD cycle. Each phase has a purpose, and skipping any of them undermines the entire methodology.

  1. RED phase: Write ALL failing tests before any implementation. Every acceptance criterion becomes at least one test. The test suite should be a complete expression of the spec.
  2. GREEN phase: Write MINIMAL code to pass — no gold-plating, no “while I’m here” additions. The only goal is a green test suite.
  3. REFACTOR phase: Clean up with confidence. Your tests are the safety net. Improve naming, extract functions, reduce duplication — but change no behavior.
  4. VERIFY phase: An independent agent runs quality gates in a different context with no shared state. This catches assumptions the implementing agent baked in.
Warning: Never skip phases. The discipline IS the value. RED without GREEN is just a wish list. GREEN without RED is untested code. REFACTOR without tests is hope-driven development. VERIFY without independence is self-grading homework.

Test Strategy

Different test types serve different purposes. Match your test strategy to what you’re verifying.

Coverage Targets

Coverage expectations scale with project maturity. Don’t over-invest in coverage for a POC, and don’t ship a GA product at 40%.

Maturity Level Coverage Target Rationale
POC None required Validate the idea first. Tests slow exploration.
Alpha 60% Core paths tested. Gaps acceptable in experimental areas.
Beta 80% Production-bound code needs real coverage. E2E tests added.
GA 90% Ship with confidence. Remaining 10% is generated code or trivial getters.

Human-Agent Collaboration

ADD defines three engagement modes that control how much autonomy agents have. Choosing the right mode prevents both bottlenecks and runaway decisions.

Tip: Always define clear boundaries before /add:away. Review the briefing from /add:back before continuing work — the agent may have queued decisions that need your input.

Away Mode Best Practices

Away mode lets your agent team work while you’re gone. But autonomy without boundaries is a recipe for irreversible mistakes.

Warning: Agents in away mode will never deploy to production, merge to main, or implement features without specs — these are hard boundaries. But they CAN commit, push, and open PRs. Make sure your scope is intentional.

Running Effective Retros

Retrospectives are how ADD gets smarter over time. Without them, agents repeat the same mistakes across cycles.

Knowledge Management

ADD’s three-tier knowledge system prevents agents from starting every project from scratch. Let it work for you.

Tip: Agents read all three tiers before starting any task. Well-maintained knowledge tiers mean agents start smarter on every feature.

Knowledge Promotion

Knowledge flows upward through the tiers: project discoveries can be promoted to your user library during retros, and truly universal insights can be promoted to plugin-global (in the ADD dev project only).

Tier Location Scope Promote When
Tier 3: Project .add/learnings.md This project only Auto-checkpoints; always active
Tier 2: User ~/.claude/add/library.md All your projects During /add:retro when a learning is universal
Tier 1: Global knowledge/global.md All ADD users Rare; only for fundamental ADD insights
Warning: Resist the urge to promote everything to Tier 2. A noisy knowledge library is worse than an empty one — agents waste time processing irrelevant context. Only promote patterns you’d bet money will help your next project.

Common Mistakes

These are the mistakes we see most often. Every one of them has cost teams real time — learn from their pain.

Anti-Pattern Why It’s Bad Do This Instead
Skipping specs Implementation drifts, no traceability, agents guess at requirements Always /add:spec before code
Writing tests after code Tests validate implementation, not behavior — they pass by definition Strict RED → GREEN order
Gold-plating in GREEN phase Wastes time, tests may not cover extras, scope creep Minimal code to pass tests, nothing more
Ignoring retros Same mistakes repeated, no learning accumulation Run retros every 2 weeks minimum
Autonomous mode too early Agent makes wrong decisions without context, rework required Start Guided, graduate to Balanced
Compound acceptance criteria Can’t test independently, unclear pass/fail One behavior per AC
Skipping VERIFY phase Quality issues slip through, self-grading homework Always run /add:verify
Not setting away boundaries Agent makes irreversible changes outside intended scope Define explicit scope and limits
Promoting everything to Tier 2 Knowledge library becomes noisy, agents waste context window Only promote universal patterns
Starting at GA maturity Overwhelming process for new projects, friction kills momentum Start POC, promote as project matures