Skip to content

Add first-class Pi support#404

Open
Jrakru wants to merge 1 commit intosafishamsi:v4from
Jrakru:v4
Open

Add first-class Pi support#404
Jrakru wants to merge 1 commit intosafishamsi:v4from
Jrakru:v4

Conversation

@Jrakru
Copy link
Copy Markdown

@Jrakru Jrakru commented Apr 16, 2026

Summary

This PR adds first-class support for Pi (@mariozechner/pi-coding-agent).

It adds:

  • graphify install --platform pi to install Graphify into Pi's global skill directory
  • graphify pi install / graphify pi uninstall for project-level Pi integration
  • a dedicated packaged skill-pi.md
  • a .pi/prompts/graphify.md alias so /graphify works naturally inside Pi projects
  • README and install-test coverage for the Pi flow

Why

Pi has a different customization model than the harnesses already supported here. In particular, it uses:

  • global skills in ~/.pi/agent/skills/
  • project AGENTS.md
  • prompt templates in .pi/prompts/

This PR integrates Graphify with those native Pi entry points directly rather than adapting another platform's skill at install time.

That keeps the feature predictable for Pi users and keeps the implementation easier to review and maintain.

Design Notes

A few choices here were intentional:

  • Pi gets a dedicated skill-pi.md rather than runtime rewriting of another platform's skill file.
    • This makes the behavior explicit in the repo and avoids hidden install-time transformations.
  • graphify install --platform pi supports the minimal global-skill flow via /skill:graphify.
  • graphify pi install adds the project-level pieces needed for a more natural Pi experience:
    • AGENTS.md
    • .pi/prompts/graphify.md
    • /graphify as a prompt-template alias inside the project

So the PR supports both:

  • a lightweight global install
  • a more ergonomic project-local setup

User Impact

After this change, Pi users can either:

graphify install --platform pi

and run Graphify via:

/skill:graphify .

or run:

graphify pi install

to get:

  • the global Pi skill
  • project AGENTS.md guidance
  • a .pi/prompts/graphify.md alias so /graphify works inside the project

Verification

I verified the change with:

  • pytest tests/test_install.py -q
  • python -m py_compile graphify/__main__.py tests/test_install.py
  • graphify update .

Scope

This PR is intentionally narrow:

  • installer wiring
  • one new Pi-specific skill file
  • docs
  • tests

I avoided broader refactors so the Pi support can be reviewed on its own.

Copilot AI review requested due to automatic review settings April 16, 2026 16:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds first-class integration for the Pi coding agent (@mariozechner/pi-coding-agent) by introducing a Pi-specific skill file, installer wiring, project-local prompt alias support, and corresponding documentation/tests.

Changes:

  • Add Pi as an installable platform (graphify install --platform pi) targeting ~/.pi/agent/skills/graphify/.
  • Add project-level Pi commands (graphify pi install|uninstall) to manage AGENTS.md and a .pi/prompts/graphify.md alias for /graphify.
  • Package skill-pi.md and expand README + install tests to cover the Pi flow.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
graphify/__main__.py Adds Pi platform config and pi install/uninstall command handling, plus prompt-alias management.
graphify/skill-pi.md Introduces a dedicated Pi skill document.
tests/test_install.py Adds install + project integration tests for Pi and includes skill-pi.md in package checks.
pyproject.toml Adds Pi to description/keywords and includes skill-pi.md in package data.
README.md Documents Pi install and project integration workflows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread graphify/skill-pi.md
Comment on lines +79 to +84
**In every subsequent bash block, replace `python3` with `$(cat .graphify_python)` to use the correct interpreter.**

### Step 2 - Detect files

```bash
$(cat .graphify_python) -c "
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Step 1 writes the interpreter path to graphify-out/.graphify_python, but Step 2 (and many later bash blocks) run $(cat .graphify_python) .... As written, cat .graphify_python will fail and all subsequent commands will use the wrong interpreter. Make the path consistent by either writing .graphify_python in the project root, or updating every $(cat .graphify_python) reference to $(cat graphify-out/.graphify_python).

Suggested change
**In every subsequent bash block, replace `python3` with `$(cat .graphify_python)` to use the correct interpreter.**
### Step 2 - Detect files
```bash
$(cat .graphify_python) -c "
**In every subsequent bash block, replace `python3` with `$(cat graphify-out/.graphify_python)` to use the correct interpreter.**
### Step 2 - Detect files
```bash
$(cat graphify-out/.graphify_python) -c "

Copilot uses AI. Check for mistakes.
Comment thread graphify/skill-pi.md
Comment on lines +83 to +91
```bash
$(cat .graphify_python) -c "
import json
from graphify.detect import detect
from pathlib import Path
result = detect(Path('INPUT_PATH'))
print(json.dumps(result))
" > .graphify_detect.json
```
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Step 2 writes detect output to .graphify_detect.json in the project root, but Step 2.5 reads graphify-out/.graphify_detect.json for transcription. That mismatch will break video/audio transcription on Pi. Align the detect output location and all subsequent reads to a single path (preferably under graphify-out/ like other artifacts).

Copilot uses AI. Check for mistakes.
Comment thread graphify/skill-pi.md
Comment on lines +194 to +198
**Fast path:** If detection found zero docs, papers, and images (code-only corpus), skip Part B entirely and go straight to Part C. AST handles code - there is nothing for semantic subagents to do.

> **Pi platform:** Multi-agent support is still early on Pi. Extraction runs sequentially — you read and extract each file yourself. This is slower than parallel platforms but fully reliable.

Print: `"Semantic extraction: N files (sequential — Pi)"`
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section still instructs semantic extraction via parallel subagents, but the Pi note says extraction is sequential (no multi-agent). That’s contradictory guidance for Pi and can cause the wrong workflow to be followed. Gate the subagent/parallel instructions to non-Pi platforms, or rewrite Part B here to describe only the sequential Pi flow.

Copilot uses AI. Check for mistakes.
Comment thread graphify/__main__.py
Comment on lines +936 to +940
def _pi_install(project_dir: Path | None = None) -> None:
"""Install graphify for Pi: global skill + local AGENTS + /graphify prompt alias."""
install(platform="pi")
_agents_install(project_dir or Path("."), "pi")

Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_pi_install() calls install(platform="pi"), which prints the post-install hint "For a native /graphify alias inside a project, run: graphify pi install". When the user is already running graphify pi install, this becomes confusing/self-referential output. Consider refactoring install() to allow suppressing the Pi-specific hint when invoked from _pi_install(), or extract a lower-level "copy skill file" helper that _pi_install() can call without the interactive guidance prints.

Copilot uses AI. Check for mistakes.
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.

2 participants