feat(hosts): add Pi as a new host target#846
Open
mlarabi wants to merge 1 commit intogarrytan:mainfrom
Open
Conversation
17149c7 to
5574d80
Compare
Add Pi (https://github.com/mariozechner/pi-coding-agent) as a supported host. Pi uses Claude Opus under the hood with its own skill discovery system (~/.pi/agent/skills/ global, .pi/skills/ project-local). Changes: - hosts/pi.ts: Pi host config with Agent Skills spec compliance (1024 char description limit, allowlist frontmatter, prefixName), lowercase tool name rewrites, boundary instructions including ~/.pi/ for Codex isolation, self-identity rewrites, full learnings mode - scripts/host-config.ts: add frontmatter.prefixName option — Pi requires name: field to match parent directory (gstack-review, etc.) - scripts/gen-skill-docs.ts: implement prefixName in transformFrontmatter - hosts/index.ts: register Pi (9 hosts total) - .gitignore: add .pi/ - setup: add Pi host support (--host pi, auto-detect, generate .pi/ skill docs, install to ~/.pi/agent/skills/ with runtime asset symlinks and copied SKILL.md files). Skip prefix prompt for Pi-only installs — Pi always uses gstack-* names (name: must match dirname). - gstack-upgrade/SKILL.md.tmpl: detect .pi/ install paths for upgrades - test/host-config.test.ts: update host count assertion (8 → 9) - test/gen-skill-docs.test.ts: update setup validation for pi host - test/fixtures/golden/: regenerate baselines - README.md: add Pi to agents table
5574d80 to
00f506b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Pi as a new supported host. Pi is an open-source AI coding agent harness that uses Claude Opus under the hood, with its own skill discovery system following the Agent Skills specification.
New host config (
hosts/pi.ts):~/.pi/agent/skills/global,.pi/skills/project-local)frontmatter.prefixName: true— Pi validates thatname:matches the parent directory name (review→gstack-review)Bash→bash,Read→read,AskUserQuestion→ask_user_question)~/.pi/so Codex avoids reading Pi skill filesClaude Opus 4.6 via PiNew config option (
scripts/host-config.ts):frontmatter.prefixName— whentrue, thename:field in generated SKILL.md is prefixed withgstack-to match the output directory name. Pi requires this at runtime; other hosts don't enforce it.Setup script (
setup):--host piaccepted,piadded to auto-detect (command -v pi).pi/skill docs viabun run gen:skill-docs --host pi~/.pi/agent/skills/gstack/runtime root with symlinked assets (bin/,browse/dist,browse/bin,ETHOS.md, review sidecars), copies generated Pi-native SKILL.md files into~/.pi/agent/skills/gstack-*/Upgrade template (
gstack-upgrade/SKILL.md.tmpl):.pi/skills/gstack(local-git) and~/.pi/agent/skills/gstack(vendored-global) install paths.pi/skills/gstackalongside.claude/skills/gstackUninstall (
bin/gstack-uninstall):~/.pi/agent/skills/gstack*(global Pi install).pi/skills/gstack*(project-local Pi sidecar)rmdir .pi/itself — Pi owns that directory and may havesettings.json, sessions, or other state thereInfrastructure:
hosts/index.ts(9 hosts total).pi/added to.gitignoreFollows docs/ADDING_A_HOST.md step-by-step. Zero changes to the generator's core logic — only a 3-line
prefixNameimplementation intransformFrontmatter.Design decisions
Always prefixed — no short names for Pi
Pi validates at runtime that the
name:field in SKILL.md matches the parent directory name. The generator outputs skills togstack-*directories (e.g.,gstack-review/SKILL.md), so the frontmatter must sayname: gstack-review. Short names (/skill:reviewin a directory calledreview/) would require both renaming the install directory and rewriting the frontmatter during setup — fragile and not worth the complexity.The setup script skips the prefix prompt entirely for
--host pi. The check uses$HOST(available early, beforeINSTALL_*flags are resolved) rather than$INSTALL_PI(set later) to avoid the prompt showing before the flag exists.Suppress
gstack-relinkwarning for PiWhen
skill_prefix: trueis saved in~/.gstack/config.yaml,gen:skill-docsprints a reminder to rungstack-relinkto re-apply Claude symlink name patches. This is irrelevant for Pi (Pi doesn't use symlinks — it copies SKILL.md files). The warning is suppressed when--host piis the active generation target.Don't rmdir
.pi/on uninstallOther host directories (
.agents/,.factory/) are created exclusively by gstack and can be safely removed..pi/is owned by Pi itself and may containsettings.json, session data, or other user config. Uninstall removesgstack*entries inside.pi/skills/but leaves the directory intact.Boundary instructions include
~/.pi/When Codex is invoked as a second opinion from a Pi session, the boundary instruction now tells Codex to avoid
~/.pi/alongside~/.claude/and~/.agents/. Without this, Codex could waste tokens reading Pi skill definitions.Test Coverage
All new code paths covered by existing parameterized smoke tests that auto-pick up new hosts.
Pre-Landing Review
No issues found. One new config file (
hosts/pi.ts), one new config option (prefixName), setup script Pi section, upgrade template awareness, uninstall support, and standard test/gitignore updates. No changes to existing host configs or generator core logic.Test plan
bun run gen:skill-docs --host pigenerates 35 skillsname:fields match directory names (gstack-review,gstack-ship, etc.)bun run scripts/host-config-export.ts validate— all 9 configs validbun run skill:check— Pi: 35/35 skills, 0 missing, freshness ✅bun test test/host-config.test.ts— all passbun test test/gen-skill-docs.test.ts— all pass (including setup Pi validation)grep -r ".claude/skills" .pi/skills/— empty (no path leakage)bun run build— full build succeeds./setup --host pi— no prefix prompt, installs to~/.pi/agent/skills/, Pi discovers all 35 skills./bin/gstack-uninstall— lists Pi paths in confirmation, removesgstack*entries, preserves.pi/