Phase 12: Agent Specialization & Domain-Expert QA

phase-pal-e-agency-12-agent-specialization Phase

phase
Goal: Split the agent model into domain-specialized execution agents and expert QA reviewers. DevOps splits from Dev-Backend. QA becomes Dev-QA and DevOps-QA with deep domain expertise. Issue routing via domain labels.
Owner: Betty Sue (docs) + Dev agent (configs)
Repo: forgejo_admin/claude-custom (agent configs, hooks, skills)
Depends on: None (independent of Phases 10-11)

Design Principles

  • Execution agents (Dev-Frontend, Dev-Backend, DevOps): Action-biased. Read issue, write code, open PR. Hooks enforce SOP compliance mechanically — agent can't skip it. No expertise loading needed, just execution.
  • QA agents (Dev-QA, DevOps-QA): Quality-biased. Deep domain expertise (PEP, OWASP, Terraform best practices, k8s security benchmarks). Flag process gaps ("this should be in CI"). Suggest test improvements. First-class process contributors, not just code reviewers.
  • Frontend exception: Impeccable stays on Dev-Frontend because design is write-time — can't review bad typography into good typography. Backend/DevOps quality IS review-time — QA catches it.
  • QA as DORA auditor: Every manual validation step QA spots is a DORA regression. QA agents flag "why isn't this automated?" and generate TODOs for pipeline improvements.

Agent Model Evolution

Current New Change
Dev-Backend (Python + IaC) Dev-Backend (Python/FastAPI/SQLAlchemy only) Remove IaC scope
DevOps (Salt + Terraform + k8s + ArgoCD + Helm) New agent, split from Dev-Backend
QA (generalist) Frontend-QA (a11y, performance, responsive, UX expert) Domain-specialized + design review
QA (generalist) Dev-QA (Python/FastAPI/SQLAlchemy/PEP expert) Domain-specialized + process feedback
DevOps-QA (IaC/k8s/ArgoCD/Terraform expert) Domain-specialized + process feedback

Scope

Sub Deliverable Owner Repo Status
12a Agent definitions in pal-e-docs — create <code>agent-devops</code>, <code>agent-frontend-qa</code>, <code>agent-dev-qa</code>, <code>agent-devops-qa</code> notes. Update org chart, SOPs. Deprecate <code>agent-qa</code>. Betty Sue + Dottie n/a (pal-e-docs) COMPLETED
12b Agent configs in claude-custom — PR #100 merged. 4 agent configs, spawn requirements, subagent context injection. Dev agent forgejo_admin/claude-custom COMPLETED
12c Domain label routing — PR #102 merged. Labels on 36 repos. Smart <code>/review-pr</code> router. Domain label enforcement hook. Betty Sue + Dev agent forgejo_admin/claude-custom COMPLETED
12v <strong>Validation gate — L1 PASSED, L2 COMPLETED.</strong> <strong>L1:</strong> PR #106 merged (config fixes). All 4 tested agent types PASS. <strong>L2 FINDING:</strong> Legacy generic QA outperformed domain QA (6 blockers caught vs 0). Root cause: Claude Opus already has domain expertise — specialization CONSTRAINED attention rather than ADDING capability. <strong>DECISION:</strong> Consolidated back to 5-agent model (PR #108 merged): Dev (all capabilities), QA (generic + dynamic domain), Betty Sue, Penny, Dottie. PRs #110 (Impeccable cleanup) and #112 (skill flags) also merged. Betty Sue n/a (operational validation) COMPLETED
12d QA process feedback loop — give QA agent limited pal-e-docs write access. <strong>DORMANT:</strong> Genuine capability improvement but separate concern from specialization. Activate when QA write access becomes a bottleneck. Dev agent forgejo_admin/claude-custom DORMANT
12e QA knowledge layer — embed domain expertise into vector store. <strong>DESCOPED:</strong> L2 proved the model already has domain expertise. RAG adds nothing. Invalidated by data. Betty Sue + Dev agent Cross-pillar DESCOPED

DORA Impact

  • Change Failure Rate (Agency metric): Domain-expert QA catches domain-specific bugs that generalist QA misses. Fewer post-merge defects.
  • Lead Time (Docs metric): QA process feedback creates TODOs for pipeline automation. Every manual step flagged → automated → lead time decreases over time.
  • Deployment Frequency (Platform metric): Better QA = fewer rework cycles = faster merge velocity.
  • plan-pal-e-agency — parent plan
  • agent-dev-frontend — Impeccable-powered frontend agent (the model for domain specialization)
  • agent-dev-backend — existing backend agent (scope narrows in 12b)
  • agent-qa — existing generalist QA (replaced by Dev-QA + DevOps-QA in 12a-12b)
  • enforcement-architecture — enforcement layers that constrain agent behavior
  • plan-pal-e-pac — sovereign dev experience (nanochat fine-tuning, 12e dependency)