Skip to content

feat: add Pi.dev's open source coding harness as a new host#1

Merged
skyfallsin merged 4 commits intomainfrom
feat/pi-host-support
Mar 24, 2026
Merged

feat: add Pi.dev's open source coding harness as a new host#1
skyfallsin merged 4 commits intomainfrom
feat/pi-host-support

Conversation

@skyfallsin
Copy link
Owner

Summary

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. 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.

148 new tests: Pi template generation (frontmatter, path rewrites, /codex exclusion, skill naming), setup install flow (directory creation, SKILL.md copying, runtime root symlinks, cleanup of stale layouts), and cross-host parity checks.

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)

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/.
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.
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).
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 as native host for gstack skill generation feat: add Pi.dev's open source coding harness as a new host Mar 24, 2026
@skyfallsin skyfallsin merged commit b5b70de into main Mar 24, 2026
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