@counterposition/skill-pi 0.1.1 → 0.65.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/package.json +1 -1
- package/skills/pi/README.md +24 -20
- package/skills/pi/SKILL.md +59 -25
- package/skills/pi/references/extensions.md +150 -234
- package/skills/pi/references/packages.md +89 -59
- package/skills/pi/references/patterns.md +4 -4
- package/skills/pi/references/providers.md +101 -153
- package/skills/pi/references/sdk.md +174 -118
- package/skills/pi/references/settings.md +119 -100
- package/skills/pi/references/skills.md +83 -73
package/README.md
CHANGED
package/package.json
CHANGED
package/skills/pi/README.md
CHANGED
|
@@ -1,44 +1,48 @@
|
|
|
1
1
|
# Pi Skill
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Knowing others is intelligence; knowing yourself is true wisdom.
|
|
4
|
+
>
|
|
5
|
+
> — Lao Tzu, *Tao Te Ching*
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
7
|
+
A coding agent that cannot reason about its own architecture will invent APIs that don't exist, hallucinate configuration formats, and give confident wrong answers about its own internals. The failure mode is subtle: the answers *sound* right, because the agent knows how systems like it tend to work. But Pi is specific, and the details matter.
|
|
8
|
+
|
|
9
|
+
This skill gives Pi self-knowledge. It injects task-specific reference documentation into context so that Pi reasons from grounded facts — about its extensions, settings, providers, sessions, and SDK — rather than from plausible fictions.
|
|
10
|
+
|
|
11
|
+
Without this skill, Pi guesses about itself. With it, Pi *knows*.
|
|
8
12
|
|
|
9
13
|
## Install
|
|
10
14
|
|
|
11
15
|
```bash
|
|
12
|
-
#
|
|
16
|
+
# as a skill
|
|
13
17
|
npx skills add counterposition/pi --skill pi
|
|
14
18
|
|
|
15
|
-
#
|
|
19
|
+
# as a Pi package
|
|
16
20
|
pi install npm:@counterposition/skill-pi
|
|
17
21
|
```
|
|
18
22
|
|
|
19
|
-
Maintainer
|
|
23
|
+
### Maintainer Paths
|
|
20
24
|
|
|
21
25
|
```bash
|
|
22
|
-
#
|
|
26
|
+
# from a local checkout
|
|
23
27
|
npx skills add /absolute/path/to/pi --skill pi
|
|
24
28
|
|
|
25
|
-
# packaged
|
|
29
|
+
# packaged install from monorepo root
|
|
26
30
|
pi install ./packages/skill-pi
|
|
27
31
|
```
|
|
28
32
|
|
|
29
|
-
If you
|
|
33
|
+
If you develop inside this repo, Pi already loads the skill via `.pi/settings.json`.
|
|
34
|
+
|
|
35
|
+
## What this covers
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
Pi's architecture and package layout. Skill authoring, discovery, and routing. Extensions, tools, and UI hooks. Settings, models, providers, and packages. Sessions, forks, and compaction. The SDK and RPC interface.
|
|
32
38
|
|
|
33
|
-
-
|
|
34
|
-
- Skill authoring and discovery
|
|
35
|
-
- Extensions, tools, and UI hooks
|
|
36
|
-
- Settings, models, providers, and packages
|
|
37
|
-
- Sessions, forks, and compaction
|
|
39
|
+
The reference material lives in `references/` as task-specific documents — not a single monolith, but pieces sized for injection into a conversation when relevant.
|
|
38
40
|
|
|
39
41
|
## Files
|
|
40
42
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
| Path | Purpose |
|
|
44
|
+
|---|---|
|
|
45
|
+
| `SKILL.md` | Trigger rules and routing description |
|
|
46
|
+
| `references/` | Task-specific Pi reference documents |
|
|
47
|
+
| `evals/evals.json` | Example evaluation cases |
|
|
48
|
+
| `LICENSE.md` | GPLv3 license text |
|
package/skills/pi/SKILL.md
CHANGED
|
@@ -7,13 +7,13 @@ compatibility: "Pi-specific guidance for agents that support Agent Skills"
|
|
|
7
7
|
|
|
8
8
|
# Pi Coding Agent
|
|
9
9
|
|
|
10
|
-
Pi is a minimal
|
|
10
|
+
Pi is a minimal terminal coding harness. It ships four default tools (`read`, `write`, `edit`, `bash`) and four execution modes (interactive TUI, print, JSON/RPC, SDK). Features like sub-agents, plan mode, permission flows, and MCP are intentionally left to extensions and Pi packages.
|
|
11
11
|
|
|
12
12
|
Pi's philosophy: **adapt Pi to your workflows, not the other way around**. Users extend it via TypeScript extensions, skills, prompt templates, themes, and shareable Pi packages.
|
|
13
13
|
|
|
14
14
|
## Architecture at a Glance
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
The coding-agent stack centers on four core packages. The monorepo also includes adjacent packages such as `pi-web-ui`, `pi-mom`, and `pi-pods`.
|
|
17
17
|
|
|
18
18
|
| Package | npm | Purpose |
|
|
19
19
|
|---------|-----|---------|
|
|
@@ -76,6 +76,12 @@ Bundles of extensions, skills, prompts, and themes distributed via npm, git, or
|
|
|
76
76
|
|
|
77
77
|
Read `references/packages.md` for the package structure, `pi` manifest field, installation, and publishing.
|
|
78
78
|
|
|
79
|
+
### Context Files & Prompt Templates
|
|
80
|
+
|
|
81
|
+
Pi loads `AGENTS.md` or `CLAUDE.md` from the global agent dir and from `cwd` up through parent directories. `.pi/SYSTEM.md` replaces the default system prompt, and `APPEND_SYSTEM.md` appends to it. Prompt templates in `prompts/` directories become slash commands.
|
|
82
|
+
|
|
83
|
+
Read `references/settings.md` for discovery rules and config keys, and `references/packages.md` for how prompts/themes ship in packages.
|
|
84
|
+
|
|
79
85
|
### SDK
|
|
80
86
|
|
|
81
87
|
Programmatic embedding via `createAgentSession()`. Gives full control over models, tools, extensions, sessions, and event streaming.
|
|
@@ -99,6 +105,7 @@ Read `references/patterns.md` for copy-paste-ready examples.
|
|
|
99
105
|
Sessions are append-only JSONL files with a tree structure (entries linked by `id`/`parentId`). This allows branching without modifying history. Key operations:
|
|
100
106
|
|
|
101
107
|
- **`/tree`** — Navigate the session tree, jump to any point
|
|
108
|
+
- **`Shift+T` in `/tree`** — Toggle timestamps on tree entry labels
|
|
102
109
|
- **`/compact`** — Manually trigger context compaction
|
|
103
110
|
- **`/fork`** — Branch from a specific point
|
|
104
111
|
- **Auto-compaction** — Triggers when `contextTokens > contextWindow - reserveTokens`
|
|
@@ -117,7 +124,7 @@ Compaction walks backward from the newest message, keeping `keepRecentTokens` (d
|
|
|
117
124
|
| `find` | Find files by glob pattern |
|
|
118
125
|
| `ls` | List directory contents |
|
|
119
126
|
|
|
120
|
-
**
|
|
127
|
+
**Common tool sets:** `codingTools()` = `[read, bash, edit, write]`, `readOnlyTools()` = `[read, grep, find, ls]`. When you provide a custom `cwd` and explicit tools in the SDK, use `createCodingTools(cwd)` / `createReadOnlyTools(cwd)` so path resolution stays correct.
|
|
121
128
|
|
|
122
129
|
## Execution Modes
|
|
123
130
|
|
|
@@ -125,34 +132,60 @@ Compaction walks backward from the newest message, keeping `keepRecentTokens` (d
|
|
|
125
132
|
|------|-----------|----------|
|
|
126
133
|
| Interactive | `pi` | Full TUI with editor, streaming, keybindings |
|
|
127
134
|
| Print | `pi -p "prompt"` | Single-shot text output |
|
|
128
|
-
| JSON | `pi --mode json
|
|
135
|
+
| JSON | `pi --mode json "prompt"` | Newline-delimited event stream |
|
|
129
136
|
| RPC | `pi --mode rpc` | JSON-RPC over stdin/stdout for IDE integration |
|
|
130
137
|
| SDK | `createAgentSession()` | Embed in Node.js applications |
|
|
131
138
|
|
|
132
139
|
## Quick Reference: CLI Flags
|
|
133
140
|
|
|
134
141
|
```text
|
|
135
|
-
pi [options] [
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
--
|
|
147
|
-
--
|
|
148
|
-
--
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
142
|
+
pi [options] [@files...] [messages...]
|
|
143
|
+
|
|
144
|
+
# package commands
|
|
145
|
+
install <source> [-l]
|
|
146
|
+
remove <source> [-l]
|
|
147
|
+
uninstall <source> [-l]
|
|
148
|
+
update [source]
|
|
149
|
+
list
|
|
150
|
+
config
|
|
151
|
+
|
|
152
|
+
# modes and output
|
|
153
|
+
-p, --print
|
|
154
|
+
--mode json|rpc
|
|
155
|
+
--export <in> [out]
|
|
156
|
+
|
|
157
|
+
# model selection
|
|
158
|
+
--provider <name>
|
|
159
|
+
--model <pattern>
|
|
160
|
+
--api-key <key>
|
|
161
|
+
--thinking <level>
|
|
162
|
+
--models <patterns>
|
|
163
|
+
--list-models [search]
|
|
164
|
+
|
|
165
|
+
# sessions
|
|
166
|
+
-c, --continue
|
|
167
|
+
-r, --resume
|
|
168
|
+
--session <path|id>
|
|
169
|
+
--fork <path|id>
|
|
170
|
+
--session-dir <dir>
|
|
171
|
+
--no-session
|
|
172
|
+
|
|
173
|
+
# tools and resources
|
|
174
|
+
--tools <list>
|
|
175
|
+
--no-tools
|
|
176
|
+
-e, --extension <source>
|
|
177
|
+
--skill <path>
|
|
178
|
+
--prompt-template <path>
|
|
179
|
+
--theme <path>
|
|
180
|
+
--no-extensions
|
|
181
|
+
--no-skills
|
|
182
|
+
--no-prompt-templates
|
|
183
|
+
--no-themes
|
|
184
|
+
|
|
185
|
+
# prompts and misc
|
|
186
|
+
--system-prompt <text>
|
|
187
|
+
--append-system-prompt <text>
|
|
188
|
+
--verbose
|
|
156
189
|
```
|
|
157
190
|
|
|
158
191
|
## How to Use This Skill
|
|
@@ -164,6 +197,7 @@ When working with Pi, read the appropriate reference file for the task at hand:
|
|
|
164
197
|
| Writing an extension (tools, commands, events, UI) | `references/extensions.md` |
|
|
165
198
|
| Creating a skill (SKILL.md authoring) | `references/skills.md` |
|
|
166
199
|
| Configuring Pi (settings.json options) | `references/settings.md` |
|
|
200
|
+
| Context files, prompt templates, themes, and resource discovery | `references/settings.md` and `references/packages.md` |
|
|
167
201
|
| Building a shareable package | `references/packages.md` |
|
|
168
202
|
| Embedding Pi programmatically | `references/sdk.md` |
|
|
169
203
|
| Adding LLM providers or models | `references/providers.md` |
|