<feed xmlns='http://www.w3.org/2005/Atom'>
<title>claude-plugins-official.git/plugins/code-modernization/commands/modernize-extract-rules.md, branch bump/cloud-sql-sqlserver</title>
<subtitle>Official Claude Code plugin directory
</subtitle>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/'/>
<entry>
<title>code-modernization: fold the same rule found in several files into one</title>
<updated>2026-09-25T04:18:31+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-25T04:18:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=fc8adcf13fab336a810a622e8cf7be86be3a183b'/>
<id>fc8adcf13fab336a810a622e8cf7be86be3a183b</id>
<content type='text'>
A numeric library implemented in C, in a C++ header and in a fixed-point
variant produced three "twiddle factor" rules, two "generic butterfly" rules
and two "factorization" rules, because the referee's duplicate key is the
file plus the rule's name. The plan and the review then carry noise.

After verification, one small agent per 150 rules lists the groups that
describe the same behavior implemented in more than one place, told to merge
only what would be implemented and tested as one thing. The kept rule cites
every place (the renderer shows them as "Also cited") and takes the highest
priority of its group; overlapping, out-of-range or self-merging groups are
ignored, and the rule list is fenced as untrusted data. The count is
reported as stats.consolidated.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A numeric library implemented in C, in a C++ header and in a fixed-point
variant produced three "twiddle factor" rules, two "generic butterfly" rules
and two "factorization" rules, because the referee's duplicate key is the
file plus the rule's name. The plan and the review then carry noise.

After verification, one small agent per 150 rules lists the groups that
describe the same behavior implemented in more than one place, told to merge
only what would be implemented and tested as one thing. The kept rule cites
every place (the renderer shows them as "Also cited") and takes the highest
priority of its group; overlapping, out-of-range or self-merging groups are
ignored, and the rule list is fenced as untrusted data. The count is
reported as stats.consolidated.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: people's verdicts on rules reach the build, and safer baselines</title>
<updated>2026-09-25T04:01:36+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-25T04:01:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=0c186cf8c54bdf925cb2572e871ec16d04aa8425'/>
<id>0c186cf8c54bdf925cb2572e871ec16d04aa8425</id>
<content type='text'>
A reviewer's "this rule is wrong" never reached the plan or the rewrite: the
pane wrote a review ledger that no command read, and without the pane there
was no way to write one. /code-modernization:modernize-review asks about the
rules that need judgement (P0 rules with a defect, an SME question or less
than High confidence) in a pop-up, or takes verdicts typed in the request,
and writes the same RULE_REVIEWS.json/.md with an optional note. brief,
transform, reimagine and the test engineer read it: a rule marked wrong is
not an oracle and a P0 rule under discussion blocks.

Running the old system to record a baseline is now limited to the local
machine or a test environment the person named; production or third-party
services, new accounts and real data are off limits unless the approved plan
names them, a token in a recorded response is replaced before anything is
saved, and every command stops the servers it started.

Also: the front door asks in two pop-ups within the four-option limit, every
command points a missing-code user to /modernize &lt;name&gt; --source &lt;path&gt;, the
status inventory and next-step order include review and verify, the
assessment says what Rehost and Replace mean, preflight notes the Windows
python name, and the plugin and marketplace descriptions match what it does.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A reviewer's "this rule is wrong" never reached the plan or the rewrite: the
pane wrote a review ledger that no command read, and without the pane there
was no way to write one. /code-modernization:modernize-review asks about the
rules that need judgement (P0 rules with a defect, an SME question or less
than High confidence) in a pop-up, or takes verdicts typed in the request,
and writes the same RULE_REVIEWS.json/.md with an optional note. brief,
transform, reimagine and the test engineer read it: a rule marked wrong is
not an oracle and a P0 rule under discussion blocks.

Running the old system to record a baseline is now limited to the local
machine or a test environment the person named; production or third-party
services, new accounts and real data are off limits unless the approved plan
names them, a token in a recorded response is replaced before anything is
saved, and every command stops the servers it started.

Also: the front door asks in two pop-ups within the four-option limit, every
command points a missing-code user to /modernize &lt;name&gt; --source &lt;path&gt;, the
status inventory and next-step order include review and verify, the
assessment says what Rehost and Replace mean, preflight notes the Windows
python name, and the plugin and marketplace descriptions match what it does.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: call workflows by name and fix the uplift version arguments</title>
<updated>2026-09-25T03:27:49+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-25T03:27:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=f33999b153851d927a103e0f4b6032ed53a94aad'/>
<id>f33999b153851d927a103e0f4b6032ed53a94aad</id>
<content type='text'>
The Workflow tool refuses a plugin script path whenever the plugin lives
outside the working directory, which is the normal case for an installed
plugin: the model failed once or twice on every run before falling back to
the registered name. The commands now call each workflow by its registered
name and mention the script path only as a fallback.

