Self-learning example
A small Node.js project for drafting, verifying and reusing a skill.
A small Node.js project for trying skill drafting. The first task extends a string-normalization function; you draft and verify a skill from it, then reuse the skill for a similar second task.
Download the starter project. It contains the source, three passing tests and this walkthrough. It does not contain a skill or a verification report.
Requirements#
- Node 24+ and Git.
- pi-kit with a model that can call tools.
- A model for the Attendant, which drafts the skill. It can be the same model.
Model calls may cost money. Verification works in a scratch checkout but does not restrict tools to it.
Set up the project#
Extract the archive and run in the
self-learning folder:git init -b main
git add .
git commit -m "Add self-learning starter"
npm test
There are no dependencies. Git needs your name and email configured. Then open the folder as a project in pi-kit.
Do the first task#
Create a Local thread and send:
Extend slugify in src/slug.mjs. Lowercase and trim the input, replace each run of non-ASCII-alphanumeric characters with one hyphen, and remove leading/trailing hyphens. Add tests for repeated whitespace, punctuation, and an input containing only punctuation. Preserve the existing tests. Run npm test. Do not commit or install packages.
Review the diff and the test output, then commit while pi-kit is running, so the thread records the outcome:
git add src test
git commit -m "Normalize punctuation and whitespace in slugs"
Verification compares against this outcome; keep both commits.
Draft and verify a skill#
- Type
/learnin the thread and agree to send it for drafting if asked. A card appears: A skill was drafted from this thread. - Choose Read. The procedure should be reusable: read the existing behavior, add edge-case tests, implement, run the checks. It should not just restate this task's expected output.
- Choose Verify now. The first prompt is replayed with the draft from the base commit. Read the files, hunks and checks in the report. A different but correct implementation can still score Partial or Failed.
- Edit the draft if needed, choose This project and Approve. The skill is written to
.pi/skills/<name>/SKILL.md.
Reuse the skill#
Start another thread, pick the skill from
/, and send:Add normalizeBranchName in src/branch.mjs. Normalize punctuation and whitespace into single hyphens, lowercase the result, remove leading/trailing hyphens, and prefix the result with feat/. Return feat/untitled when the normalized name is empty. Add tests and run npm test. Do not commit or install packages.
The skill reaches the model as instructions; the model itself is unchanged. Check whether it followed the procedure and whether the tests cover the cases.
Recorded run#
The screenshots come from a real run of this project in pi-kit 0.93.0 with a local Qwen3.6 35B-A3B model:
- The first task passed all six tests and produced a draft,
extend-slugify-function. - Verification returned Failed: 0 of 2 files and 0 of 2 hunks reproduced, 56% of changed lines matching.
- The check was skipped: the recorded command named the original folder by absolute path, so it would have run there.
Similarity and checks are separate results, so read the report, not just the verdict. Prefer project-relative test commands so checks run in the scratch checkout. Approval and the second task were not part of the recording.
Download the recorded-run summary. Temporary paths in it are replaced with
<source-project>.Keep the evidence#
Keep the first diff and its tests, the draft and your edits, the verification result, the installed path and the second task's test output. Results differ between models and runs.