rule-script-runner
Runs the registered rule scripts on the diff during feature-development checks, aggregates findings into the rules report with a hash cache, and decides whether checks is blocked: deterministic findings block under strict mode, heuristic ones go to review. Use when the checks stage runs with rule_compliance in warn or strict mode.
- License 许可
- MIT
- 所属仓库
- Eliyce/paqad-ai
- 最近更新
- 2026-11-13
- Stars
- ★ 8
- Forks
- 0
01 前言 Front Matter
- name
- rule-script-runner
- metadata
- { "cacheable": "false", "model_tier": "fast", "paqad-meta": "skill.meta.yaml", "output_format": "json" }
- description
- Runs the registered rule scripts on the diff during feature-development checks, aggregates findings into the rules report with a hash cache, and decides whether checks is blocked: deterministic findings block under strict mode, heuristic ones go to review. Use when the checks stage runs with rule_compliance in warn or strict mode.
02 资源文件 4
- 参考文档agents/openai.yaml308 B
- 参考文档references/run-contract.md2.0 KB
- 脚本scripts/run.mjs717 B
- 参考文档skill.meta.yaml390 B
03 SKILL.md 正文
What It Does
During feature-development.checks, runs every script registered in docs/instructions/rules/rule-script-map.yml against the changed files (diff-scoped) and aggregates the findings:
deterministicfindings → block thechecksstage undermode: strict.heuristicfindings → informational; routed to thereviewstage alongsideadversarial-review. They never block.- A script declaring
requires.binariesthat are missing emits a clean "missing dependency" result and is skipped: it never crashes the stage.
Results are written to .paqad/scripts/rules/.cache/report.json, hash-cached on rule_files_hash × script_files_hash × target_files_hash so unchanged inputs re-use the cached report.
Use This When
- Invoked from
feature-development.checksafter the project command checks, whenchecks.rule_compliance.modeiswarnorstrict. - Never invoked directly by the user; it is a workflow sub-step.
Inputs
docs/instructions/rules/rule-script-map.yml(read-only).- The registered
.paqad/scripts/rules/**/*.mjsscripts. - The changed-files list (diff) for
scope: changed-files; whole-tree enumeration otherwise. checks.rule_compliance.modefromfeature-development.yaml.
Procedure
- Read
checks.rule_compliance.modefromfeature-development.yaml. Ifoff, skip entirely. - Run the runner:
Exit 0 = stage may proceed. Exit 1 =node scripts/run.mjs <project-root> <mode> [changed-file ...]mode: strictand adeterministicfinding blocks the stage. - Surface blocking
deterministicfindings as the stage failure with file:line and message. Passheuristicfindings to thereviewstage.
Output Contract
.paqad/scripts/rules/.cache/report.jsonwritten (or re-used from cache).- JSON
RunReporton stdout:results,counts(deterministic / heuristic / skipped), andblocking. - Non-zero exit only when
mode: strictand at least onedeterministicfinding exists.
Escalate / Stop Conditions
- Under
mode: strict, stop thechecksstage on anydeterministicfinding. - Never block on
heuristicfindings: they informreviewonly. - A missing declared binary is reported and the single script skipped; the stage is never crashed by it.
- If
rule-script-map.ymlis absent, the runner returns an empty, non-blocking report.
Resources
references/run-contract.md: mode + exit-code + diff-scope contract.runtime/base/skills/rule-script-runner/agents/openai.yaml: agent interface metadata.src/rule-scripts/runner.ts: the execution + aggregation + hash-cache engine.
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.