repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by admin

feat: report API-adoption simplifications in modernize audit

eda41183a1d57edf89fa75444cbb99339d5db170

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

Harvest public-API capabilities at or above the repository-resolved Pi
version, search the full scope for subsumed hand-rolled shapes, and
append confirmed simplifications with replacement, evidence, and
behavior delta after the verdict.

Changed files (2)

.pi/prompts/modernize.md

Modified
2 -description: Audit this repository for migrations required by the latest Pi release
2 +description: Audit this repository for migrations and API-adoption opportunities from the latest Pi release
3 3 argument-hint: "[focus]"

.pi/skills/modernize/SKILL.md

Modified
2 2 name: modernize
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.
47 58 ## Output
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:
85 +```text
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
91 +```
93 +Order simplifications by path.
94 +Simplifications never change the verdict or suppress the art.