agent/skills/pi-prompt-authoring/SKILL.md
Authors system prompt additions for pi coding agent. Use when extending pi's default prompt with custom principles, guidelines, or project-specific rules via SYSTEM.md or APPEND_SYSTEM.md.
npx skillsauth add knoopx/pi pi-prompt-authoringInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Authors custom system prompt additions for pi coding agent. Pi provides a default system prompt with identity, tools, and guidelines. This skill covers what to add via SYSTEM.md (replace default) or APPEND_SYSTEM.md (extend default).
Pi builds the system prompt dynamically at runtime. The construction follows this order:
When using the default prompt, pi constructs it with these sections:
APPEND_SYSTEM.md or --append-system-promptAGENTS.md/CLAUDE.md filesread tool is enabled)Tools appear in the system prompt only when a one-line description snippet is provided. Default tools are read, bash, edit, write. The format is:
Available tools:
- read: Read the contents of a file
- bash: Execute a bash command in the current working directory
- edit: Edit a single file using exact text replacement
- write: Write content to a file
Custom tools from extensions can also be included if the extension provides a snippet. If no tools have snippets, the prompt shows "(none)".
Guidelines are context-aware based on available tools:
bash is available without grep/find/ls: "Use bash for file operations like ls, rg, find"bash is available with grep/find/ls: "Prefer grep/find/ls tools over bash for file exploration (faster, respects .gitignore)"Custom guidelines can be added via extensions and appear before the default guidelines.
At startup, pi scans skill locations and extracts names, descriptions, and file paths. The system prompt includes visible skills in XML format per the Agent Skills specification:
The following skills provide specialized instructions for specific tasks.
Use the read tool to load a skill's file when the task matches its description.
When a skill file references a relative path, resolve it against the skill directory (parent of SKILL.md / dirname of the path) and use that absolute path in tool commands.
<available_skills>
<skill>
<name>skill-name</name>
<description>What this skill does and when to use it</description>
<location>/absolute/path/to/skill/SKILL.md</location>
</skill>
</available_skills>
This is progressive disclosure: only the skill list is always in context; full skill instructions load on-demand when the agent uses read to load the SKILL.md file. Skills with disable-model-invocation: true in frontmatter are excluded from the prompt and can only be invoked via /skill:name commands.
Pi loads AGENTS.md (or CLAUDE.md, in that priority order) from:
~/.pi/agent/AGENTS.md (global, loaded first)All matching files are concatenated in this order with headers:
# Project Context
Project-specific instructions and guidelines:
## /path/to/AGENTS.md
[content]
If both AGENTS.md and CLAUDE.md exist in the same directory, only AGENTS.md is used.
SYSTEM.md or --system-prompt (replaces default):
APPEND_SYSTEM.md or --append-system-prompt is still appendedAGENTS.md/CLAUDE.md) are appended afterread tool is availableAPPEND_SYSTEM.md or --append-system-prompt (extends default):
.pi/SYSTEM.md or .pi/APPEND_SYSTEM.md~/.pi/agent/SYSTEM.md or ~/.pi/agent/APPEND_SYSTEM.md--system-prompt <text> (replaces) or --append-system-prompt <text> (extends)Project files take precedence over global files. CLI flags override file-based discovery.
Key principle: Don't duplicate what pi already provides. Focus your custom prompt on additional principles and constraints specific to your workflow.
Purpose: Define coding standards, code quality expectations, and architectural preferences. Pi's default is minimal; add principles for your workflow.
Common principle categories:
Example:
<simplicity>
The assistant uses the simplest code that solves the problem. Abstraction is earned.
</simplicity>
<codebase_health>
Every change must leave the codebase healthier. Delete dead code.
</codebase_health>
Purpose: Enforce specific behaviors beyond pi's defaults. Define how the agent should approach tasks, handle errors, and interact with users.
Common guideline categories:
Example:
<debugging_and_fixes>
Fix the cause, not the symptom. Read the implementation, trace the box model,
understand the pixels, then change one thing with certainty.
</debugging_and_fixes>
<scope>
One change does one thing. No unrequested features, no undiscussed removals.
</scope>
Purpose: Add usage patterns for custom tools registered via pi extensions. Pi auto-generates tool descriptions for built-in tools; only add guidelines for extension-specific tools.
Example for custom display tool:
<display_requirements>
The display must show what you are doing. Update at phase changes.
Use genui tool with openui-lang source for display updates.
</display_requirements>
<genui_tool>
Use Canvas with Header, Col, and Timestamp. Header includes icon, title, subtitle.
Icons by phase: sync for running, check for done, bug for error.
</genui_tool>
Purpose: Add project-specific conventions, commands, or constraints. Pi already loads AGENTS.md/CLAUDE.md files; use APPEND_SYSTEM.md for rules that don't fit there.
Example:
<project_context>
The project uses Nix flakes. Always use `nix develop` for shell access.
Build with `nix build`. Tests run via `nix flake check`.
</project_context>
Use APPEND_SYSTEM.md for extensions: Don't replace pi's default unless necessary. Append custom principles to preserve built-in functionality.
Use SYSTEM.md for replacements: Only if you need to fundamentally change pi's behavior.
XML tags for organization: Use <section_name> tags to organize principles logically.
Concise, value-based rules: "Scope is sacred" not "When asked to do X, only touch files that Y".
No procedural details: Avoid code snippets, variable names, or step-by-step scenarios.
Before finalizing:
SYSTEM.md (replace) or APPEND_SYSTEM.md (extend)tools
Inform the user what is happening — skip passive lookups
development
Renders markdown to self-contained HTML with a custom dark stylesheet and opens in browser. Use when previewing markdown documents, generating styled HTML from README or report files.
testing
Programmatic hunk selection for Jujutsu — split, commit, or squash specific hunks without interactive prompts. Use when making partial commits or selective squashes.
content-media
Manage version control with Jujutsu (jj) — no staging area, immediate changes, smart rebasing. Use when navigating history, squashing, or pushing to Git remotes.