README.md

 1<!--
 2SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
 3
 4SPDX-License-Identifier: CC0-1.0
 5-->
 6
 7# pi-extensions
 8
 9A collection of [Pi](https://github.com/badlogic/pi-mono) extensions. They're
10all quite rough currently, having just been imported to this repo from ad-hoc,
11vibed individual scripts created by saying "go change
12`~/.config/pi/extensions/foo.ts` so it bars".
13
14## Packages
15
16### [`@amolith/pi-handoff`](https://www.npmjs.com/package/@amolith/pi-handoff)
17
18Get to the end of the thing you're doing, then use a lightweight subagent to
19extract particular bits from the current session and create a new one from those
20bits with `/handoff thorough goal description`. You can also tell Pi to hand
21something off (it has a tool).
22
23```sh
24pi install npm:@amolith/pi-handoff
25```
26
27> Based on [handoff.ts](https://github.com/pasky/pi-amplike/blob/main/extensions/handoff.ts)
28> and [session-query.ts](https://github.com/pasky/pi-amplike/blob/main/extensions/session-query.ts)
29> by Petr Baudis, licensed MIT accordingly. Reworked so the subagent calls a
30> tool instead of expecting it to produce well-formed JSON, added an auto-submit
31> countdown, a session query tool, and make the extraction model configurable
32> via `PI_HANDOFF_MODEL`.
33
34### [`@amolith/pi-answer`](https://www.npmjs.com/package/@amolith/pi-answer)
35
36See that Pi spit a bunch of Markdown at you with some embedded questions, use
37`/answer` to have a lightweight subagent extract those questions so you can
38answer them in a nice form instead of mentally parsing all that LLM-speak. For
39best results, give a good description of `/answer what you want to turned into questions for answering`.
40
41```sh
42pi install npm:@amolith/pi-answer
43```
44
45> Based on [answer.ts](https://github.com/mitsuhiko/agent-stuff/blob/main/pi-extensions/answer.ts)
46> by Armin Ronacher, licensed Apache-2.0 accordingly. Reworked so the subagent
47> calls a tool instead of expecting it to produce well-formed JSON, rewrote the
48> system prompt with few-shot examples, added a notes editor (Alt+N) and
49> fallback extraction with the current model when the preferred model is
50> unavailable.
51
52### [`@amolith/pi-questionnaire`](https://www.npmjs.com/package/@amolith/pi-questionnaire)
53
54Have Pi construct on-the-fly questionnaires to ask you stuff before it goes off
55and does the wrong thing.
56
57```sh
58pi install npm:@amolith/pi-questionnaire
59```
60
61> Based on [questionnaire.ts](https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/examples/extensions/questionnaire.ts)
62> by Mario Zechner, licensed MIT accordingly. Added a free-text notes editor,
63> word wrapping for long prompts, and custom answers are sent as a steering
64> user message so the user can go back and edit them later.
65
66### [`@amolith/pi-personality`](https://www.npmjs.com/package/@amolith/pi-personality)
67
68Drop markdown files in `$PI_CODING_AGENT_DIR/personalities/` and switch between
69them with `/personality`. Lets your agent be a grumpy senior today and a patient
70tutor tomorrow. The active personality gets injected into the system prompt and
71persists across sessions until you change it.
72
73```sh
74pi install npm:@amolith/pi-personality
75```
76
77> All mine :)
78
79## Development
80
81Prerequisites: [mise](https://mise.jdx.dev/) (installs bun automatically).
82
83```sh
84# Install dependencies
85bun install
86
87# Format, lint, and type-check everything
88mise run check
89```