modernize-uplift also referred to legacy/$system_version, which is not an
argument; it now uses $source_version everywhere, and the version pair, the
rewrite target and the vision fall back to analysis/&lt;system&gt;/INTENT.md when
they are not given. The README notes that a scripted (claude -p) run needs
CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS=0 so long fan-out steps can finish.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Workflow tool refuses a plugin script path whenever the plugin lives
outside the working directory, which is the normal case for an installed
plugin: the model failed once or twice on every run before falling back to
the registered name. The commands now call each workflow by its registered
name and mention the script path only as a fallback.

modernize-uplift also referred to legacy/$system_version, which is not an
argument; it now uses $source_version everywhere, and the version pair, the
rewrite target and the vision fall back to analysis/&lt;system&gt;/INTENT.md when
they are not given. The README notes that a scripted (claude -p) run needs
CLAUDE_CODE_PRINT_BG_WAIT_CEILING_MS=0 so long fan-out steps can finish.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: rate rules by what the system is for, and make live runs finish</title>
<updated>2026-09-25T03:15:45+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-25T03:15:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=696904602b2bdf3e0ddd07ae1221f9eb3e3b8e62'/>
<id>696904602b2bdf3e0ddd07ae1221f9eb3e3b8e62</id>
<content type='text'>
Two problems from running the commands on real repositories:

- The P0 definition was money- and regulation-shaped, so a music-library
  tool got no P0 rules and its behavior contract came out empty. P0 now
  means the system's core purpose depends on the rule, or a wrong result is
  costly or irreversible (money, legal, data integrity, security or safety,
  or the central calculation or decision the system exists to perform).
- Citations came back as lists of ranges, and the rule renderer numbered
  RULE-NNN in a different order from the document. Each rule now cites one
  range and the numbers read in sequence.

Commands that start subagents now say to run them in the foreground and
wait, because a headless session ends when the model stops talking even if
it said it was waiting for a background agent.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Two problems from running the commands on real repositories:

- The P0 definition was money- and regulation-shaped, so a music-library
  tool got no P0 rules and its behavior contract came out empty. P0 now
  means the system's core purpose depends on the rule, or a wrong result is
  costly or irreversible (money, legal, data integrity, security or safety,
  or the central calculation or decision the system exists to perform).
- Citations came back as lists of ranges, and the rule renderer numbered
  RULE-NNN in a different order from the document. Each rule now cites one
  range and the numbers read in sequence.

Commands that start subagents now say to run them in the foreground and
wait, because a headless session ends when the model stops talking even if
it said it was waiting for a background agent.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: simpler commands, a source option, a report page and an equivalence check</title>
<updated>2026-09-25T03:14:51+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-25T03:14:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=cafefb304bde4070c6c0877528ee49c1252eff85'/>
<id>cafefb304bde4070c6c0877528ee49c1252eff85</id>
<content type='text'>
Commands hardcoded legacy/&lt;system&gt;, so code too big to copy, or living at
an absolute path, needed a hand-made symlink. Preflight now takes
--source &lt;path&gt; and makes the legacy/&lt;system&gt; link for you (a junction on
Windows); nothing is copied, and every command says where the link points
before it starts. The harden patch is applied with patch -p1 -d.

Each command ends by naming the next command to run, and the commands are
about a third shorter with no step removed:
- map accepts an existing dependency graph (--graph) or the stack's own
  tooling, maps very large estates in resumable chunks, records reflection
  targets as unresolved instead of dead, asks before describing more than
  40 nodes, and never gives two nodes the same location.
- transform can take its module and target from the brief, counts the
  equivalence cases that executed (zero is a failure and a comparison never
  skips), shows the tests can fail with a deliberate one-line break, and
  hands "same or different" to a script when both systems can run.
- brief writes each phase in one fixed shape: one command, module ids as in
  the map, and criteria written as conditions a build command may tick but
  not reword.
- reimagine reuses the discovery artifacts instead of extracting them again.
- status names the exact command to paste next.

