You can modify Pi without writing code: AGENTS.md, prompt templates, skills, themes and settings.
Difficulty: ★★★ | Prerequisites:01、02、03 | All customizations in this article are No need to write code。
0. Choose the right mechanism first: the principle of least power
Official Quickstart:Start with the weakest mechanism that meets the need。
AGENTS.md (persistent instructions) < prompt template (reuse prompt) < skills (command + supporting files, loaded on demand) < extension (executable code)
1. Configure directory panorama
1.1 User level: Agent directory (default ~/.pi/agent, available PI_CODING_AGENT_DIR modification)
settings.json- Responsibilities
- User-level settings, resource paths, Pi package declarations
keybindings.json- Responsibilities
- Shortcut keys
mcp.json- Responsibilities
- MCP server available for all projects
models.json- Responsibilities
- Compatible with endpoints, models and model overrides
auth.json- Responsibilities
- Saved API Key and OAuth credentials (do not submit)
AGENTS.override.md/AGENTS.md/CLAUDE.md- Responsibilities
- User commands that take effect across directories
SYSTEM.md- Responsibilities
- replace Pi default system prompt
APPEND_SYSTEM.md- Responsibilities
- Append to system prompts
extensions/skills/prompts/themes/- Responsibilities
- User Extensions/Skills/Prompt Templates/Themes
| path | Responsibilities |
|---|---|
settings.json | User-level settings, resource paths, Pi package declarations |
keybindings.json | Shortcut keys |
mcp.json | MCP server available for all projects |
models.json | Compatible with endpoints, models and model overrides |
auth.json | Saved API Key and OAuth credentials (do not submit) |
AGENTS.override.md / AGENTS.md / CLAUDE.md | User commands that take effect across directories |
SYSTEM.md | replace Pi default system prompt |
APPEND_SYSTEM.md | Append to system prompts |
extensions/ skills/ prompts/ themes/ | User Extensions/Skills/Prompt Templates/Themes |
1.2 Project level:.pi/(The project needs to be trusted before loading)
.pi/settings.json、.pi/mcp.json、.pi/SYSTEM.md、.pi/APPEND_SYSTEM.md、.pi/extensions/、.pi/skills/、.pi/prompts/、.pi/themes/。
- Yes
SYSTEM.md/APPEND_SYSTEM.md: Files of trusted projects take precedence over files of the same name in the agent directory.Files with the same name are not merged; - Project settings override user settings and resource lists are merged;
- Run in session after manual modification
/reload。
2. Context file (AGENTS.md)
context file independent from .pi Configuration:
- Pi from agent directory, working directory, and all their parent directories load them;
- context file pair The directory where it is located and below take effect;
- Supported file names:
AGENTS.md、AGENTS.MD、CLAUDE.md、CLAUDE.MD, andAGENTS.override.md; AGENTS.override.mdReplace only same directory inAGENTS.md/CLAUDE.md, does not affect other directories;- Discovery context file No project trust required(So be wary of instructions in unfamiliar warehouses);
-nc/--no-context-filesDisabled.
Example AGENTS.md:
#Project agreement
- Use TypeScript strict mode to disable any
- Test command: npm test; npm run check must be passed before submission
- All user-visible copy should be in Simplified Chinese
- Do not modify the vendor/ directory
2.1 System prompt file
SYSTEM.md: Replace the default system prompt as a whole (use with caution, as you will lose the Pi built-in tool usage instructions);APPEND_SYSTEM.md: Appended after the default system prompt, which is usually safer;- Command line equivalent:
--system-prompt、--append-system-prompt。
3. Prompt Templates
Prompt templates make Markdown files reusable / command,No executable behavior。
3.1 Creation (official example)
~/.pi/agent/prompts/review.md:
description: Review staged git changes
argument-hint: "[focus]"
Review the staged changes. Focus on ${1:-correctness, security, and error handling}.
- The file name is the command name →
/review; descriptionDisplayed in command completion; when omitted, the first line of non-empty text is used;argument-hintOptional:<尖括号>Indicates required,[方括号]Indicates optional.
Use:
/review
/review concurrency
/review "API compatibility" # Quotation marks count as a parameter (shell-like quotation mark rules)
3.2 Parameter substitution syntax
$1、$2…- result
- single positional parameter
$@or$ARGUMENTS- result
- All parameters are connected with spaces
${1:-default}- result
- first parameter or default value
${@:-default}- result
- All parameters or default values
${@:N}- result
- Parameters starting from the Nth
${@:N:L}- result
- L parameters starting from Nth
| Grammar | result |
|---|---|
$1、$2 … | single positional parameter |
$@ or $ARGUMENTS | All parameters are connected with spaces |
${1:-default} | first parameter or default value |
${@:-default} | All parameters or default values |
${@:N} | Parameters starting from the Nth |
${@:N:L} | L parameters starting from Nth |
3.3 Loading rules
- Agreed directory (
~/.pi/agent/prompts/、.pi/prompts/) only loads direct children.md; - Setting items
promptsand Pi packages can optionally nest files; - The template is entering the agent before expand; expand through
inputThe event gets the original input first (unless the extension command with the same name has already been processed).
4. Skills
Skills are provided for a certain type of job Special instructions and supporting documents. Pi only announces the number of each skill in the system prompts name, description and path, the model will only read the complete version when the task requires it. SKILL.md(Load on demand, save context). Pi implemented Agent Skills Specification(https://agentskills.io/specification )。
4.1 Directory structure (official example)
pdf-tools/
├── SKILL.md
├── scripts/
│ └── extract.sh
├── references/
│ └── formats.md
└── assets/
└── template.json
4.2 SKILL.md
name: pdf-tools
description: Extract text and tables from PDF files. Use when reading, converting, or inspecting PDFs.
# PDF tools
Read references/formats.md before converting a document. Run scripts relative to this skill directory.
Keys to writing a good description:Explain "what to do" and "when to use it" at the same time. "Helps with PDFs" describes insufficient routing information. For citing supporting documents Path relative to skill directory, Pi will tell the model where the skill is.
4.3 frontmatter field
name- Purpose
- Command and display name (lowercase letters, numbers, hyphens, ≤64 characters, no leading or trailing or consecutive hyphens)
description- Purpose
- Route description for the model (≤1024 characters, required, if missing, it will not be loaded)
license- Purpose
- license
compatibility- Purpose
- Environmental requirements
metadata- Purpose
- Extra key-value metadata
allowed-tools- Purpose
- Experimental: List of pre-approved tools
disable-model-invocation- Purpose
- set to
trueThe model is not automatically selected and can only be called through explicit commands.
| Field | Purpose |
|---|---|
name | Command and display name (lowercase letters, numbers, hyphens, ≤64 characters, no leading or trailing or consecutive hyphens) |
description | Route description for the model (≤1024 characters, required, if missing, it will not be loaded) |
license | license |
compatibility | Environmental requirements |
metadata | Extra key-value metadata |
allowed-tools | Experimental: List of pre-approved tools |
disable-model-invocation | set to true The model is not automatically selected and can only be called through explicit commands. |
4.4 Calling and loading locations
- Force loading:
/skill:pdf-tools extract report.pdf(The parameters will be appended to the command as a user request); - settings
enableSkillCommandscontrol/skill:nameWhether to appear in command completion; - Location:
~/.pi/agent/skills/、.pi/skills/, and the Agent Skills common location~/.agents/skills/、.agents/skills/(The project level will search upward from the working directory to the warehouse root); - contains
SKILL.mddirectory will be recursive discovery;When there is a name conflict, keep the one found first and warn; - After modification
/reload;Reference skill collection:https://github.com/badlogic/pi-skills 、https://github.com/anthropics/skills 。
Security: Project skills can instruct the model to run scripts or modify files. Please review before trusting the project.
5. Themes
5.1 Built-in themes
system(Default, starting from 0.99),dark、light。system The theme derives colors from the terminal's own foreground/background and a 16-color ANSI palette, ensuring a text contrast ratio of at least 4.5:1 (WCAG), which is automatically rebuilt when the terminal switches between light and dark.
5.2 Choice
in /settings → Theme selection, save as setting item:
{ "theme": "dark" }
Automatically follow light and dark (light color first, then dark color):
{ "theme": "light/dark" }
Single run:`pi --use-theme light` or `pi --use-theme light/dark`。
5.3 Custom themes
- Copy a built-in theme (source code
src/modes/interactive/theme) or press schema to create a new one; - save as
~/.pi/agent/themes/my-theme.json,The file name is the same asnameconsistent(This enables hot reloading); - Modify
varsandcolors; - in
/settingsSelectmy-theme。
{
"$schema": "https://pi.dev/schemas/theme.schema.json",
"name": "my-theme",
"appearance": "dark",
"vars": {
"primary": "okhsl(250 60% 65%)"
},
"colors": {
"accent": "primary"
}
}
The above is just a structural representation:
colorsThere is a group in Required role, actually please copy the complete built-in theme before modifying it, and verify it with schema. As of 1.2.0 the theme object is strict : Custom colors can only be placed invars,colors/exportThere cannot be custom keys or additional top-level metadata.
Color can be written as:"#0af" / "#00aaff"、"oklch(62% 0.1 200)"、"okhsl(250 60% 55%)", 256 color index 39, variable name reference "primary", terminal default color ""。
Color Role Grouping: Universal (accent、border*、text、muted、dim、success、error、warning), message (userMessage*…), tools (toolPendingBg、toolSuccessBg…)、Markdown(md*)、diff(toolDiff*), syntax highlighting (syntax*), HTML export (export.*)。
6. Commonly used items in settings (settings.json)
It is recommended to add "$schema": "https://pi.dev/schemas/settings.schema.json" Get editor completion.
{
"$schema": "https://pi.dev/schemas/settings.schema.json",
"defaultProvider": "anthropic",
"defaultModel": "claude-sonnet-4-5",
"defaultThinkingLevel": "medium",
"defaultTools": ["+grep", "+find", "+ls"],
"theme": "light/dark",
"tuiMode": "fullscreen",
"quietStartup": "header",
"steeringMode": "one-at-a-time",
"compaction": { "enabled": true, "reserveTokens": 16384, "keepRecentTokens": 20000 },
"retry": { "enabled": true, "maxRetries": 3 },
"skills": ["~/my-skills"],
"prompts": ["~/my-prompts"],
"enableSkillCommands": true
}
defaultThinkingLevel- Default
"medium"- Description
- Start thinking level
enabledModels- Default
- All
- Description
- Enable selection and recycling of model modes
defaultTools- Default
- read,bash,edit,write
- Description
- support
+name/-name
doubleEscapeAction- Default
"tree"- Description
- Double-click Esc action in empty editor
defaultProjectTrust- Default
"ask"- Description
- Can only be set in the agent directory
sessionDir- Default
- —
- Description
- Session storage directory
sessionShareDestination- Default
"auto"- Description
/shareTarget (1.3+)
shellPath/shellCommandPrefix- Default
- —
- Description
- Custom shell
httpProxy- Default
- —
- Description
- Agent (can only be set in the agent directory)
markdown.mermaid- Default
"streaming"- Description
- Mermaid rendering
| settings | Default | Description |
|---|---|---|
defaultThinkingLevel | "medium" | Start thinking level |
enabledModels | All | Enable selection and recycling of model modes |
defaultTools | read,bash,edit,write | support +name/-name |
doubleEscapeAction | "tree" | Double-click Esc action in empty editor |
defaultProjectTrust | "ask" | Can only be set in the agent directory |
sessionDir | — | Session storage directory |
sessionShareDestination | "auto" | /share Target (1.3+) |
shellPath / shellCommandPrefix | — | Custom shell |
httpProxy | — | Agent (can only be set in the agent directory) |
markdown.mermaid | "streaming" | Mermaid rendering |
resource array(extensions/skills/prompts/themes) support !pattern exclude,+path Precisely include,-path Precise exclusion. The built-in extension is builtin:mcp、builtin:llama.cpp、builtin:codemode、builtin:tool-search, use -builtin:mcp Disabled. can also be run pi config Interactively start and stop resources.
7. Shortcut keys (keybindings.json)
{
"$schema": "https://pi.dev/schemas/keybindings.schema.json",
"app.session.new": "ctrl+shift+n",
"app.session.tree": ["ctrl+shift+t", "alt+shift+t"]
}
empty list [] Indicates that an action is disabled; after modification /reload; use /hotkeys View the currently active shortcut keys.
8. Small exercises
- AGENTS.md: Write in a project root directory
AGENTS.md, requiring "all responses to be in Chinese, giving conclusions first and then giving details." Restart Pi to view the loaded resources listed in the startup header and verify the effect. - prompt template:Create
~/.pi/agent/prompts/commit.md, the content is "Generate submission information in Conventional Commits format based on staged diff, the type defaults to ${1:-feat}", and then execute!git diff --stagedand/commit fix。 - template with parameters:Write a
/translateTemplate, the first parameter is the target language, the remaining parameters (${@:2}) is the text to be translated. - Skills:Create
~/.pi/agent/skills/changelog-writer/SKILL.md, incidentalreferences/style.md(Write your changelog style). Ask Pi to "write changelog for the last 10 commits" and see if it reads the skill automatically; try again/skill:changelog-writer。 - Topic: Copy built-in
darkThe theme is~/.pi/agent/themes/my-dark.json, changenameandaccent, in/settingsSwitch in and observe hot reloading. - Thinking questions: Should a "code review process" be implemented using templates, skills, or extensions? Applicable conditions are given respectively.
9. Official sources
- Configuration:https://pi.dev/docs/latest/configuration
- Settings Reference:https://pi.dev/docs/latest/settings
- Prompt Templates:https://pi.dev/docs/latest/prompt-templates
- Skills:https://pi.dev/docs/latest/skills
- Themes:https://pi.dev/docs/latest/themes
- Keybindings:https://pi.dev/docs/latest/keybindings
- Agent Skills specification:https://agentskills.io/specification
- Pi skills collection:https://github.com/badlogic/pi-skills