@a-canary/pi-upskill
Learn from failures, automatically reduce token waste
Install & Use
Copy this prompt and send it to your AI assistant (Claude / Cursor / TRAE / Codex / WorkBuddy etc.) to auto-install:
Help me install this AI Skill: @a-canary/pi-upskill. It is used for: Learn from failures, automatically reduce token waste Full Skill content: https://321skill.com/skills/a-canary-pi-upskill/raw/index.md Read that page and install it.
The prompt includes a link to the full Skill content. You can also view the full content.
This skill addresses the issue of repeatedly making the same mistakes during AI-assisted coding, which leads to significant token wastage. In practical development, developers often encounter repetitive errors—such as forgetting to run tests or neglecting to check code standards before commits—that force the AI to regenerate or correct code multiple times. This not only consumes tokens but also reduces efficiency. pi-upskill solves this by recording each failure and correction, automatically generating reusable rules to fundamentally prevent the recurrence of similar errors.
Usage is straightforward: simply instruct the AI via natural language in the conversation to log a correction (e.g., "Record: didn't run tests before commit. Correction: always run tests before commit"). The AI will then invoke the upskill-log tool to save the correction to a local file. Once 20 corrections have been accumulated, run the /upskill-analyze command. The system will analyze all records and automatically generate a single skill or rule with the highest token-saving potential. Additionally, you can use /upskill-backfill to scan past conversations and extract corrections, and /upskill-status to check progress.
It is particularly well-suited for teams or individuals who rely on AI coding assistants long-term, especially developers who have encountered repetitive errors and want to reduce token consumption. For agent developers and full-stack engineers using the pi framework, this skill can significantly boost coding efficiency and minimize wasted context windows caused by repeated mistakes.
We recommend enabling this skill early in a project and encouraging team members to actively log corrections. Note that it primarily relies on the pi framework's extension mechanism, so the pi environment must be installed first. The default threshold is 20 corrections, which can be adjusted in settings based on project complexity. Also, when logging, try to provide accurate tokens_wasted estimates to help the analysis prioritize corrections with high token waste.
Key Features
Unlike pi-reflect's iterative self-improvement, pi-upskill logs specific corrections and, upon reaching a threshold, automatically generates a single high-impact edit, focusing more on reducing token waste. Compared to the pattern extraction of upskill.md, it provides a complete toolchain (logging, backfilling, analysis, status query) without requiring manual management of memory files.
Limitations
Only supports the pi framework environment; requires pi installation and extension loading first. The default threshold is 20 corrections; automatic analysis cannot be triggered if insufficient corrections are accumulated. Recorded data is stored locally in `.pix/corrections.jsonl` and does not sync automatically across multiple devices.
FAQ
How do I install pi-upskill?
In the pi environment, run `pi install git:github.com/a-canary/pi-upskill` or `pi install npm:pi-upskill`, then execute `/reload` to load it.
How do I check the current correction progress?
Run the `/upskill-status` command. It will display the number of recorded corrections, the threshold, the count of strong and pattern corrections, and the total wasted tokens.
Installation guide for AI assistants
If your AI coding assistant (Claude Code, Cursor, TRAE etc.) can see this page, send it this message to auto-install:
Visit https://321skill.com/skills/a-canary-pi-upskill/raw/index.md to read the original Skill definition (Markdown format) for @a-canary/pi-upskill, and install it according to the instructions.
Raw Markdown URL for AI: /skills/a-canary-pi-upskill/raw/index.md