Files
planning-with-files/docs/pi-agent.md
T
OthmanAdi ad1b6927e8 fix: take first-party ownership of the npm channel (#213)
The documented Pi install pointed at npm packages the maintainer does not
control: README and .pi docs at @tomxprime/planning-with-files (published
once at 1.1.0 on 2026-05-22, 15 releases behind), docs/pi-agent.md at
pi-planning-with-files (published from a fork at 1.0.1 on 2026-02-04).
Neither can be refreshed from this repo, so the canonical Pi install
handed users a stale snapshot.

Changes:
- .pi/skills/planning-with-files/package.json renamed to the unscoped
  planning-with-files, version 3.9.0, matching the repo release.
- package.json files list gains negation patterns so node_modules,
  __pycache__ and the extension package-lock never enter the tarball
  (a dry-run pack from this machine was 179 MB unpacked without them,
  66 kB with).
- Bundled extension package renamed planning-with-files-pi-extension;
  lock file name and version synced (was stale at 1.1.0 vs 1.2.3).
- All live install docs point at pi install npm:planning-with-files.
- bump-version.py and test_skill_md_version_parity.py add the npm
  package.json to the parity set (19 entries) so the npm version can
  never silently drift from a release again. Publishing stays a manual
  per-release step, documented in AGENTS.md.
2026-08-03 11:28:29 +02:00

144 lines
3.4 KiB
Markdown

# Pi Agent Setup
How to use planning-with-files with [Pi Coding Agent](https://pi.dev).
---
## Installation
### Recommended: Install from npm
```bash
pi install npm:planning-with-files
```
This package now installs **both**:
- Skill: `planning-with-files` (3-file planning workflow)
- Extension: `planning-with-files` hook parity runtime
### Manual Install (repo copy)
```bash
# Clone repo
git clone https://github.com/OthmanAdi/planning-with-files.git
cd planning-with-files
# Copy skill package into your Pi skills directory
mkdir -p ~/.pi/agent/skills/planning-with-files
cp -r .pi/skills/planning-with-files/* ~/.pi/agent/skills/planning-with-files/
```
---
## What Pi Now Supports
Pi integration provides Claude-style lifecycle behavior via extension events:
- Session catchup on `session_start`
- Passive plan status before approval
- Plan context reminder/injection on `before_agent_start` after `/plan-execute`
- Pre-tool plan recitation equivalent on `tool_call` after `/plan-execute`
- Post-write reminders on `tool_result` after `/plan-execute`
- Auto-continue guard on `agent_end` after `/plan-execute` (limit: 3)
- Pre-compaction reminder on `session_before_compact`
- Plan attestation guard (`[PLAN TAMPERED — injection blocked]`)
---
## Mode System (DeepSeek-aware)
The extension supports four modes:
- `auto` (default):
- DeepSeek model -> `cache-safe`
- Other models -> `parity`
- `parity`: maximum Claude-equivalent behavior (dynamic plan injection)
- `cache-safe`: stable fixed reminder for better DeepSeek KV-cache hit rate
- `notify`: UI notifications only, no conversation injection
### Configure via environment variable
```bash
PWF_MODE=auto pi
PWF_MODE=parity pi
PWF_MODE=cache-safe pi
PWF_MODE=notify pi
```
### Configure via settings
Project-level (`.pi/settings.json`) overrides global (`~/.pi/agent/settings.json`):
```json
{
"planningWithFiles": {
"mode": "auto"
}
}
```
---
## Commands
After installation, these extension commands are available:
- `/plan-status` — show current plan counts and paths
- `/plan-attest [--show|--clear]` — manage plan SHA-256 attestation
- `/plan-execute` — approve the active plan and enable hook activation
- `/plan-execute reset` — return the active plan to passive review mode
- `/plan-goal <text|default|clear>` — set/clear continuation goal text
- `/plan-loop [10m] [prompt...]` — periodic planning tick; use `stop` to cancel
---
## Usage
Start with:
```bash
/skill:planning-with-files
```
Then ask Pi to create/update:
- `task_plan.md`
- `findings.md`
- `progress.md`
Review and edit the plan until it matches your intent. During this review
stage, the extension stays passive: it may show plan status, but it does not
inject plan context, recite the plan before tools, or auto-continue.
When you are ready to execute, run:
```text
/plan-execute
```
For long tasks, keep `task_plan.md` as the source of truth and let the activated
hooks/extension events enforce the loop.
---
## Troubleshooting
1. Confirm package installed:
```bash
pi list
```
2. Reload runtime:
```bash
/reload
```
3. Check skill and extension paths:
- skill: `.pi/skills/planning-with-files/`
- extension: `extensions/planning-with-files/index.ts`
4. If plan injection is blocked, run:
```bash
/plan-attest --show
```
Then re-attest intentionally changed plans:
```bash
/plan-attest
```