Immutable. This exact content is served forever at /api/v1/blob/ca688a35ff2e1b4e.
---
name: pi-docs
description: Look up Pi coding-agent documentation in the local Miyo-indexed folder labeled `pi` (resolved at runtime via Miyo — no hardcoded filesystem path, works on macOS/Windows/Linux). Use when answering questions about the Pi terminal coding harness, the `pi` CLI, extensions, skills, prompt templates, themes, pi packages, providers, models, settings, keybindings, sessions, compaction, the Pi SDK, RPC mode, JSON event stream, or TUI components.
disable-model-invocation: true
---
# Pi Documentation (local Miyo mirror)
A local Markdown mirror of the official Pi coding-agent docs
(~27 pages from `github.com/earendil-works/pi`, `packages/coding-agent/docs/`), indexed
in **Miyo** under the folder label **`pi`**. The docs are in **English** — phrase Miyo
queries in English for best recall.
> This skill is **manual-only** (`disable-model-invocation: true`): nothing loads into
> context until you invoke it with `/pi-docs`. Drop a copy at
> `~/.claude/skills/pi-docs/SKILL.md` (or your harness's skills dir) for it to be
> available in every chat at zero idle context cost. Remove that frontmatter line in a
> project copy if you want the agent to auto-invoke it there.
>
> **Note:** index the `pi` folder in Miyo first (`mcp__miyo__list_folders` should show
> `pi (… files, ready)`); if it isn't indexed yet, point Miyo at this repo's `docs/pi/`
> folder with the label `pi`.
## Access is portable — never hardcode a filesystem path
This skill addresses the docs **only through Miyo's folder label `pi`**, not through any
absolute path. Miyo resolves the physical location on whatever machine it runs
(macOS/Windows/Linux), so the skill is portable.
- **Verify the folder exists** (and confirm its exact label) with
`mcp__miyo__list_folders` — you should see `pi (… files, ready)`. If on some machine it
was indexed under a different label, use that label everywhere below.
- **All file paths are Miyo-relative**, of the form `pi/<file>.md` — exactly as returned
by `mcp__miyo__search` / `mcp__miyo__list_files`. Pass those same relative paths
straight to `mcp__miyo__read_file`; **do not** prepend a mirror root and **do not** use
the native `Read` tool (that would need an OS-specific absolute path and break
portability).
## File naming
Filenames match the upstream slugs at `packages/coding-agent/docs/` directly. The mirror
is **flat** — no subdirectories:
- `pi/index.md` (the overview / getting-started page)
- `pi/extensions.md`, `pi/skills.md`, `pi/sdk.md`
- `pi/keybindings.md`, `pi/models.md`, `pi/compaction.md`
## How Miyo retrieval works (build better queries)
Miyo search is **hybrid**: for every query it runs two retrievers and fuses them with
**RRF** (Reciprocal Rank Fusion), then applies a **literal-match boost** (an exact query
substring in the title, then in the body, is pushed up):
- **Dense (semantic)** — embeds the query, matches by meaning. Good on paraphrase, weak
when your wording is far from the docs' actual terms.
- **BM25 (lexical)** — keyword match. Good on exact terms/jargon, blind to synonyms.
A hit must surface in **at least one** retriever's prefetch to appear at all — RRF only
ranks what was already pulled. So the usual failure is **recall, not ranking**: if
neither semantic nor keyword catches it, raising `limit` or reranking won't help.
Query rules that follow from this:
- **Use Pi's own vocabulary** ("extension", "prompt template", "compaction", "RPC mode",
"JSON event stream", "provider", "keybinding") rather than a casual paraphrase — this
feeds BM25 and aligns the dense vector simultaneously.
- **Name the exact term** you expect in the doc (a setting, CLI flag, event name) — the
literal boost rewards an exact substring.
- **If the first query misses, reformulate** with different/added domain terms or fire
2–3 variants; don't just bump `limit`.
- Do **not** prepend instruction-style prefixes (e.g. `Instruct: …`) — Miyo embeds the
query text verbatim and symmetrically with documents, so that only adds noise.
## Search the whole docset
Use Miyo semantic search scoped to the folder:
```
mcp__miyo__search(
query: "<natural-language question>",
folder_path: "pi",
limit: 5 # 3–8 is usually enough; raise for broad topics
)
```
## Search a specific topic
Add the `path` filter (case-insensitive **substring** on the result path) to narrow to
one file. The corpus is flat, so `path` matches a **filename fragment**, no slashes:
```
# Extensions
mcp__miyo__search(query: "...", folder_path: "pi", path: "extensions", limit: 5)
# Sessions / compaction
mcp__miyo__search(query: "...", folder_path: "pi", path: "compaction", limit: 5)
```
⚠️ **`path` must be a single fragment with no slash.** Miyo stores the folder prefix with
the OS-native separator (`\` on Windows, `/` on macOS/Linux), so a filter containing a
separator silently matches nothing on the wrong OS. Match the filename slug alone.
Miyo returns ranked chunks with file paths and the matched snippet. For most questions
the snippets answer directly — synthesize and cite source files inline by their
Miyo-relative path, e.g. `[extensions.md](pi/extensions.md)`.
## When to read the full file
Fetch the raw file when the search chunk lacks the exact detail — an exact JSON schema
for settings or extension manifests, full keybindings/theme table, precise CLI flag
spelling, or the complete provider/model configuration reference.
Pass the **Miyo-relative path** that search/`list_files` returned straight to
`mcp__miyo__read_file` — no path rewriting, fully portable:
```
mcp__miyo__read_file(file_path: "pi/<file>.md")
```
If a page is large and `mcp__miyo__read_file` gets truncated by the harness, lean on the
search chunks (raise `limit`, or add a `path` filter) to pull just the relevant sections.
## Anti-patterns
- Do **not** call `mcp__miyo__search` without `folder_path: "pi"` — results will leak in
from other indexed folders.
- Do **not** read raw docs first to "find" something — search first, read only when a
chunk lacks a specific detail.
- Do **not** use a web fetcher against `github.com/earendil-works/pi/` — the local mirror
is fresher and rate-limit-free.
## Sub-commands the user may invoke
### `/pi-docs <question>`
Search the whole docset (`folder_path: "pi"`). Synthesize an answer from the top 3–5
chunks and cite source files.
### `/pi-docs <topic> "<question>"`
Search scoped to a `path` fragment — e.g. `extensions` → `path: "extensions"`,
`sessions` → `path: "sessions"` (single fragment, no slash).
### `/pi-docs explain "<concept>"`
Broader search (`limit: 10`), group hits by file, and explain the concept covering:
definition, configuration, related features, gotchas.
### `/pi-docs` (no args)
List what's indexed (`mcp__miyo__list_files(file_path: "pi/")`, or
`mcp__miyo__list_folders` for the count) and suggest the user phrase a question.