skills/rdc-extract-verifier-rules/SKILL.md
Read recent enhancement-log entries, cluster failures by pattern, generate candidate verifier rules, test them against the known-good corpus and the failure corpus, and propose pull requests adding the highest-confidence rules to forbidden-patterns.json. Use this skill on a nightly cadence (3 AM PT), or manually when the user says "extract verifier rules", "promote enhancement log", "what new rules should we add", or after a significant brochure run produced many failures.
npx skillsauth add LIFEAI/rdc-skills rdc-extract-verifier-rulesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
The self-learning loop. The verifier corpus is the moat (per DECISIONS-LOG.md D-009). This skill is how the corpus grows.
enhancement-log.jsonl entries since last run timestampN >= 3 occurrences:
proposepropose candidate:
regen-root adding the rule to verifiers/forbidden-patterns.json.rdc/reports/verifier-{YYYY-MM-DD}.mdTwo-stage clustering:
Stage 1 — Fingerprint clustering:
input_fingerprint (sha256 of the offending JSX block)Stage 2 — Semantic clustering:
reason and pattern fields with @xenova/transformers (384-dim, local — no API)For each cluster, generate one of:
pattern strings in the clusterExample:
Cluster patterns:
<div className="flex flex-col gap-4">
<div className="flex flex-col gap-6">
<div className="flex flex-row items-center">
Generated regex:
<div[^>]*className="[^"]*\\bflex\\b
Example:
AST candidate:
JSXOpeningElement[name.name='div'] > JSXAttribute[name.name='className'] CallExpression[callee.name='clsx']
Run the candidate against the known-good corpus:
final_grade >= 85corpus:reference in SupabaseIf the candidate matches any known-good output → reject the candidate. False positives in the verifier corpus are unacceptable because they break working flows.
Run the candidate against the failure cluster:
For each promoted candidate, create a PR on LIFEAI/regen-root:
Title: [verifier-corpus] Add rule FP0{N} — {short description}
Body:
This rule was generated by rdc:extract-verifier-rules on {date}.
**Cluster size:** {N} occurrences over {time span}
**False positive rate:** {rate}
**Recall:** {percent}
**Sample failures:**
{3-5 example enhancement-log entries}
**Generated rule:**
```json
{rule JSON}
Reviewer checklist:
Auto-merging: {yes/no based on confidence}
## Auto-merge policy
Auto-merge if **all** are true:
- False-positive rate = 0
- Recall ≥ 95%
- Cluster size ≥ 10
- The rule pattern is a strict subset of an existing pattern (not a fundamentally new category)
- A maintainer's auto-merge flag is enabled in `.rdc/config.json`
Otherwise, await human review.
## Output: nightly report
`.rdc/reports/verifier-{YYYY-MM-DD}.md`:
```markdown
# Verifier Corpus Update — {date}
## Summary
- Enhancement log entries since last run: {N}
- Clusters identified: {C}
- Rules proposed: {R}
- Rules auto-merged: {A}
- Rules awaiting review: {W}
## Top clusters
| Cluster | Size | Pattern | Status |
|---|---|---|---|
| ...
## Open PRs
- #{N}: FP0{X} — {description}
- ...
## False-positive rejections
Candidates that failed the known-good test:
- {summary}
## Corpus growth
- Total rules in forbidden-patterns.json: {before} → {after}
- Total component-allowlist entries: unchanged
- Pagination rules: unchanged
A maintainer can run this skill manually after a significant brochure run to immediately promote lessons learned:
rdc:extract-verifier-rules --since "2026-05-27" --auto-merge=false
The --auto-merge=false flag forces human review on all proposals regardless of confidence.
The verifier corpus is the asset. Anyone can copy the kit. Anyone can copy the ESLint plugin. Replicating 12 months of customer-tested failure patterns is the moat. This skill is how that moat compounds. Every brochure run feeds it. Every nightly run grows it.
After 12 months at moderate scale, the corpus will contain ~500-2,000 rules, calibrated against real customer documents, with each rule's hit count visible. New competitors entering this category will face a starting position 12 months behind.
That is the point.
testing
Orchestrate a Brochurify job from source ingest through delivered PDF, using six parallel-dispatched typed sub-agents and the convergence loop. Use this skill EVERY TIME the user invokes Brochurify directly via "brochurify this", "make a brochure from", "convert this to a brochure PDF", or "rdc:brochurify". Also runs automatically when a job arrives from the broker via monkey_dispatch. The skill enforces D-001 through D-016 from the brochurify DECISIONS-LOG.
devops
The mandatory contract for authoring brochure JSX using @lifeai/brochure-kit. Use this skill EVERY TIME any AI engine (Claude, Cursor, Copilot, /design, Cowork, v0) generates JSX intended for the Brochurify pipeline — whether the user says "write a brochure," "make a one-pager," "draft a PDF report," or any equivalent. Also trigger when a file imports from @lifeai/brochure-kit. Failing to read this skill before authoring is a defect.
testing
Usage `rdc:housekeeping [--fix]` — Weekly maintenance audit: directory structure verification, PUBLISH.md URL validation, CLAUDE.md freshness, orphan detection, places compliance, and stale version scan. Produces `.rdc/reports/YYYY-MM-DD-housekeeping.md`. With `--fix`, auto-remediate safe issues.
tools
Convert Office documents to/from Markdown with the build-corpus CLI: .docx/.pptx/.ppt → Markdown (Word OMML equations become KaTeX-readable TeX; tables, images, headings preserved), and Markdown → Word (.docx) where inline $...$ and display $$...$$ LaTeX become NATIVE Office Math (OMML) that Word renders as real equations. Use this skill whenever the user asks to convert a Word/PowerPoint document to Markdown, build a Markdown corpus from Office files, turn Markdown into a .docx (optionally with a .dotx template), or "open the report" to edit. Install build-corpus straight from GitHub and run it in the session.