feat(targets): add Pi coding agent target - #2907
Open
Abhishek Sharma (abhishekbiyala) wants to merge 1 commit into
Open
feat(targets): add Pi coding agent target#2907Abhishek Sharma (abhishekbiyala) wants to merge 1 commit into
Abhishek Sharma (abhishekbiyala) wants to merge 1 commit into
Conversation
Copilot started reviewing on behalf of
Abhishek Sharma (abhishekbiyala)
September 8, 2026 17:38
View session
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new pi target profile is missing pack_prefixes for its dual-root layout and the changelog entry is missing the PR number.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a new first-class pi target to the APM CLI, modeling Pi coding agent deployment/detection and documenting its supported primitives and conventions.
Changes:
- Added
pito the target capability catalog and native target profiles, including.pi/auto-detection and theagentscompile family. - Implemented Pi’s target profile mappings: skills converge to
.agents/skills/(project) and commands deploy to.pi/prompts/. - Added/updated unit tests, documentation pages, and an Unreleased changelog entry to reflect the new target.
File summaries
| File | Description |
|---|---|
src/apm_cli/core/target_catalog.py |
Registers the pi target capability in the catalog. |
src/apm_cli/integration/targets.py |
Adds the pi TargetProfile (primitive mappings, scope behavior, detection settings). |
src/apm_cli/core/target_detection.py |
Adds .pi/ as a detection signal and updates target display/deploy metadata. |
tests/unit/integration/test_pi_target.py |
New acceptance-style unit tests covering Pi profile layout and primitive deployment behavior. |
tests/unit/integration/test_dep_target_intersection.py |
Fixes a substring-based leak assertion that became problematic with short target names like pi. |
tests/unit/integration/test_data_driven_dispatch.py |
Updates bucket/partition characterization to include commands_pi. |
tests/unit/core/test_target_catalog.py |
Updates characterized target sets and adds Pi native profile expectations. |
tests/unit/core/test_scope.py |
Updates known-target assertions to include pi. |
docs/src/content/docs/reference/targets-matrix.md |
Documents Pi in the targets matrix, including detection, deploy roots, and primitive support. |
docs/src/content/docs/concepts/primitives-and-targets.md |
Updates conceptual docs and matrices to include Pi as a target. |
CHANGELOG.md |
Adds an Unreleased entry describing the new Pi target. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+705
to
+708
| "pi": TargetProfile( | ||
| capability=TARGET_CAPABILITIES["pi"], | ||
| root_dir=".pi", | ||
| primitives={ |
|
|
||
| ### Added | ||
|
|
||
| - Added `pi` as a first-class target for the Pi coding agent (`@earendil-works/pi-coding-agent`). Skills converge on the cross-tool `.agents/skills/` directory and prompt templates deploy to `.pi/prompts/` as `/name` slash commands (reusing the Claude command transform). Pi auto-detects on a `.pi/` directory, is included in `--target all`, and compiles to the `AGENTS.md` family. Instructions are compile-only and Pi exposes no native agents or hooks primitives. |
|
|
||
|
|
||
| def _make_command_package(project_root: Path, prompts: dict[str, str]) -> MagicMock: | ||
| """Create a package on disk with ``.apm/prompts/*.md`` command sources.""" |
Add `pi` as a first-class APM target for the Pi coding agent (@earendil-works/pi-coding-agent), following the opencode/kiro/codex pattern: one TARGET_CAPABILITIES entry plus one KNOWN_TARGETS profile. Pi's loadable project resources (verified against the shipped dist core/resource-loader.js) are skills, prompt templates, themes, and extensions -- there is no native agent-definition directory. Accordingly the profile exposes only: - skills: converge on the cross-tool .agents/skills/<name>/SKILL.md (Pi natively reads both .pi/skills/ and .agents/skills/); user scope resolves to ~/.pi/agent/skills/. - commands: Pi prompt templates (/name slash commands) deploy to .pi/prompts/ reusing the shared claude_command transformer, since Pi's description/argument-hint frontmatter and $1/$@/$ARGUMENTS substitution match Claude commands exactly. Instructions are compile-only (Pi reads AGENTS.md -> compile_family "agents"); Pi has no hooks concept. MCP wiring is deferred to a follow-up. Pi auto-detects on a .pi/ directory and is included in --target all. Also fix a latent substring-collision in the copilot per-file routing test: "pi" is a substring of "copilot", so the leak assertion is tightened to match the delimited source marker (pkg-<target>-) instead. Adds tests/unit/integration/test_pi_target.py and updates the target characterization goldens, the targets matrix, and the primitives-and- targets concept doc.
Abhishek Sharma (abhishekbiyala)
force-pushed
the
feat/pi-target
branch
from
September 8, 2026 18:01
df01cd9 to
a02aa79
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.
Fixes #2908
Description
Adds
pias a first-class APM target for the Pi coding agent (@earendil-works/pi-coding-agent), following the exact opencode/kiro/codex pattern — oneTARGET_CAPABILITIESentry plus oneKNOWN_TARGETSprofile, no new classes.Pi is an actively-used harness that currently has no APM target, so its users have no manifest/lockfile/upgrade story for agent context. This closes that gap.
What was added
pi: project root.pi/, user scope~/.pi/agent/,compile_family="agents"(Pi readsAGENTS.md),in_all=True, auto-detected on a.pi/directory.dist/core/resource-loader.jsanddist/config.js, not inferred):.agents/skills/<name>/SKILL.md(skill_standard, verbatim), matching codex/opencode/gemini. Pi natively reads both.pi/skills/and.agents/skills/. User scope resolves to~/.pi/agent/skills/./nameslash commands) deploy to.pi/prompts/<name>.mdvia the existing sharedclaude_commandtransformer, justified because Pi'sdescription/argument-hintfrontmatter and$1/$@/$ARGUMENTSsubstitution are identical to Claude commands.AGENTS.md); not an installed primitive.agentsprimitive: Pi has no native agent-definition directory. Sub-agents are an extension capability, not markdown files —disthas no.pi/agentsloader. Because no agent files are deployed, no frontmatter transform is required (unlike OpenCode).hooks(extensions cover that). MCP wiring deferred to a follow-up (needs a PiMCPClientAdapterfor.pi/settings.json).Type of change
Testing
uv run --frozen pytest tests/unit tests/test_console.py→ 22303 passed, 43 skipped, 21 xfailedtests/unit/integration/test_pi_target.py(7 tests); characterization goldens updated intest_scope.py,test_target_catalog.py,test_data_driven_dispatch.py; fixed a latent"pi"⊂"copilot"substring collision in a parametrized leak assertion intest_dep_target_intersection.pyuv run --frozen pytest tests/integration/test_target_resolution_e2e.py tests/integration/test_primitive_target_covering_array.py→ 35 passed, 11 precondition-skippedruff check+ruff format --checkonsrc/andtests/→ cleanapm targetsin a.pi/dir reports Pi active (deploy dir.pi/);apm install --target pideploys a skill to.agents/skills/✅Files changed
src/apm_cli/core/target_catalog.py—picapabilitysrc/apm_cli/integration/targets.py—piTargetProfilesrc/apm_cli/core/target_detection.py—.pi/detection signal + display/deploy/signal dictstests/unit/integration/test_pi_target.py— newtests/unit/core/test_scope.py,tests/unit/core/test_target_catalog.py,tests/unit/integration/test_data_driven_dispatch.py,tests/unit/integration/test_dep_target_intersection.py— goldens/assertions updateddocs/.../reference/targets-matrix.md,docs/.../concepts/primitives-and-targets.md,CHANGELOG.mdSpec conformance (OpenAPM v0.1)