rule-script-reconciler
Compares rule-script-map.yml with the rule markdown and the registered scripts, writes RS-* drift findings, and raises user-approvable deltas through the Decision Pause Contract, with no model judgement. Use when feature-development planning starts, or during analyze rules to confirm the map is in sync.
- License 许可
- MIT
- 所属仓库
- Eliyce/paqad-ai
- 最近更新
- 2026-11-13
- Stars
- ★ 8
- Forks
- 0
01 前言 Front Matter
- name
- rule-script-reconciler
- metadata
- { "cacheable": "false", "model_tier": "fast", "paqad-meta": "skill.meta.yaml", "output_format": "markdown" }
- description
- Compares rule-script-map.yml with the rule markdown and the registered scripts, writes RS-* drift findings, and raises user-approvable deltas through the Decision Pause Contract, with no model judgement. Use when feature-development planning starts, or during analyze rules to confirm the map is in sync.
02 资源文件 4
- 参考文档agents/openai.yaml331 B
- 参考文档references/drift-codes.md3.6 KB
- 脚本scripts/reconcile.mjs411 B
- 参考文档skill.meta.yaml259 B
03 SKILL.md 正文
What It Does
Detects every form of rules-as-scripts drift and writes .paqad/scripts/rules/.cache/drift.json:
| Code | Meaning |
|---|---|
RS-RULE-ADDED |
A markdown bullet without a <!-- @rule --> marker, or a marked rule absent from the map: an ungated addition. |
RS-RULE-EDITED |
Marker present, but the text hash differs from the map entry. |
RS-RULE-REMOVED |
A map entry whose marker is gone from the markdown. |
RS-SCRIPT-STALE |
A rule was edited but its scripts were not regenerated. |
RS-FIXTURE-FAIL |
A registered script no longer passes its own fixtures. |
RS-CACHE-INVALID |
The findings report exists but its rule_files_hash no longer reconciles. |
Any code except RS-CACHE-INVALID blocks feature-development per the project's escalation.rule_scripts_stale setting.
Use This When
- At
feature-developmentplanning entry (the planning stage instructions invoke it). - During
analyze rules, to confirm the map is in sync before classifying.
Inputs
docs/instructions/rules/rule-script-map.yml(read-only).- The rule markdown under
docs/instructions/rules/**(read-only: no marker embedding here). - The registered
.paqad/scripts/rules/**/*.mjsscripts and their fixtures. - The cached
.paqad/scripts/rules/.cache/report.jsonfor the cache-validity check.
Procedure
- Run the reconciler:
Exit 0 = clean. Exit 1 = drift present (blocking).node scripts/reconcile.mjs [project-root] - Group findings by code. For each, surface a Decision Pause packet:
RS-RULE-ADDED→ "Unmarked rule detected: treat as a new rule (runanalyze rules) or as an edit of an existing rule?"RS-RULE-EDITED→ "Rule text changed:edit rule RL-…(regenerate scripts) or accept as-is?"RS-RULE-REMOVED→ "Marker gone:remove rule RL-…?"RS-SCRIPT-STALE/RS-FIXTURE-FAIL→ "Regenerate scripts forRL-…?"
- Apply the chosen resolution through
rule-editororrule-script-generator. Never edit the map directly.
Output Contract
.paqad/scripts/rules/.cache/drift.jsonwritten with findings + counts +blocked.- A
## Drift Findingsmarkdown block listing each code, count, and one-line detail. - A
## Pending User Decisionsblock for each surfaced packet. - Under
escalation.rule_scripts_stale: stop|ask, block planning until resolved.
Escalate / Stop Conditions
- Block
feature-developmentplanning on any RS-* drift exceptRS-CACHE-INVALID, perescalation.rule_scripts_stale. - Never embed markers or write the map from this skill: resolutions route through
rule-editor/rule-script-generator. RS-CACHE-INVALIDis informational; the runner recomputes the report on its next run.
Resources
references/drift-codes.md: the RS-* vocabulary + resolution map.runtime/base/skills/rule-script-reconciler/agents/openai.yaml: agent interface metadata.src/rule-scripts/reconciler.ts: the drift-detection engine.- the Decision Pause Contract (in the framework bootstrap): packet semantics.
04 同仓库更多 Skills
sample-skill
Sample bundled skill fixture
processing-invoices
Turns a supplier invoice into one ledger line. Use when a supplier invoice arrives and needs booking.
processing-invoices
Turns a supplier invoice into one ledger line. Use when a supplier invoice arrives and needs booking.
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.
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.
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.