This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Contract-Agents is a collection of 125 AI agent definitions (Markdown files) governed by a shared contract (agents/AGENTS_CONTRACT.md v2.0). Agents are organized into 10 divisions by prefix (eng-*, test-*, design-*, mkt-*, prod-*, pm-*, game-*, spatial-*, spec-*, support-*) plus a contract-orchestrator. The project is tool-agnostic — agents install into Claude Code, Kilo CLI, Goose, and OpenCode.
make test # Runs tests/contract-test.sh (frontmatter validation) and tests/token-check.sh (line count warnings)
make install # Install agents globally to all detected tools
make install-claude DIVISION=eng # Install specific division to specific tool
make clean # Remove installed agents from all tool directoriesagents/AGENTS_CONTRACT.md— The shared contract all agents inherit. When contract rules conflict with agent-specific rules, the contract wins.agents/<prefix>-<name>.md— Individual agent definitions. Each is minimal: YAML frontmatter (name,displayName,description) + domain-specific rules + output format. Shared behavior lives in the contract, not duplicated per agent.agents/contract-orchestrator.md— Special orchestrator agent that delegates to specialists via the Agent tool but never does work itself.templates/agent-template.md— Canonical template for creating new agents.tasks/lessons.md— Agents read this at session start and append lessons after corrections (part of the contract's self-improvement loop).tasks/todo.md— Multi-step task tracking per the contract's task management rules.scripts/— Python utilities for bulk agent modifications (slimming, standardizing outputs).
- Use the division prefix matching the agent's domain (see README for prefix table).
- Follow
templates/agent-template.mdformat: YAML frontmatter → domain rules → output section. - Keep agents minimal — put shared rules in
AGENTS_CONTRACT.md, not in individual agents. - The contract-test validates: presence of
---frontmatter delimiters,name:field, anddescription:field. - Token-check warns if any agent exceeds 100 lines — agents should be concise.
- Run
make testafter changes to validate.
- The contract (
AGENTS_CONTRACT.md) is the single source of truth for cross-cutting rules. Never duplicate contract rules into individual agent files. - Only the orchestrator spawns sub-agents; leaf agents request delegation but don't spawn.
- Agent filenames must match the pattern
<division-prefix>-<name>.md.