What it is for
Produces a rules inventory where every entry was read back against source. It records where each rule is enforced and what happens on violation, and it separates declared-but-unenforced values from real rules. Use it when- You need a list of the calculations, validations, authorization checks or state transitions in a module or domain.
- You are starting a modernization and need the behavioral contract.
Prerequisites
- A repository that CoreStory v3 has indexed. The skill checks this first with
statusandcorpus_info, and stops if the snapshot is missing or the last ingest failed. Setup is on the CoreStory v3 playbooks overview. - The
corestory-localplugin or the MCP connection, so the agent can reach the CoreStory v3 tools. - A narrow scope. If the scope is broad, the skill asks for one module or domain.
How to invoke it
- Automatic. With the Claude Code plugin, a session hook points the agent to the matching skill before it edits or answers. The agent picks
business-rules-extractionwhen the request fits. - By name. Ask for it directly (
/business-rules-extractionin Claude Code; the plugin may show it ascorestory-local:business-rules-extraction), or say “use the business-rules-extraction skill” in other agents. - From a rules file. Without the plugin hook, add the one-line fallback from the overview to
CLAUDE.mdorAGENTS.md. - Inside a modernization it writes to
modernization/02-rules-inventory.mdwith the phase header; see the phase-file convention.
What it produces
RULES.mdin the repository root (or the file you name): one block per rule with claim, category, evidence quote withpath:start-end, enforcement point, values, status (confirmed, corrected, declared-not-enforced, uncertain), the CoreStory id, and notes. It ends with a table of unenforced and uncertain rules andNot verified.
How it works
- Preflight with
statusandcorpus_info; restate the scope. - Concept sweep with
search(kind:"sao:Rule"), then a file sweep withrules_forfollowingnext_call, which finds rules the concept sweep missed. - Open every candidate with
entityandinclude:["description","evidence"]. - Verify with
read_fileon each evidence span; find the enforcement point and read values from source, including lookup tables. - Trace the main entry points with
connectionsandread_file, and add behavior the graph did not give asflow-tracerules.
Limits
- The inventory is a set of verified rules, not a claim that every rule was found. An empty or exhausted
rules_forresult does not mean a file has no rules. - Constructs the graph has no structure for, such as some non-code artifacts, are listed under
Not verified. - CoreStory reads and indexes code. It does not run or test it. Any test results in the output are the agent’s own, from commands it ran.
- Results describe the ingested snapshot, which may differ from your working tree if files changed since.
- Hits from
searchare leads, not proof. The skill reads the cited lines before it relies on a rule, and lists what it could not check underNot verified. - Compared with the hosted playbook: the hosted playbook is Business Rules Extraction.
Skill source
The full recipe is the skill file itself:business-rules-extraction/SKILL.md on GitHub.