modernize-extract-rules
Mine the business rules out of the code into testable Given/When/Then rule cards with file:line citations
от smartworldarafath★ 16 звёзд на GitHub
Установить modernize-extract-rules в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Extract the business rules embedded in the system into a structured, testable
specification: the institutional knowledge that is locked in code and in the heads of
engineers about to retire. If a module pattern was given ($module_pattern), focus
there; otherwise cover the whole system. Prioritize calculation, validation, eligibility
and state-transition logic over plumbing.
The code is legacy/$system, often a symlink to where it really lives: say where it points (readlink legacy/$system) in one line before you start. If legacy/$system does not exist, stop and say so: nothing can run without the code, so the fix is /code-modernization:modernize $system --source <path to the code>. Run every subagent in the foreground and wait for its result: never end your turn while one is still running.
Method A — Workflow (preferred when the Workflow tool is available)
This command is your authorization to run it. Extraction is sharded per module, so
each extractor reads a small slice (whole-estate passes miss the tail and their contexts
balloon); each rule's file:line citation is verified by a referee agent; and every P0
rule is confirmed by a two-judge panel before it can anchor the behavior contract.
1. Build the shard list
python3 "${ANTIGRAVITY_PLUGIN_ROOT}/scripts/make_shards.py" $system "$module_pattern"
It reads analysis/$system/topology.json when map has run (one shard per module, small
ones merged; the better shards) and otherwise the directory tree, and writes
analysis/$system/extract-rules.modules.json. If it reports 0 shards, stop and tell
the user: the pattern matched nothing, or no source files were found. If it says tiny
estate, omit modules (lens mode: three whole-estate extractors in rounds until two
rounds find nothing new; modulePattern narrows them). Source that is not a module (SQL,
shared includes, config-held tables) is read only when a shard references it; if the
assessment says logic lives there, add shards for those files by hand.
2. Estimate, ask if large, launch
Estimate first: 10 to 15 agents per shard, about 16k tokens per agent, about 8 agents finishing per minute. For calibration, 4 shards (five programs, 1,600 lines) used 58 agents in under 10 minutes; a 44-program, 30,000-line estate used 466 to 647 agents, about 8.8M tokens and 50 to 80 minutes; a tiny system in lens mode is 15 to 40 agents.
With more than 12 shards, ask before launching with the ask_question tool (a pop-up;
a reply that only mentions the estimate is easy to miss and is not a gate). Put the shard
count, lines and estimate in the question; offer "Run all N shards", "Only a slice (say
which, as a module pattern)" and "Cancel". On a slice, rebuild the list with that pattern.
With 12 shards or fewer, launch at once and say how many shards and the rough estimate.
A run is capped at 1000 agents: for more than about 70 shards, launch parts of at most 70,
one Workflow call after another, and merge the results (concatenate rules, de-duplicate
by source + name) before rendering once.
Call it by name (the plugin registers it). If the tool does not know the name, pass scriptPath: "${ANTIGRAVITY_PLUGIN_ROOT}/workflows/extract-rules.js" instead:
Workflow({
name: "code-modernization:modernize-extract-rules-mine",
args: {
system: "$system",
modules: <contents of analysis/$system/extract-rules.modules.json>, // omit in lens mode
modulePattern: "$module_pattern" // lens mode only
}
})
Optional batchSize (default 8, max 16): shards extracted, then refereed, per batch.
Record the Run ID (wf_…) and transcript directory (one per part): you need them to
resume. Show the workflow's per-batch log lines as they arrive.
3. If the run stops or reports failures
- Stopped or failed (
status: failed,TaskStop, an interrupted session) so no result came back: if the error names the args, fix them and relaunch; otherwise resume, never restart, and never fall back to Method B: completed agents are journaled. Stop a run that is somehow still going, then re-invoke with the identical workflownameandargs(re-read the modules file; cut it the same way if split) plusresumeFromRunId: "<Run ID>". Finished agents replay instantly. Afterparallel[i] failedlines the resume re-runs from that batch onward, still far cheaper than starting over. If resume is impossible, readjournal.jsonlin the transcript directory before telling anyone work was lost: every completed agent's result is a{"type":"result",…}line there. - Completed with failures (
<failures>lists dead agents): do not resume (a failed agent makes the journal replay everything after it). Use the result:rerunModulesholds every shard with a gap, re-passable. Render what was confirmed, then offer one follow-up invocation (same workflowname,args.modules=rerunModules, no
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл modernize-extract-rules?
Mine the business rules out of the code into testable Given/When/Then rule cards with file:line citations
Как установить скилл modernize-extract-rules?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл modernize-extract-rules запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…