scripts/build_report.py turns whatever the commands wrote into one
self-contained, offline REPORT.html (Mermaid is vendored, all text from the
analysis is escaped, the quarantined secrets file is never read), and
scripts/compare.py decides byte-for-byte whether two outputs match, records
why, and checks it can fail. The shard builder ignores symbolic links and
paths that leave the source, matches a plain name against what lies beneath
it, and falls back to the directory tree when the map's modules share a
location.

The README drops from 275 to about 100 lines; the pane's reference moves to
hooks/README.md.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commands hardcoded legacy/&lt;system&gt;, so code too big to copy, or living at
an absolute path, needed a hand-made symlink. Preflight now takes
--source &lt;path&gt; and makes the legacy/&lt;system&gt; link for you (a junction on
Windows); nothing is copied, and every command says where the link points
before it starts. The harden patch is applied with patch -p1 -d.

Each command ends by naming the next command to run, and the commands are
about a third shorter with no step removed:
- map accepts an existing dependency graph (--graph) or the stack's own
  tooling, maps very large estates in resumable chunks, records reflection
  targets as unresolved instead of dead, asks before describing more than
  40 nodes, and never gives two nodes the same location.
- transform can take its module and target from the brief, counts the
  equivalence cases that executed (zero is a failure and a comparison never
  skips), shows the tests can fail with a deliberate one-line break, and
  hands "same or different" to a script when both systems can run.
- brief writes each phase in one fixed shape: one command, module ids as in
  the map, and criteria written as conditions a build command may tick but
  not reword.
- reimagine reuses the discovery artifacts instead of extracting them again.
- status names the exact command to paste next.

scripts/build_report.py turns whatever the commands wrote into one
self-contained, offline REPORT.html (Mermaid is vendored, all text from the
analysis is escaped, the quarantined secrets file is never read), and
scripts/compare.py decides byte-for-byte whether two outputs match, records
why, and checks it can fail. The shard builder ignores symbolic links and
paths that leave the source, matches a plain name against what lies beneath
it, and falls back to the directory tree when the map's modules share a
location.

The README drops from 275 to about 100 lines; the pane's reference moves to
hooks/README.md.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: extract-rules uses a shard builder and a rules renderer that ship with the plugin</title>
<updated>2026-09-25T01:26:30+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-25T01:26:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=b10dab2f5ad83f642a03b5f800dea71651830beb'/>
<id>b10dab2f5ad83f642a03b5f800dea71651830beb</id>
<content type='text'>
The command used to carry a 35-line shard-building script inline and asked
the model to write a rules renderer on every run, so the shard list and the
BUSINESS_RULES.md layout varied from run to run and could not be tested.

scripts/make_shards.py builds the shard list from topology.json when the map
has run, and from the directory tree when it has not (skipping vendored,
generated and test-fixture directories, one shard per directory, split at 25
files or about 5,000 lines). scripts/render_rules.py turns the workflow's
result into BUSINESS_RULES.md and DATA_OBJECTS.md with RULE-NNN headings, the
SME section and the coverage gaps, and writes every value from the analysis as
plain text.

The workflow takes an optional sourceDir, so the code can live outside the
workspace, and shard files are kept relative to it. The command drops from 305
to about 150 lines.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The command used to carry a 35-line shard-building script inline and asked
the model to write a rules renderer on every run, so the shard list and the
BUSINESS_RULES.md layout varied from run to run and could not be tested.

scripts/make_shards.py builds the shard list from topology.json when the map
has run, and from the directory tree when it has not (skipping vendored,
generated and test-fixture directories, one shard per directory, split at 25
files or about 5,000 lines). scripts/render_rules.py turns the workflow's
result into BUSINESS_RULES.md and DATA_OBJECTS.md with RULE-NNN headings, the
SME section and the coverage gaps, and writes every value from the analysis as
plain text.

The workflow takes an optional sourceDir, so the code can live outside the
workspace, and shard files are kept relative to it. The command drops from 305
to about 150 lines.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: extract-rules asks before a large run, with an estimate</title>
<updated>2026-09-25T00:50:21+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-24T02:52:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=d13ff0324cf9a8744be6c75251689816485e68cf'/>
<id>d13ff0324cf9a8744be6c75251689816485e68cf</id>
<content type='text'>
The command told the model to state the shard count and an estimate
before launching, but in live runs on a small system it launched
without saying anything: a reply that only mentions the estimate is
easy to skip and is not a gate.

With more than 12 shards the command now requires an AskUserQuestion
that carries the shard count, the line count and the estimate (agents,
tokens, minutes) and offers to run all shards, run only a slice, or
cancel. With 12 shards or fewer it launches straight away and says
what it launched.

