User Story
As an adopter running ApexYard against a domain-specific codebase, I want Rex to load domain-specific review notes when a PR touches files in that domain, so that reviews catch domain-specific gotchas that pure code-and-ticket context misses (e.g. GitHub EMU migration scripts must handle private-fork access; Stripe webhook handlers must verify the Stripe-Signature header).
Acceptance Criteria
Stage 1 — Path-globbed domain handbooks (this ticket's MVP)
Stage 2 — Codify-rule capture (follow-up ticket)
Stage 3 — Auto-propose from PR stream (follow-up ticket)
Design Notes
No UI changes — this is a Rex agent-prompt change + handbooks/ tree extension + two follow-up skills.
The framework layer change is small: Rex's prompt (.claude/agents/code-reviewer.md § 8) gains a fourth discovery glob alongside architecture / general / language. Path-match logic lives in Rex's prompt (no new hook needed — the glob runs at review time, not at edit time).
Out of Scope
- External-doc auto-fetch at review time. Tempting for ingesting GitHub's EMU docs, but introduces a freshness-versus-reproducibility tension we don't want in CI-class agents. Stays out unless an operator explicitly asks.
- Per-team / per-project handbook overrides — handbooks remain framework-level (with the custom-handbooks layer for split-portfolio adopters). Already deferred per the existing handbooks design.
- Stage 2 + Stage 3 implementations — included in ACs as follow-up scope but implemented as separate tickets so this MVP can land first.
Effort Estimate
Stage 1 only: ~2 days. Stages 2 + 3 are separate tickets.
Glossary
| Term |
Definition |
| Rex |
The Code Reviewer sub-agent (.claude/agents/code-reviewer.md) — automated first-pass review on every PR |
| Domain handbook |
A markdown file under handbooks/domain/<area>/ that captures domain-specific review knowledge (e.g. GitHub EMU semantics, Stripe webhook validation rules) |
| Path-glob frontmatter |
A paths: field in the handbook's YAML frontmatter that tells Rex "only load me if the PR diff matches one of these globs" |
| Custom-handbooks layer |
The <private>/custom-handbooks/<dim>/... tree introduced in framework #243 for split-portfolio adopters to ship private handbooks alongside the public ones |
User Story
As an adopter running ApexYard against a domain-specific codebase, I want Rex to load domain-specific review notes when a PR touches files in that domain, so that reviews catch domain-specific gotchas that pure code-and-ticket context misses (e.g. GitHub EMU migration scripts must handle private-fork access; Stripe webhook handlers must verify the
Stripe-Signatureheader).Acceptance Criteria
Stage 1 — Path-globbed domain handbooks (this ticket's MVP)
handbooks/domain/<area>/*.mddiscovered by Rex on every reviewpaths:frontmatter field (list of globs). Rex loads the handbook only when the PR diff matches at least one glob (e.g.paths: ['scripts/github-emu-migration/**'])paths:is absent or empty, the handbook always loads (foundational domain rules)ENFORCEMENT: blockingmarker honoured (same shape as architecture/general/language handbooks)<private>/custom-handbooks/domain/<area>/discovered alongside the public tree, both loaded when matchedhandbooks/README.mddocuments the new category with the frontmatter conventionhandbooks/domain/README.mdexplains path-mirroring + thepaths:field + a worked exampleStage 2 — Codify-rule capture (follow-up ticket)
/codify-ruleskill takes a human comment + diff context and proposes a handbook entryStage 3 — Auto-propose from PR stream (follow-up ticket)
/enrich-domain <area>skill walks recent merged PRs that touched the areaDesign Notes
No UI changes — this is a Rex agent-prompt change + handbooks/ tree extension + two follow-up skills.
The framework layer change is small: Rex's prompt (
.claude/agents/code-reviewer.md§ 8) gains a fourth discovery glob alongside architecture / general / language. Path-match logic lives in Rex's prompt (no new hook needed — the glob runs at review time, not at edit time).Out of Scope
Effort Estimate
Stage 1 only: ~2 days. Stages 2 + 3 are separate tickets.
Glossary
.claude/agents/code-reviewer.md) — automated first-pass review on every PRhandbooks/domain/<area>/that captures domain-specific review knowledge (e.g. GitHub EMU semantics, Stripe webhook validation rules)paths:field in the handbook's YAML frontmatter that tells Rex "only load me if the PR diff matches one of these globs"<private>/custom-handbooks/<dim>/...tree introduced in framework #243 for split-portfolio adopters to ship private handbooks alongside the public ones