Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

agent-rule-enforcement

БесплатноЗапускает вложенные скриптыНе проверен

Audit whether an agent's written rules are actually enforceable: classify each rule as interception, exit gate, detection, or prompt-only, compute blocking…

cengcengcai-creatorот cengcengcai-creator223 установки в других каталогах

Об этом скилле

Agent Rule Enforcement

Rules are cheap to write and expensive to enforce. This skill separates three questions that usually get merged:

  1. What did we write? (rulebook audit)
  2. What actually happens? (behavior audit over logs)
  3. What would make it stick? (conversion to an enforcement point)

Developed through agent operation and corrected against real failures, not hand-authored as a prompt template.

Applicability

Use for

  • A rulebook or system prompt that has grown past what anyone can track.
  • The question “are these rules actually followed, or just written?”
  • Measuring whether a rules change improved enforcement rather than adding more text.

Do not use for

  • Drafting new policy. This audits enforcement, not intent.
  • Compliance certification. Coverage is a structural metric, not an assurance of correct behaviour.
  • Rule sets with no execution surface at all (pure advice documents).

Boundary

Required: a rule file in Markdown or plain text, and read access to execution artefacts (scripts, hooks, logs) if they exist.

Optional: an event log (JSONL) for the behavior audit; tool-policy configuration; exit-code gates.

Known limits:

  • Tier classification is judgement. Keyword heuristics are a starting point, not a verdict.
  • Coverage counts rules, not strength. One interception can matter more than twenty detections.
  • A rule classified as “detected” may still be routinely violated; detection is not correction.
  • This skill cannot prove safety or correctness; it can only show where enforcement is absent.

Part A — Rulebook audit

A1. Quantify the surface

Count must-clauses separately from descriptive prose. Only must/shall/required/never-style statements enter the audit.

Completion criterion: a number for must-clauses, plus the file and line range audited.

A2. Inventory the executors

List everything that can actually stop or detect something: pre-action checks, tool policies, exit-code gates, scheduled audits, CI checks.

Completion criterion: each executor names the rules it covers.

A3. Classify every must-clause into exactly one tier

Tier Test Example
Interception The action cannot complete without passing tool not mounted, permission denied, sandbox boundary
Exit gate A script returns non-zero and blocks “done” deliverable check, linter, schema validation
Detection A later scan can find it, but nothing stops it transcript audit, log query, periodic report
Prompt-only Written in the rule file, no checker anywhere “ask when unsure”

Completion criterion: every must-clause has one tier; counts sum to the total.

A4. Compute blocking coverage

blocking coverage = (interception + exit gate) / must-clauses

Report detection coverage separately. Never merge the two. A rule that can be found afterwards is not a rule that is enforced.

Completion criterion: both percentages present, with the formula shown.

Part B — Behavior audit

Structure inspection says what could happen; logs say what did. Run both, and keep the conclusions separate.

B1. Define observable checks

A check must be a predicate over event fields, not a reading of intent. Good checks:

Check Predicate
Long task, no checkpoint duration_ms > threshold and checkpoint_count == 0
Retry storm same tool called >= N times consecutively after errors
Silent failure outcome == error and user_visible_message == false
Unverified claim task produced claims and tool_calls == 0

Completion criterion: every check names the fields it reads and the threshold it uses.

B2. Segment tasks

Group events into tasks by session and idle gap. State the gap and why; segmentation is a judgement that changes every count.

Completion criterion: segmentation rule written down; task count reported.

B3. Run and report

Report per-check: hits, base (how many tasks were eligible), rate. Do not report a naked hit count.

Completion criterion: each check has hits / base / rate, and the log window is stated.

B4. Calibrate before trusting

Run the audit on a period where you know the answer. If the checks fire on known-good runs, the checks are wrong — fix the predicate, not the threshold.

Completion criterion: at least one false-positive check documented and corrected, or an explicit note that calibration was not performed.

Part C — Conversion

Order of leverage, most to least:

  1. Move the rule to an interception point — tool policy, permission, sandbox. Cheapest and strongest.
  2. Add an exit gate — a script that returns non-zero. Start as warning-only, promote after a clean week.
  3. Keep detection — only where interception is impossible (e.g. judgement calls).
  4. Leave as prompt — only for rules that genuinely need judgement, and accept that they will sometimes be missed.

Output at most three conversion proposals. Each must n

Полный SKILL.md на ClawHub

Установить agent-rule-enforcement в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл agent-rule-enforcement?

Audit whether an agent's written rules are actually enforceable: classify each rule as interception, exit gate, detection, or prompt-only, compute blocking coverage, and run behavioral checks over event logs. Use when a rulebook has grown, when someone asks whether rules are really followed, or after changing agent instructions. Tool-agnostic; works on Markdown rules and JSONL event logs.

Как установить скилл agent-rule-enforcement?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл agent-rule-enforcement запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить agent-rule-enforcement с