Scan a repository for Opus-4.6-era patterns that break or degrade on Opus 4.7 — fixed-budget Extended Thinking parameters, retired model ID aliases, and prompts that assumed verbose default output or eager sub-agent delegation. Produces a categorized report with file:line references and migration actions. Triggers on: "opus 4.7 migration", "migrate to opus 4.7", "audit for opus 4.7", "opus 4.6 to 4.7", "scan for budget_tokens", "find retired model IDs", "adapt repo to opus 4.7". NOT for implementing migrations — this skill identifies candidates.
Identify patterns in a repository that break or silently degrade when the Anthropic platform routes to Opus 4.7. Produces a categorized report with file:line references so a maintainer can plan a scoped migration PR rather than chasing symptoms after the fact.
| File | Contents | Load When |
|---|---|---|
scripts/scan.py | Repo scanner producing a categorized findings report | Always |
references/migration-map.md | Per-category migration actions with before/after code samples | When a category returns findings |
The scanner is intentionally narrow. It reports three categories of deterministic patterns plus two heuristic categories that require manual review.
Opus 4.7 does not support Extended Thinking with a fixed budget_tokens value. Code that still passes thinking={"type": "enabled", "budget_tokens": N} fails or is ignored depending on SDK version.
Patterns flagged:
budget_tokens= in Python source"budget_tokens" keys inside thinking={...} dict literals.thinking.budget_tokens attribute referencesDated or superseded Claude model aliases that no longer map to the current model. Using them is not broken but defeats the platform's model routing.
Patterns flagged:
claude-opus-4-5, claude-opus-4-4, claude-opus-4-3, claude-opus-4-2, claude-opus-4-1, claude-opus-4-0claude-sonnet-4-5, claude-sonnet-4-4, claude-sonnet-4-3, claude-sonnet-4-2, claude-sonnet-4-1, claude-sonnet-4-0claude-*-20250514, claude-*-20241022, etc.claude-3-* family (superseded)Per the armory convention "model refs in config files only," any claude-* literal in .py / .ts / .js source code outside of config.toml, .env, or test-only sentinel strings is a candidate for extraction.
Opus 4.7 is less default-verbose than 4.6. Prompts that relied on Opus 4.6's eager output or never needed a depth cue may produce shorter-than-expected responses on 4.7.
Patterns flagged (review required):
Opus 4.7 delegates more judiciously than 4.6. Agent prompts instructing "spawn in parallel" without the phrase "in a single message" or stating sub-task independence often serialize on 4.7.
Patterns flagged (review required):
Spawn + parallel language in agent prompts without "single message" or "independent"subagent_type dispatches in loops or sequential blocks where parallelism was intendedExecute:
python3 scripts/scan.py /path/to/repo
Optional flags:
--categories A,B,C — run only deterministic categories (skip heuristics)--exclude tests/,vendor/,node_modules/ — path exclusion--format json — machine-readable output for CI integration--exit-code — exit 1 if any findings (useful for pre-commit hooks)Group findings by category and sort by severity. Deterministic categories (A, B, C) are always actionable. Heuristic categories (D, E) require reading the surrounding prompt context before editing.
Priority order for a migration PR:
claude-opus-4-7, claude-sonnet-4-6, claude-haiku-4-5) or to the platform's auto-routing nameconfig.toml per repo conventionFor each category with findings, apply the actions documented in references/migration-map.md. Prefer small PRs grouped by category over one large PR.
Pair the migration with:
budget_tokens from …"high/xhigh effort level on the targeted agents)The scanner produces a categorized report:
Opus 4.7 Migration Scan — /path/to/repo
Category A: Fixed-budget Extended Thinking 2 findings
src/agent/reasoner.py:47 budget_tokens=8000
src/agent/planner.py:112 thinking={"type": "enabled", "budget_tokens": 4096}
Category B: Retired model ID aliases 3 findings
tests/test_agent.py:89 claude-opus-4-5
config/dev.yaml:14 claude-sonnet-4-5
src/llm/client.py:23 claude-sonnet-4-20250514
Category C: Hardcoded model refs outside config 1 finding
scripts/bulk_process.py:8 DEFAULT_MODEL = "claude-sonnet-4-6"
Category D: Verbosity-assuming prompts 0 findings (heuristics disabled)
Category E: Non-explicit parallel dispatch 0 findings (heuristics disabled)
Total: 6 deterministic findings across 3 categories.
| Condition | Action |
|---|---|
| Repo path does not exist | Exit 2 with a clear error message |
| No Python / TypeScript / JS files in repo | Skip Category A, C; continue with B, D, E on other file types |
| Regex error in scanner | Exit 3; file a bug with the offending pattern |
| False positives from Category B on changelogs | Exclude CHANGELOG.md by default; override with --include-changelogs |
budget_tokens variable that is never passed to the Anthropic SDK will still be flagged.model = config["models"][stage]) — those need integration tests, not static analysis.rules/adaptive-thinking-control/RULE.md — prompt-level controls that replace fixed thinking budgetsskills/usage-audit/SKILL.md — broader context-bloat audit (complementary)skills/mcp-to-skill/SKILL.md — MCP-to-skill conversion (relevant when migration surfaces heavy MCP usage)