/code-modernization:modernize-extract-rules <system-dir> [module-pattern]from code-modernization
Extracts business rules from legacy code into structured, testable specifications. Useful for understanding and modernizing legacy systems.
Ships in code-modernization. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Extract the business rules embedded in legacy/$1 into a structured,
testable specification — the institutional knowledge that's currently locked
in code and in the heads of engineers who are about to retire.
Scope: if a module pattern was given ($2), focus there; otherwise cover the
entire system. Either way, prioritize calculation, validation, eligibility,
and state-transition logic over plumbing.
Spawn three business-rules-extractor subagents in parallel, each assigned
a different lens. If $2 is non-empty, include "focusing on files matching
$2" in each prompt.
Calculations — "Find every formula, rate, threshold, and computed value in legacy/$1. For each: what does it compute, what are the inputs, what is the exact formula/algorithm, where is it implemented (file:line), and what edge cases does the code handle?"
Validations & eligibility — "Find every business validation, eligibility check, and guard condition in legacy/$1. For each: what is being checked, what happens on pass/fail, where is it (file:line)?"
State & lifecycle — "Find every status field, state machine, and lifecycle transition in legacy/$1. For each entity: what states exist, what triggers transitions, what side-effects fire?"
Merge the three result sets. Deduplicate. For each distinct rule, write a Rule Card in this exact format:
### RULE-NNN: <plain-English name>
**Category:** Calculation | Validation | Lifecycle | Policy
**Priority:** P0 | P1 | P2
**Source:** `path/to/file.ext:line-line`
**Plain English:** One sentence a business analyst would recognize.
**Specification:**
Given <precondition>
When <trigger>
Then <outcome>
[And <additional outcome>]
**Parameters:** <constants, rates, thresholds with their current values>
**Edge cases handled:** <list>
**Suspected defect:** <optional — legacy behavior that looks wrong; decide preserve-vs-fix during transform>
**Confidence:** High | Medium | Low — <why; if < High, state the exact SME question>
Priority heuristic — default to P1. Assign P0 if the rule moves money,
enforces a regulatory/compliance requirement, or guards data integrity (and
flag P0 rules at <High confidence as SME-required). Assign P2 for
display/formatting/convenience rules. The downstream /modernize-brief
behavior contract is built from the P0 rules, so assign deliberately.
Write all rule cards to analysis/$1/BUSINESS_RULES.md with:
As a companion, create analysis/$1/DATA_OBJECTS.md cataloging the core
data transfer objects / records / entities: name, fields with types, which
rules consume/produce them, source location.
Report: total rules found, breakdown by category, count needing SME review.
Suggest: glow -p analysis/$1/BUSINESS_RULES.md
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub minhthang1009/dotclaude --plugin code-modernization7 skills in this plugin
/modernize-assessThis skill should be used when the user asks to assess a legacy system for modernization ('modernize assess', 'danh gia he thong legacy') - full discovery and portfolio analysis: inventory, complexity, technical debt, effort estimation./modernize-briefThis skill should be used when the user asks to generate a phased Modernization Brief ('modernize brief', 'len ke hoach modernize') - the approved plan that transformation agents execute against./modernize-hardenThis skill should be used when the user asks for a security vulnerability scan with a reviewable remediation patch on legacy code ('modernize harden', 'security scan legacy') - OWASP, CWE, CVE, secrets, injection.Other plugins' skills for the same job