Skip to content

Commit cb86121

Browse files
committed
feat: add Pi CLI package
1 parent 0de9668 commit cb86121

32 files changed

Lines changed: 6292 additions & 17 deletions

File tree

.codex/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[features]
2+
codex_hooks = true

.codex/hooks.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"hooks": {
3+
"SessionStart": [
4+
{
5+
"matcher": "startup|resume",
6+
"hooks": [
7+
{
8+
"type": "command",
9+
"command": "uvx deepwork codex-hook session_start",
10+
"statusMessage": "Loading DeepWork context"
11+
}
12+
]
13+
}
14+
],
15+
"PostToolUse": [
16+
{
17+
"matcher": "Bash",
18+
"hooks": [
19+
{
20+
"type": "command",
21+
"command": "uvx deepwork codex-hook post_tool_use",
22+
"statusMessage": "Checking DeepWork post-tool hooks"
23+
}
24+
]
25+
},
26+
{
27+
"matcher": "Write",
28+
"hooks": [
29+
{
30+
"type": "command",
31+
"command": "uvx deepwork codex-hook post_write",
32+
"statusMessage": "Validating DeepSchema after write"
33+
}
34+
]
35+
},
36+
{
37+
"matcher": "Edit",
38+
"hooks": [
39+
{
40+
"type": "command",
41+
"command": "uvx deepwork codex-hook post_edit",
42+
"statusMessage": "Validating DeepSchema after edit"
43+
}
44+
]
45+
}
46+
]
47+
}
48+
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ result
8585

8686
# Distribution / packaging
8787
*.whl
88+
node_modules/
8889

