Deploy the shared agent rules to pi - #32
Conversation
Pi is installed on this machine but the manifest never knew about it, so pi sessions ran with the skills and none of the rules. Pi already discovers ~/.agents/skills natively -- symlinked skill directories included -- but it loads exactly one global context file and supports no @-imports, so the rules can't be mirrored per-file the way home/.copilot/instructions does it. Generate home/.pi/agent/AGENTS.md from home/.agents/rules/*.md and link that one file into ~/.pi/agent, guarded by make check-pi-agents on the same self-heal-locally / fail-in-CI contract as the copilot mirror. Linking the whole directory instead would pull pi's sessions, trust.json and auth.json into a public repo and clobber the host's own ~/.pi provisioning, so .pi is the manifest's first partially-linked root and test_manifest_covers_link_dotfiles now requires an entry underneath it rather than one for it. Design, verification, and rejected alternatives: docs/superpowers/specs/2026-08-21-pi-harness-support-design.md Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Self-review of my own diff. Two things I'd want a reviewer to look at, neither blocking, plus what I didn't verify.
The What I verified: pi's discovery paths read out of the installed binary rather than the docs; What I didn't: deploy it. This clone isn't the live one, so pointing |
Problem
Pi (
pi.dev) is installed on this machine — the host provisions~/.local/bin/piplus anexe-devextension — and themanifesthas never known it exists. So pi sessions run with the skills and none of the rules: no communication register, no git/PR hygiene, no model-selection guidance.Pi already discovers
~/.agents/skillsnatively and follows symlinked skill directories, so skills reach it for free. That's the.agents-as-source-of-truth decision paying off unprompted — pi's author picked the same cross-harness convention independently. Context files are the whole gap: pi loads exactly one global file,~/.pi/agent/AGENTS.md, with no@-imports and no rules directory. Neither the Claude mechanism (@rules/…imports) nor the Copilot one (per-file symlinks) transfers.Motivation
The repo already treats "a rule rename silently stops reaching a harness" as a build-breaking bug — that's why
check-copilot-instructionsexists. Pi is the fourth consumer of the same config and currently the only one getting none of it, which is exactly the failure that guard was written to prevent, one harness over.Proposed Solution
scripts/build-pi-agents.shconcatenateshome/.agents/rules/*.mdintohome/.pi/agent/AGENTS.md, each rule preceded by an HTML comment naming its source file. Deterministic order, idempotent, refuses to write a header-only file if the rules dir comes up empty.make check-pi-agentsregenerates locally and prints "please commit"; underCIit fails instead. Same contract ascheck-copilot-instructions, wired intoci.yml.tool=pi-conditioned:home/.pi/agent/AGENTS.md → ~/.pi/agent/AGENTS.md.home/.pi/.gitignoreis a default-deny allowlist, matchinghome/.claude/.gitignore.test_manifest_covers_link_dotfileslearns about partially-linked roots:.pineeds an entry underneath it, not one for the directory.Linking all of
home/.pi → ~/.pithe way.claude/.copilot/.geminiare linked was rejected —deploy.shwould back up the host's live~/.piand replace it, and pi'ssessions/(full transcripts),trust.json(private workspace paths — the AntigravitytrustedWorkspacesproblem again) andauth.json(credentials) would land inside a public repo.Verified live rather than inferred: paths were read out of the installed pi binary, and a cheap model run confirmed both halves — the agent quoted a rule sentence verbatim and named
home/.agents/rules/improvement.mdfrom its provenance comment, and listed 13 skills out of~/.agents/skills(the other 14 carrydisable-model-invocation: trueand are correctly withheld).Design, evidence, and the rest of the rejected options:
docs/superpowers/specs/2026-08-21-pi-harness-support-design.md.Feedback
./deploy.sh applywould hard-fail on a missing source, and deploy.sh staying symlink-only is a parked decision. Worth confirming that trade is the one you want.macos-interactions.md. Mirrors what Copilot gets; costs a few hundred tokens on Linux. Say the word if pi should get a subset.settings.jsonshipped. Theme, default model, thinking level, telemetry opt-out are all available — every one of them looked like a preference rather than a fix, so nothing speculative went in.~/.pi/agent/APPEND_SYSTEM.mdis the machine-private layer foridentity.md/exe.md, deliberately not automated. Setting it up on each machine is a manual step; tell me if you'd rather it be scripted.~/.dotfilesand you runmake deploy.