Skip to content

feat: add Pi as native host#418

Open
skyfallsin wants to merge 1 commit intogarrytan:mainfrom
skyfallsin:main
Open

feat: add Pi as native host#418
skyfallsin wants to merge 1 commit intogarrytan:mainfrom
skyfallsin:main

Conversation

@skyfallsin
Copy link

@skyfallsin skyfallsin commented Mar 24, 2026

Summary

This PR adds an easy-to-install path for gstack into the open source pi coding harness.

Pi host support for gen-skill-docs and setup: --host pi generates Pi-compatible SKILL.md files with correct frontmatter (name: must match directory), path rewrites (.claude/.pi/), and preamble shell variables ($GSTACK_ROOT defaulting to ~/.pi/agent/skills/gstack). setup installs Pi skills via cp to ~/.pi/agent/skills/gstack-*/ when INSTALL_PI=1. (gen-skill-docs.ts, setup)

Architecture docs: New "Multi-host generation (Claude, Codex, Pi)" section in ARCHITECTURE.md covering shared transforms, Pi vs Codex differences table, path rewrite rules (order-sensitive, sidecar handling), and setup flow.

23 new tests: Pi template generation (frontmatter, path rewrites, /codex exclusion, skill naming, sidecar paths, dry-run freshness) and setup install flow (directory creation, SKILL.md copying, runtime root symlinks, cleanup of stale layouts).

Pre-Landing Review

No issues found.

Test plan

  • Gen-skill-docs tests pass (Pi generation, path rewrites, naming)
  • Setup tests pass (Pi install flow, runtime root, cleanup)
  • Skill validation tests pass (358 tests)
  • Snapshot tests pass (38 tests)
  • Total: 921 pass, 22 pre-existing failures (PATH/env issues, unrelated)

* feat: add Pi as native host for gstack skill generation

Add --host pi support to gen-skill-docs.ts and the setup script. Pi skills
are generated to .pi/skills/gstack-{name}/SKILL.md with Pi-specific preamble
paths ($GSTACK_ROOT defaulting to ~/.pi/agent/skills/gstack), repo-local
override from .pi/skills/gstack, and correct frontmatter name: fields that
match directory names (gstack-review, not review) to pass Pi's validation.

Setup --host pi generates .pi/ skill docs, creates a runtime root at
~/.pi/agent/skills/gstack with symlinked bin/browse/review assets, and
copies generated skills into ~/.pi/agent/skills/.

* test: add Pi host generation + setup validation tests

Mirrors the existing Codex test suite for the new --host pi support:

Pi generation (18 tests):
- Output path verification for all generated skills
- Skill naming (gstack- prefix, no double-prefix)
- Frontmatter: name+description only, name matches directory
- No openai.yaml metadata (Pi doesn't use it)
- No .claude/ or .agents/ path leaks in output
- /codex skill excluded
- Preamble resolves from ~/.pi/agent/skills/gstack
- Sidecar paths use .pi/skills/gstack/review/ (not gstack-review/)
- Auto-generated headers present
- Dry-run freshness check
- Path rewrite rules apply to all skills
- Claude output unaffected by Pi generation
- Hook skills have safety prose
- Multiline descriptions preserved

Setup validation (5 tests):
- INSTALL_PI flag exists
- Pi install section creates runtime root with symlinked assets
- Generated skills copied from .pi/skills/ to ~/.pi/agent/skills/
- gen:skill-docs --host pi runs before install
- Old whole-dir symlink migration handled

Also updated auto mode test to check for pi binary detection.

* docs: document Pi vs Codex host differences in ARCHITECTURE.md

Add 'Multi-host generation' section to ARCHITECTURE.md covering:
- Shared behavior between Pi and Codex (frontmatter, preamble, path
  rewriting, /codex exclusion, skill naming)
- Differences table (output dirs, name: field, openai.yaml, install
  method, migration, runtime root, repo-local detection)
- Path rewrite rules with ordering and sidecar explanation
- Setup install flow (generation, runtime root, skill copy, cleanup)

Source files (gen-skill-docs.ts, setup) now have short pointers to
ARCHITECTURE.md instead of inline comment blocks. Small inline comments
kept at key decision points (HOST_PATHS, preamble, transformFrontmatter,
openai.yaml).

* docs: compress multi-host generation section in ARCHITECTURE.md

74 lines → 46 lines. Consolidated shared transforms into a single
paragraph, merged 3 directory rows in the diff table, unified path
rewrite rules with brace notation, and trimmed setup flow prose.
All material facts preserved.
@skyfallsin skyfallsin changed the title feat: add Pi.dev's open source coding harness as a new host feat: add Pi as native host for gstack skill generation Mar 24, 2026
@skyfallsin skyfallsin changed the title feat: add Pi as native host for gstack skill generation feat: add Pi as native host Mar 24, 2026
@skyfallsin skyfallsin marked this pull request as ready for review March 24, 2026 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant