Skip to content

Codebase intelligence for AI and humans: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

fix: use harness-neutral wording in agent prompts (#4343)

Liyu0d0a6d0c5d39
diff --git a/packages/core/src/repowise/core/agent_prompts/preamble.py b/packages/core/src/repowise/core/agent_prompts/preamble.py
index d6fb2861b..26b4f9c35 100644
--- a/packages/core/src/repowise/core/agent_prompts/preamble.py
+++ b/packages/core/src/repowise/core/agent_prompts/preamble.py
@@ -24,25 +24,25 @@ _WHO: dict[str, str] = {
OPENINGS: dict[str, dict[str, str]] = {
"action": {
"generic": "produced the action below from its stored analysis of the repository (git history, code health, the dependency graph). Its evidence is listed in full or in part; treat each item as a lead to verify against the code, not as ground truth.",
- "claude-code": "produced the action below from its stored analysis. Treat each evidence item as a lead: read the code with Read and Grep, confirm it, and use TodoWrite to track the files you work through.",
+ "claude-code": "produced the action below from its stored analysis. Treat each evidence item as a lead: read and search the code, confirm it, and keep a step list to track the files you work through.",
"claude-code-mcp": 'The action below comes from Repowise\'s stored analysis. Use the MCP calls listed under "Look closer" before reading files by hand: they return the full evidence with line numbers, reasons and history. Treat each item as a lead to confirm against the code.',
"cursor": "produced the action below from its stored analysis. Treat each evidence item as a lead: open the file with @file, confirm it, then act.",
},
"fix_first": {
"generic": "ranked the change below first among the work it found. Its facts come from stored analysis; treat them as leads to confirm against the code, not as ground truth.",
- "claude-code": "ranked the change below first among the work it found. Confirm each fact with Read and Grep before editing, and track the steps with TodoWrite.",
+ "claude-code": "ranked the change below first among the work it found. Confirm each fact by reading and searching the code before editing, and keep a step list.",
"claude-code-mcp": 'Repowise ranked the change below first among the work it found. Call the MCP lookup under "Look closer" for the full record before reading files by hand, then confirm each fact against the code.',
"cursor": "ranked the change below first among the work it found. Open the target with @file, confirm each fact, then make the change.",
},
"refactoring_plan": {
"generic": "planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read the code each step names and confirm it before you change it.",
- "claude-code": "planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read each span with Read and Grep before editing, and track the steps with TodoWrite.",
+ "claude-code": "planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read and search each span before editing, and keep a step list.",
"claude-code-mcp": 'Repowise planned the refactoring below from its static analysis. It does not edit code: the steps are a spec for you to apply. Use the MCP lookup under "Look closer" and `get_symbol` on each span before reading files by hand.',
"cursor": "planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Open each span with @file and confirm it before editing.",
},
"refactoring_opportunity": {
"generic": "composed the ordered refactoring steps below for one file from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read the code each step names and confirm it before you change it.",
- "claude-code": "composed the ordered refactoring steps below for one file from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read each span with Read and Grep before editing, and track the steps with TodoWrite.",
+ "claude-code": "composed the ordered refactoring steps below for one file from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read and search each span before editing, and keep a step list.",
"claude-code-mcp": "Repowise composed the ordered refactoring steps below for one file from its static analysis. It does not edit code: the steps are a spec for you to apply. Pull the record with the call at the end and `get_symbol` each span before reading files by hand.",
"cursor": "composed the ordered refactoring steps below for one file from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Open each span with @file and confirm it before editing.",
},
diff --git a/packages/ui/__tests__/health/__snapshots__/file-health-prompt.test.tsx.snap b/packages/ui/__tests__/health/__snapshots__/file-health-prompt.test.tsx.snap
index 031155d1b..f08587402 100644
--- a/packages/ui/__tests__/health/__snapshots__/file-health-prompt.test.tsx.snap
+++ b/packages/ui/__tests__/health/__snapshots__/file-health-prompt.test.tsx.snap
@@ -2,9 +2,9 @@
exports[`FLAVOR_PREAMBLE > keeps every flavor's opening 1`] = `
{
- "claude-code": "You are Claude Code working in this repository. The findings below were detected by repowise's static analyzer. Treat each item as a lead, not ground truth. Use Read, Grep and Glob on the file, its callers, its tests and its neighbors before planning edits, and flag any false positive. Use TodoWrite for non-trivial steps.",
- "claude-code-mcp": "You are Claude Code working in this repository, which is indexed by repowise and exposes its MCP tools. The findings below were detected by repowise's static analyzer. Treat each item as a lead, not ground truth. Before re-reading files by hand, pull the context repowise already computed: call \`get_context([...])\` for the file skeleton (every signature + the bodies of the most central symbols, ~37% of a full Read), \`get_symbol("file::Name")\` for the exact bytes of one function, \`get_risk([...])\` before editing to see blast radius, co-change partners, and test gaps, and \`get_why(...)\` for the decision behind the current shape. Fall back to Read / Grep / Glob only for what the index cannot serve, and flag any false positive. Use TodoWrite for non-trivial steps.",
- "cursor": "Work on the file referenced below. The findings below were detected by repowise's static analyzer. Treat each item as a lead, not ground truth. Use @file and @codebase to read the file, its callers, its tests and its neighbors before editing, and call out any false positive.",
+ "claude-code": "You are Claude Code working in this repository. The findings below were detected by repowise's static analyzer. Treat each item as a lead, not ground truth. Open and search the file, its callers, its tests and its neighbors before planning edits, and flag any false positive. Keep a step list for non-trivial steps.",
+ "claude-code-mcp": "You are Claude Code working in this repository, which is indexed by repowise and exposes its MCP tools. The findings below were detected by repowise's static analyzer. Treat each item as a lead, not ground truth. Before re-reading files by hand, pull the context repowise already computed: call \`get_context([...])\` for the file skeleton (every signature + the bodies of the most central symbols, ~37% of a full Read), \`get_symbol("file::Name")\` for the exact bytes of one function, \`get_risk([...])\` before editing to see blast radius, co-change partners, and test gaps, and \`get_why(...)\` for the decision behind the current shape. Fall back to reading and searching the files only for what the index cannot serve, and flag any false positive. Keep a step list for non-trivial steps.",
+ "cursor": "Work on the file referenced below. The findings below were detected by repowise's static analyzer. Treat each item as a lead, not ground truth. Use @file to read the file, its callers, its tests and its neighbors and search the codebase before editing, and call out any false positive.",
"generic": "You are a senior engineer working on one file in this repository. The findings below were detected by repowise's static analyzer. Treat each item as a lead, not ground truth. Open the file, its callers, its tests and its neighbors, then confirm each item in the code before you act. If one is a false positive, say so and skip it.",
}
`;
diff --git a/packages/ui/__tests__/health/file-health-prompt.test.tsx b/packages/ui/__tests__/health/file-health-prompt.test.tsx
index 8f802ef2b..c40c25d8e 100644
--- a/packages/ui/__tests__/health/file-health-prompt.test.tsx
+++ b/packages/ui/__tests__/health/file-health-prompt.test.tsx
@@ -148,7 +148,7 @@ describe("buildFileHealthAiPrompt", () => {
describe("FLAVOR_PREAMBLE", () => {
it("keeps every flavor's opening", () => {
expect(FLAVOR_PREAMBLE).toMatchSnapshot();
- expect(FLAVOR_PREAMBLE["claude-code-mcp"]).toContain("Fall back to Read / Grep / Glob only");
+ expect(FLAVOR_PREAMBLE["claude-code-mcp"]).toContain("Fall back to reading and searching the files only");
});
});
diff --git a/packages/ui/__tests__/workspace/co-change-ai-prompt.test.ts b/packages/ui/__tests__/workspace/co-change-ai-prompt.test.ts
index 3c5aeaf61..409dccf1e 100644
--- a/packages/ui/__tests__/workspace/co-change-ai-prompt.test.ts
+++ b/packages/ui/__tests__/workspace/co-change-ai-prompt.test.ts
@@ -163,7 +163,7 @@ describe("co-change prompt Verify", () => {
expect(opening).not.toContain("the commits that touched them before");
}
expect(buildCoChangePairAiPrompt({ pair: pair(), flavor: "claude-code" })).toContain(
- "Use Read, Grep and Glob on the files it names before planning edits",
+ "Open and search the files it names before planning edits",
);
});
});
diff --git a/packages/ui/src/health/ai-prompt-modal.tsx b/packages/ui/src/health/ai-prompt-modal.tsx
index 3e8064d1b..92935538c 100644
--- a/packages/ui/src/health/ai-prompt-modal.tsx
+++ b/packages/ui/src/health/ai-prompt-modal.tsx
@@ -44,7 +44,7 @@ export function fileChatContext(path: string | null | undefined): ChatContext |
* own label already names, and the hint for the active one says the rest. */
const FLAVORS: { value: AiPromptFlavor; label: string; hint: string }[] = [
{ value: "generic", label: "Generic", hint: "Any agent: Copilot, Codex, ChatGPT, custom." },
- { value: "claude-code", label: "Claude Code", hint: "Tuned for Claude Code's tools (Read / Edit / TodoWrite)." },
+ { value: "claude-code", label: "Claude Code", hint: "Tuned for Claude Code." },
{
value: "claude-code-mcp",
label: "Claude + MCP",
diff --git a/packages/ui/src/health/ai-prompts/shared.ts b/packages/ui/src/health/ai-prompts/shared.ts
index d5af1c676..9156c8726 100644
--- a/packages/ui/src/health/ai-prompts/shared.ts
+++ b/packages/ui/src/health/ai-prompts/shared.ts
@@ -45,13 +45,13 @@ const READ_FIRST: Record<Exclude<AiPromptFlavor, "claude-code-mcp">, (open: stri
generic: (open) =>
`Open ${open}, then confirm each item in the code before you act. If one is a false positive, say so and skip it.`,
"claude-code": (open) =>
- `Use Read, Grep and Glob on ${open} before planning edits, and flag any false positive. Use TodoWrite for non-trivial steps.`,
+ `Open and search ${open} before planning edits, and flag any false positive. Keep a step list for non-trivial steps.`,
cursor: (open) =>
- `Use @file and @codebase to read ${open} before editing, and call out any false positive.`,
+ `Use @file to read ${open} and search the codebase before editing, and call out any false positive.`,
};
const MCP_FALLBACK =
- "Fall back to Read / Grep / Glob only for what the index cannot serve, and flag any false positive. Use TodoWrite for non-trivial steps.";
+ "Fall back to reading and searching the files only for what the index cannot serve, and flag any false positive. Keep a step list for non-trivial steps.";
export type PreambleParts =
| {
diff --git a/tests/fixtures/agent_prompts/golden.json b/tests/fixtures/agent_prompts/golden.json
index a69a9cebd..1cf7f4582 100644
--- a/tests/fixtures/agent_prompts/golden.json
+++ b/tests/fixtures/agent_prompts/golden.json
@@ -2,25 +2,25 @@
"action": {
"evidence_over_cap": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis of the repository (git history, code health, the dependency graph). Its evidence is listed in full or in part; treat each item as a lead to verify against the code, not as ground truth.\n## Action (`acme/api`)\n**Clean up what this week's commits left in `src/billing.py`**\n3 commits in the last 7 days added or worsened them … the rest are older.\n## Why it is on the list\n- Target: `src/billing.py` (`Invoice.total`)\n- critical: 1\n- callers: 12 (inferred)\n- coverage: unknown (unknown)\n- Effort estimate: M; confidence in the facts: high\n## Evidence (3 of 1,234, worst first)\n- `src/billing.py:40`: `Invoice.total`, Complex method, critical (commit abc1234def)\n - total has cyclomatic complexity 31 — \"too many\" branches\n- `src/tax.py`: made up marker\n- `src/ledger.py`: `Ledger`, high\n - deeply nested\n\n…and 1,231 more. The first call under \"Look closer\" returns them.\n## Look closer (Repowise CLI)\n- Every open finding in these files:\n `repowise health --file src/billing.py`\n## Done when\nThe findings close on the next update.\n\nCommand: `repowise update`\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis. Treat each evidence item as a lead: read the code with Read and Grep, confirm it, and use TodoWrite to track the files you work through.\n## Action (`acme/api`)\n**Clean up what this week's commits left in `src/billing.py`**\n3 commits in the last 7 days added or worsened them … the rest are older.\n## Why it is on the list\n- Target: `src/billing.py` (`Invoice.total`)\n- critical: 1\n- callers: 12 (inferred)\n- coverage: unknown (unknown)\n- Effort estimate: M; confidence in the facts: high\n## Evidence (3 of 1,234, worst first)\n- `src/billing.py:40`: `Invoice.total`, Complex method, critical (commit abc1234def)\n - total has cyclomatic complexity 31 — \"too many\" branches\n- `src/tax.py`: made up marker\n- `src/ledger.py`: `Ledger`, high\n - deeply nested\n\n…and 1,231 more. The first call under \"Look closer\" returns them.\n## Look closer (Repowise CLI)\n- Every open finding in these files:\n `repowise health --file src/billing.py`\n## Done when\nThe findings close on the next update.\n\nCommand: `repowise update`\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis. Treat each evidence item as a lead: read and search the code, confirm it, and keep a step list to track the files you work through.\n## Action (`acme/api`)\n**Clean up what this week's commits left in `src/billing.py`**\n3 commits in the last 7 days added or worsened them … the rest are older.\n## Why it is on the list\n- Target: `src/billing.py` (`Invoice.total`)\n- critical: 1\n- callers: 12 (inferred)\n- coverage: unknown (unknown)\n- Effort estimate: M; confidence in the facts: high\n## Evidence (3 of 1,234, worst first)\n- `src/billing.py:40`: `Invoice.total`, Complex method, critical (commit abc1234def)\n - total has cyclomatic complexity 31 — \"too many\" branches\n- `src/tax.py`: made up marker\n- `src/ledger.py`: `Ledger`, high\n - deeply nested\n\n…and 1,231 more. The first call under \"Look closer\" returns them.\n## Look closer (Repowise CLI)\n- Every open finding in these files:\n `repowise health --file src/billing.py`\n## Done when\nThe findings close on the next update.\n\nCommand: `repowise update`\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. The action below comes from Repowise's stored analysis. Use the MCP calls listed under \"Look closer\" before reading files by hand: they return the full evidence with line numbers, reasons and history. Treat each item as a lead to confirm against the code.\n## Action (`acme/api`)\n**Clean up what this week's commits left in `src/billing.py`**\n3 commits in the last 7 days added or worsened them … the rest are older.\n## Why it is on the list\n- Target: `src/billing.py` (`Invoice.total`)\n- critical: 1\n- callers: 12 (inferred)\n- coverage: unknown (unknown)\n- Effort estimate: M; confidence in the facts: high\n## Evidence (3 of 1,234, worst first)\n- `src/billing.py:40`: `Invoice.total`, Complex method, critical (commit abc1234def)\n - total has cyclomatic complexity 31 — \"too many\" branches\n- `src/tax.py`: made up marker\n- `src/ledger.py`: `Ledger`, high\n - deeply nested\n\n…and 1,231 more. The first call under \"Look closer\" returns them.\n## Look closer (Repowise MCP)\n- Every open finding in these files:\n `get_health(targets=[\"src/billing.py\", \"src/tax.py\"], include=[\"biomarkers\"])`\n## Done when\nThe findings close on the next update.\n\nCommand: `repowise update`\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis. Treat each evidence item as a lead: open the file with @file, confirm it, then act.\n## Action (`acme/api`)\n**Clean up what this week's commits left in `src/billing.py`**\n3 commits in the last 7 days added or worsened them … the rest are older.\n## Why it is on the list\n- Target: `src/billing.py` (`Invoice.total`)\n- critical: 1\n- callers: 12 (inferred)\n- coverage: unknown (unknown)\n- Effort estimate: M; confidence in the facts: high\n## Evidence (3 of 1,234, worst first)\n- `src/billing.py:40`: `Invoice.total`, Complex method, critical (commit abc1234def)\n - total has cyclomatic complexity 31 — \"too many\" branches\n- `src/tax.py`: made up marker\n- `src/ledger.py`: `Ledger`, high\n - deeply nested\n\n…and 1,231 more. The first call under \"Look closer\" returns them.\n## Look closer (Repowise CLI)\n- Every open finding in these files:\n `repowise health --file src/billing.py`\n## Done when\nThe findings close on the next update.\n\nCommand: `repowise update`\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition."
},
"includes_only": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis of the repository (git history, code health, the dependency graph). Its evidence is listed in full or in part; treat each item as a lead to verify against the code, not as ground truth.\n## Action\n**Stabilise `src/payments/`**\nMost fixes in 90 days landed here.\n## Why it is on the list\n- fixes in 90 days: 14\n- Effort estimate: L; confidence in the facts: medium\n## Files\n- `src/payments/a.py`\n- `src/payments/b.py`\n## Look closer (Repowise CLI)\n- The folder's history:\n `get_risk(targets=[\"src/payments/\"])`\n- The fix log:\n `repowise risk src/payments`\n## Done when\nFewer than 3 fixes land here in the next 90 days.\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis. Treat each evidence item as a lead: read the code with Read and Grep, confirm it, and use TodoWrite to track the files you work through.\n## Action\n**Stabilise `src/payments/`**\nMost fixes in 90 days landed here.\n## Why it is on the list\n- fixes in 90 days: 14\n- Effort estimate: L; confidence in the facts: medium\n## Files\n- `src/payments/a.py`\n- `src/payments/b.py`\n## Look closer (Repowise CLI)\n- The folder's history:\n `get_risk(targets=[\"src/payments/\"])`\n- The fix log:\n `repowise risk src/payments`\n## Done when\nFewer than 3 fixes land here in the next 90 days.\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis. Treat each evidence item as a lead: read and search the code, confirm it, and keep a step list to track the files you work through.\n## Action\n**Stabilise `src/payments/`**\nMost fixes in 90 days landed here.\n## Why it is on the list\n- fixes in 90 days: 14\n- Effort estimate: L; confidence in the facts: medium\n## Files\n- `src/payments/a.py`\n- `src/payments/b.py`\n## Look closer (Repowise CLI)\n- The folder's history:\n `get_risk(targets=[\"src/payments/\"])`\n- The fix log:\n `repowise risk src/payments`\n## Done when\nFewer than 3 fixes land here in the next 90 days.\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. The action below comes from Repowise's stored analysis. Use the MCP calls listed under \"Look closer\" before reading files by hand: they return the full evidence with line numbers, reasons and history. Treat each item as a lead to confirm against the code.\n## Action\n**Stabilise `src/payments/`**\nMost fixes in 90 days landed here.\n## Why it is on the list\n- fixes in 90 days: 14\n- Effort estimate: L; confidence in the facts: medium\n## Files\n- `src/payments/a.py`\n- `src/payments/b.py`\n## Look closer (Repowise MCP)\n- The folder's history:\n `get_risk(targets=[\"src/payments/\"])`\n- The fix log:\n `repowise risk src/payments`\n## Done when\nFewer than 3 fixes land here in the next 90 days.\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis. Treat each evidence item as a lead: open the file with @file, confirm it, then act.\n## Action\n**Stabilise `src/payments/`**\nMost fixes in 90 days landed here.\n## Why it is on the list\n- fixes in 90 days: 14\n- Effort estimate: L; confidence in the facts: medium\n## Files\n- `src/payments/a.py`\n- `src/payments/b.py`\n## Look closer (Repowise CLI)\n- The folder's history:\n `get_risk(targets=[\"src/payments/\"])`\n- The fix log:\n `repowise risk src/payments`\n## Done when\nFewer than 3 fixes land here in the next 90 days.\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition."
},
"bare": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis of the repository (git history, code health, the dependency graph). Its evidence is listed in full or in part; treat each item as a lead to verify against the code, not as ground truth.\n## Action\n**Ingest a coverage report**\nCoverage is unknown, so test gaps read as guesses.\n## Why it is on the list\n- Target: `pyproject.toml`\n- Effort estimate: S; confidence in the facts: high\n## Done when\nA coverage report is ingested.\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis. Treat each evidence item as a lead: read the code with Read and Grep, confirm it, and use TodoWrite to track the files you work through.\n## Action\n**Ingest a coverage report**\nCoverage is unknown, so test gaps read as guesses.\n## Why it is on the list\n- Target: `pyproject.toml`\n- Effort estimate: S; confidence in the facts: high\n## Done when\nA coverage report is ingested.\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis. Treat each evidence item as a lead: read and search the code, confirm it, and keep a step list to track the files you work through.\n## Action\n**Ingest a coverage report**\nCoverage is unknown, so test gaps read as guesses.\n## Why it is on the list\n- Target: `pyproject.toml`\n- Effort estimate: S; confidence in the facts: high\n## Done when\nA coverage report is ingested.\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. The action below comes from Repowise's stored analysis. Use the MCP calls listed under \"Look closer\" before reading files by hand: they return the full evidence with line numbers, reasons and history. Treat each item as a lead to confirm against the code.\n## Action\n**Ingest a coverage report**\nCoverage is unknown, so test gaps read as guesses.\n## Why it is on the list\n- Target: `pyproject.toml`\n- Effort estimate: S; confidence in the facts: high\n## Done when\nA coverage report is ingested.\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis. Treat each evidence item as a lead: open the file with @file, confirm it, then act.\n## Action\n**Ingest a coverage report**\nCoverage is unknown, so test gaps read as guesses.\n## Why it is on the list\n- Target: `pyproject.toml`\n- Effort estimate: S; confidence in the facts: high\n## Done when\nA coverage report is ingested.\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition."
},
"details_exact": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis of the repository (git history, code health, the dependency graph). Its evidence is listed in full or in part; treat each item as a lead to verify against the code, not as ground truth.\n## Action (`café-ünïcode`)\n**Remove the live secret in `src/settings.py`**\nA credential is committed in plain text.\n## Why it is on the list\n- Target: `src/settings.py`\n- kind: hardcoded_secret\n- Effort estimate: S; confidence in the facts: high\n## Evidence (1 of 1)\n- `src/settings.py:4`: I/O in loop, high\n - TOKEN = \"sk_live_…\"\n## Look closer (Repowise CLI)\n- The finding:\n `repowise security src/settings.py`\n## Done when\nThe scanner no longer flags the line.\n\nCommand: `repowise security`\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis. Treat each evidence item as a lead: read the code with Read and Grep, confirm it, and use TodoWrite to track the files you work through.\n## Action (`café-ünïcode`)\n**Remove the live secret in `src/settings.py`**\nA credential is committed in plain text.\n## Why it is on the list\n- Target: `src/settings.py`\n- kind: hardcoded_secret\n- Effort estimate: S; confidence in the facts: high\n## Evidence (1 of 1)\n- `src/settings.py:4`: I/O in loop, high\n - TOKEN = \"sk_live_…\"\n## Look closer (Repowise CLI)\n- The finding:\n `repowise security src/settings.py`\n## Done when\nThe scanner no longer flags the line.\n\nCommand: `repowise security`\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis. Treat each evidence item as a lead: read and search the code, confirm it, and keep a step list to track the files you work through.\n## Action (`café-ünïcode`)\n**Remove the live secret in `src/settings.py`**\nA credential is committed in plain text.\n## Why it is on the list\n- Target: `src/settings.py`\n- kind: hardcoded_secret\n- Effort estimate: S; confidence in the facts: high\n## Evidence (1 of 1)\n- `src/settings.py:4`: I/O in loop, high\n - TOKEN = \"sk_live_…\"\n## Look closer (Repowise CLI)\n- The finding:\n `repowise security src/settings.py`\n## Done when\nThe scanner no longer flags the line.\n\nCommand: `repowise security`\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. The action below comes from Repowise's stored analysis. Use the MCP calls listed under \"Look closer\" before reading files by hand: they return the full evidence with line numbers, reasons and history. Treat each item as a lead to confirm against the code.\n## Action (`café-ünïcode`)\n**Remove the live secret in `src/settings.py`**\nA credential is committed in plain text.\n## Why it is on the list\n- Target: `src/settings.py`\n- kind: hardcoded_secret\n- Effort estimate: S; confidence in the facts: high\n## Evidence (1 of 1)\n- `src/settings.py:4`: I/O in loop, high\n - TOKEN = \"sk_live_…\"\n## Look closer (Repowise MCP)\n- The finding:\n `get_security(targets=[\"src/settings.py\"])`\n## Done when\nThe scanner no longer flags the line.\n\nCommand: `repowise security`\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, produced the action below from its stored analysis. Treat each evidence item as a lead: open the file with @file, confirm it, then act.\n## Action (`café-ünïcode`)\n**Remove the live secret in `src/settings.py`**\nA credential is committed in plain text.\n## Why it is on the list\n- Target: `src/settings.py`\n- kind: hardcoded_secret\n- Effort estimate: S; confidence in the facts: high\n## Evidence (1 of 1)\n- `src/settings.py:4`: I/O in loop, high\n - TOKEN = \"sk_live_…\"\n## Look closer (Repowise CLI)\n- The finding:\n `repowise security src/settings.py`\n## Done when\nThe scanner no longer flags the line.\n\nCommand: `repowise security`\n## Hard constraints\n- **Confirm each item before changing anything.** The analysis is stored, not live; the code may have moved since it ran.\n- **Stay inside what the action names.** Work only on the files and functions listed. If the right fix is elsewhere, stop and say where and why.\n- **Keep behaviour unless the action is about behaviour.** Refactors and test additions must not change what the code does; run the tests that cover each file before and after.\n- **Say when an item is wrong.** If a finding does not hold, or its fix would cost more than it saves, report that rather than forcing an edit.\n## What I expect back\n1. For each item you looked at: whether it held, and what you changed or why you left it.\n2. The tests you ran, before and after.\n3. What remains against the done condition."
}
@@ -28,25 +28,25 @@
"fix_item": {
"no_tests_mixed_args": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Its facts come from stored analysis; treat them as leads to confirm against the code, not as ground truth.\n## Fix first (`acme/api`)\n**Batch the queries in load_rows**\nload_rows runs one query per row — 3 call sites reach it.\n## Facts\n- Target: `src/rows.py`\n- Gain: fewer round trips\n- Effort: M (one function)\n- Risk: Touches 1 file.\n- Confidence: medium. the loop is static\n## Verify\nNo guarding tests found. Write a test that pins the current behaviour before you change anything.\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Confirm each fact with Read and Grep before editing, and track the steps with TodoWrite.\n## Fix first (`acme/api`)\n**Batch the queries in load_rows**\nload_rows runs one query per row — 3 call sites reach it.\n## Facts\n- Target: `src/rows.py`\n- Gain: fewer round trips\n- Effort: M (one function)\n- Risk: Touches 1 file.\n- Confidence: medium. the loop is static\n## Verify\nNo guarding tests found. Write a test that pins the current behaviour before you change anything.\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Confirm each fact by reading and searching the code before editing, and keep a step list.\n## Fix first (`acme/api`)\n**Batch the queries in load_rows**\nload_rows runs one query per row — 3 call sites reach it.\n## Facts\n- Target: `src/rows.py`\n- Gain: fewer round trips\n- Effort: M (one function)\n- Risk: Touches 1 file.\n- Confidence: medium. the loop is static\n## Verify\nNo guarding tests found. Write a test that pins the current behaviour before you change anything.\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. Repowise ranked the change below first among the work it found. Call the MCP lookup under \"Look closer\" for the full record before reading files by hand, then confirm each fact against the code.\n## Fix first (`acme/api`)\n**Batch the queries in load_rows**\nload_rows runs one query per row — 3 call sites reach it.\n## Facts\n- Target: `src/rows.py`\n- Gain: fewer round trips\n- Effort: M (one function)\n- Risk: Touches 1 file.\n- Confidence: medium. the loop is static\n## Verify\nNo guarding tests found. Write a test that pins the current behaviour before you change anything.\n## Look closer (Repowise MCP)\n`get_health(query=\"say \\\"hi\\\" \\\\path\\nnext\\ttab … ünï \\u0001\", limit=5, ratio=2.5, whole=3.0, flag=True, off=False, none=None, targets=[\"a.py\", \"b \\\"c\\\".py\"], nested={\"k\": [1, 2.0, \"x\"]})`\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Open the target with @file, confirm each fact, then make the change.\n## Fix first (`acme/api`)\n**Batch the queries in load_rows**\nload_rows runs one query per row — 3 call sites reach it.\n## Facts\n- Target: `src/rows.py`\n- Gain: fewer round trips\n- Effort: M (one function)\n- Risk: Touches 1 file.\n- Confidence: medium. the loop is static\n## Verify\nNo guarding tests found. Write a test that pins the current behaviour before you change anything.\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why."
},
"tests_and_steps_over_cap": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Its facts come from stored analysis; treat them as leads to confirm against the code, not as ground truth.\n## Fix first\n**Extract lines 60-122 of Klass.method into compute_info**\nKlass.method: CCN 15, 44 lines, nests 3 deep; 4 files import it.\n## Facts\n- Target: `src/a.py:12` (`Klass.method`)\n- Gain: +1.7 health on this file\n- Effort: S (sized by the stored plan)\n- Risk: Touches 2 files; 4 files import it.\n- Confidence: high. 2 of 5 steps proven mechanical by the plan\n- health recoverable: +1.7 (inferred)\n- steps: 5 (2 mechanical)\n- coverage: unknown (unknown)\n## Steps, in order\n1. Extract lines 60-122 into compute_info(repo_path) -> info (`src/a.py:60`) [mechanical]\n2. Move the helper (`src/b.py`) [judgment]\n3. Rename `x` to `count` (`src/a.py`) [mechanical]\n…and 2 more; the lookup below returns them.\n## Verify\n- `tests/unit/test_a.py`: reaches the changed code through the call-graph\n- `tests/unit/test_b.py`\n- …and 1,205 more\n\nRun: `pytest tests/unit/test_a.py tests/unit/test_b.py`\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Confirm each fact with Read and Grep before editing, and track the steps with TodoWrite.\n## Fix first\n**Extract lines 60-122 of Klass.method into compute_info**\nKlass.method: CCN 15, 44 lines, nests 3 deep; 4 files import it.\n## Facts\n- Target: `src/a.py:12` (`Klass.method`)\n- Gain: +1.7 health on this file\n- Effort: S (sized by the stored plan)\n- Risk: Touches 2 files; 4 files import it.\n- Confidence: high. 2 of 5 steps proven mechanical by the plan\n- health recoverable: +1.7 (inferred)\n- steps: 5 (2 mechanical)\n- coverage: unknown (unknown)\n## Steps, in order\n1. Extract lines 60-122 into compute_info(repo_path) -> info (`src/a.py:60`) [mechanical]\n2. Move the helper (`src/b.py`) [judgment]\n3. Rename `x` to `count` (`src/a.py`) [mechanical]\n…and 2 more; the lookup below returns them.\n## Verify\n- `tests/unit/test_a.py`: reaches the changed code through the call-graph\n- `tests/unit/test_b.py`\n- …and 1,205 more\n\nRun: `pytest tests/unit/test_a.py tests/unit/test_b.py`\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Confirm each fact by reading and searching the code before editing, and keep a step list.\n## Fix first\n**Extract lines 60-122 of Klass.method into compute_info**\nKlass.method: CCN 15, 44 lines, nests 3 deep; 4 files import it.\n## Facts\n- Target: `src/a.py:12` (`Klass.method`)\n- Gain: +1.7 health on this file\n- Effort: S (sized by the stored plan)\n- Risk: Touches 2 files; 4 files import it.\n- Confidence: high. 2 of 5 steps proven mechanical by the plan\n- health recoverable: +1.7 (inferred)\n- steps: 5 (2 mechanical)\n- coverage: unknown (unknown)\n## Steps, in order\n1. Extract lines 60-122 into compute_info(repo_path) -> info (`src/a.py:60`) [mechanical]\n2. Move the helper (`src/b.py`) [judgment]\n3. Rename `x` to `count` (`src/a.py`) [mechanical]\n…and 2 more; the lookup below returns them.\n## Verify\n- `tests/unit/test_a.py`: reaches the changed code through the call-graph\n- `tests/unit/test_b.py`\n- …and 1,205 more\n\nRun: `pytest tests/unit/test_a.py tests/unit/test_b.py`\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. Repowise ranked the change below first among the work it found. Call the MCP lookup under \"Look closer\" for the full record before reading files by hand, then confirm each fact against the code.\n## Fix first\n**Extract lines 60-122 of Klass.method into compute_info**\nKlass.method: CCN 15, 44 lines, nests 3 deep; 4 files import it.\n## Facts\n- Target: `src/a.py:12` (`Klass.method`)\n- Gain: +1.7 health on this file\n- Effort: S (sized by the stored plan)\n- Risk: Touches 2 files; 4 files import it.\n- Confidence: high. 2 of 5 steps proven mechanical by the plan\n- health recoverable: +1.7 (inferred)\n- steps: 5 (2 mechanical)\n- coverage: unknown (unknown)\n## Steps, in order\n1. Extract lines 60-122 into compute_info(repo_path) -> info (`src/a.py:60`) [mechanical]\n2. Move the helper (`src/b.py`) [judgment]\n3. Rename `x` to `count` (`src/a.py`) [mechanical]\n…and 2 more; the lookup below returns them.\n## Verify\n- `tests/unit/test_a.py`: reaches the changed code through the call-graph\n- `tests/unit/test_b.py`\n- …and 1,205 more\n\nRun: `pytest tests/unit/test_a.py tests/unit/test_b.py`\n## Look closer (Repowise MCP)\n`get_health(opportunity_id=\"refop3_1\")`\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Open the target with @file, confirm each fact, then make the change.\n## Fix first\n**Extract lines 60-122 of Klass.method into compute_info**\nKlass.method: CCN 15, 44 lines, nests 3 deep; 4 files import it.\n## Facts\n- Target: `src/a.py:12` (`Klass.method`)\n- Gain: +1.7 health on this file\n- Effort: S (sized by the stored plan)\n- Risk: Touches 2 files; 4 files import it.\n- Confidence: high. 2 of 5 steps proven mechanical by the plan\n- health recoverable: +1.7 (inferred)\n- steps: 5 (2 mechanical)\n- coverage: unknown (unknown)\n## Steps, in order\n1. Extract lines 60-122 into compute_info(repo_path) -> info (`src/a.py:60`) [mechanical]\n2. Move the helper (`src/b.py`) [judgment]\n3. Rename `x` to `count` (`src/a.py`) [mechanical]\n…and 2 more; the lookup below returns them.\n## Verify\n- `tests/unit/test_a.py`: reaches the changed code through the call-graph\n- `tests/unit/test_b.py`\n- …and 1,205 more\n\nRun: `pytest tests/unit/test_a.py tests/unit/test_b.py`\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why."
},
"exact_no_command_empty_args": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Its facts come from stored analysis; treat them as leads to confirm against the code, not as ground truth.\n## Fix first (`r`)\n**Break up GraphFlow (CCN 260, 1,094 lines)**\nGraphFlow: CCN 260, 1,094 lines, nests 7 deep.\n## Facts\n- Target: `packages/ui/src/graph/graph-flow.tsx:198` (`GraphFlow`)\n- Gain: +0.4 health on this file\n- Effort: XL (1,094 lines)\n- Risk: Touches 1 file; 4 files import it.\n- Confidence: low. no plan proves the steps\n- finding: nested_complexity\n## Steps, in order\n1. Flatten the control flow. (`packages/ui/src/graph/graph-flow.tsx:198`) [judgment]\n## Verify\n- `packages/ui/__tests__/graph-flow.test.tsx`: imports the file\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Confirm each fact with Read and Grep before editing, and track the steps with TodoWrite.\n## Fix first (`r`)\n**Break up GraphFlow (CCN 260, 1,094 lines)**\nGraphFlow: CCN 260, 1,094 lines, nests 7 deep.\n## Facts\n- Target: `packages/ui/src/graph/graph-flow.tsx:198` (`GraphFlow`)\n- Gain: +0.4 health on this file\n- Effort: XL (1,094 lines)\n- Risk: Touches 1 file; 4 files import it.\n- Confidence: low. no plan proves the steps\n- finding: nested_complexity\n## Steps, in order\n1. Flatten the control flow. (`packages/ui/src/graph/graph-flow.tsx:198`) [judgment]\n## Verify\n- `packages/ui/__tests__/graph-flow.test.tsx`: imports the file\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Confirm each fact by reading and searching the code before editing, and keep a step list.\n## Fix first (`r`)\n**Break up GraphFlow (CCN 260, 1,094 lines)**\nGraphFlow: CCN 260, 1,094 lines, nests 7 deep.\n## Facts\n- Target: `packages/ui/src/graph/graph-flow.tsx:198` (`GraphFlow`)\n- Gain: +0.4 health on this file\n- Effort: XL (1,094 lines)\n- Risk: Touches 1 file; 4 files import it.\n- Confidence: low. no plan proves the steps\n- finding: nested_complexity\n## Steps, in order\n1. Flatten the control flow. (`packages/ui/src/graph/graph-flow.tsx:198`) [judgment]\n## Verify\n- `packages/ui/__tests__/graph-flow.test.tsx`: imports the file\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. Repowise ranked the change below first among the work it found. Call the MCP lookup under \"Look closer\" for the full record before reading files by hand, then confirm each fact against the code.\n## Fix first (`r`)\n**Break up GraphFlow (CCN 260, 1,094 lines)**\nGraphFlow: CCN 260, 1,094 lines, nests 7 deep.\n## Facts\n- Target: `packages/ui/src/graph/graph-flow.tsx:198` (`GraphFlow`)\n- Gain: +0.4 health on this file\n- Effort: XL (1,094 lines)\n- Risk: Touches 1 file; 4 files import it.\n- Confidence: low. no plan proves the steps\n- finding: nested_complexity\n## Steps, in order\n1. Flatten the control flow. (`packages/ui/src/graph/graph-flow.tsx:198`) [judgment]\n## Verify\n- `packages/ui/__tests__/graph-flow.test.tsx`: imports the file\n## Look closer (Repowise MCP)\n`get_health()`\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Open the target with @file, confirm each fact, then make the change.\n## Fix first (`r`)\n**Break up GraphFlow (CCN 260, 1,094 lines)**\nGraphFlow: CCN 260, 1,094 lines, nests 7 deep.\n## Facts\n- Target: `packages/ui/src/graph/graph-flow.tsx:198` (`GraphFlow`)\n- Gain: +0.4 health on this file\n- Effort: XL (1,094 lines)\n- Risk: Touches 1 file; 4 files import it.\n- Confidence: low. no plan proves the steps\n- finding: nested_complexity\n## Steps, in order\n1. Flatten the control flow. (`packages/ui/src/graph/graph-flow.tsx:198`) [judgment]\n## Verify\n- `packages/ui/__tests__/graph-flow.test.tsx`: imports the file\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why."
},
"helper_texts_and_prerequisite": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Its facts come from stored analysis; treat them as leads to confirm against the code, not as ground truth.\n## Fix first (`r`)\n**Extract lines 20-35 of run into <name>**\nrun has many independent paths through it.\n## Facts\n- Target: `src/core.py:20` (`run`)\n- Gain: +1.0 health on this file\n- Effort: S (sized by the stored plan)\n- Risk: Touches 1 file.\n- Confidence: medium. 0 of 1 step proven mechanical by the plan\n## Steps, in order\n1. Extract lines 20-35 of run into <name>(rows) -> total; name it for what the lines do (`src/core.py:20`) [judgment]\n Helper: `def _<name>(rows):`\n Call: `total = _<name>(rows)`\n Check: `pytest tests/test_core.py`\n## Verify\nNo test reaches this; add a characterization test for `run` before the edit.\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Confirm each fact with Read and Grep before editing, and track the steps with TodoWrite.\n## Fix first (`r`)\n**Extract lines 20-35 of run into <name>**\nrun has many independent paths through it.\n## Facts\n- Target: `src/core.py:20` (`run`)\n- Gain: +1.0 health on this file\n- Effort: S (sized by the stored plan)\n- Risk: Touches 1 file.\n- Confidence: medium. 0 of 1 step proven mechanical by the plan\n## Steps, in order\n1. Extract lines 20-35 of run into <name>(rows) -> total; name it for what the lines do (`src/core.py:20`) [judgment]\n Helper: `def _<name>(rows):`\n Call: `total = _<name>(rows)`\n Check: `pytest tests/test_core.py`\n## Verify\nNo test reaches this; add a characterization test for `run` before the edit.\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Confirm each fact by reading and searching the code before editing, and keep a step list.\n## Fix first (`r`)\n**Extract lines 20-35 of run into <name>**\nrun has many independent paths through it.\n## Facts\n- Target: `src/core.py:20` (`run`)\n- Gain: +1.0 health on this file\n- Effort: S (sized by the stored plan)\n- Risk: Touches 1 file.\n- Confidence: medium. 0 of 1 step proven mechanical by the plan\n## Steps, in order\n1. Extract lines 20-35 of run into <name>(rows) -> total; name it for what the lines do (`src/core.py:20`) [judgment]\n Helper: `def _<name>(rows):`\n Call: `total = _<name>(rows)`\n Check: `pytest tests/test_core.py`\n## Verify\nNo test reaches this; add a characterization test for `run` before the edit.\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. Repowise ranked the change below first among the work it found. Call the MCP lookup under \"Look closer\" for the full record before reading files by hand, then confirm each fact against the code.\n## Fix first (`r`)\n**Extract lines 20-35 of run into <name>**\nrun has many independent paths through it.\n## Facts\n- Target: `src/core.py:20` (`run`)\n- Gain: +1.0 health on this file\n- Effort: S (sized by the stored plan)\n- Risk: Touches 1 file.\n- Confidence: medium. 0 of 1 step proven mechanical by the plan\n## Steps, in order\n1. Extract lines 20-35 of run into <name>(rows) -> total; name it for what the lines do (`src/core.py:20`) [judgment]\n Helper: `def _<name>(rows):`\n Call: `total = _<name>(rows)`\n Check: `pytest tests/test_core.py`\n## Verify\nNo test reaches this; add a characterization test for `run` before the edit.\n## Look closer (Repowise MCP)\n`get_health()`\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, ranked the change below first among the work it found. Open the target with @file, confirm each fact, then make the change.\n## Fix first (`r`)\n**Extract lines 20-35 of run into <name>**\nrun has many independent paths through it.\n## Facts\n- Target: `src/core.py:20` (`run`)\n- Gain: +1.0 health on this file\n- Effort: S (sized by the stored plan)\n- Risk: Touches 1 file.\n- Confidence: medium. 0 of 1 step proven mechanical by the plan\n## Steps, in order\n1. Extract lines 20-35 of run into <name>(rows) -> total; name it for what the lines do (`src/core.py:20`) [judgment]\n Helper: `def _<name>(rows):`\n Call: `total = _<name>(rows)`\n Check: `pytest tests/test_core.py`\n## Verify\nNo test reaches this; add a characterization test for `run` before the edit.\n## Hard constraints\n- **Confirm before changing.** The analysis is stored, not live; the code may have moved since it ran.\n- **Keep behaviour.** This is a structural or performance change; what the code returns must not change.\n- **Run Verify before and after.** If no guarding test exists, write one that pins today's behaviour first.\n- **Say when it is wrong.** If the problem does not hold, or the change costs more than it saves, report that and stop.\n## What I expect back\n1. Whether the problem held, and what you changed.\n2. The Verify run, before and after, with its result.\n3. Anything you left undone, and why."
}
@@ -60,37 +60,37 @@
"refactoring_plan": {
"extract_method_typed": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read the code each step names and confirm it before you change it.\n## Extract Method (`acme/api`)\nExtract lines 61-78 of `Loader.load` into `_extracted_helper`.\n- Plan: `refac4_aaaaaaaaaaaaaaaaaaaa`\n- Target: `src/loader.py:40-120` (`Loader.load`)\n## Before you edit\n- The guarding tests pass before the edit.\n- Decision \"Loaders stay sync-free\" governs this file; check it allows this change first.\n- Changed in 3 commits by ana in the 14 days before the last index; check nobody is mid-change.\n- Decision `dec_2` also governs this file; read it.\n## Steps, in order\n1. Move lines 61-78 of `Loader.load` into a new helper `_extracted_helper` in the same scope, and replace them with one call to it. The helper's name is a placeholder: rename it for what it returns or does, in its header and its call. (`src/loader.py:61-78`)\n - New helper: `async def _extracted_helper(self, path: Path, strict) -> <type>:`\n - Replace lines 61-78 with: `config = await self._extracted_helper(path, strict)`\n - Parameters (in): path, strict\n - Returns (out): config\n - Note: The return type is not named in the code.\n - Note: Fill each `<name>` / `<type>` placeholder from the code.\n## Verify\nRun these before and after the change, the most direct first:\n\n- `tests/test_loader.py` (covers lines 61-78)\n- `tests/test_cli.py`\n2 of 3 guarding tests shown.\n\nRun:\n\n```\npytest tests/test_cli.py tests/test_loader.py\n```\n\n- Expect: `Loader.load` loses about 6 branches of cyclomatic complexity.\n- Expect: File health recovers about 1.25.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not touch anything outside lines 61-78 and the call that replaces them.**\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read each span with Read and Grep before editing, and track the steps with TodoWrite.\n## Extract Method (`acme/api`)\nExtract lines 61-78 of `Loader.load` into `_extracted_helper`.\n- Plan: `refac4_aaaaaaaaaaaaaaaaaaaa`\n- Target: `src/loader.py:40-120` (`Loader.load`)\n## Before you edit\n- The guarding tests pass before the edit.\n- Decision \"Loaders stay sync-free\" governs this file; check it allows this change first.\n- Changed in 3 commits by ana in the 14 days before the last index; check nobody is mid-change.\n- Decision `dec_2` also governs this file; read it.\n## Steps, in order\n1. Move lines 61-78 of `Loader.load` into a new helper `_extracted_helper` in the same scope, and replace them with one call to it. The helper's name is a placeholder: rename it for what it returns or does, in its header and its call. (`src/loader.py:61-78`)\n - New helper: `async def _extracted_helper(self, path: Path, strict) -> <type>:`\n - Replace lines 61-78 with: `config = await self._extracted_helper(path, strict)`\n - Parameters (in): path, strict\n - Returns (out): config\n - Note: The return type is not named in the code.\n - Note: Fill each `<name>` / `<type>` placeholder from the code.\n## Verify\nRun these before and after the change, the most direct first:\n\n- `tests/test_loader.py` (covers lines 61-78)\n- `tests/test_cli.py`\n2 of 3 guarding tests shown.\n\nRun:\n\n```\npytest tests/test_cli.py tests/test_loader.py\n```\n\n- Expect: `Loader.load` loses about 6 branches of cyclomatic complexity.\n- Expect: File health recovers about 1.25.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not touch anything outside lines 61-78 and the call that replaces them.**\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read and search each span before editing, and keep a step list.\n## Extract Method (`acme/api`)\nExtract lines 61-78 of `Loader.load` into `_extracted_helper`.\n- Plan: `refac4_aaaaaaaaaaaaaaaaaaaa`\n- Target: `src/loader.py:40-120` (`Loader.load`)\n## Before you edit\n- The guarding tests pass before the edit.\n- Decision \"Loaders stay sync-free\" governs this file; check it allows this change first.\n- Changed in 3 commits by ana in the 14 days before the last index; check nobody is mid-change.\n- Decision `dec_2` also governs this file; read it.\n## Steps, in order\n1. Move lines 61-78 of `Loader.load` into a new helper `_extracted_helper` in the same scope, and replace them with one call to it. The helper's name is a placeholder: rename it for what it returns or does, in its header and its call. (`src/loader.py:61-78`)\n - New helper: `async def _extracted_helper(self, path: Path, strict) -> <type>:`\n - Replace lines 61-78 with: `config = await self._extracted_helper(path, strict)`\n - Parameters (in): path, strict\n - Returns (out): config\n - Note: The return type is not named in the code.\n - Note: Fill each `<name>` / `<type>` placeholder from the code.\n## Verify\nRun these before and after the change, the most direct first:\n\n- `tests/test_loader.py` (covers lines 61-78)\n- `tests/test_cli.py`\n2 of 3 guarding tests shown.\n\nRun:\n\n```\npytest tests/test_cli.py tests/test_loader.py\n```\n\n- Expect: `Loader.load` loses about 6 branches of cyclomatic complexity.\n- Expect: File health recovers about 1.25.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not touch anything outside lines 61-78 and the call that replaces them.**\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. Repowise planned the refactoring below from its static analysis. It does not edit code: the steps are a spec for you to apply. Use the MCP lookup under \"Look closer\" and `get_symbol` on each span before reading files by hand.\n## Extract Method (`acme/api`)\nExtract lines 61-78 of `Loader.load` into `_extracted_helper`.\n- Plan: `refac4_aaaaaaaaaaaaaaaaaaaa`\n- Target: `src/loader.py:40-120` (`Loader.load`)\n## Before you edit\n- The guarding tests pass before the edit.\n- Decision \"Loaders stay sync-free\" governs this file; check it allows this change first.\n- Changed in 3 commits by ana in the 14 days before the last index; check nobody is mid-change.\n- Decision `dec_2` also governs this file; read it.\n## Steps, in order\n1. Move lines 61-78 of `Loader.load` into a new helper `_extracted_helper` in the same scope, and replace them with one call to it. The helper's name is a placeholder: rename it for what it returns or does, in its header and its call. (`src/loader.py:61-78`)\n - New helper: `async def _extracted_helper(self, path: Path, strict) -> <type>:`\n - Replace lines 61-78 with: `config = await self._extracted_helper(path, strict)`\n - Parameters (in): path, strict\n - Returns (out): config\n - Note: The return type is not named in the code.\n - Note: Fill each `<name>` / `<type>` placeholder from the code.\n## Verify\nRun these before and after the change, the most direct first:\n\n- `tests/test_loader.py` (covers lines 61-78)\n- `tests/test_cli.py`\n2 of 3 guarding tests shown.\n\nRun:\n\n```\npytest tests/test_cli.py tests/test_loader.py\n```\n\n- Expect: `Loader.load` loses about 6 branches of cyclomatic complexity.\n- Expect: File health recovers about 1.25.\n## Look closer (Repowise MCP)\n`get_health(plan_id=\"refac4_aaaaaaaaaaaaaaaaaaaa\")`\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not touch anything outside lines 61-78 and the call that replaces them.**\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Open each span with @file and confirm it before editing.\n## Extract Method (`acme/api`)\nExtract lines 61-78 of `Loader.load` into `_extracted_helper`.\n- Plan: `refac4_aaaaaaaaaaaaaaaaaaaa`\n- Target: `src/loader.py:40-120` (`Loader.load`)\n## Before you edit\n- The guarding tests pass before the edit.\n- Decision \"Loaders stay sync-free\" governs this file; check it allows this change first.\n- Changed in 3 commits by ana in the 14 days before the last index; check nobody is mid-change.\n- Decision `dec_2` also governs this file; read it.\n## Steps, in order\n1. Move lines 61-78 of `Loader.load` into a new helper `_extracted_helper` in the same scope, and replace them with one call to it. The helper's name is a placeholder: rename it for what it returns or does, in its header and its call. (`src/loader.py:61-78`)\n - New helper: `async def _extracted_helper(self, path: Path, strict) -> <type>:`\n - Replace lines 61-78 with: `config = await self._extracted_helper(path, strict)`\n - Parameters (in): path, strict\n - Returns (out): config\n - Note: The return type is not named in the code.\n - Note: Fill each `<name>` / `<type>` placeholder from the code.\n## Verify\nRun these before and after the change, the most direct first:\n\n- `tests/test_loader.py` (covers lines 61-78)\n- `tests/test_cli.py`\n2 of 3 guarding tests shown.\n\nRun:\n\n```\npytest tests/test_cli.py tests/test_loader.py\n```\n\n- Expect: `Loader.load` loses about 6 branches of cyclomatic complexity.\n- Expect: File health recovers about 1.25.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not touch anything outside lines 61-78 and the call that replaces them.**\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change."
},
"extract_method_staged_anchored": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read the code each step names and confirm it before you change it.\n## Extract Method\nSplit `build_report` into 2 helpers it calls in order (cyclomatic complexity 31 -> 19).\n- Plan: `refac4_iiiiiiiiiiiiiiiiiiii`\n- Target: `src/report.py:10-60` (`build_report`)\n## Steps, in order\n1. Stage 1 of 2: Move the span of `build_report` that starts and ends with the lines shown (lines 14-30 when planned) into a new helper `_extracted_helper` in the same scope, and replace it with one call to it. Each stage's helper name is a placeholder: rename each one for what it returns or does, in its header and its call. (`src/report.py:14-30`)\n - The span starts with:\n```\n for row in rows:\n```\n - The span ends with:\n```\n totals[row.key] += row.amount\n```\n - New helper: `def _extracted_helper(rows):`\n - End the helper with: `return totals`\n - Replace the span with: `totals = _extracted_helper(rows)`\n - Parameters (in): rows\n - Returns (out): totals\n2. Stage 2 of 2: Move the span of `build_report` that starts and ends with the lines shown (lines 32-51 when planned) into a new helper `_extracted_helper_2` in the same scope, and replace it with one call to it. (`src/report.py:32-51`)\n - The span starts with:\n```\n if not totals:\n return None\n```\n - The span ends with:\n```\n out.append(f\"`{key}`: {value}\")\n```\n - New helper: `def _extracted_helper_2(totals):`\n - End the helper with: `return out`\n - Replace the span with: `out = _extracted_helper_2(totals)`\n - Parameters (in): totals\n - Returns (out): out\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: `build_report` loses about 12 branches of cyclomatic complexity.\n- Expect: File health recovers about 0.90.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not touch anything outside the lines the steps move (lines 14-51 when planned) and the calls that replace them (and the object the stages share, if any).**\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Do not find a span by its line numbers.** They are where it was when planned and move with every edit; match its first and last lines.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read each span with Read and Grep before editing, and track the steps with TodoWrite.\n## Extract Method\nSplit `build_report` into 2 helpers it calls in order (cyclomatic complexity 31 -> 19).\n- Plan: `refac4_iiiiiiiiiiiiiiiiiiii`\n- Target: `src/report.py:10-60` (`build_report`)\n## Steps, in order\n1. Stage 1 of 2: Move the span of `build_report` that starts and ends with the lines shown (lines 14-30 when planned) into a new helper `_extracted_helper` in the same scope, and replace it with one call to it. Each stage's helper name is a placeholder: rename each one for what it returns or does, in its header and its call. (`src/report.py:14-30`)\n - The span starts with:\n```\n for row in rows:\n```\n - The span ends with:\n```\n totals[row.key] += row.amount\n```\n - New helper: `def _extracted_helper(rows):`\n - End the helper with: `return totals`\n - Replace the span with: `totals = _extracted_helper(rows)`\n - Parameters (in): rows\n - Returns (out): totals\n2. Stage 2 of 2: Move the span of `build_report` that starts and ends with the lines shown (lines 32-51 when planned) into a new helper `_extracted_helper_2` in the same scope, and replace it with one call to it. (`src/report.py:32-51`)\n - The span starts with:\n```\n if not totals:\n return None\n```\n - The span ends with:\n```\n out.append(f\"`{key}`: {value}\")\n```\n - New helper: `def _extracted_helper_2(totals):`\n - End the helper with: `return out`\n - Replace the span with: `out = _extracted_helper_2(totals)`\n - Parameters (in): totals\n - Returns (out): out\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: `build_report` loses about 12 branches of cyclomatic complexity.\n- Expect: File health recovers about 0.90.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not touch anything outside the lines the steps move (lines 14-51 when planned) and the calls that replace them (and the object the stages share, if any).**\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Do not find a span by its line numbers.** They are where it was when planned and move with every edit; match its first and last lines.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read and search each span before editing, and keep a step list.\n## Extract Method\nSplit `build_report` into 2 helpers it calls in order (cyclomatic complexity 31 -> 19).\n- Plan: `refac4_iiiiiiiiiiiiiiiiiiii`\n- Target: `src/report.py:10-60` (`build_report`)\n## Steps, in order\n1. Stage 1 of 2: Move the span of `build_report` that starts and ends with the lines shown (lines 14-30 when planned) into a new helper `_extracted_helper` in the same scope, and replace it with one call to it. Each stage's helper name is a placeholder: rename each one for what it returns or does, in its header and its call. (`src/report.py:14-30`)\n - The span starts with:\n```\n for row in rows:\n```\n - The span ends with:\n```\n totals[row.key] += row.amount\n```\n - New helper: `def _extracted_helper(rows):`\n - End the helper with: `return totals`\n - Replace the span with: `totals = _extracted_helper(rows)`\n - Parameters (in): rows\n - Returns (out): totals\n2. Stage 2 of 2: Move the span of `build_report` that starts and ends with the lines shown (lines 32-51 when planned) into a new helper `_extracted_helper_2` in the same scope, and replace it with one call to it. (`src/report.py:32-51`)\n - The span starts with:\n```\n if not totals:\n return None\n```\n - The span ends with:\n```\n out.append(f\"`{key}`: {value}\")\n```\n - New helper: `def _extracted_helper_2(totals):`\n - End the helper with: `return out`\n - Replace the span with: `out = _extracted_helper_2(totals)`\n - Parameters (in): totals\n - Returns (out): out\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: `build_report` loses about 12 branches of cyclomatic complexity.\n- Expect: File health recovers about 0.90.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not touch anything outside the lines the steps move (lines 14-51 when planned) and the calls that replace them (and the object the stages share, if any).**\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Do not find a span by its line numbers.** They are where it was when planned and move with every edit; match its first and last lines.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. Repowise planned the refactoring below from its static analysis. It does not edit code: the steps are a spec for you to apply. Use the MCP lookup under \"Look closer\" and `get_symbol` on each span before reading files by hand.\n## Extract Method\nSplit `build_report` into 2 helpers it calls in order (cyclomatic complexity 31 -> 19).\n- Plan: `refac4_iiiiiiiiiiiiiiiiiiii`\n- Target: `src/report.py:10-60` (`build_report`)\n## Steps, in order\n1. Stage 1 of 2: Move the span of `build_report` that starts and ends with the lines shown (lines 14-30 when planned) into a new helper `_extracted_helper` in the same scope, and replace it with one call to it. Each stage's helper name is a placeholder: rename each one for what it returns or does, in its header and its call. (`src/report.py:14-30`)\n - The span starts with:\n```\n for row in rows:\n```\n - The span ends with:\n```\n totals[row.key] += row.amount\n```\n - New helper: `def _extracted_helper(rows):`\n - End the helper with: `return totals`\n - Replace the span with: `totals = _extracted_helper(rows)`\n - Parameters (in): rows\n - Returns (out): totals\n2. Stage 2 of 2: Move the span of `build_report` that starts and ends with the lines shown (lines 32-51 when planned) into a new helper `_extracted_helper_2` in the same scope, and replace it with one call to it. (`src/report.py:32-51`)\n - The span starts with:\n```\n if not totals:\n return None\n```\n - The span ends with:\n```\n out.append(f\"`{key}`: {value}\")\n```\n - New helper: `def _extracted_helper_2(totals):`\n - End the helper with: `return out`\n - Replace the span with: `out = _extracted_helper_2(totals)`\n - Parameters (in): totals\n - Returns (out): out\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: `build_report` loses about 12 branches of cyclomatic complexity.\n- Expect: File health recovers about 0.90.\n## Look closer (Repowise MCP)\n`get_health(plan_id=\"refac4_iiiiiiiiiiiiiiiiiiii\")`\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not touch anything outside the lines the steps move (lines 14-51 when planned) and the calls that replace them (and the object the stages share, if any).**\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Do not find a span by its line numbers.** They are where it was when planned and move with every edit; match its first and last lines.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Open each span with @file and confirm it before editing.\n## Extract Method\nSplit `build_report` into 2 helpers it calls in order (cyclomatic complexity 31 -> 19).\n- Plan: `refac4_iiiiiiiiiiiiiiiiiiii`\n- Target: `src/report.py:10-60` (`build_report`)\n## Steps, in order\n1. Stage 1 of 2: Move the span of `build_report` that starts and ends with the lines shown (lines 14-30 when planned) into a new helper `_extracted_helper` in the same scope, and replace it with one call to it. Each stage's helper name is a placeholder: rename each one for what it returns or does, in its header and its call. (`src/report.py:14-30`)\n - The span starts with:\n```\n for row in rows:\n```\n - The span ends with:\n```\n totals[row.key] += row.amount\n```\n - New helper: `def _extracted_helper(rows):`\n - End the helper with: `return totals`\n - Replace the span with: `totals = _extracted_helper(rows)`\n - Parameters (in): rows\n - Returns (out): totals\n2. Stage 2 of 2: Move the span of `build_report` that starts and ends with the lines shown (lines 32-51 when planned) into a new helper `_extracted_helper_2` in the same scope, and replace it with one call to it. (`src/report.py:32-51`)\n - The span starts with:\n```\n if not totals:\n return None\n```\n - The span ends with:\n```\n out.append(f\"`{key}`: {value}\")\n```\n - New helper: `def _extracted_helper_2(totals):`\n - End the helper with: `return out`\n - Replace the span with: `out = _extracted_helper_2(totals)`\n - Parameters (in): totals\n - Returns (out): out\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: `build_report` loses about 12 branches of cyclomatic complexity.\n- Expect: File health recovers about 0.90.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not touch anything outside the lines the steps move (lines 14-51 when planned) and the calls that replace them (and the object the stages share, if any).**\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Do not find a span by its line numbers.** They are where it was when planned and move with every edit; match its first and last lines.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change."
},
"performance_fix_steps": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read the code each step names and confirm it before you change it.\n## Performance\nBatch the repeated per-item calls in `load_rows`.\n- Plan: `refac4_bbbbbbbbbbbbbbbbbbbb`\n- Target: `src/rows.py:12` (`load_rows`)\n## Before you edit\n- No test reaches this; add a characterization test for `load_rows` before the edit.\n## Steps, in order\n1. Add a form of fetch_row that takes every key at once. (`src/db.py`)\n - Judgment step.\n2. Collect the keys before the loop and replace the per-key fetch_row call with one batched call in `load_rows`. (`src/rows.py:12`)\n - Judgment step.\n - Verify this step: `pytest tests/test_rows.py`\n## Verify\nNo guarding test was found; the test added before the edit passes after it.\n\n- Expect: The repeated work no longer runs once per item at 2 call sites.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not change the results or errors the batched or reordered calls produce.**\n- **Do not apply a judgment step without reading the code it names first.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read each span with Read and Grep before editing, and track the steps with TodoWrite.\n## Performance\nBatch the repeated per-item calls in `load_rows`.\n- Plan: `refac4_bbbbbbbbbbbbbbbbbbbb`\n- Target: `src/rows.py:12` (`load_rows`)\n## Before you edit\n- No test reaches this; add a characterization test for `load_rows` before the edit.\n## Steps, in order\n1. Add a form of fetch_row that takes every key at once. (`src/db.py`)\n - Judgment step.\n2. Collect the keys before the loop and replace the per-key fetch_row call with one batched call in `load_rows`. (`src/rows.py:12`)\n - Judgment step.\n - Verify this step: `pytest tests/test_rows.py`\n## Verify\nNo guarding test was found; the test added before the edit passes after it.\n\n- Expect: The repeated work no longer runs once per item at 2 call sites.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not change the results or errors the batched or reordered calls produce.**\n- **Do not apply a judgment step without reading the code it names first.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read and search each span before editing, and keep a step list.\n## Performance\nBatch the repeated per-item calls in `load_rows`.\n- Plan: `refac4_bbbbbbbbbbbbbbbbbbbb`\n- Target: `src/rows.py:12` (`load_rows`)\n## Before you edit\n- No test reaches this; add a characterization test for `load_rows` before the edit.\n## Steps, in order\n1. Add a form of fetch_row that takes every key at once. (`src/db.py`)\n - Judgment step.\n2. Collect the keys before the loop and replace the per-key fetch_row call with one batched call in `load_rows`. (`src/rows.py:12`)\n - Judgment step.\n - Verify this step: `pytest tests/test_rows.py`\n## Verify\nNo guarding test was found; the test added before the edit passes after it.\n\n- Expect: The repeated work no longer runs once per item at 2 call sites.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not change the results or errors the batched or reordered calls produce.**\n- **Do not apply a judgment step without reading the code it names first.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. Repowise planned the refactoring below from its static analysis. It does not edit code: the steps are a spec for you to apply. Use the MCP lookup under \"Look closer\" and `get_symbol` on each span before reading files by hand.\n## Performance\nBatch the repeated per-item calls in `load_rows`.\n- Plan: `refac4_bbbbbbbbbbbbbbbbbbbb`\n- Target: `src/rows.py:12` (`load_rows`)\n## Before you edit\n- No test reaches this; add a characterization test for `load_rows` before the edit.\n## Steps, in order\n1. Add a form of fetch_row that takes every key at once. (`src/db.py`)\n - Judgment step.\n2. Collect the keys before the loop and replace the per-key fetch_row call with one batched call in `load_rows`. (`src/rows.py:12`)\n - Judgment step.\n - Verify this step: `pytest tests/test_rows.py`\n## Verify\nNo guarding test was found; the test added before the edit passes after it.\n\n- Expect: The repeated work no longer runs once per item at 2 call sites.\n## Look closer (Repowise MCP)\n`get_health(plan_id=\"refac4_bbbbbbbbbbbbbbbbbbbb\")`\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not change the results or errors the batched or reordered calls produce.**\n- **Do not apply a judgment step without reading the code it names first.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Open each span with @file and confirm it before editing.\n## Performance\nBatch the repeated per-item calls in `load_rows`.\n- Plan: `refac4_bbbbbbbbbbbbbbbbbbbb`\n- Target: `src/rows.py:12` (`load_rows`)\n## Before you edit\n- No test reaches this; add a characterization test for `load_rows` before the edit.\n## Steps, in order\n1. Add a form of fetch_row that takes every key at once. (`src/db.py`)\n - Judgment step.\n2. Collect the keys before the loop and replace the per-key fetch_row call with one batched call in `load_rows`. (`src/rows.py:12`)\n - Judgment step.\n - Verify this step: `pytest tests/test_rows.py`\n## Verify\nNo guarding test was found; the test added before the edit passes after it.\n\n- Expect: The repeated work no longer runs once per item at 2 call sites.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not change the results or errors the batched or reordered calls produce.**\n- **Do not apply a judgment step without reading the code it names first.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change."
},
"split_file_older_row": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read the code each step names and confirm it before you change it.\n## Split File\nSplit `pkg/big.py`: move 2 groups of symbols into their own files.\n- Plan: `refac4_cccccccccccccccccccc`\n- Target: `pkg/big.py`\n## Before you edit\n- Risks and governing decisions were not checked for this plan.\n## Steps, in order\n1. Move `parse_a`, `parse_b` to `pkg/parsing.py` (a starting name; follow the repo's convention). (`pkg/parsing.py`)\n2. Move `render` to a new file (part 2) (a starting name; follow the repo's convention).\n3. Leave `Config` in `pkg/big.py`: more than one group uses them. (`pkg/big.py`)\n4. Keep `pkg/big.py` importable: re-export the moved symbols, or update every importer. (`pkg/big.py`)\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: No resulting file is near the original's 900 lines.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not put one symbol in two files.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read each span with Read and Grep before editing, and track the steps with TodoWrite.\n## Split File\nSplit `pkg/big.py`: move 2 groups of symbols into their own files.\n- Plan: `refac4_cccccccccccccccccccc`\n- Target: `pkg/big.py`\n## Before you edit\n- Risks and governing decisions were not checked for this plan.\n## Steps, in order\n1. Move `parse_a`, `parse_b` to `pkg/parsing.py` (a starting name; follow the repo's convention). (`pkg/parsing.py`)\n2. Move `render` to a new file (part 2) (a starting name; follow the repo's convention).\n3. Leave `Config` in `pkg/big.py`: more than one group uses them. (`pkg/big.py`)\n4. Keep `pkg/big.py` importable: re-export the moved symbols, or update every importer. (`pkg/big.py`)\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: No resulting file is near the original's 900 lines.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not put one symbol in two files.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read and search each span before editing, and keep a step list.\n## Split File\nSplit `pkg/big.py`: move 2 groups of symbols into their own files.\n- Plan: `refac4_cccccccccccccccccccc`\n- Target: `pkg/big.py`\n## Before you edit\n- Risks and governing decisions were not checked for this plan.\n## Steps, in order\n1. Move `parse_a`, `parse_b` to `pkg/parsing.py` (a starting name; follow the repo's convention). (`pkg/parsing.py`)\n2. Move `render` to a new file (part 2) (a starting name; follow the repo's convention).\n3. Leave `Config` in `pkg/big.py`: more than one group uses them. (`pkg/big.py`)\n4. Keep `pkg/big.py` importable: re-export the moved symbols, or update every importer. (`pkg/big.py`)\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: No resulting file is near the original's 900 lines.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not put one symbol in two files.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. Repowise planned the refactoring below from its static analysis. It does not edit code: the steps are a spec for you to apply. Use the MCP lookup under \"Look closer\" and `get_symbol` on each span before reading files by hand.\n## Split File\nSplit `pkg/big.py`: move 2 groups of symbols into their own files.\n- Plan: `refac4_cccccccccccccccccccc`\n- Target: `pkg/big.py`\n## Before you edit\n- Risks and governing decisions were not checked for this plan.\n## Steps, in order\n1. Move `parse_a`, `parse_b` to `pkg/parsing.py` (a starting name; follow the repo's convention). (`pkg/parsing.py`)\n2. Move `render` to a new file (part 2) (a starting name; follow the repo's convention).\n3. Leave `Config` in `pkg/big.py`: more than one group uses them. (`pkg/big.py`)\n4. Keep `pkg/big.py` importable: re-export the moved symbols, or update every importer. (`pkg/big.py`)\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: No resulting file is near the original's 900 lines.\n## Look closer (Repowise MCP)\n`get_health(plan_id=\"refac4_cccccccccccccccccccc\")`\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not put one symbol in two files.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Open each span with @file and confirm it before editing.\n## Split File\nSplit `pkg/big.py`: move 2 groups of symbols into their own files.\n- Plan: `refac4_cccccccccccccccccccc`\n- Target: `pkg/big.py`\n## Before you edit\n- Risks and governing decisions were not checked for this plan.\n## Steps, in order\n1. Move `parse_a`, `parse_b` to `pkg/parsing.py` (a starting name; follow the repo's convention). (`pkg/parsing.py`)\n2. Move `render` to a new file (part 2) (a starting name; follow the repo's convention).\n3. Leave `Config` in `pkg/big.py`: more than one group uses them. (`pkg/big.py`)\n4. Keep `pkg/big.py` importable: re-export the moved symbols, or update every importer. (`pkg/big.py`)\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: No resulting file is near the original's 900 lines.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not put one symbol in two files.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change."
},
"break_cycle_advisory": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read the code each step names and confirm it before you change it.\n## Break Cycle\nBreak the 2-file import cycle by cutting 1 import.\n- Plan: `refac4_gggggggggggggggggggg`\n- Target: `pkg/a.py`\n## Advisory: one way to cut the cycle\n- Remove the import of `pkg/b.py`: invert the dependency or move what both need into a module neither imports. A function-local import only if it really breaks the cycle. (`pkg/a.py`)\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: The 2-file import cycle is gone.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not merge the files in the cycle.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read each span with Read and Grep before editing, and track the steps with TodoWrite.\n## Break Cycle\nBreak the 2-file import cycle by cutting 1 import.\n- Plan: `refac4_gggggggggggggggggggg`\n- Target: `pkg/a.py`\n## Advisory: one way to cut the cycle\n- Remove the import of `pkg/b.py`: invert the dependency or move what both need into a module neither imports. A function-local import only if it really breaks the cycle. (`pkg/a.py`)\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: The 2-file import cycle is gone.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not merge the files in the cycle.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read and search each span before editing, and keep a step list.\n## Break Cycle\nBreak the 2-file import cycle by cutting 1 import.\n- Plan: `refac4_gggggggggggggggggggg`\n- Target: `pkg/a.py`\n## Advisory: one way to cut the cycle\n- Remove the import of `pkg/b.py`: invert the dependency or move what both need into a module neither imports. A function-local import only if it really breaks the cycle. (`pkg/a.py`)\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: The 2-file import cycle is gone.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not merge the files in the cycle.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. Repowise planned the refactoring below from its static analysis. It does not edit code: the steps are a spec for you to apply. Use the MCP lookup under \"Look closer\" and `get_symbol` on each span before reading files by hand.\n## Break Cycle\nBreak the 2-file import cycle by cutting 1 import.\n- Plan: `refac4_gggggggggggggggggggg`\n- Target: `pkg/a.py`\n## Advisory: one way to cut the cycle\n- Remove the import of `pkg/b.py`: invert the dependency or move what both need into a module neither imports. A function-local import only if it really breaks the cycle. (`pkg/a.py`)\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: The 2-file import cycle is gone.\n## Look closer (Repowise MCP)\n`get_health(plan_id=\"refac4_gggggggggggggggggggg\")`\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not merge the files in the cycle.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Open each span with @file and confirm it before editing.\n## Break Cycle\nBreak the 2-file import cycle by cutting 1 import.\n- Plan: `refac4_gggggggggggggggggggg`\n- Target: `pkg/a.py`\n## Advisory: one way to cut the cycle\n- Remove the import of `pkg/b.py`: invert the dependency or move what both need into a module neither imports. A function-local import only if it really breaks the cycle. (`pkg/a.py`)\n## Verify\nThe tests that exercise the change pass; add one if none does.\n\n- Expect: The 2-file import cycle is gone.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not merge the files in the cycle.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change."
},
"move_method_unaudited": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read the code each step names and confirm it before you change it.\n## Move Method\nMove `total_tax` from `Order` to `TaxTable` in `src/tax.py`, then update every call site; keep a delegating wrapper only for callers you cannot reach.\n- Plan: `refac4_hhhhhhhhhhhhhhhhhhhh`\n- Target: `src/order.py:20-34` (`Order.total_tax`)\n## Before you edit\n- The guarding tests pass before the edit.\n- This plan type is not yet audited for accuracy; confirm it fits before applying.\n- `Order.total_tax` has 3 callers; each has to reach it through `TaxTable` after the move.\n## Steps, in order\n1. Move `total_tax` from `Order` to `TaxTable` in `src/tax.py`, then update every call site; keep a delegating wrapper only for callers you cannot reach. (`src/order.py:20-34`)\n## Verify\nThe 4 guarding tests (not listed here) pass after the edit.\n\n- Expect: File health recovers about 0.40.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not leave a call site pointing at the old class.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read each span with Read and Grep before editing, and track the steps with TodoWrite.\n## Move Method\nMove `total_tax` from `Order` to `TaxTable` in `src/tax.py`, then update every call site; keep a delegating wrapper only for callers you cannot reach.\n- Plan: `refac4_hhhhhhhhhhhhhhhhhhhh`\n- Target: `src/order.py:20-34` (`Order.total_tax`)\n## Before you edit\n- The guarding tests pass before the edit.\n- This plan type is not yet audited for accuracy; confirm it fits before applying.\n- `Order.total_tax` has 3 callers; each has to reach it through `TaxTable` after the move.\n## Steps, in order\n1. Move `total_tax` from `Order` to `TaxTable` in `src/tax.py`, then update every call site; keep a delegating wrapper only for callers you cannot reach. (`src/order.py:20-34`)\n## Verify\nThe 4 guarding tests (not listed here) pass after the edit.\n\n- Expect: File health recovers about 0.40.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not leave a call site pointing at the old class.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read and search each span before editing, and keep a step list.\n## Move Method\nMove `total_tax` from `Order` to `TaxTable` in `src/tax.py`, then update every call site; keep a delegating wrapper only for callers you cannot reach.\n- Plan: `refac4_hhhhhhhhhhhhhhhhhhhh`\n- Target: `src/order.py:20-34` (`Order.total_tax`)\n## Before you edit\n- The guarding tests pass before the edit.\n- This plan type is not yet audited for accuracy; confirm it fits before applying.\n- `Order.total_tax` has 3 callers; each has to reach it through `TaxTable` after the move.\n## Steps, in order\n1. Move `total_tax` from `Order` to `TaxTable` in `src/tax.py`, then update every call site; keep a delegating wrapper only for callers you cannot reach. (`src/order.py:20-34`)\n## Verify\nThe 4 guarding tests (not listed here) pass after the edit.\n\n- Expect: File health recovers about 0.40.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not leave a call site pointing at the old class.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. Repowise planned the refactoring below from its static analysis. It does not edit code: the steps are a spec for you to apply. Use the MCP lookup under \"Look closer\" and `get_symbol` on each span before reading files by hand.\n## Move Method\nMove `total_tax` from `Order` to `TaxTable` in `src/tax.py`, then update every call site; keep a delegating wrapper only for callers you cannot reach.\n- Plan: `refac4_hhhhhhhhhhhhhhhhhhhh`\n- Target: `src/order.py:20-34` (`Order.total_tax`)\n## Before you edit\n- The guarding tests pass before the edit.\n- This plan type is not yet audited for accuracy; confirm it fits before applying.\n- `Order.total_tax` has 3 callers; each has to reach it through `TaxTable` after the move.\n## Steps, in order\n1. Move `total_tax` from `Order` to `TaxTable` in `src/tax.py`, then update every call site; keep a delegating wrapper only for callers you cannot reach. (`src/order.py:20-34`)\n## Verify\nThe 4 guarding tests (not listed here) pass after the edit.\n\n- Expect: File health recovers about 0.40.\n## Look closer (Repowise MCP)\n`get_health(plan_id=\"refac4_hhhhhhhhhhhhhhhhhhhh\")`\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not leave a call site pointing at the old class.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, planned the refactoring below from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Open each span with @file and confirm it before editing.\n## Move Method\nMove `total_tax` from `Order` to `TaxTable` in `src/tax.py`, then update every call site; keep a delegating wrapper only for callers you cannot reach.\n- Plan: `refac4_hhhhhhhhhhhhhhhhhhhh`\n- Target: `src/order.py:20-34` (`Order.total_tax`)\n## Before you edit\n- The guarding tests pass before the edit.\n- This plan type is not yet audited for accuracy; confirm it fits before applying.\n- `Order.total_tax` has 3 callers; each has to reach it through `TaxTable` after the move.\n## Steps, in order\n1. Move `total_tax` from `Order` to `TaxTable` in `src/tax.py`, then update every call site; keep a delegating wrapper only for callers you cannot reach. (`src/order.py:20-34`)\n## Verify\nThe 4 guarding tests (not listed here) pass after the edit.\n\n- Expect: File health recovers about 0.40.\n## Hard constraints\n- **Do not change behaviour.** What the code returns, raises or writes stays the same.\n- **Do not leave a call site pointing at the old class.**\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step applied.\n2. What you named or introduced, and why.\n3. The Verify run, before and after, with its result.\n4. Any call sites or files you also had to change."
}
@@ -106,7 +106,7 @@
"refactoring_opportunity": {
"two_steps_one_relocated": {
"generic": "You are a senior engineer in this repository. Repowise, a code-intelligence index, composed the ordered refactoring steps below for one file from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read the code each step names and confirm it before you change it.\n## Extract Method in `src/loader.py` (`acme/api`)\n- Opportunity: `refop4_dddddddddddddddddddd`\n- File: `src/loader.py`\n- Leading cause: complex method.\n- 2 steps: 1 mechanical, 1 judgment.\n- Recovers ~2.50 of health score if applied.\n- Effort: M bucket. Detector confidence: high.\n- No dominant problem was recorded for this file, so whether these steps address it is unknown.\n## Steps, in order\nA step marked 'Moved by an earlier step' names a symbol an earlier step relocates.\n\n1. **Extract Method** at `src/loader.py:40-120` (`Loader.load`)\n - Step id: `refac4_aaaaaaaaaaaaaaaaaaaa`\n - Mechanical: dataflow proved local extraction.\n - Move lines 61-78 of `Loader.load` into a new helper `<name>` in the same scope, and replace them with one call to it. The helper's name is a placeholder: rename it for what it returns or does, in its header and its call. (`src/loader.py:61-78`)\n - Parameters (in): path\n - Returns (out): (nothing)\n\n2. **Move Method** at `src/loader.py:130` (`Loader.parse`)\n - Step id: `refac4_eeeeeeeeeeeeeeeeeeee`\n - Judgment. Not established: call sites resolved.\n - **Locate it again first.** Step `refac4_aaaaaaaaaaaaaaaaaaaa` moves this symbol, so the path and lines above are where it was, not where it will be when you get here.\n - This step's plan was not in this payload; ask for it by id: `refac4_eeeeeeeeeeeeeeeeeeee`.\n## Evidence behind the diagnosis\nSupporting observations, not extra work.\n- Extract Helper `loader.py:10-20`: duplicated lines: 11; occurrence count: 2\n1 of 3 shown.\n## Verify\n### For `Loader.load`\n\nRun these before and after the change, the most direct first:\n\n- `tests/test_loader.py`\n\nRun:\n\n```\npytest tests/test_loader.py\n```\n\n### For `Loader.parse`\n\nNo guarding test was found; the test added before the edit passes after it.\n## Hard constraints\n- **Apply the steps in the order given.** It is dependency-safe; reordering it is not.\n- **Read a judgment step's code before applying it.** Its obligation is unproven.\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Keep behaviour.** Run the tests (and type-checker / linter) before and after.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step above applied in order.\n2. Per step: whether you applied it, and for anything you skipped, the reason.\n3. The Verify run, before and after, with its result.\n4. The opportunity id `refop4_dddddddddddddddddddd`, so the work can be matched back to the record.\n## This opportunity's id\n`refop4_dddddddddddddddddddd`\nQuote it when you report back.",
- "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, composed the ordered refactoring steps below for one file from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read each span with Read and Grep before editing, and track the steps with TodoWrite.\n## Extract Method in `src/loader.py` (`acme/api`)\n- Opportunity: `refop4_dddddddddddddddddddd`\n- File: `src/loader.py`\n- Leading cause: complex method.\n- 2 steps: 1 mechanical, 1 judgment.\n- Recovers ~2.50 of health score if applied.\n- Effort: M bucket. Detector confidence: high.\n- No dominant problem was recorded for this file, so whether these steps address it is unknown.\n## Steps, in order\nA step marked 'Moved by an earlier step' names a symbol an earlier step relocates.\n\n1. **Extract Method** at `src/loader.py:40-120` (`Loader.load`)\n - Step id: `refac4_aaaaaaaaaaaaaaaaaaaa`\n - Mechanical: dataflow proved local extraction.\n - Move lines 61-78 of `Loader.load` into a new helper `<name>` in the same scope, and replace them with one call to it. The helper's name is a placeholder: rename it for what it returns or does, in its header and its call. (`src/loader.py:61-78`)\n - Parameters (in): path\n - Returns (out): (nothing)\n\n2. **Move Method** at `src/loader.py:130` (`Loader.parse`)\n - Step id: `refac4_eeeeeeeeeeeeeeeeeeee`\n - Judgment. Not established: call sites resolved.\n - **Locate it again first.** Step `refac4_aaaaaaaaaaaaaaaaaaaa` moves this symbol, so the path and lines above are where it was, not where it will be when you get here.\n - This step's plan was not in this payload; ask for it by id: `refac4_eeeeeeeeeeeeeeeeeeee`.\n## Evidence behind the diagnosis\nSupporting observations, not extra work.\n- Extract Helper `loader.py:10-20`: duplicated lines: 11; occurrence count: 2\n1 of 3 shown.\n## Verify\n### For `Loader.load`\n\nRun these before and after the change, the most direct first:\n\n- `tests/test_loader.py`\n\nRun:\n\n```\npytest tests/test_loader.py\n```\n\n### For `Loader.parse`\n\nNo guarding test was found; the test added before the edit passes after it.\n## Hard constraints\n- **Apply the steps in the order given.** It is dependency-safe; reordering it is not.\n- **Read a judgment step's code before applying it.** Its obligation is unproven.\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Keep behaviour.** Run the tests (and type-checker / linter) before and after.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step above applied in order.\n2. Per step: whether you applied it, and for anything you skipped, the reason.\n3. The Verify run, before and after, with its result.\n4. The opportunity id `refop4_dddddddddddddddddddd`, so the work can be matched back to the record.\n## This opportunity's id\n`refop4_dddddddddddddddddddd`\nQuote it when you report back.",
+ "claude-code": "You are Claude Code in this repository. Repowise, a code-intelligence index, composed the ordered refactoring steps below for one file from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Read and search each span before editing, and keep a step list.\n## Extract Method in `src/loader.py` (`acme/api`)\n- Opportunity: `refop4_dddddddddddddddddddd`\n- File: `src/loader.py`\n- Leading cause: complex method.\n- 2 steps: 1 mechanical, 1 judgment.\n- Recovers ~2.50 of health score if applied.\n- Effort: M bucket. Detector confidence: high.\n- No dominant problem was recorded for this file, so whether these steps address it is unknown.\n## Steps, in order\nA step marked 'Moved by an earlier step' names a symbol an earlier step relocates.\n\n1. **Extract Method** at `src/loader.py:40-120` (`Loader.load`)\n - Step id: `refac4_aaaaaaaaaaaaaaaaaaaa`\n - Mechanical: dataflow proved local extraction.\n - Move lines 61-78 of `Loader.load` into a new helper `<name>` in the same scope, and replace them with one call to it. The helper's name is a placeholder: rename it for what it returns or does, in its header and its call. (`src/loader.py:61-78`)\n - Parameters (in): path\n - Returns (out): (nothing)\n\n2. **Move Method** at `src/loader.py:130` (`Loader.parse`)\n - Step id: `refac4_eeeeeeeeeeeeeeeeeeee`\n - Judgment. Not established: call sites resolved.\n - **Locate it again first.** Step `refac4_aaaaaaaaaaaaaaaaaaaa` moves this symbol, so the path and lines above are where it was, not where it will be when you get here.\n - This step's plan was not in this payload; ask for it by id: `refac4_eeeeeeeeeeeeeeeeeeee`.\n## Evidence behind the diagnosis\nSupporting observations, not extra work.\n- Extract Helper `loader.py:10-20`: duplicated lines: 11; occurrence count: 2\n1 of 3 shown.\n## Verify\n### For `Loader.load`\n\nRun these before and after the change, the most direct first:\n\n- `tests/test_loader.py`\n\nRun:\n\n```\npytest tests/test_loader.py\n```\n\n### For `Loader.parse`\n\nNo guarding test was found; the test added before the edit passes after it.\n## Hard constraints\n- **Apply the steps in the order given.** It is dependency-safe; reordering it is not.\n- **Read a judgment step's code before applying it.** Its obligation is unproven.\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Keep behaviour.** Run the tests (and type-checker / linter) before and after.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step above applied in order.\n2. Per step: whether you applied it, and for anything you skipped, the reason.\n3. The Verify run, before and after, with its result.\n4. The opportunity id `refop4_dddddddddddddddddddd`, so the work can be matched back to the record.\n## This opportunity's id\n`refop4_dddddddddddddddddddd`\nQuote it when you report back.",
"claude-code-mcp": "You are Claude Code in this repository, which Repowise indexes and serves over MCP. Repowise composed the ordered refactoring steps below for one file from its static analysis. It does not edit code: the steps are a spec for you to apply. Pull the record with the call at the end and `get_symbol` each span before reading files by hand.\n## Extract Method in `src/loader.py` (`acme/api`)\n- Opportunity: `refop4_dddddddddddddddddddd`\n- File: `src/loader.py`\n- Leading cause: complex method.\n- 2 steps: 1 mechanical, 1 judgment.\n- Recovers ~2.50 of health score if applied.\n- Effort: M bucket. Detector confidence: high.\n- No dominant problem was recorded for this file, so whether these steps address it is unknown.\n## Steps, in order\nA step marked 'Moved by an earlier step' names a symbol an earlier step relocates.\n\n1. **Extract Method** at `src/loader.py:40-120` (`Loader.load`)\n - Step id: `refac4_aaaaaaaaaaaaaaaaaaaa`\n - Mechanical: dataflow proved local extraction.\n - Move lines 61-78 of `Loader.load` into a new helper `<name>` in the same scope, and replace them with one call to it. The helper's name is a placeholder: rename it for what it returns or does, in its header and its call. (`src/loader.py:61-78`)\n - Parameters (in): path\n - Returns (out): (nothing)\n\n2. **Move Method** at `src/loader.py:130` (`Loader.parse`)\n - Step id: `refac4_eeeeeeeeeeeeeeeeeeee`\n - Judgment. Not established: call sites resolved.\n - **Locate it again first.** Step `refac4_aaaaaaaaaaaaaaaaaaaa` moves this symbol, so the path and lines above are where it was, not where it will be when you get here.\n - This step's plan was not in this payload; ask for it by id: `refac4_eeeeeeeeeeeeeeeeeeee`.\n## Evidence behind the diagnosis\nSupporting observations, not extra work.\n- Extract Helper `loader.py:10-20`: duplicated lines: 11; occurrence count: 2\n1 of 3 shown.\n## Verify\n### For `Loader.load`\n\nRun these before and after the change, the most direct first:\n\n- `tests/test_loader.py`\n\nRun:\n\n```\npytest tests/test_loader.py\n```\n\n### For `Loader.parse`\n\nNo guarding test was found; the test added before the edit passes after it.\n## Hard constraints\n- **Apply the steps in the order given.** It is dependency-safe; reordering it is not.\n- **Read a judgment step's code before applying it.** Its obligation is unproven.\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Keep behaviour.** Run the tests (and type-checker / linter) before and after.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step above applied in order.\n2. Per step: whether you applied it, and for anything you skipped, the reason.\n3. The Verify run, before and after, with its result.\n4. The opportunity id `refop4_dddddddddddddddddddd`, so the work can be matched back to the record.\n## Pull this record yourself\n`get_health(opportunity_id=\"refop4_dddddddddddddddddddd\")`\nIt returns this opportunity from the index: every ordered step with its plan, the validation profiles and the evidence. Call it before you start; the steps above are a snapshot.",
"cursor": "Work in this repository. Repowise, a code-intelligence index, composed the ordered refactoring steps below for one file from its static analysis. Repowise does not edit code: the steps are a spec for you to apply. Open each span with @file and confirm it before editing.\n## Extract Method in `src/loader.py` (`acme/api`)\n- Opportunity: `refop4_dddddddddddddddddddd`\n- File: `src/loader.py`\n- Leading cause: complex method.\n- 2 steps: 1 mechanical, 1 judgment.\n- Recovers ~2.50 of health score if applied.\n- Effort: M bucket. Detector confidence: high.\n- No dominant problem was recorded for this file, so whether these steps address it is unknown.\n## Steps, in order\nA step marked 'Moved by an earlier step' names a symbol an earlier step relocates.\n\n1. **Extract Method** at `src/loader.py:40-120` (`Loader.load`)\n - Step id: `refac4_aaaaaaaaaaaaaaaaaaaa`\n - Mechanical: dataflow proved local extraction.\n - Move lines 61-78 of `Loader.load` into a new helper `<name>` in the same scope, and replace them with one call to it. The helper's name is a placeholder: rename it for what it returns or does, in its header and its call. (`src/loader.py:61-78`)\n - Parameters (in): path\n - Returns (out): (nothing)\n\n2. **Move Method** at `src/loader.py:130` (`Loader.parse`)\n - Step id: `refac4_eeeeeeeeeeeeeeeeeeee`\n - Judgment. Not established: call sites resolved.\n - **Locate it again first.** Step `refac4_aaaaaaaaaaaaaaaaaaaa` moves this symbol, so the path and lines above are where it was, not where it will be when you get here.\n - This step's plan was not in this payload; ask for it by id: `refac4_eeeeeeeeeeeeeeeeeeee`.\n## Evidence behind the diagnosis\nSupporting observations, not extra work.\n- Extract Helper `loader.py:10-20`: duplicated lines: 11; occurrence count: 2\n1 of 3 shown.\n## Verify\n### For `Loader.load`\n\nRun these before and after the change, the most direct first:\n\n- `tests/test_loader.py`\n\nRun:\n\n```\npytest tests/test_loader.py\n```\n\n### For `Loader.parse`\n\nNo guarding test was found; the test added before the edit passes after it.\n## Hard constraints\n- **Apply the steps in the order given.** It is dependency-safe; reordering it is not.\n- **Read a judgment step's code before applying it.** Its obligation is unproven.\n- **Do not generate a script that rewrites the file.** Make each edit directly in the file, one at a time, re-reading the span after each.\n- **Keep behaviour.** Run the tests (and type-checker / linter) before and after.\n- **Confirm before changing.** The plan comes from stored static analysis; the code may have moved since it ran.\n- **Say when it is wrong.** If the plan does not fit the real code, stop and explain why instead of forcing it.\n## What I expect back\n1. The refactored code, with each step above applied in order.\n2. Per step: whether you applied it, and for anything you skipped, the reason.\n3. The Verify run, before and after, with its result.\n4. The opportunity id `refop4_dddddddddddddddddddd`, so the work can be matched back to the record.\n## This opportunity's id\n`refop4_dddddddddddddddddddd`\nQuote it when you report back."
}
diff --git a/tests/unit/agent_prompts/test_golden.py b/tests/unit/agent_prompts/test_golden.py
index 965cacfc6..367f1dae4 100644
--- a/tests/unit/agent_prompts/test_golden.py
+++ b/tests/unit/agent_prompts/test_golden.py
@@ -119,6 +119,22 @@ def test_refactoring_opportunity_matches_golden(case: dict, flavor: str) -> None
assert text == _GOLDEN["refactoring_opportunity"][case["name"]][flavor]
+def test_no_rendered_flavor_names_todowrite() -> None:
+ """Harness tool names drift between releases; prompts must stay neutral (#3430)."""
+
+ def _walk(node: object) -> list[str]:
+ if isinstance(node, str):
+ return [node]
+ if isinstance(node, dict):
+ return [text for value in node.values() for text in _walk(value)]
+ if isinstance(node, list):
+ return [text for value in node for text in _walk(value)]
+ return []
+
+ for text in _walk(_render_all()):
+ assert "TodoWrite" not in text
+
+
def test_a_step_fences_code_that_spans_lines_and_lists_its_notes() -> None:
from repowise.core.agent_prompts.fix_first import _step