3 -description: "Audit this repository against the latest published Pi changelog and APIs. Use when checking for obsolete Pi extension, SDK, config, prompt, skill, model, session, tool, TUI, or provider code."
3 +description: "Audit this repository against the latest published Pi changelog and APIs. Use when checking for obsolete Pi extension, SDK, config, prompt, skill, model, session, tool, TUI, or provider code. Also reports new-API adoption opportunities that subsume hand-rolled code."
4 4 disable-model-invocation: true
30 30 - identify exact obsolete and replacement code shapes;
31 31 - discard provider catalog, prose, and bug-fix entries that require no repository migration.
33 -5. Obtain the complete scan scope from `git ls-files -z --cached --others --exclude-standard`.
33 +5. Collect simplification opportunities from the same audit.
34 + Treat every Added or Changed entry introducing or extending public API at the repository-resolved Pi version (`candidatesAfterVersion`) or newer as a capability.
35 + For each capability derive the hand-rolled repository shape it subsumes, such as manual auth resolution, direct provider calls, manual entry persistence, or duplicated projection logic.
36 + Discard capabilities without a plausible repository shape and stylistic-only preferences.
38 +6. Obtain the complete scan scope from `git ls-files -z --cached --others --exclude-standard`.
34 39 Pipe or chunk its NUL-delimited paths directly into searches; never print the full list into context.
35 40 If enumeration fails, stop and report `MODERNIZE FAILED` with the exact reason.
36 - Search that complete scope for each normalized obsolete shape with `grep`, then `read` every match and relevant caller.
41 + Search that complete scope for each normalized obsolete shape and each derived simplification shape with `grep`, then `read` every match and relevant caller.
37 42 Skip binary content, but never silently narrow the enumerated file set.
38 43 Optional user focus prioritizes inspection only; whole-repository coverage remains mandatory.
40 -6. Confirm a finding only when both are present:
45 +7. Confirm a finding only when both are present:
41 46 - migration evidence from a changelog plus latest docs/source;
42 47 - contextual repository evidence showing obsolete behavior still applies.
44 -7. Do not report dependency age alone as a code finding.
49 +8. Confirm a simplification only when both are present:
50 + - capability evidence from the changelog plus latest docs/source showing the new API performs the equivalent work;
51 + - contextual repository evidence showing the hand-rolled shape at a precise `path:line`.
52 + Name the observable behavior delta.
53 + Discard the simplification when the delta exceeds error typing, error timing, or internal call routing.
55 +9. Do not report dependency age alone as a code finding.
45 56 Report an old repo-resolved Pi package only when its age leaves code or package constraints requiring migration.
69 80 Generate fresh, non-boxed ASCII art under 20 lines.
70 81 No art on failure or findings.
83 +When simplifications were confirmed, append after the verdict:
86 +MODERNIZE SIMPLIFICATIONS: N
87 +- path:line — hand-rolled shape
88 + replacement: exact new API and introducing version
89 + evidence: current doc or source
90 + delta: observable behavior difference, or none
93 +Order simplifications by path.
94 +Simplifications never change the verdict or suppress the art.