8990
# Logs
9091
*.log

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ DeepWork fixes this with two systems: **Workflows** that force agents to follow
1111
claude plugin marketplace add Unsupervisedcom/deepwork && claude plugin install deepwork@deepwork-plugins && claude "/deepwork:new_user"
1212
```
1313

14+
### Pi CLI
15+
```
16+
pi install git:github.com/Unsupervisedcom/deepwork
17+
```
18+
19+
Then start Pi in a project and run `/deepwork_setup`, followed by `/new_user`.
20+
The Pi package covers the main DeepWork workflows, reviews, DeepSchemas, and
21+
planning skills. It does not install the separate learning-agents plugin.
22+
23+
For parallel `/review` execution in Pi, optionally install
24+
`@tintinweb/pi-subagents`. DeepWork detects it lazily on the first review run and
25+
falls back to sequential reviews when it is absent.
26+
1427
The onboarding flow will introduce you to DeepWork and help you get started. Or, do the task you want to automate — just ask Claude to do it, and work with Claude to refine it as you go:
1528
```
1629
Research our top 3 competitors and write a SWOT analysis for each one.
@@ -138,7 +151,14 @@ In Claude Code:
138151
claude plugin marketplace add Unsupervisedcom/deepwork && claude plugin install deepwork@deepwork-plugins && claude "/deepwork:new_user"
139152
```
140153

141-
The onboarding flow walks you through setup. If you prefer to skip it, just start a new Claude Code session.
154+
In Pi CLI:
155+
```
156+
pi install git:github.com/Unsupervisedcom/deepwork
157+
```
158+
159+
Then run `/deepwork_setup` in your project and invoke `/new_user`.
160+
161+
The onboarding flow walks you through setup. If you prefer to skip it, start a new session in your agent CLI.
142162

143163
> **Note:** If your folder isn't a Git repo yet, run `git init` first.
144164
@@ -375,10 +395,11 @@ Use `/deepschema` for the full reference on creating and managing schemas.
375395
| Platform | Status | Notes |
376396
|----------|--------|-------|
377397
| **Claude Code** | Full Support | Recommended. Plugin-based delivery with quality hooks. |
398+
| **Pi CLI** | Full Support | Pi package with MCP adapter integration, skills, and extension hooks. |
378399
| **Gemini CLI** | Partial Support | TOML format skill, manual setup |
379400
| OpenCode | Planned | |
380401
| GitHub Copilot CLI | Planned | |
381-
| Others | Planned | We are nailing Claude and Gemini first, then adding others according to demand |
402+
| Others | Planned | We are adding platforms according to demand |
382403

383404
**Tip:** Use the terminal (Claude Code CLI), not the VS Code extension. The terminal has full feature support.
384405

doc/architecture.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ deepwork/ # DeepWork tool repository
8787
│ │ ├── discovery.py # Find .deepreview files in project tree
8888
│ │ ├── matcher.py # Git diff + glob matching + strategy grouping
8989
│ │ ├── instructions.py # Generate review instruction files
90-
│ │ ├── formatter.py # Format output for Claude Code
90+
│ │ ├── formatter.py # Format review output for agent platforms
9191
│ │ ├── mcp.py # MCP adapter for review pipeline
9292
│ │ └── schema.py # JSON schema loader
9393
│ ├── schemas/ # Definition schemas
@@ -121,8 +121,13 @@ deepwork/ # DeepWork tool repository
121121
│ │ │ └── review/SKILL.md
122122
│ │ ├── hooks/ # hooks.json, post_commit_reminder.sh, post_compact.sh, startup_context.sh, deepschema_write.sh
123123
│ │ └── .mcp.json # MCP server config
124-
│ └── gemini/ # Gemini CLI extension
125-
│ └── skills/deepwork/SKILL.md
124+
│ ├── gemini/ # Gemini CLI extension
125+
│ │ └── skills/deepwork/SKILL.md
126+
│ └── pi/ # Pi CLI package
127+
│ ├── package.json
128+
│ ├── extensions/index.ts
129+
│ ├── mcp.json.example
130+
│ └── skills/
126131
├── library/jobs/ # Reusable example jobs
127132
├── tests/ # Test suite
128133
├── doc/ # Documentation
@@ -170,7 +175,7 @@ The review command:
170175
- Matches changed files against rules using include/exclude glob patterns
171176
- Groups files by review strategy (`individual`, `matches_together`, `all_changed_files`)
172177
- Generates per-task instruction files in `.deepwork/tmp/review_instructions/`
173-
- Outputs structured text for Claude Code to dispatch parallel review agents
178+
- Outputs platform-formatted review instructions for Claude Code and Pi
174179

175180
### 4. Jobs Command (`jobs.py`)
176181

@@ -197,6 +202,7 @@ deepwork setup
197202
The setup command:
198203
- Detects Claude Code by checking for `~/.claude` directory
199204
- Configures `~/.claude/settings.json` with marketplace, plugin, MCP permissions, auto-update, and project-root-relative `Read`/`Write`/`Edit` permissions for `/.deepwork/**/*` (applies to every project)
205+
- Detects Pi CLI by checking for `~/.pi/agent` and adds the DeepWork Pi package source to `~/.pi/agent/settings.json`
200206
- Idempotent — safe to run multiple times
201207
- Preserves existing settings
202208

@@ -206,8 +212,16 @@ Platform-specific delivery is now handled by plugins in `plugins/`:
206212

207213
- **Claude Code**: `plugins/claude/` — installed as a Claude Code plugin via marketplace
208214
- **Gemini CLI**: `plugins/gemini/` — skill files copied to `.gemini/skills/`
215+
- **Pi CLI**: `plugins/pi/` — installed as a Pi package with skills, extension hooks, and MCP adapter integration
209216

210-
Each plugin contains static files (skill, hooks, MCP config) rather than generated content. The shared skill body lives in `platform/skill-body.md` as the single source of truth.
217+
Each plugin contains checked-in skills and platform integration files rather than generated content. The shared core skill body lives in `platform/skill-body.md`.
218+
219+
Pi reviews can optionally use `tintinweb/pi-subagents`. The Pi extension does
220+
not ping the subagent bus during startup; the first `/review` invocation sends a
221+
`subagents:rpc:ping` event and caches the result for the session. If the ping
222+
succeeds, each generated review task is spawned through `subagents:rpc:spawn`.
223+
If it fails or times out, the extension injects a sequential review prompt into
224+
the current session.
211225

212226
---
213227

@@ -1162,4 +1176,3 @@ deepwork serve --transport sse --port 8000
11621176
- [JSON Schema](https://json-schema.org/)
11631177
- [Model Context Protocol](https://modelcontextprotocol.io/)
11641178
- [FastMCP Documentation](https://github.com/jlowin/fastmcp)
1165-

0 commit comments

Comments
 (0)