extract-rule
Installation
SKILL.md
Code changes often encode a decision that was made once but should guide every future change:
where a file belongs, how a test is written, what a layer may depend on.
This skill turns those implicit decisions into explicit rules under docs/rules/,
so agents and humans can follow them without rediscovering the reasoning.
The flow is interactive by design: the user confirms the distilled rules and their wording before anything is written. Do not skip the confirmation points.
Step 1: Establish the scope
Run git status --porcelain.
- If there are uncommitted changes (staged, unstaged, or untracked), those files are the scope.
- Otherwise, ask the user for a specific commit or a number of commits behind the current branch.
Propose the latest commit (
HEAD) as the default.
Set aside files that carry no engineering decision — agent/tooling artefacts
(e.g. .agents/, skills-lock.json), lockfiles, generated files — and say which ones you excluded.
State the chosen scope back to the user in one line before continuing.