{"_id":"@a-canary/pi-upskill","name":"@a-canary/pi-upskill","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@a-canary/pi-upskill","version":"1.0.0","description":"Learn from failures, reduce token waste, improve automatically","keywords":["pi-package"],"author":{"name":"a-canary"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/a-canary/pi-upskill.git"},"peerDependencies":{"@mariozechner/pi-coding-agent":"*","@mariozechner/pi-tui":"*","@sinclair/typebox":"*"},"pi":{"extensions":["./extension"],"skills":["./skills"]},"gitHead":"10f50a6b4b852afcfa581259984d62260ee0ecac","_id":"@a-canary/pi-upskill@1.0.0","bugs":{"url":"https://github.com/a-canary/pi-upskill/issues"},"homepage":"https://github.com/a-canary/pi-upskill#readme","_nodeVersion":"25.1.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-hA1nrBV+nYO/h9jAx8qEArXQFocYq5CjM/gfJVOzwEy1aVqfOgZjSSLk++UJQPgwFH37fhfHBYFqDls/R6U7dQ==","shasum":"0c7b18d6b81a3e117cbd1bf5ffd4c6d602c8a319","tarball":"https://registry.npmjs.org/@a-canary/pi-upskill/-/pi-upskill-1.0.0.tgz","fileCount":5,"unpackedSize":21954,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAQlH5eIfMUysP98R1RxHuSTifVTMrC1a1N2SWv2pNqyAiEA3/Yj/6uFNz7GGutUp5UYbgF+YAsnc9IFxqKy9ZhWvM4="}]},"_npmUser":{"name":"a-canary","email":"aaron.canary@gmail.com"},"directories":{},"maintainers":[{"name":"a-canary","email":"aaron.canary@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-upskill_1.0.0_1773767690818_0.17572688160101158"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-17T17:14:50.710Z","1.0.0":"2026-03-17T17:14:50.967Z","modified":"2026-03-17T17:14:51.195Z"},"maintainers":[{"name":"a-canary","email":"aaron.canary@gmail.com"}],"description":"Learn from failures, reduce token waste, improve automatically","homepage":"https://github.com/a-canary/pi-upskill#readme","keywords":["pi-package"],"repository":{"type":"git","url":"git+https://github.com/a-canary/pi-upskill.git"},"author":{"name":"a-canary"},"bugs":{"url":"https://github.com/a-canary/pi-upskill/issues"},"license":"MIT","readme":"# pi-upskill\n\nLearn from failures. Reduce token waste. Improve automatically.\n\n## Overview\n\npi-upskill tracks corrections (failures → fixes) and generates skills/rules to prevent future mistakes.\n\n**Core flow:**\n1. Log corrections during conversation (`upskill-log` tool)\n2. Backfill from past sessions (`/upskill-backfill`)\n3. At threshold, analyze and generate ONE high-impact edit (`/upskill-analyze`)\n\n## Installation\n\n```bash\n# From git (recommended)\npi install git:github.com/a-canary/pi-upskill\n\n# Or from npm after publishing\npi install npm:pi-upskill\n\n# Try without installing\npi -e git:github.com/a-canary/pi-upskill\n```\n\nAfter install, reload: `/reload`\n\n## Usage\n\n### During conversation: log corrections\n\nThe agent uses the `upskill-log` tool:\n\n```\nAgent: [uses upskill-log tool]\n  failure: \"Committed without running tests\"\n  correction: \"Always run tests before commit\"\n  strength: \"strong\"\n  tokens_wasted: 3000\n\nResult: Logged correction #5 to .pi/corrections.jsonl\n        Progress: 5/20 corrections\n```\n\n**Strength levels:**\n- `strong` — User said \"always/never/remember\" → single occurrence = skill\n- `pattern` — Self-correction or repeated issue → needs 3x occurrences\n\n### One-time: scan past sessions\n\n```\n/upskill-backfill\n```\n\nScans session files from pi, claude, opencode, codex. Extracts corrections for review.\n\n### At threshold: analyze and improve\n\n```\n/upskill-analyze\n```\n\nWhen 20+ corrections logged, triggers background analysis:\n1. LLM reviews all corrections\n2. Selects ONE edit for maximum token impact\n3. Applies surgical edit (skill/AGENTS.md/MEMORY.md)\n4. Removes addressed corrections\n\n### Check progress\n\n```\n/upskill-status\n```\n\nShows: count, threshold, strong vs pattern, total tokens wasted.\n\n## Data Format\n\n`.pi/corrections.jsonl` — one JSON object per line:\n\n```json\n{\"timestamp\":\"2025-03-13T01:30:00Z\",\"failure\":\"Committed without tests\",\"correction\":\"Always run tests first\",\"context\":\"User reminder after broken CI\",\"tokens_wasted\":3000,\"source\":\"user\",\"strength\":\"strong\"}\n```\n\n**Required fields (max 30 words each):**\n- `timestamp` — ISO 8601\n- `failure` — What went wrong\n- `correction` — How to fix / what to do instead\n- `source` — \"user\" or \"self\"\n- `strength` — \"strong\" or \"pattern\"\n\n**Optional:**\n- `context` — Relevant context\n- `tokens_wasted` — Estimated tokens\n\n## Configuration\n\n`.pi/settings.json`:\n\n```json\n{\n  \"upskill\": {\n    \"threshold\": 20,\n    \"autoAnalyze\": false,\n    \"lookbackDays\": 7\n  }\n}\n```\n\n## Architecture\n\n```\n~/pi-upskill/\n├── CHOICES.md           # Decision record\n├── PLAN.md              # Implementation phases\n├── README.md            # This file\n├── extension/\n│   └── index.ts         # upskill-log tool, commands\n└── skills/\n    ├── analyze/SKILL.md # Pattern analysis workflow\n    └── backfill/SKILL.md # Historical scan workflow\n```\n\n**Hybrid interface:**\n- Extension provides `upskill-log` tool (inline during conversation)\n- Skills provide `/upskill-backfill` and `/upskill-analyze` commands\n\n## Key Decisions\n\nSee [CHOICES.md](CHOICES.md) for full decision record.\n\n| ID | Decision |\n|----|----------|\n| UX-0001 | User corrections with \"always/never/remember\" → immediate skill |\n| UX-0002 | Self-corrections → need 3x pattern before skill |\n| F-0003 | At 20 corrections → background analysis, ONE edit for max impact |\n| D-0003 | Processed corrections removed after edit applied |\n\n## Inspiration\n\n- [upskill.md](https://github.com/claude-admin/cc-plugins) — Pattern extraction from memory\n- [pi-reflect](https://github.com/jo-inc/pi-reflect) — Iterative self-improvement\n","readmeFilename":"README.md","_rev":"1-c02c2a929937cd5be60c496fe83ab102"}