diff --git a/.gitignore b/.gitignore index 0d6ec02e3..c360e4ca1 100644 --- a/.gitignore +++ b/.gitignore @@ -80,3 +80,4 @@ integrations/kimi/*/ !integrations/openclaw/README.md !integrations/kimi/README.md integrations/codex/agents/* +integrations/pi/agency-*/ diff --git a/integrations/README.md b/integrations/README.md index cb5b8db03..aad13039a 100644 --- a/integrations/README.md +++ b/integrations/README.md @@ -17,6 +17,7 @@ supported agentic coding tools. - **[Kimi Code](#kimi-code)** — YAML agent specs in `kimi/` - **[Qwen Code](#qwen-code)** — project-scoped `.md` SubAgents in `.qwen/agents/` - **[Codex](#codex)** — `.toml` custom agents in `codex/` +- **[Pi](#pi)** — `SKILL.md` per agent in `pi/` ## Quick Install @@ -30,6 +31,7 @@ supported agentic coding tools. ./scripts/install.sh --tool openclaw ./scripts/install.sh --tool claude-code ./scripts/install.sh --tool codex +./scripts/install.sh --tool pi # Gemini CLI needs generated integration files on a fresh clone ./scripts/convert.sh --tool gemini-cli @@ -257,3 +259,20 @@ directly, run the converter before installing from a fresh clone: ``` See [codex/README.md](codex/README.md) for details. + +--- + +## Pi + +Each agent becomes a Pi Coding Agent skill folder containing a `SKILL.md` file. +Skills are installed to `~/.pi/agent/skills/`. + +Because the skill files are generated from the source Markdown, run +`./scripts/convert.sh --tool pi` before installing from a fresh clone. + +```bash +./scripts/convert.sh --tool pi +./scripts/install.sh --tool pi +``` + +See [pi/README.md](pi/README.md) for details. diff --git a/integrations/pi/README.md b/integrations/pi/README.md new file mode 100644 index 000000000..72b9a6f24 --- /dev/null +++ b/integrations/pi/README.md @@ -0,0 +1,56 @@ +# Pi Coding Agent Integration + +Installs the full Agency roster as Pi skills. Each agent is prefixed +with `agency-` to avoid conflicts with existing skills. + +## Install + +```bash +./scripts/install.sh --tool pi +``` + +This copies files from `integrations/pi/` to +`~/.pi/agent/skills/`. + +## Activate a Skill + +In Pi, activate an agent by its slug: + +``` +Use the agency-frontend-developer skill to review this component. +``` + +Available slugs follow the pattern `agency-`, e.g.: +- `agency-frontend-developer` +- `agency-backend-architect` +- `agency-reality-checker` +- `agency-growth-hacker` + +## Regenerate + +After modifying agents, regenerate the skill files: + +```bash +./scripts/convert.sh --tool pi +``` + +## File Format + +Each skill is a `SKILL.md` file with standard frontmatter: + +```yaml +--- +name: agency-frontend-developer +description: Expert frontend developer specializing in... +--- +``` + +## Skill Locations + +Pi discovers skills from several locations: + +- **Global (user-level):** `~/.pi/agent/skills/` +- **Project-level:** `.pi/skills/` + +The installer copies skills to the global location by default. Set the +`PI_SKILLS_DIR` environment variable to override the destination path. diff --git a/scripts/convert.sh b/scripts/convert.sh index 1521015d4..2940a42ff 100755 --- a/scripts/convert.sh +++ b/scripts/convert.sh @@ -20,6 +20,7 @@ # qwen — Qwen Code SubAgent files (~/.qwen/agents/*.md) # kimi — Kimi Code CLI agent files (~/.config/kimi/agents/) # codex — Codex custom agent TOML files (~/.codex/agents/*.toml) +# pi — Pi Coding Agent skill files (~/.pi/agent/skills/) # all — All tools (default) # # Output is written to integrations// relative to the repo root. @@ -130,6 +131,29 @@ ${body} HEREDOC } +convert_pi() { + local file="$1" + local name description slug outdir outfile body + + name="$(get_field "name" "$file")" + description="$(get_field "description" "$file")" + slug="agency-$(slugify "$name")" + body="$(get_body "$file")" + + outdir="$OUT_DIR/pi/$slug" + outfile="$outdir/SKILL.md" + mkdir -p "$outdir" + + # Pi Coding Agent SKILL.md format: folder per skill in ~/.pi/agent/skills/ + cat > "$outfile" </dev/null } @@ -363,6 +366,7 @@ detect_windsurf() { command -v windsurf >/dev/null 2>&1 || [[ -d "${HOME}/.c detect_qwen() { command -v qwen >/dev/null 2>&1 || [[ -d "${HOME}/.qwen" ]]; } detect_kimi() { command -v kimi >/dev/null 2>&1; } detect_codex() { command -v codex >/dev/null 2>&1 || [[ -d "${HOME}/.codex" ]]; } +detect_pi() { command -v pi >/dev/null 2>&1 || [[ -d "${HOME}/.pi" ]]; } is_detected() { case "$1" in @@ -378,6 +382,7 @@ is_detected() { qwen) detect_qwen ;; kimi) detect_kimi ;; codex) detect_codex ;; + pi) detect_pi ;; *) return 1 ;; esac } @@ -397,6 +402,7 @@ tool_label() { qwen) printf "%-14s %s" "Qwen Code" "(~/.qwen/agents)" ;; kimi) printf "%-14s %s" "Kimi Code" "(~/.config/kimi/agents)" ;; codex) printf "%-14s %s" "Codex" "(~/.codex/agents)" ;; + pi) printf "%-14s %s" "Pi" "(~/.pi/agent/skills)" ;; esac } @@ -520,7 +526,7 @@ tool_simple_name() { claude-code) echo "Claude Code";; copilot) echo "Copilot";; antigravity) echo "Antigravity";; gemini-cli) echo "Gemini CLI";; opencode) echo "OpenCode";; openclaw) echo "OpenClaw";; cursor) echo "Cursor";; aider) echo "Aider";; windsurf) echo "Windsurf";; - qwen) echo "Qwen Code";; kimi) echo "Kimi Code";; codex) echo "Codex";; *) echo "$1";; + qwen) echo "Qwen Code";; kimi) echo "Kimi Code";; codex) echo "Codex";; pi) echo "Pi";; *) echo "$1";; esac } @@ -897,6 +903,23 @@ install_codex() { ok "Codex: $count agents -> $dest" } +install_pi() { + local src="$INTEGRATIONS/pi" + local dest; dest="$(resolve_dest pi "${HOME}/.pi/agent/skills")" + local count=0 + [[ -d "$src" ]] || { err "integrations/pi missing. Run convert.sh first."; return 1; } + mkdir -p "$dest" + local d + while IFS= read -r -d '' d; do + local name; name="$(basename "$d")" + slug_allowed "$name" || continue + mkdir -p "$dest/$name" + install_file "$d/SKILL.md" "$dest/$name/SKILL.md" + incr count + done < <(find "$src" -mindepth 1 -maxdepth 1 -type d -print0) + ok "Pi: $count skills -> $dest" +} + install_tool() { ensure_converted "$1" case "$1" in @@ -912,6 +935,7 @@ install_tool() { qwen) install_qwen ;; kimi) install_kimi ;; codex) install_codex ;; + pi) install_pi ;; esac }