Retort framework for multi-tool AI agent team orchestration, sync generation, and quality-gated workflows.
This repository uses Retort to manage AI agent team workflows across multiple tools.
-
Repository: retort
-
Default Branch: main
-
Integration Branch (PR target): dev
-
Framework Version: 3.1.0
-
Phase: active
- Languages: javascript, yaml, markdown
- Backend: node.js
- ORM: none
- Database: none
- Messaging: none
- Architecture: monolith
- API Style: mixed
| Command | Purpose |
| ------------------- | ---------------------------------------- | -------------------------------------------- |
| /start | New user entry point — guided next steps |
| | /orchestrate | Master coordinator — assess, plan, delegate |
| | /discover | Scan codebase, detect tech stacks |
| | /review | Code review with quality gates |
| | /check | Universal quality gate (lint + test + build) |
| | /plan | Structured planning before implementation |
| /build | Build project (auto-detects stack) |
| /test | Run tests (auto-detects stack) |
| /format | Format code (auto-detects stack) |
| /deploy | Deployment automation |
| /security | Security audit |
| /sync-backlog | Update AGENT_BACKLOG.md |
| /document-history | Create history doc for completed work |
|
| Command | Team | Focus |
|---|---|---|
/team-backend |
Backend (T1) | API, services, core logic |
/team-frontend |
Frontend (T2) | UI, components, PWA |
/team-data |
Data (T3) | DB, models, migrations |
/team-infra |
Infrastructure (T4) | IaC, cloud resources |
/team-devops |
DevOps (T5) | CI/CD, containers |
/team-testing |
Testing (T6) | Quality, coverage |
/team-security |
Security (T7) | Auth, compliance |
/team-docs |
Documentation (T8) | Docs, guides |
/team-product |
Product (T9) | Features, PRDs |
/team-quality |
Quality (T10) | Review, refactor |
- Discovery — Understand requirements, scan codebase (
/discover) - Planning — Design solution, create ADRs (
/plan) - Implementation — Write code, add tests (team commands)
- Validation — Verify quality, run gates (
/check,/review) - Ship — Deploy, document
/orchestrate --assess-only → Understand current state
/plan → Design implementation
/team-<name> → Execute with appropriate team
/check → Verify quality gates
/review → Code review
/document-history → Record what was done and why
```
## Cross-Cutting Conventions
### Authentication
Provider: custom-jwt, strategy: jwt-bearer.
RBAC is enforced.
### API
- Versioning: url-segment
- Pagination: cursor
- Response format: envelope
## Testing
- **Unit**: vitest
- **Integration**: vitest
- **Coverage target**: 80%
Always run the full test suite before creating a PR.
## Architecture
- **Agents**: `.claude/agents/` — Specialized AI agents by category
- **Commands**: `.claude/commands/` — Slash command definitions
- **Rules**: `.claude/rules/` — Domain-specific coding rules
- **Hooks**: `.claude/hooks/` — Lifecycle hooks (session-start, protect-sensitive, etc.)
- **State**: `.claude/state/` — Orchestrator state and session tracking
## Documentation
- **PRDs**: `docs/prd/`
- **ADRs**: `docs/architecture/decisions/`
- **API Spec**: `docs/api/`
- **Brand Guide**: `.agentkit/spec/brand.yaml` — AgentKit Forge (primary: `#1976D2`)
### History Documentation (MANDATORY)
After completing significant work (bug fixes, features, implementations, or migrations), **always** create a history document:
```bash
./scripts/create-doc.sh <type> "<title>" [pr-number]
| Work Type | Command | Trigger |
|---|---|---|
| Bug fix (non-trivial) | ./scripts/create-doc.sh bugfix "Title" |
Any bug fix touching 2+ files or requiring root-cause analysis |
| New feature | ./scripts/create-doc.sh feature "Title" |
Any user-facing feature or new capability |
| Implementation | ./scripts/create-doc.sh implementation "Title" |
Architecture changes, refactors, new subsystems |
| Migration | ./scripts/create-doc.sh migration "Title" |
Library upgrades, data migrations, infrastructure changes |
Templates are in docs/history/ — fill in all sections after generation. The /review --focus=retrospective command captures issues and lessons learned separately. See docs/engineering/06_pr_documentation.md for the full strategy.
All project documentation follows a domain-driven structure in docs/:
| Category | Purpose |
|---|---|
product/ |
Product vision, strategy, personas, PRDs |
architecture/ |
Specs, ADRs, diagrams, tech stack decisions |
orchestration/ |
Orchestration guide, PM guide, protocols |
agents/ |
Agent catalog, roles, team mappings |
api/ |
API reference, authentication, versioning |
operations/ |
Deployment, monitoring, SLAs |
engineering/ |
Setup, coding standards, testing, contributing |
integrations/ |
External services, third-party connections |
reference/ |
Glossary, acronyms, FAQ, tool config |
handoffs/ |
AI session handoff documents |
history/ |
Bug fixes, features, implementations, lessons |
- Naming convention:
{org}-{env}-{project}-{resourcetype}-{region}- Default region: global
- Organisation prefix: akf
- Preferred IaC toolchain: terraform, terragrunt
- Mandatory tags (required on every taggable resource):
environment, project, owner, cost_center - Optional tags (recommended):
team, created_by, managed_by
Tagging is enforced. When creating or modifying IaC resources, always include the mandatory tags listed above. Use a shared
localsblock or Terragruntinputsfor consistency. See.claude/rules/iac.mdfor examples.
Work is delegated between agents using task files in .claude/state/tasks/.
Each task is a JSON file with a lifecycle: submitted → accepted → working → completed/failed/rejected.
Key rules:
- The orchestrator creates tasks and assigns them to teams.
- Teams accept or reject tasks based on scope and accepted types.
- On completion, teams add artifacts (files changed, test results) and optionally set
handoffTofor downstream teams. - The orchestrator processes handoffs and manages dependency chains (
dependsOn/blockedBy). - Tasks support fan-out (parallel delegation) and chained handoff (sequential delegation).
See .claude/state/tasks/ for active task files. See UNIFIED_AGENT_TEAMS.md for team coordination protocol.
All commit messages and PR titles MUST follow Conventional Commits format:
type(scope): description
Types: feat, fix, docs, style, refactor, test, chore, ci, perf, build, revert
Examples:
feat(auth): add OAuth2 login flowfix(api): handle null response from payment gatewaydocs(readme): update setup instructionschore(deps): update vitest to v2.1ci(workflows): add coverage enforcementrefactor(sync): extract template rendering helpers
Common mistakes to avoid:
Plan: Brand-Driven Editor Theme— NOT valid, usefeat(editor): add brand-driven theme generationUpdate files— NOT valid, usechore: update generated filesWIP— NOT valid, usechore(wip): partial implementation of X
The CI branch-protection workflow rejects PRs with non-conforming titles. Fix the title before pushing.
When you modify any file in .agentkit/spec/, you MUST run sync before committing:
pnpm -C .agentkit retort:syncThen commit the regenerated output. The CI drift check will fail if generated files are out of sync. This is the #1 cause of CI failures across branches.
Workflow:
- Edit spec files in
.agentkit/spec/ - Run
pnpm -C .agentkit retort:sync - Commit spec changes and generated output together (or in two atomic commits)
- Verify with
git diff --quiet— if there's output, you missed something
Feature branches: type/short-description (e.g., feat/add-user-auth, fix/token-refresh)
All PRs must target dev — not main or any other branch unless explicitly instructed:
gh pr create --base dev --title "type(scope): description"The integration branch (dev) is the configured PR target for this repo. Creating PRs against main directly causes reverse-merge noise and bypasses the integration pipeline. A hookify rule in .claude/rules/pr-base-branch.md enforces this at runtime.
- Never commit secrets, API keys, or credentials
- Never force-push to main
- Never run destructive commands without confirmation
- Never modify files in
.agentkit/templates/,.agentkit/engines/,.agentkit/overlays/, or.agentkit/bin/— these are the upstream source-of-truth for Retort and are protected by a PreToolUse hook. Note:.agentkit/spec/is the intended edit point for project configuration — modify spec YAML files there and runretort syncto regenerate output - Never directly edit files marked
<!-- GENERATED by Retort — DO NOT EDIT -->— modify the spec in.agentkit/spec/and runretort syncinstead; if spec files changed, runpnpm -C .agentkit retort:syncand commit regenerated outputs before creating a PR - Always run
/checkbefore creating a PR - Always use Conventional Commits format for PR titles:
type(scope): description— CI rejects non-conforming titles (valid types: feat, fix, docs, style, refactor, test, chore, ci, perf, build, revert) - Always document breaking changes — PRs with
!:orBREAKINGin the title must include a## Breaking Changessection, ADR reference, or migration guide in the PR body (CI enforces this) - Always write tests for new functionality
- COMMAND_GUIDE.md — When to use orchestrate vs plan vs project-review
- AGENTS.md — Universal agent instruction file
- UNIFIED_AGENT_TEAMS.md — Full team specification
- AGENT_BACKLOG.md — Current backlog
- QUALITY_GATES.md — Definition of done per phase
- RUNBOOK_AI.md — Recovery procedures