AGENT SKILL

rule-editor

Adds, edits, removes or downgrades one rule in rules-as-scripts with a per-rule cascade and no global rebuild: mints or keeps the stable RL-hash id, regenerates only that rule's scripts, and writes the map through src/rule-scripts/apply.ts. Use when the user asks to add, edit or remove a rule, or to mark one unverifiable.

License 许可
MIT
所属仓库
Eliyce/paqad-ai
最近更新
2026-11-13
Stars
★ 8
Forks
0

01 前言 Front Matter

name
rule-editor
metadata
{ "cacheable": "false", "model_tier": "medium", "paqad-meta": "skill.meta.yaml", "output_format": "markdown" }
description
Adds, edits, removes or downgrades one rule in rules-as-scripts with a per-rule cascade and no global rebuild: mints or keeps the stable RL-hash id, regenerates only that rule's scripts, and writes the map through src/rule-scripts/apply.ts. Use when the user asks to add, edit or remove a rule, or to mark one unverifiable.

02 资源文件 4

03 SKILL.md 正文

What It Does

Owns the mutation cascade so adding, editing, or removing a rule recomputes only what changed: never a full regeneration:

Mode Effect
add Inserts the bullet into the target rule file, mints a stable RL-<hash> id, then classifies + generates scripts for only the new rule.
edit Updates the bullet text, preserves the id, regenerates only that rule's scripts, and surfaces a behavior diff via Decision Pause when scripts change.
remove Removes the bullet, moves the map entry to archived: (delayed delete); scripts pruned on the next regen pass.
downgrade Keeps the rule, deletes its scripts, flips the map entry to verifiability.kind: unverifiable with a recorded reason.

Use This When

  • A user prompt matches the priority-225 router rules add rule, edit rule, remove rule, or mark rule as unverifiable.

Inputs

  • The target rule file (for add) or the RL-<id> (for edit/remove/downgrade).
  • The new rule text (add, edit) or downgrade reason (downgrade).
  • docs/instructions/rules/rule-script-map.yml (written only via the bundled wrapper → src/rule-scripts/apply.ts).

Procedure

  1. Apply the deterministic mechanics:
    node scripts/edit-rule.mjs add       <project-root> <source-rel> "<text>"
    node scripts/edit-rule.mjs edit      <project-root> RL-<id> "<text>"
    node scripts/edit-rule.mjs remove    <project-root> RL-<id>
    node scripts/edit-rule.mjs downgrade <project-root> RL-<id> "<reason>"
    
  2. For add and edit: re-run analyze rules (idempotent, touches only the changed rule) then generate rule scripts with only_rule_id set to the affected id, so only that rule's scripts are regenerated.
  3. For edit, diff the regenerated scripts against the prior ones; if behavior changed, surface a Decision Pause packet before accepting.
  4. Present a ## Rule Change Summary naming the id, the mode, and any scripts added/removed.

Output Contract

  • The rule markdown updated with a preserved/minted <!-- @rule RL-<hash> --> marker.
  • rule-script-map.yml updated via src/rule-scripts/apply.ts (archive on remove, unverifiable on downgrade, script set on add/edit).
  • A ## Rule Change Summary markdown block.

Escalate / Stop Conditions

  • edit / remove / downgrade on an id not found on disk stops with a clear error: never guesses which rule was meant.
  • Behavior-changing edit regenerations surface a Decision Pause diff before acceptance.
  • Never edit rule-script-map.yml by hand; the wrapper is the only path.
  • A new rule that contradicts an existing one is surfaced as a conflict (via rule-analyzer) before its scripts are written.

Resources

  • references/edit-modes.md: the four sub-modes + cascade contract.
  • runtime/base/skills/rule-editor/agents/openai.yaml: agent interface metadata.
  • src/rule-scripts/editor.ts: markdown add/edit/remove mechanics.
  • src/rule-scripts/mutate.ts: per-rule map mutations.
  • the Decision Pause Contract (in the framework bootstrap): packet semantics for edit diffs + conflicts.

04 同仓库更多 Skills

Eliyce
Eliyce/paqad-ai

sample-skill

Sample bundled skill fixture

★ 8
Eliyce
Eliyce/paqad-ai

processing-invoices

Turns a supplier invoice into one ledger line. Use when a supplier invoice arrives and needs booking.

★ 8
Eliyce
Eliyce/paqad-ai

processing-invoices

Turns a supplier invoice into one ledger line. Use when a supplier invoice arrives and needs booking.

★ 8
Eliyce
Eliyce/paqad-ai

understand-idea

Chat and Claude Code: Step 1 of the discover journey: clarifies the goal, who benefits, success and constraints into the idea block. Use when the journey directs it to step 1, not directly.

★ 8
Eliyce
Eliyce/paqad-ai

size-work

Chat and Claude Code: Suggest a size for a ticket from comparable finished work, as a labelled suggestion the team still owns. Use it when someone asks "how big is this?", "roughly how much work is ABC-12?", or wants a backlog item sized. It finds the team's sizing scale at first use, picks two to five of the closest finished tickets with links, and gives a size or range with the drivers behind it and a confidence of low, medium or high, lowered and explained when the area's documents are template text. Every result is labelled a suggested size, never a date or a commitment. It writes nothing into the size field unless the user says "set it", and it refuses to overwrite an existing size unless the user asks to replace it. Produces the sizing block of the record.

★ 8
Eliyce
Eliyce/paqad-ai

refine-ticket

Chat and Claude Code: Improve one or more existing tracker tickets without losing the author's intent. Use it when someone wants a ticket read, diagnosed and tidied up ("this ticket is vague", "fix up ABC-12", "split this, it's too big"). It reads each ticket in full and snapshots it with its last-updated time, says what is wrong with evidence, and proposes a field-by-field before and after change set limited to summary, description, labels, parent, links and new child tickets on a split. It writes nothing until an explicit "apply it" bound to that exact change set, re-checks the ticket for conflicting edits just before writing, never replaces rich descriptions with plain text, never deletes or closes a ticket, and reads each ticket back after applying. Produces the existing and changes blocks of the record.

★ 8