본문으로 건너뛰기
cccskills
무료GitHub에 공개

rule-refactor

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md5.2 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

<!-- cloud_safe: degrade -->

rule-refactor

When to use

  • measure_augment_budget --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 pass after a batch of rule additions

Do NOT use this skill for:

Iron Law

Threshold-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.

Procedure

1. Inspect the current budget state

./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

2. Run the audit pipeline

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.

3. Categorise every flagged rule

For each rule the audit surfaces (overlap pair, low-likelihood, oversized, or the new addition that triggered this skill), assign exactly one verdict:

VerdictTest
keepIron-Law / always-on safety net, no overlap, fires often
merge≥ 2 rules same domain, near-identical triggers, overlap ≥ 0.4
deleteNever fires (low-likelihood + no path/keyword hit in 30 days), or fully subsumed by a skill
move-to-contextBody is reference material (tables, mechanics, examples) — the obligation is short, the rest is lookup
promote-to-skillBody has numbered steps / a workflow — not a constraint

4. Present the verdict table to the user

One Markdown table, one row per flagged rule, before any file change. User approves the list. No silent edits.

5. Apply approved changes

For each approved verdict:

  • merge → rewrite the surviving rule to cover both domains; delete the absorbed one; update any routes_to: references.
  • delete → remove the file from src/rules/ and the corresponding dist/agent-src/rules/ projection.
  • move-to-context → extract the body into src/agent-src/contexts/<area>/<name>.md, replace the rule body with the obligation + a load_context: pointer.
  • promote-to-skill → create src/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).

6. Re-validate

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.

7. Record the delta

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.

Output format

  1. Verdict table (approved by user) at the top of the cleanup PR description
  2. Per-verdict commits (one per merge / delete / move / promote group)
  3. Final measure_augment_budget --check output showing utilisation < 0.95
  4. Trend snapshot recorded

Gotchas

  • Do NOT raise FAIL_THRESHOLD to dodge the audit
  • Do NOT delete a rule that has a routes_to: pointer without updating the pointer's source
  • Do NOT merge rules across tier boundaries (e.g. tier-1 always with a tier-3 stub) without surfacing the tier collapse to the user
  • Do NOT skip the trend-append — the history is what tells future agents how the cap was managed

Do NOT

  • Do NOT loosen the budget gate
  • Do NOT touch the cap (TOTAL_CAP) without an ADR
  • Do NOT apply changes before user approves the verdict table
  • Do NOT delete the rule-refactor audit reports — they're the artifact reviewers cite

Cloud Behavior

On cloud surfaces, the audit scripts are not reachable. The skill still applies — prose-only:

  • Inspect the rule list (frontmatter + descriptions) and propose the verdict table from reading alone.
  • Tell the user to run the audit scripts locally before applying.
  • Do not attempt to call any script.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use when reviewing UI for accessibility — WCAG 2.2 AA, keyboard nav, focus, ARIA, contrast, screen-reader semantics — even on 'is this a11y-OK?' or 'mach das barrierefrei'.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config132026년 10월 22일 업데이트

Use when defining or auditing the activation event — aha-moment selection, retention correlation, falsifiable definition. Triggers on 'what is our aha moment', 'redefine activation'.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config132026년 10월 22일 업데이트

Use when capturing an architectural decision — file naming, next ADR number, Status / Context / Decision / Consequences, index regen; fires even without saying 'ADR'.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config132026년 10월 22일 업데이트

Adversarial critique — devil's advocate, stress-test, honest teardown ('poke holes', 'be brutal', 'was hältst du davon'); explicit request only. Routine code or design review → code-review.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config132026년 10월 22일 업데이트

Use when reading, creating, or updating agent documentation, module docs, roadmaps, or AGENTS.md. Understands the full .augment/, agents/, and copilot-instructions structure.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config132026년 10월 22일 업데이트

Use for an adversarial red-team / blue-team / auditor review of an AI agent's CONFIG + behaviour (rules, skills, MCP, hooks, permissions) — attack-chain → defensive-gap list, not a code audit.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

event4u-app/agent-config132026년 10월 22일 업데이트

event4u-app의 스킬 모두 보기

이 스킬의 문제 신고