The estimate is now a working formula (10 to 15 agents per shard, about
16k tokens per agent, about 8 agents finishing per minute) with the two
runs it comes from: 4 shards used 58 agents in under 10 minutes, and a
44-program, 30,000-line estate used 466 to 647 agents.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The command told the model to state the shard count and an estimate
before launching, but in live runs on a small system it launched
without saying anything: a reply that only mentions the estimate is
easy to skip and is not a gate.

With more than 12 shards the command now requires an AskUserQuestion
that carries the shard count, the line count and the estimate (agents,
tokens, minutes) and offers to run all shards, run only a slice, or
cancel. With 12 shards or fewer it launches straight away and says
what it launched.

The estimate is now a working formula (10 to 15 agents per shard, about
16k tokens per agent, about 8 agents finishing per minute) with the two
runs it comes from: 4 shards used 58 agents in under 10 minutes, and a
44-program, 30,000-line estate used 466 to 647 agents.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: keep RULE-NNN headings and the rule-render script</title>
<updated>2026-09-25T00:49:55+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-24T02:01:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=ffa01ef52f175dfe3abe19171f4714fe496082db'/>
<id>ffa01ef52f175dfe3abe19171f4714fe496082db</id>
<content type='text'>
A run numbered rules with domain-coded ids (BR-D7 and similar), which
broke the tools that find rules by their RULE-NNN heading. The Rule Card
section now says the heading is exactly that form, numbered
sequentially.

The script that renders BUSINESS_RULES.md and DATA_OBJECTS.md from the
workflow result was being written to /tmp, so the documents could not be
regenerated. It is now saved as analysis/&lt;system&gt;/render_rules.py, next
to the result it reads.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A run numbered rules with domain-coded ids (BR-D7 and similar), which
broke the tools that find rules by their RULE-NNN heading. The Rule Card
section now says the heading is exactly that form, numbered
sequentially.

The script that renders BUSINESS_RULES.md and DATA_OBJECTS.md from the
workflow result was being written to /tmp, so the documents could not be
regenerated. It is now saved as analysis/&lt;system&gt;/render_rules.py, next
to the result it reads.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: extract-rules per-module shards, resume and coverage gaps</title>
<updated>2026-09-25T00:49:55+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-24T02:01:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=08bf451b72fb386f47dae959c35294e7d89164b4'/>
<id>08bf451b72fb386f47dae959c35294e7d89164b4</id>
<content type='text'>
Extraction now shards by module: one extractor per module, in ordered
batches, so each agent reads a small slice instead of the whole estate.
The command builds the module list from analysis/&lt;system&gt;/topology.json
when it exists (otherwise from the directory tree), states the shard
count and an agent estimate before launching, and documents how to
resume an interrupted run with resumeFromRunId and how to re-run only
the shards that failed. The workflow stays inside the runtime's agent
cap and reports coverage gaps (skipped, failed and unverified shards)
instead of returning a partial catalog without saying so.

The estimate paragraph carries what was observed on a 44-program,
30,000-line system: 466 to 647 agents, about 8.8M tokens, 50 to 80
minutes. Module-mode extractors cite paths relative to legacy/&lt;system&gt;/,
like the lens-mode extractors.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extraction now shards by module: one extractor per module, in ordered
batches, so each agent reads a small slice instead of the whole estate.
The command builds the module list from analysis/&lt;system&gt;/topology.json
when it exists (otherwise from the directory tree), states the shard
count and an agent estimate before launching, and documents how to
resume an interrupted run with resumeFromRunId and how to re-run only
the shards that failed. The workflow stays inside the runtime's agent
cap and reports coverage gaps (skipped, failed and unverified shards)
instead of returning a partial catalog without saying so.

The estimate paragraph carries what was observed on a 44-program,
30,000-line system: 466 to 647 agents, about 8.8M tokens, 50 to 80
minutes. Module-mode extractors cite paths relative to legacy/&lt;system&gt;/,
like the lens-mode extractors.
</pre>
</div>
</content>
</entry>
<entry>
<title>code-modernization: extract-rules citation paths and categories</title>
<updated>2026-09-25T00:49:55+00:00</updated>
<author>
<name>Morgan Lunt</name>
<email>morganl@anthropic.com</email>
</author>
<published>2026-09-24T01:54:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.1991861.xyz/claude-plugins-official.git/commit/?id=686a686cc0dc7fad8ac562c38b4f91bf9747f2a6'/>
<id>686a686cc0dc7fad8ac562c38b4f91bf9747f2a6</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
