# AGENTS.md — Sub-agent Roster

> Real agent definitions land in `.claude/agents/` during Phase 7. This file lists the roster and trigger phrases so contributors know what's available and which agent owns which kind of work.

Each agent will be a Markdown file with: role, responsibilities, allowed scope (folders/files/tools), forbidden actions, required context files, quality checklist, and a handoff protocol.

## Roster

| Agent                   | Use when...                                                          | Scope (after Phase 7)                                |
| ----------------------- | -------------------------------------------------------------------- | ---------------------------------------------------- |
| `architect-agent`       | Designing a new system, drafting an ADR, choosing between approaches | Read-only across repo, write `docs/decisions/`       |
| `frontend-agent`        | Angular or Next.js work — components, services, routing, state       | `apps/web-angular`, `apps/web-next`, `packages/ui-*` |
| `backend-agent`         | NestJS or .NET API work — endpoints, modules, services               | `apps/api-nest`, `dotnet/`, `enterprise-modules/`    |
| `database-agent`        | Schema, migrations, queries, indexes (Prisma + EF + raw SQL)         | `prisma/`, `database/`                               |
| `devops-agent`          | Docker, K8s, CI/CD, env management                                   | `platform/`, `.github/workflows`, `.gitlab-ci.yml`   |
| `security-agent`        | Auth, secrets, OWASP review, dependency vuln triage                  | Read-only + `SECURITY.md`, `docs/compliance/`        |
| `reviewer-agent`        | Pre-merge code review for style, conventions, anti-patterns          | Read-only across diff                                |
| `documentation-agent`   | Docs sync, ADRs, runbooks, knowledge base updates                    | `docs/`, `knowledge/`, README files                  |
| `qa-agent`              | Writing tests, raising coverage, E2E scenarios                       | `*.spec.ts`, `*.test.ts`, `*.Tests.cs`, `e2e/`       |
| `performance-agent`     | Lighthouse, bundle size, DB query plans, load testing                | Read-only + reports under `docs/`                    |
| `accessibility-agent`   | WCAG 2.2 AA reviews, keyboard nav, screen-reader labels              | `apps/web-*/**`                                      |
| `i18n-agent`            | Keep TH/EN locale files in sync                                      | `apps/web-*/i18n`, `packages/i18n-keys`              |
| `migration-agent`       | Safe schema/breaking changes with rollback plans                     | `prisma/migrations`, `database/migrations`           |
| `cost-agent`            | Cloud + AI + dependency cost optimization                            | Read-only + `docs/cost-reports/`                     |
| `prd-agent`             | Turning a vague idea into a PRD + tickets                            | `docs/prd/`                                          |
| `release-manager-agent` | Version bumps, changelogs, release notes                             | `CHANGELOG.md`, `package.json`, tags                 |

## Orchestrators

Multi-agent pipelines live in `.claude/orchestrators/` (Phase 7):

- `feature-orchestrator` — prd → architect → backend → frontend → qa → reviewer → documentation
- `review-orchestrator` — reviewer + security + performance + accessibility (parallel)
- `deployment-orchestrator` — security-audit → perf-audit → release-manager → devops
- `release-orchestrator` — changelog → tag → notes → notifications
- `incident-orchestrator` — triage → root-cause → fix → postmortem ADR

## Until Phase 7 lands

The primary agent acts as all-of-the-above with the principles in [`CLAUDE.md`](CLAUDE.md). When uncertain, fall back to:

1. Read the most relevant `CLAUDE.md` (root or layer-specific).
2. Check existing ADRs in `docs/decisions/`.
3. If the decision is novel and load-bearing, write a new ADR and continue.
