Designing a Clear Spec for AI Agent Teams: a Practical Checklist

AI agent teams succeed when the specification is both precise for coordination and small enough for agents to act on independently. Use this checklist to produce a spec that supports parallel work, reliable outputs, and easy review.

1. One-line mission + acceptance criteria

State the project goal in one sentence and attach concrete acceptance criteria (tests, performance targets, UX checks). Agents should always know the single success condition to aim for.

2. Canonical commands & CI hooks

List exact shell commands the agents must run (build, test, lint, format, deploy). Example: npm test, pytest -q, npm run lint -- --fix. Include required CI checks and thresholds (e.g., test coverage > 80%).

3. Project structure & single-source files

Map where code, tests, docs, and config live (e.g., src/, tests/, docs/). Provide one authoritative spec file (SPEC.md) and reference it; agents should refresh only the relevant subsection when working on a task.

4. Task-level modularization

Break features into independent modules with clear inputs, outputs, and interfaces (API contracts, file names, schema). Make each module small enough for a single agent to complete and test end-to-end.

5. Interfaces, contracts, and examples

Supply concrete API contracts, example requests/responses, database schemas, and sample data. Prefer short, runnable examples over long prose descriptions.

6. Tests as specifications

Include unit and integration test templates or failing tests that define correct behavior. Require agents to run and pass tests before proposing changes.

7. Constraints and boundaries

Three-tier guidance: Always (mandatory actions), Ask (actions requiring human approval), and Never (forbidden areas like secrets, prod DB writes). Be explicit about risky operations.

8. Style, naming, and small examples

Show short code snippets demonstrating the desired style and naming conventions. One representative example is more actionable than lengthy rules.

9. Orchestration & coordination points

Define how agents coordinate: ownership of artifacts (who writes tests, who reviews), the orchestrator (human or agent), and handoff artifacts (PR templates, CHANGELOG entries). Specify expected commit/PR format and review gates.

10. Self-checks, rollback, and observability

Require agents to run sanity checks, add logging/metrics where appropriate, and include a rollback plan for deployments. Point to monitoring dashboards or how to verify behavior post-change.

11. Update protocol

Describe how the spec itself evolves: who may update SPEC.md, how changes are reviewed, and how agents discover spec updates (version tags, changelog entries).

Quick template (copy into SPEC.md)

– Mission: One sentence.
– Acceptance tests: list.
– Commands: list exact commands.
– Structure: folders.
– Modules: 1–3 sentence descriptions per module.
– APIs/examples: minimal runnable examples.
– Tests: test commands + required coverage.
– Boundaries: Always / Ask / Never.
– Orchestration: agent roles + handoff artifacts.
– Spec version: semver and changelog link.

Using this checklist yields a spec that enables parallel, reliable work: agents can take bounded tasks, run deterministic checks, and hand off results into an established review loop.

Sources

o Português