Business Rule Extractor

Business Rule Extractor is a skill for Claude Code, Codex from SkillMedev/legacy-modernization. It costs 129 tokens per session (1,005 once invoked), scanned A, a copy of Business Rule Extractor, MIT.

A written inventory of the rules hidden inside older, complicated code. It records conditions, exceptions, edge cases, and examples of how inputs become outputs.

In plain words
What is it for?
Use it before rewriting, porting, or replacing legacy code whose business rules are undocumented.
Why use it?
When code is the only description of how a system works, rewriting it can accidentally change important behavior, including bugs users may rely on. This makes that behavior explicit first.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it before rewriting, porting, or replacing legacy code whose business rules are undocumented.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skillmedev/legacy-modernization/business-rule-extractor
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add SkillMedev/legacy-modernization --skill business-rule-extractor
Clone the repo
git clone --depth 1 https://github.com/SkillMedev/legacy-modernization

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Business Rule Extractor

README.md
[![agentmods](https://agentmods.dev/badge/skills/skillmedev/legacy-modernization/business-rule-extractor/github.svg)](https://agentmods.dev/skills/skillmedev/legacy-modernization/business-rule-extractor)
Your own site
<a href="https://agentmods.dev/skills/skillmedev/legacy-modernization/business-rule-extractor"><img src="https://agentmods.dev/badge/skills/skillmedev/legacy-modernization/business-rule-extractor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Business Rule Extractor

Your own site · 80×15
<a href="https://agentmods.dev/skills/skillmedev/legacy-modernization/business-rule-extractor"><img src="https://agentmods.dev/badge/skills/skillmedev/legacy-modernization/business-rule-extractor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 129 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,005 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00129 $0.01005
Opus 5 $0.00064 $0.00502
Sonnet 5 $0.00026 $0.00201
Haiku 4.5 $0.00013 $0.00101

Measured 10d ago against content hash f3f96779eb81, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

Business Rule Extractor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to Business Rule Extractor — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/business-rule-extractor/SKILL.md · 37 lines

How it starts

The opening of the file, as written. The whole thing — 37 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Business Rule Extractor

Turn undocumented legacy logic into a written rule inventory so a rewrite preserves behavior instead of silently changing it. The source code is the spec, and most of it is accidental - your job is to surface what it actually does, not what it should do.

Workflow

  1. Scope the extraction target. Identify the exact module, files, and entry points to be rewritten. List every external system, shared table, global, and session state the logic touches - a rule split across files is the one most likely to break on rewrite.
  2. Mine rules from conditionals and constants. For each branch, guard, magic number, string literal, and validation, ask "what business reality does this encode?" amount > 10000 is a large-transaction threshold; a hardcoded date is a regulation start; a branch on one customer ID is a negotiated exception. Magic numbers are almost always undocumented policy. Treat any constant that appears in two or more places as a single rule with duplication risk - note every occurrence, because a rewrite that updates one copy and misses the other creates a divergence bug.
  3. Record order and interaction. Capture precedence (which discount wins when two apply), short-circuits, fall-through defaults, and exact boundary handling of null, empty, negative, and > vs >=. Evaluation order is itself a rule; note every place an input path forks.
  4. Separate intended rules from bug-as-features. Code alone cannot tell you which behaviors are deliberate. Flag each questionable behavior and confirm against domain experts, support tickets, or production data - aim for at least two independent sources (e.g. one expert plus production evidence) before labeling a behavior intended. Document bug-as-features explicitly so the rewrite team decides consciously, not in an incident.
  5. Capture each rule as input-to-output examples. For every rule, record concrete cases from real data, especially at boundaries - a minimum of 3 cases per rule (below, at, and above each boundary), and 10+ for rules with interacting conditions. A table of cases removes the ambiguity that "applies a tiered discount" leaves behind.
  6. Hand off open questions. Before declaring a path dead, check production logs or traffic over a window that covers the business cycle - 90 days is a practical floor, a full year for anything with annual/seasonal triggers. Mark provably dead paths as dead rather than reverse-engineering intent. List behaviors you could not classify as explicit questions for domain owners.

Read the full file on GitHub · 37 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 37 lines · 129 tokens per session scan A f3f96779eb81

Subscribe to this mod's changes

Business Rule Extractor is a skill published in the GitHub repository SkillMedev/legacy-modernization (2 stars, last pushed 2mo ago), licensed MIT. It adds 129 tokens to every session and 1,005 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to Business Rule Extractor, differing in 0 lines, and is treated as a copy.