From bbce42d2b124d6e4dd78c05b33b029fba8ee3e51 Mon Sep 17 00:00:00 2001 From: abdul Date: Tue, 9 Jun 2026 00:08:58 +0700 Subject: [PATCH] feat(hosts): add pi as a supported host Pi implements the Agent Skills spec, so gstack skills work with one config file (no generator, setup, or tooling changes). Skills install to ~/.pi/agent/skills/gstack-*/ for global and .pi/skills/ for project-local, both discovered by pi at startup. - hosts/pi.ts: minimal config mirroring opencode pattern - hosts/index.ts: register pi in ALL_HOST_CONFIGS + re-exports - .gitignore: skip .pi/ (generated skill docs) - README.md: add Pi row to host table + dedicated install section --- .gitignore | 1 + README.md | 18 +++++++++++++++ hosts/index.ts | 5 +++-- hosts/pi.ts | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 hosts/pi.ts diff --git a/.gitignore b/.gitignore index 42b2c2a04..91e34530d 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ bin/gstack-global-discover* .slate/ .cursor/ .openclaw/ +.pi/ .hermes/ .gbrain/ .gbrain-source diff --git a/README.md b/README.md index c8b20b308..97accea2b 100644 --- a/README.md +++ b/README.md @@ -120,11 +120,29 @@ Or target a specific agent with `./setup --host `: | Slate | `--host slate` | `~/.slate/skills/gstack-*/` | | Kiro | `--host kiro` | `~/.kiro/skills/gstack-*/` | | Hermes | `--host hermes` | `~/.hermes/skills/gstack-*/` | +| Pi | `--host pi` | `~/.pi/agent/skills/gstack-*/` | | GBrain (mod) | `--host gbrain` | `~/.gbrain/skills/gstack-*/` | **Want to add support for another agent?** See [docs/ADDING_A_HOST.md](docs/ADDING_A_HOST.md). It's one TypeScript config file, zero code changes. +### Pi + +[Pi](https://pi.dev) implements the [Agent Skills standard](https://agentskills.io/specification) +end-to-end, so every gstack skill works out of the box once the skills directory +is configured. Install gstack into pi's global agent skills path: + +```bash +git clone --single-branch --depth 1 https://github.com/garrytan/gstack.git ~/gstack +cd ~/gstack && ./setup --host pi +``` + +Skills land at `~/.pi/agent/skills/gstack-*/`. For project-local skills (trusted +project), pi also discovers `.pi/skills/`. Pi loads skill descriptions at startup +and lazy-loads the full `SKILL.md` on demand, matching Claude Code's behavior. + +Invoke a skill with `/skill:` (e.g. `/skill:review`, `/skill:ship`). + ## See it work ``` diff --git a/hosts/index.ts b/hosts/index.ts index cc1c213b5..18728b6eb 100644 --- a/hosts/index.ts +++ b/hosts/index.ts @@ -16,9 +16,10 @@ import cursor from './cursor'; import openclaw from './openclaw'; import hermes from './hermes'; import gbrain from './gbrain'; +import pi from './pi'; /** All registered host configs. Add new hosts here. */ -export const ALL_HOST_CONFIGS: HostConfig[] = [claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain]; +export const ALL_HOST_CONFIGS: HostConfig[] = [claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain, pi]; /** Map from host name to config. */ export const HOST_CONFIG_MAP: Record = Object.fromEntries( @@ -65,4 +66,4 @@ export function getExternalHosts(): HostConfig[] { } // Re-export individual configs for direct import -export { claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain }; +export { claude, codex, factory, kiro, opencode, slate, cursor, openclaw, hermes, gbrain, pi }; diff --git a/hosts/pi.ts b/hosts/pi.ts new file mode 100644 index 000000000..fb717c2e7 --- /dev/null +++ b/hosts/pi.ts @@ -0,0 +1,60 @@ +import type { HostConfig } from '../scripts/host-config'; + +const pi: HostConfig = { + name: 'pi', + displayName: 'Pi', + cliCommand: 'pi', + cliAliases: [], + + globalRoot: '.pi/agent/skills/gstack', + localSkillRoot: '.pi/skills/gstack', + hostSubdir: '.pi', + usesEnvVars: true, + + frontmatter: { + mode: 'allowlist', + keepFields: ['name', 'description'], + descriptionLimit: 1024, + }, + + generation: { + generateMetadata: false, + skipSkills: ['codex'], + }, + + pathRewrites: [ + { from: '~/.claude/skills/gstack', to: '~/.pi/agent/skills/gstack' }, + { from: '.claude/skills/gstack', to: '.pi/skills/gstack' }, + { from: '.claude/skills', to: '.pi/skills' }, + ], + toolRewrites: { + 'use the Bash tool': 'use the bash tool', + 'use the Write tool': 'use the write tool', + 'use the Read tool': 'use the read tool', + 'use the Edit tool': 'use the edit tool', + 'use the Grep tool': 'use the grep tool', + 'use the Glob tool': 'use the find tool', + 'use the Agent tool': 'use the agent tool', + 'the Bash tool': 'the bash tool', + 'the Read tool': 'the read tool', + 'the Write tool': 'the write tool', + 'the Edit tool': 'the edit tool', + }, + suppressedResolvers: ['GBRAIN_CONTEXT_LOAD', 'GBRAIN_SAVE_RESULTS'], + + runtimeRoot: { + globalSymlinks: ['bin', 'browse/dist', 'browse/bin', 'design/dist', 'gstack-upgrade', 'ETHOS.md', 'review/specialists', 'qa/templates', 'qa/references', 'plan-devex-review/dx-hall-of-fame.md'], + globalFiles: { + 'review': ['checklist.md', 'design-checklist.md', 'greptile-triage.md', 'TODOS-format.md'], + }, + }, + + install: { + prefixable: false, + linkingStrategy: 'symlink-generated', + }, + + learningsMode: 'basic', +}; + +export default pi;