User Story
As an operator using ApexYard's Rex agent, I want a /codify-rule skill that turns a human-review comment (that caught a Rex-miss) into a draft handbook entry, so that the handbook layer compounds on Rex's actual misses rather than only the rules an operator thought to write proactively.
Acceptance Criteria
Design Notes
This is Stage 2 of #293 (Rex domain-aware handbooks). Stage 1 (the path-glob discovery foundation) merged via PR #294 / commit 28b3b76. Stage 3 (/enrich-domain for mining recent PRs) is a separate follow-up ticket.
Bumping above other v1.5 items because the harness can only improve itself if this exists. Without /codify-rule, the handbook layer stays at "rules an operator thought to write" — a static slice. With it, the layer becomes a learning surface that compounds with every Rex-miss.
Reference: industry harness-engineering "steering loop" — "whenever an issue happens multiple times, the feedforward and feedback controls should be improved". /codify-rule is the operator-side hook into that loop.
Out of Scope
- Mining historical PRs (that's Stage 3 /
/enrich-domain)
- Auto-suggesting rules without operator approval — every capture is Y/N gated
- Cross-project rule propagation (single project's
handbooks/domain/<area>/ only)
Glossary
| Term |
Definition |
| Rex-miss |
A bug a human caught in review that Rex didn't flag — exactly the kind of miss a domain handbook could prevent next time |
| Steering loop |
industry harness-engineering's term for the operator's job — iterating the harness based on observed miss patterns |
| Capture |
The shape of evidence /codify-rule extracts: comment text + file:line + author + PR# |
Surfaced 2026-05-19 reading industry harness-engineering article; matches the planned Stage 2 of #293.
User Story
As an operator using ApexYard's Rex agent, I want a
/codify-ruleskill that turns a human-review comment (that caught a Rex-miss) into a draft handbook entry, so that the handbook layer compounds on Rex's actual misses rather than only the rules an operator thought to write proactively.Acceptance Criteria
/codify-ruleinvokable from any PR context (current PR inferred from branch / cwd, or passed as arg)# Handbook: <title>/## The rule/## Why/## What Rex flags/## Sample finding/## What's NOT a violationpaths:frontmatter pre-populated); architecture handbook if pattern matches existing arch concerns; general otherwiseENFORCEMENT: blocking/codify-rulecapture appends as a new entry, doesn't overwriteDesign Notes
This is Stage 2 of #293 (Rex domain-aware handbooks). Stage 1 (the path-glob discovery foundation) merged via PR #294 / commit 28b3b76. Stage 3 (
/enrich-domainfor mining recent PRs) is a separate follow-up ticket.Bumping above other v1.5 items because the harness can only improve itself if this exists. Without
/codify-rule, the handbook layer stays at "rules an operator thought to write" — a static slice. With it, the layer becomes a learning surface that compounds with every Rex-miss.Reference: industry harness-engineering "steering loop" — "whenever an issue happens multiple times, the feedforward and feedback controls should be improved".
/codify-ruleis the operator-side hook into that loop.Out of Scope
/enrich-domain)handbooks/domain/<area>/only)Glossary
/codify-ruleextracts: comment text + file:line + author + PR#Surfaced 2026-05-19 reading industry harness-engineering article; matches the planned Stage 2 of #293.