Best for
- measureaugmentbudget --check fails (utilisation ≥ 0.95)
- A new rule would push the budget over 0.95 — caught by the budget
- User says "audit rules", "rule cleanup", "rules over budget",
event4u-app/agent-config/src/skills/rule-refactor/SKILL.md
Use when the rule set is over the Augment budget, when a new rule would breach it, or when asked to audit / merge / prune rules — runs the audit pipeline and proposes a verdict per rule.
Decision brief
Use when the rule set is over the Augment budget, when a new rule would breach it, or when asked to audit / merge / prune rules — runs the audit pipeline and proposes a verdict per rule.
Compatibility matrix
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/event4u-app/agent-config --skill "src/skills/rule-refactor"Inspect the Agent Skill "rule-refactor" from https://github.com/event4u-app/agent-config/blob/0adf49a8ae84b0ff6e2de8759eea43257e020eff/src/skills/rule-refactor/SKILL.md at commit 0adf49a8ae84b0ff6e2de8759eea43257e020eff. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
The audit infrastructure already exists — compose it:
measureaugmentbudget --check fails (utilisation ≥ 0.95) A new rule would push the budget over 0.95 — caught by the budget gate in rule-writing User says "audit rules", "rule cleanup", "rules over budget", "prune rules", "merge rules", "rule system review" Periodic governance pas…
Threshold-lift is forbidden. When the budget breaches, the content must shrink — not the gate. Loosening FAILTHRESHOLD in scripts/measureaugmentbudget.ts to make CI pass is an explicit anti-pattern. The only valid budget-growth move is an ADR that raises TOTALCAP.
Review the “1. Inspect the current budget state” section in the pinned source before continuing.
The audit infrastructure already exists — compose it:
Permission review
The documentation asks the agent to create, modify, or delete local files.
**delete** → remove the file from `.agent-src.uncondensed/rules/`The documentation asks the agent to run terminal commands or scripts.
bash scripts/condense.sh --syncEvidence record
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 91/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 7 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
measure_augment_budget --check fails (utilisation ≥ 0.95)rule-writingDo NOT use this skill for:
rule-writingrule-writingThreshold-lift is forbidden. When the budget breaches, the
content must shrink — not the gate. Loosening FAIL_THRESHOLD in
scripts/measure_augment_budget.ts to make CI pass is an explicit
anti-pattern. The only valid budget-growth move is an ADR that
raises TOTAL_CAP.
./scripts-run src/scripts/measure_augment_budget --json > /tmp/budget-before.json
./scripts-run src/scripts/measure_rule_budget --json > /tmp/rule-budget-before.json
The audit infrastructure already exists — compose it:
./scripts-run src/scripts/audit_auto_rules # → agents/runtime/reports/auto-rules-audit.{json,md}
./scripts-run src/scripts/audit_overlap # → appends overlap pairs to the MD
./scripts-run src/scripts/audit_likelihood # → agents/runtime/reports/auto-rules-likelihood.json
Then read agents/runtime/reports/auto-rules-audit.md end-to-end.
For each rule the audit surfaces (overlap pair, low-likelihood, oversized, or the new addition that triggered this skill), assign exactly one verdict:
| Verdict | Test |
|---|---|
| keep | Iron-Law / always-on safety net, no overlap, fires often |
| merge | ≥ 2 rules same domain, near-identical triggers, overlap ≥ 0.4 |
| delete | Never fires (low-likelihood + no path/keyword hit in 30 days), or fully subsumed by a skill |
| move-to-context | Body is reference material (tables, mechanics, examples) — the obligation is short, the rest is lookup |
| promote-to-skill | Body has numbered steps / a workflow — not a constraint |
One Markdown table, one row per flagged rule, before any file change. User approves the list. No silent edits.
For each approved verdict:
routes_to: references..agent-src.uncondensed/rules/
and the corresponding dist/agent-src/rules/ projection..agent-src.uncondensed/contexts/<area>/<name>.md, replace the
rule body with the obligation + a load_context: pointer..agent-src.uncondensed/skills/<name>/SKILL.md, replace the rule
with an auto-trigger stub that routes to it (or delete the rule
entirely if the skill's own trigger suffices).bash scripts/condense.sh --sync
./scripts-run src/scripts/condense --generate-tools
./scripts-run src/scripts/measure_augment_budget --check # must exit 0
./scripts-run src/scripts/skill_linter --all # 0 FAIL
Then run your package's full CI pipeline (see Taskfile.yml for the
canonical sequence) before pushing.
Append a snapshot to agents/runtime/.augment-budget-history.jsonl:
./scripts-run src/scripts/measure_augment_budget --trend-append
Commit the cleanup as a separate chunk from any rule-add commits so the history shows "added X" + "cleaned up Y" as distinct steps.
measure_augment_budget --check output showing utilisation < 0.95FAIL_THRESHOLD to dodge the auditroutes_to: pointer without
updating the pointer's sourceTOTAL_CAP) without an ADROn cloud surfaces, the audit scripts are not reachable. The skill still applies — prose-only: