supipowers 1.0.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +152 -60
- package/bin/.omp/SYSTEM.md +77 -0
- package/bin/.omp/supipowers/sessions/events.db +0 -0
- package/bin/.omp/supipowers/sessions/events.db-shm +0 -0
- package/bin/.omp/supipowers/sessions/events.db-wal +0 -0
- package/bin/ctx-mode-wrapper.mjs +3 -3
- package/bin/install.ts +1 -1
- package/bin/local-install.sh +39 -0
- package/package.json +14 -22
- package/skills/planning/SKILL.md +8 -5
- package/skills/qa-strategy/SKILL.md +86 -63
- package/skills/release/SKILL.md +65 -0
- package/src/bootstrap.ts +20 -8
- package/src/commands/commit.ts +44 -0
- package/src/commands/config.ts +12 -48
- package/src/commands/context.ts +117 -0
- package/src/commands/doctor.ts +1 -2
- package/src/commands/fix-pr.ts +33 -41
- package/src/commands/mcp.ts +121 -3
- package/src/commands/model-picker.ts +339 -0
- package/src/commands/model.ts +247 -0
- package/src/commands/plan.ts +22 -0
- package/src/commands/qa.ts +9 -39
- package/src/commands/release.ts +498 -29
- package/src/commands/review.ts +18 -0
- package/src/commands/status.ts +9 -26
- package/src/commands/supi.ts +2 -5
- package/src/config/defaults.ts +1 -19
- package/src/config/loader.ts +13 -4
- package/src/config/model-config.ts +116 -0
- package/src/config/model-registry-instance.ts +4 -0
- package/src/config/model-registry.ts +58 -0
- package/src/config/model-resolver.ts +113 -0
- package/src/context/analyzer.ts +316 -0
- package/src/deps/registry.ts +30 -10
- package/src/fix-pr/bot-detector.ts +41 -0
- package/src/fix-pr/scripts/fetch-pr-comments.sh +2 -2
- package/src/fix-pr/types.ts +1 -0
- package/src/git/commit-msg-hook.ts +21 -0
- package/src/git/commit-msg.ts +53 -0
- package/src/git/commit.ts +659 -0
- package/src/git/conventions.ts +215 -0
- package/src/git/status.ts +27 -0
- package/src/global.d.ts +5 -0
- package/src/index.ts +1 -7
- package/src/mcp/config.ts +80 -1
- package/src/mcp/docs.ts +1 -1
- package/src/mcp/types.ts +14 -0
- package/src/planning/approval-flow.ts +166 -0
- package/src/planning/plan-writer-prompt.ts +6 -5
- package/src/planning/prompt-builder.ts +6 -5
- package/src/platform/detect.ts +4 -6
- package/src/platform/omp.ts +36 -15
- package/src/platform/test-utils.ts +17 -17
- package/src/platform/types.ts +19 -6
- package/src/qa/config.ts +0 -1
- package/src/qa/prompt-builder.ts +47 -24
- package/src/qa/scripts/run-e2e-tests.sh +46 -14
- package/src/qa/types.ts +0 -1
- package/src/release/changelog.ts +173 -0
- package/src/release/commit-types.ts +35 -0
- package/src/release/detector.ts +69 -0
- package/src/release/executor.ts +172 -0
- package/src/release/prompt.ts +71 -0
- package/src/release/version.ts +81 -0
- package/src/storage/plans.ts +7 -11
- package/src/types.ts +84 -54
- package/src/commands/run.ts +0 -344
- package/src/orchestrator/agent-grid.ts +0 -439
- package/src/orchestrator/agent-prompts.ts +0 -290
- package/src/orchestrator/batch-scheduler.ts +0 -59
- package/src/orchestrator/conflict-resolver.ts +0 -39
- package/src/orchestrator/dispatcher.ts +0 -458
- package/src/orchestrator/progress-renderer.ts +0 -172
- package/src/orchestrator/prompts.ts +0 -149
- package/src/orchestrator/result-collector.ts +0 -72
- package/src/orchestrator/run-progress.ts +0 -78
- package/src/platform/pi.ts +0 -46
- package/src/qa/scripts/ensure-playwright.sh +0 -38
- package/src/release/analyzer.ts +0 -22
- package/src/release/notes.ts +0 -26
- package/src/release/publisher.ts +0 -33
- package/src/storage/runs.ts +0 -126
- package/src/types/bun-sqlite.d.ts +0 -24
package/README.md
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
-
<img width="1584" height="672" alt="
|
|
1
|
+
<img width="1584" height="672" alt="supipowers" src="https://github.com/user-attachments/assets/ec0f3658-54d7-4471-91ba-39297191f055" />
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
2
4
|
|
|
3
5
|
# Supipowers
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
[](https://www.npmjs.com/package/supipowers)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
|
|
10
|
+
Agentic workflows for [Pi](https://github.com/mariozechner/pi-coding-agent) and [OMP](https://github.com/can1357/oh-my-pi) coding agents.
|
|
11
|
+
Plan features, orchestrate sub-agents, run quality gates, fix PRs, manage MCP servers, and ship releases. All from slash commands.
|
|
12
|
+
|
|
13
|
+
[Install](#install) · [Commands](#commands) · [How it works](#how-it-works) · [Configuration](#configuration) · [Development](#development)
|
|
14
|
+
|
|
15
|
+
</div>
|
|
6
16
|
|
|
7
17
|
## Install
|
|
8
18
|
|
|
@@ -10,33 +20,64 @@ Agentic workflows for [OMP](https://github.com/can1357/oh-my-pi). Plan features,
|
|
|
10
20
|
bunx supipowers@latest
|
|
11
21
|
```
|
|
12
22
|
|
|
13
|
-
The installer
|
|
14
|
-
|
|
15
|
-
Re-running the installer updates supipowers if a newer version is available. Already up-to-date installs are detected and skipped.
|
|
23
|
+
The installer detects which agent you're running (Pi or OMP), copies supipowers into the right directory, and optionally sets up LSP servers for better code intelligence. Re-running the installer upgrades to the latest version if one is available.
|
|
16
24
|
|
|
17
|
-
### Update from inside
|
|
25
|
+
### Update from inside your agent
|
|
18
26
|
|
|
19
27
|
```
|
|
20
28
|
/supi:update
|
|
21
29
|
```
|
|
22
30
|
|
|
23
|
-
Checks npm for the latest version, downloads and installs it
|
|
31
|
+
Checks npm for the latest version, downloads and installs it. No prompts, no restart needed.
|
|
24
32
|
|
|
25
|
-
##
|
|
33
|
+
## Requirements
|
|
34
|
+
|
|
35
|
+
### Required
|
|
36
|
+
|
|
37
|
+
| Dependency | What it's for |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| [Pi](https://github.com/mariozechner/pi-coding-agent) or [OMP](https://github.com/can1357/oh-my-pi) | The coding agent that supipowers extends |
|
|
40
|
+
| [Bun](https://bun.sh) | Runtime (provides bun:sqlite with FTS5 for full-text search) |
|
|
41
|
+
| [Git](https://git-scm.com) | Version control (used by the installer and context-mode setup) |
|
|
42
|
+
|
|
43
|
+
### Optional
|
|
44
|
+
|
|
45
|
+
The installer scans for these and offers to install any that are missing. Everything works without them, but each one unlocks additional capabilities.
|
|
46
|
+
|
|
47
|
+
| Dependency | Category | What it enables | Install command |
|
|
48
|
+
| --- | --- | --- | --- |
|
|
49
|
+
| [mcpc](https://github.com/apify/mcpc) | MCP | MCP server management via `/supi:mcp` | `npm install -g @apify/mcpc` |
|
|
50
|
+
| [context-mode](https://github.com/mksglu/context-mode) | MCP | Context window protection (auto-routes large outputs through sandboxed execution) | Installed as extension via `git clone` + `npm install` |
|
|
51
|
+
| [typescript-language-server](https://github.com/typescript-language-server/typescript-language-server) | LSP | TypeScript/JavaScript diagnostics, references, completions | `bun add -g typescript-language-server typescript` |
|
|
52
|
+
| [Pyright](https://github.com/microsoft/pyright) | LSP | Python type checking and language features | `pip install pyright` |
|
|
53
|
+
| [rust-analyzer](https://rust-analyzer.github.io) | LSP | Rust language server | `rustup component add rust-analyzer` |
|
|
54
|
+
| [gopls](https://pkg.go.dev/golang.org/x/tools/gopls) | LSP | Go language server | `go install golang.org/x/tools/gopls@latest` |
|
|
55
|
+
| [playwright-cli](https://github.com/microsoft/playwright-cli) | Testing | Interactive browser exploration for E2E flow discovery via `/supi:qa --e2e` | `npm install -g @playwright/cli@latest` |
|
|
56
|
+
| [Playwright Test](https://playwright.dev) | Testing | Test runner for E2E test execution via `run-e2e-tests.sh` | `npm install -g @playwright/cli@latest` |
|
|
26
57
|
|
|
27
|
-
|
|
28
|
-
| ---------------- | ------------------------------------------------ |
|
|
29
|
-
| `/supi` | Interactive menu — commands and project status |
|
|
30
|
-
| `/supi:plan` | Collaborative planning with task breakdown |
|
|
31
|
-
| `/supi:run` | Execute a plan with parallel sub-agents |
|
|
32
|
-
| `/supi:review` | Quality gates at chosen depth |
|
|
33
|
-
| `/supi:qa` | Run test suite and E2E pipeline |
|
|
34
|
-
| `/supi:release` | Version bump, release notes, publish |
|
|
35
|
-
| `/supi:config` | Interactive settings (TUI) |
|
|
36
|
-
| `/supi:status` | Check running sub-agents and progress |
|
|
37
|
-
| `/supi:update` | Update supipowers to latest version |
|
|
58
|
+
LSP servers are language-specific. You only need the ones matching the languages in your project. Sub-agents use them to check diagnostics and find references before making changes.
|
|
38
59
|
|
|
39
|
-
|
|
60
|
+
> [!TIP]
|
|
61
|
+
> Run `/supi:doctor` at any time to check which dependencies are installed and which are missing.
|
|
62
|
+
|
|
63
|
+
## Commands
|
|
64
|
+
|
|
65
|
+
| Command | What it does |
|
|
66
|
+
| --------------- | ----------------------------------------------------- |
|
|
67
|
+
| `/supi` | Interactive menu with commands and project status |
|
|
68
|
+
| `/supi:plan` | Collaborative planning with structured task breakdown |
|
|
69
|
+
| `/supi:run` | Execute a plan with parallel sub-agents |
|
|
70
|
+
| `/supi:review` | Quality gates at chosen depth |
|
|
71
|
+
| `/supi:qa` | E2E testing pipeline with playwright-cli |
|
|
72
|
+
| `/supi:release` | Version bump, release notes, publish |
|
|
73
|
+
| `/supi:fix-pr` | Assess and fix PR review comments |
|
|
74
|
+
| `/supi:mcp` | Manage MCP servers (connect, disconnect, list) |
|
|
75
|
+
| `/supi:config` | Interactive settings (TUI) |
|
|
76
|
+
| `/supi:status` | Check running sub-agents and progress |
|
|
77
|
+
| `/supi:doctor` | Diagnose extension health and configuration |
|
|
78
|
+
| `/supi:update` | Update supipowers to latest version |
|
|
79
|
+
|
|
80
|
+
Commands like `/supi`, `/supi:config`, `/supi:status`, and `/supi:update` open native TUI dialogs. They don't send chat messages or trigger the AI.
|
|
40
81
|
|
|
41
82
|
### Planning
|
|
42
83
|
|
|
@@ -44,7 +85,7 @@ Commands like `/supi`, `/supi:config`, `/supi:status`, and `/supi:update` open n
|
|
|
44
85
|
/supi:plan add authentication to the API
|
|
45
86
|
```
|
|
46
87
|
|
|
47
|
-
Starts an interactive
|
|
88
|
+
Starts an interactive session: clarifying questions, approach proposals, then a structured task breakdown saved to `.omp/supipowers/plans/` (or the Pi equivalent).
|
|
48
89
|
|
|
49
90
|
For simple tasks, skip the brainstorming:
|
|
50
91
|
|
|
@@ -60,7 +101,7 @@ For simple tasks, skip the brainstorming:
|
|
|
60
101
|
|
|
61
102
|
Loads the latest plan and executes it with sub-agent orchestration. Tasks marked `[parallel-safe]` run concurrently (up to the configured limit). Sequential tasks respect their dependency chains.
|
|
62
103
|
|
|
63
|
-
The orchestration loop: dispatch batch
|
|
104
|
+
The orchestration loop: dispatch batch, collect results, detect conflicts, retry failures, next batch. If interrupted, re-running picks up where it left off.
|
|
64
105
|
|
|
65
106
|
### Quality review
|
|
66
107
|
|
|
@@ -81,7 +122,16 @@ When no flag is provided, a TUI picker lets you choose the review profile intera
|
|
|
81
122
|
/supi:qa --e2e # Playwright / E2E only
|
|
82
123
|
```
|
|
83
124
|
|
|
84
|
-
Detects your test framework on first run (vitest, jest, pytest, cargo test, go test) and caches it. When no flag is provided, a TUI picker lets you choose the scope.
|
|
125
|
+
Detects your test framework on first run (vitest, jest, pytest, cargo test, go test) and caches it. E2E mode (`--e2e`) uses `playwright-cli` to run browser tests autonomously. When no flag is provided, a TUI picker lets you choose the scope.
|
|
126
|
+
|
|
127
|
+
### Fix PR
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
/supi:fix-pr # auto-detects current branch PR
|
|
131
|
+
/supi:fix-pr 42 # targets PR #42
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Pulls review comments from GitHub, assesses each one (some comments deserve pushback, not code changes), then fixes what needs fixing. Tracks sessions so you can pick up where you left off.
|
|
85
135
|
|
|
86
136
|
### Release
|
|
87
137
|
|
|
@@ -91,13 +141,35 @@ Detects your test framework on first run (vitest, jest, pytest, cargo test, go t
|
|
|
91
141
|
|
|
92
142
|
Analyzes commits since last tag, suggests a version bump, generates release notes, and publishes. On first run, a TUI picker lets you choose your pipeline (npm, GitHub release, or manual).
|
|
93
143
|
|
|
144
|
+
### MCP servers
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
/supi:mcp
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Register, connect, and manage MCP (Model Context Protocol) servers through supipowers. Each server gets auto-generated trigger rules so the agent knows when to use its tools without being told explicitly.
|
|
151
|
+
|
|
152
|
+
## How it works
|
|
153
|
+
|
|
154
|
+
Supipowers runs as an extension inside Pi or OMP. A platform abstraction layer handles the API differences between the two agents, so every command works the same regardless of which agent you're using.
|
|
155
|
+
|
|
156
|
+
**Sub-agent orchestration.** Plans are broken into batches of parallel-safe tasks. Each batch dispatches sub-agents with full tool access (file editing, bash, LSP). After a batch completes, the orchestrator checks for file conflicts, retries failures, and moves to the next batch.
|
|
157
|
+
|
|
158
|
+
**Quality gates.** Composable checks selected by profile. LSP diagnostics surface real type errors. AI review catches logic issues. Test gates run your actual test suite. Gates report issues with severity levels (error, warning, info).
|
|
159
|
+
|
|
160
|
+
**LSP integration.** Sub-agents query LSP before making changes (find references, check diagnostics). If no LSP is active, everything still works, just with less precision. The installer offers to set up LSP servers during installation.
|
|
161
|
+
|
|
162
|
+
**Context-mode integration.** When the [context-mode](https://github.com/ogrodev/context-mode) MCP server is detected, supipowers injects routing hooks that protect the agent's context window. Large command outputs, file reads, and HTTP calls are automatically routed through sandboxed execution so only summaries enter the conversation.
|
|
163
|
+
|
|
164
|
+
**Update checking.** On session start, supipowers checks npm for a newer version in the background. If one is available, a notification tells you to run `/supi:update`.
|
|
165
|
+
|
|
94
166
|
## Configuration
|
|
95
167
|
|
|
96
168
|
```
|
|
97
169
|
/supi:config
|
|
98
170
|
```
|
|
99
171
|
|
|
100
|
-
Opens an interactive settings screen
|
|
172
|
+
Opens an interactive settings screen. Select a setting to change its value: toggles flip instantly, selects open a picker, text fields open an input dialog.
|
|
101
173
|
|
|
102
174
|
### Profiles
|
|
103
175
|
|
|
@@ -118,65 +190,83 @@ Create custom profiles in `.omp/supipowers/profiles/`.
|
|
|
118
190
|
"defaultProfile": "thorough",
|
|
119
191
|
"orchestration": {
|
|
120
192
|
"maxParallelAgents": 3, // concurrent sub-agents per batch
|
|
121
|
-
"maxFixRetries": 2,
|
|
122
|
-
"maxNestingDepth": 2,
|
|
123
|
-
"modelPreference": "auto"
|
|
193
|
+
"maxFixRetries": 2, // retry failed tasks
|
|
194
|
+
"maxNestingDepth": 2, // sub-agent nesting limit
|
|
195
|
+
"modelPreference": "auto",
|
|
124
196
|
},
|
|
125
197
|
"lsp": {
|
|
126
|
-
"setupGuide": true
|
|
198
|
+
"setupGuide": true,
|
|
127
199
|
},
|
|
128
200
|
"qa": {
|
|
129
201
|
"framework": null, // auto-detected and cached
|
|
130
|
-
"command": null
|
|
131
|
-
}
|
|
202
|
+
"command": null,
|
|
203
|
+
},
|
|
132
204
|
}
|
|
133
205
|
```
|
|
134
206
|
|
|
135
|
-
Config
|
|
136
|
-
|
|
137
|
-
## How it works
|
|
207
|
+
Config lives in `~/.omp/agent/extensions/supipowers/` (OMP) or `~/.pi/agent/extensions/supipowers/` (Pi) and is managed entirely through `/supi:config`.
|
|
138
208
|
|
|
139
|
-
|
|
209
|
+
## Skills
|
|
140
210
|
|
|
141
|
-
|
|
211
|
+
Supipowers ships with prompt skills that commands load at runtime to steer AI sessions:
|
|
142
212
|
|
|
143
|
-
|
|
213
|
+
| Skill | Used by |
|
|
214
|
+
| ----------------------- | -------------------------------------- |
|
|
215
|
+
| `planning` | `/supi:plan` |
|
|
216
|
+
| `code-review` | `/supi:review` |
|
|
217
|
+
| `debugging` | Failure retry loop |
|
|
218
|
+
| `qa-strategy` | `/supi:qa` |
|
|
219
|
+
| `fix-pr` | `/supi:fix-pr` |
|
|
220
|
+
| `tdd` | Plan tasks with test-first annotations |
|
|
221
|
+
| `verification` | Pre-completion checks |
|
|
222
|
+
| `receiving-code-review` | Review comment assessment |
|
|
223
|
+
| `context-mode` | Context-mode routing hooks |
|
|
144
224
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
**Update checking**: On session start, supipowers checks npm for a newer version in the background. If one is available, a notification tells you to run `/supi:update`.
|
|
225
|
+
Skills are markdown files in `skills/`. They're loaded on demand, not bundled at build time.
|
|
148
226
|
|
|
149
227
|
## Project structure
|
|
150
228
|
|
|
151
229
|
```
|
|
152
230
|
src/
|
|
153
|
-
index.ts # extension entry
|
|
154
|
-
|
|
231
|
+
index.ts # extension entry + platform detection
|
|
232
|
+
bootstrap.ts # command registration orchestrator
|
|
233
|
+
platform/ # dual-platform abstraction (Pi + OMP)
|
|
234
|
+
detect.ts, types.ts, pi.ts, omp.ts
|
|
235
|
+
commands/ # one file per slash command
|
|
155
236
|
supi.ts, plan.ts, run.ts, review.ts, qa.ts, release.ts,
|
|
156
|
-
config.ts, status.ts, update.ts
|
|
237
|
+
fix-pr.ts, mcp.ts, config.ts, status.ts, doctor.ts, update.ts
|
|
157
238
|
orchestrator/ # sub-agent dispatch & coordination
|
|
158
239
|
batch-scheduler.ts, dispatcher.ts, result-collector.ts,
|
|
159
240
|
conflict-resolver.ts, prompts.ts
|
|
241
|
+
planning/ # plan writing & review prompts
|
|
242
|
+
plan-writer-prompt.ts, plan-reviewer.ts,
|
|
243
|
+
spec-reviewer.ts, prompt-builder.ts
|
|
160
244
|
quality/ # composable quality gates
|
|
161
245
|
gate-runner.ts, lsp-gate.ts, ai-review-gate.ts, test-gate.ts
|
|
162
246
|
qa/ # QA pipeline
|
|
163
|
-
|
|
247
|
+
session.ts, matrix.ts, prompt-builder.ts, config.ts
|
|
248
|
+
fix-pr/ # PR comment assessment & fixing
|
|
249
|
+
prompt-builder.ts, config.ts, types.ts
|
|
250
|
+
mcp/ # MCP server gateway
|
|
251
|
+
gateway.ts, registry.ts, activation.ts, triggers.ts,
|
|
252
|
+
lifecycle.ts, manager-tool.ts, mcpc.ts, config.ts
|
|
253
|
+
context-mode/ # context-mode integration
|
|
254
|
+
hooks.ts, routing.ts, detector.ts, installer.ts,
|
|
255
|
+
compressor.ts, event-store.ts, event-extractor.ts,
|
|
256
|
+
snapshot-builder.ts
|
|
164
257
|
lsp/ # LSP integration
|
|
165
258
|
detector.ts, bridge.ts, setup-guide.ts
|
|
166
|
-
notifications/ # rich inline notifications
|
|
167
|
-
renderer.ts, types.ts
|
|
168
|
-
config/ # configuration & profiles
|
|
169
|
-
loader.ts, profiles.ts, defaults.ts, schema.ts
|
|
170
|
-
storage/ # persistence
|
|
171
|
-
plans.ts, runs.ts, reports.ts
|
|
172
259
|
release/ # release automation
|
|
173
260
|
analyzer.ts, notes.ts, publisher.ts
|
|
261
|
+
config/ # configuration & profiles
|
|
262
|
+
loader.ts, profiles.ts, defaults.ts, schema.ts
|
|
263
|
+
storage/ # persistence layer
|
|
264
|
+
plans.ts, runs.ts, reports.ts, specs.ts,
|
|
265
|
+
qa-sessions.ts, fix-pr-sessions.ts
|
|
266
|
+
notifications/ # rich inline notifications
|
|
267
|
+
renderer.ts, types.ts
|
|
174
268
|
types.ts # shared type definitions
|
|
175
|
-
skills/
|
|
176
|
-
planning/SKILL.md
|
|
177
|
-
code-review/SKILL.md
|
|
178
|
-
debugging/SKILL.md
|
|
179
|
-
qa-strategy/SKILL.md
|
|
269
|
+
skills/ # runtime-loaded prompt skills
|
|
180
270
|
bin/
|
|
181
271
|
install.mjs # bunx installer
|
|
182
272
|
```
|
|
@@ -187,15 +277,17 @@ bin/
|
|
|
187
277
|
git clone https://github.com/ogrodev/supipowers.git
|
|
188
278
|
cd supipowers
|
|
189
279
|
bun install
|
|
190
|
-
bun
|
|
191
|
-
bun run typecheck
|
|
192
|
-
bun run test:watch
|
|
280
|
+
bun test # run all tests
|
|
281
|
+
bun run typecheck # type checking
|
|
282
|
+
bun run test:watch # watch mode
|
|
283
|
+
bun run build # emit to dist/
|
|
193
284
|
```
|
|
194
285
|
|
|
195
|
-
|
|
286
|
+
The test suite mirrors the `src/` structure under `tests/`. Tests use Bun's built-in test runner (`bun:test`) with inline mocks via `mock()`. Filesystem tests use temp directories created in `beforeEach`.
|
|
287
|
+
|
|
288
|
+
> [!NOTE]
|
|
289
|
+
> Supipowers works with both Pi and OMP. The platform abstraction in `src/platform/` normalizes API differences (event names, tool registration, message delivery) so you can develop against either agent.
|
|
196
290
|
|
|
197
|
-
- [OMP](https://github.com/can1357/oh-my-pi) (oh-my-pi)
|
|
198
|
-
- [Bun](https://bun.sh) runtime
|
|
199
291
|
|
|
200
292
|
## License
|
|
201
293
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# context-mode — MANDATORY routing rules
|
|
2
|
+
|
|
3
|
+
You have context-mode MCP tools available. These rules are NOT optional — they protect your context window from flooding. A single unrouted command can dump 56 KB into context and waste the entire session.
|
|
4
|
+
|
|
5
|
+
## BLOCKED commands — do NOT attempt these
|
|
6
|
+
|
|
7
|
+
### curl / wget — BLOCKED
|
|
8
|
+
Any Bash command containing `curl` or `wget` is intercepted and replaced with an error message. Do NOT retry.
|
|
9
|
+
Instead use:
|
|
10
|
+
- `ctx_fetch_and_index(url, source)` to fetch and index web pages
|
|
11
|
+
- `ctx_execute(language: "javascript", code: "const r = await fetch(...)")` to run HTTP calls in sandbox
|
|
12
|
+
|
|
13
|
+
### Inline HTTP — BLOCKED
|
|
14
|
+
Any Bash command containing `fetch('http`, `requests.get(`, `requests.post(`, `http.get(`, or `http.request(` is intercepted and replaced with an error message. Do NOT retry with Bash.
|
|
15
|
+
Instead use:
|
|
16
|
+
- `ctx_execute(language, code)` to run HTTP calls in sandbox — only stdout enters context
|
|
17
|
+
|
|
18
|
+
### WebFetch / Fetch — BLOCKED
|
|
19
|
+
WebFetch and Fetch calls are denied entirely.
|
|
20
|
+
Instead use:
|
|
21
|
+
- `ctx_fetch_and_index(url, source)` then `ctx_search(queries)` to query the indexed content
|
|
22
|
+
|
|
23
|
+
### Grep — BLOCKED
|
|
24
|
+
Grep calls are intercepted and blocked. Do NOT retry with Grep.
|
|
25
|
+
Instead use:
|
|
26
|
+
- `ctx_search(queries: ["<pattern>"])` to search indexed content
|
|
27
|
+
- `ctx_batch_execute(commands, queries)` to run searches and return compressed results
|
|
28
|
+
- `ctx_execute(language: "shell", code: "grep ...")` to run searches in sandbox
|
|
29
|
+
|
|
30
|
+
### Find / Glob — BLOCKED
|
|
31
|
+
Find/Glob calls are intercepted and blocked. Do NOT retry with Find/Glob.
|
|
32
|
+
Instead use:
|
|
33
|
+
- `ctx_execute(language: "shell", code: "find ...")` to run in sandbox
|
|
34
|
+
- `ctx_batch_execute(commands, queries)` for multiple searches
|
|
35
|
+
|
|
36
|
+
### Read (full-file, no limit) — BLOCKED
|
|
37
|
+
Reading an entire file without a `limit` parameter is blocked.
|
|
38
|
+
- If you need to **Edit** the file → re-call Read with `limit` parameter (e.g., `limit: 200`)
|
|
39
|
+
- If you need to **analyze or explore** → use `ctx_execute_file(path, language, code)` instead. Only your printed summary enters context.
|
|
40
|
+
|
|
41
|
+
## REDIRECTED tools — use sandbox equivalents
|
|
42
|
+
|
|
43
|
+
### Bash (>20 lines output)
|
|
44
|
+
Bash is ONLY for: `git`, `mkdir`, `rm`, `mv`, `cd`, `ls`, `npm install`, `pip install`, and other short-output commands.
|
|
45
|
+
For everything else, use:
|
|
46
|
+
- `ctx_batch_execute(commands, queries)` — run multiple commands + search in ONE call
|
|
47
|
+
- `ctx_execute(language: "shell", code: "...")` — run in sandbox, only stdout enters context
|
|
48
|
+
|
|
49
|
+
### Read (for analysis)
|
|
50
|
+
If you are reading a file to **Edit** it → Read with `limit` is correct (Edit needs content in context).
|
|
51
|
+
If you are reading to **analyze, explore, or summarize** → use `ctx_execute_file(path, language, code)` instead. Only your printed summary enters context. The raw file content stays in the sandbox.
|
|
52
|
+
|
|
53
|
+
## Tool selection hierarchy
|
|
54
|
+
|
|
55
|
+
1. **GATHER**: `ctx_batch_execute(commands, queries)` — Primary tool. Runs all commands, auto-indexes output, returns search results. ONE call replaces 30+ individual calls.
|
|
56
|
+
2. **FOLLOW-UP**: `ctx_search(queries: ["q1", "q2", ...])` — Query indexed content. Pass ALL questions as array in ONE call.
|
|
57
|
+
3. **PROCESSING**: `ctx_execute(language, code)` | `ctx_execute_file(path, language, code)` — Sandbox execution. Only stdout enters context.
|
|
58
|
+
4. **WEB**: `ctx_fetch_and_index(url, source)` then `ctx_search(queries)` — Fetch, chunk, index, query. Raw HTML never enters context.
|
|
59
|
+
5. **INDEX**: `ctx_index(content, source)` — Store content in FTS5 knowledge base for later search.
|
|
60
|
+
|
|
61
|
+
## Subagent routing
|
|
62
|
+
|
|
63
|
+
When spawning subagents (Agent/Task tool), the routing block is automatically injected into their prompt. Bash-type subagents are upgraded to general-purpose so they have access to MCP tools. You do NOT need to manually instruct subagents about context-mode.
|
|
64
|
+
|
|
65
|
+
## Output constraints
|
|
66
|
+
|
|
67
|
+
- Keep responses under 500 words.
|
|
68
|
+
- Write artifacts (code, configs, PRDs) to FILES — never return them as inline text. Return only: file path + 1-line description.
|
|
69
|
+
- When indexing content, use descriptive source labels so others can `ctx_search(source: "label")` later.
|
|
70
|
+
|
|
71
|
+
## ctx commands
|
|
72
|
+
|
|
73
|
+
| Command | Action |
|
|
74
|
+
|---------|--------|
|
|
75
|
+
| `ctx stats` | Call the `ctx_stats` MCP tool and display the full output verbatim |
|
|
76
|
+
| `ctx doctor` | Call the `ctx_doctor` MCP tool, run the returned shell command, display as checklist |
|
|
77
|
+
| `ctx upgrade` | Call the `ctx_upgrade` MCP tool, run the returned shell command, display as checklist |
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
package/bin/ctx-mode-wrapper.mjs
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
// Setting CLAUDE_PROJECT_DIR causes start.mjs to also write a CLAUDE.md
|
|
8
8
|
// in the project root. This is harmless (OMP doesn't read it) but the
|
|
9
|
-
// user should gitignore it. We also write .omp/
|
|
9
|
+
// user should gitignore it. We also write .omp/APPEND_SYSTEM.md with routing
|
|
10
10
|
// rules since that's what OMP actually loads as system prompt.
|
|
11
11
|
|
|
12
12
|
import { resolve, join, dirname } from "node:path";
|
|
@@ -32,7 +32,7 @@ if (!startMjs) {
|
|
|
32
32
|
process.exit(1);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
// Write .omp/
|
|
35
|
+
// Write .omp/APPEND_SYSTEM.md with routing rules (idempotent — only if marker absent)
|
|
36
36
|
const ROUTING_MARKER = "# context-mode — MANDATORY routing rules";
|
|
37
37
|
try {
|
|
38
38
|
// Find SKILL.md from multiple possible locations
|
|
@@ -47,7 +47,7 @@ try {
|
|
|
47
47
|
|
|
48
48
|
if (skillContent && skillContent.includes(ROUTING_MARKER)) {
|
|
49
49
|
const ompDir = join(projectDir, ".omp");
|
|
50
|
-
const systemMdPath = join(ompDir, "
|
|
50
|
+
const systemMdPath = join(ompDir, "APPEND_SYSTEM.md");
|
|
51
51
|
|
|
52
52
|
if (!existsSync(ompDir)) mkdirSync(ompDir, { recursive: true });
|
|
53
53
|
|
package/bin/install.ts
CHANGED
|
@@ -199,7 +199,7 @@ function installToPlatform(platformDir: string, packageRoot: string): string {
|
|
|
199
199
|
*/
|
|
200
200
|
async function installContextMode(platformDir: string): Promise<void> {
|
|
201
201
|
const extDir = join(homedir(), platformDir, "extensions", "context-mode");
|
|
202
|
-
const startMjs = join(extDir, "
|
|
202
|
+
const startMjs = join(extDir, "start.mjs");
|
|
203
203
|
|
|
204
204
|
// Check if already installed and built
|
|
205
205
|
if (existsSync(startMjs)) {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Install supipowers locally from the current working tree.
|
|
3
|
+
# Usage: ./bin/local-install.sh
|
|
4
|
+
#
|
|
5
|
+
# This creates a global symlink so both the `supipowers` CLI and
|
|
6
|
+
# the Pi/OMP extension resolve to your local source — no publish needed.
|
|
7
|
+
# Re-run after pulling new changes; the symlink stays valid.
|
|
8
|
+
|
|
9
|
+
set -euo pipefail
|
|
10
|
+
|
|
11
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
12
|
+
PROJECT_DIR="$(dirname "$SCRIPT_DIR")"
|
|
13
|
+
|
|
14
|
+
echo "→ Installing supipowers locally from $PROJECT_DIR"
|
|
15
|
+
|
|
16
|
+
# 1. Install dependencies (fast no-op when lock is current)
|
|
17
|
+
echo "→ Installing dependencies…"
|
|
18
|
+
cd "$PROJECT_DIR"
|
|
19
|
+
bun install --frozen-lockfile 2>/dev/null || bun install
|
|
20
|
+
|
|
21
|
+
# 2. Create a global symlink via bun link
|
|
22
|
+
# This registers the package globally so `supipowers` CLI works
|
|
23
|
+
# and Pi/OMP can resolve it by name.
|
|
24
|
+
echo "→ Linking supipowers globally…"
|
|
25
|
+
bun link
|
|
26
|
+
|
|
27
|
+
# 3. Verify the link
|
|
28
|
+
if command -v supipowers &>/dev/null; then
|
|
29
|
+
echo "✓ 'supipowers' CLI is available at $(which supipowers)"
|
|
30
|
+
else
|
|
31
|
+
echo "⚠ CLI not on PATH — you may need to add bun's global bin to \$PATH:"
|
|
32
|
+
echo " export PATH=\"\$HOME/.bun/bin:\$PATH\""
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
# 4. Show version
|
|
36
|
+
VERSION=$(node -e "console.log(require('$PROJECT_DIR/package.json').version)")
|
|
37
|
+
echo ""
|
|
38
|
+
echo "✓ supipowers v${VERSION} installed locally (linked to $PROJECT_DIR)"
|
|
39
|
+
echo " Any edits to src/ or skills/ take effect immediately — no rebuild needed."
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "supipowers",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "Workflow extension for
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "Workflow extension for OMP coding agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "
|
|
7
|
+
"test": "bun test tests/",
|
|
8
8
|
"typecheck": "tsc --noEmit",
|
|
9
|
-
"test:watch": "
|
|
10
|
-
"build": "tsc -p tsconfig.build.json"
|
|
9
|
+
"test:watch": "bun test --watch tests/",
|
|
10
|
+
"build": "tsc -p tsconfig.build.json",
|
|
11
|
+
"prepare": "git config core.hooksPath hooks || true"
|
|
11
12
|
},
|
|
12
13
|
"keywords": [
|
|
13
|
-
"pi-extension",
|
|
14
14
|
"omp-extension",
|
|
15
15
|
"workflow",
|
|
16
16
|
"agent",
|
|
@@ -27,14 +27,6 @@
|
|
|
27
27
|
"README.md",
|
|
28
28
|
"LICENSE"
|
|
29
29
|
],
|
|
30
|
-
"pi": {
|
|
31
|
-
"extensions": [
|
|
32
|
-
"./src/index.ts"
|
|
33
|
-
],
|
|
34
|
-
"skills": [
|
|
35
|
-
"./skills"
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
30
|
"omp": {
|
|
39
31
|
"extensions": [
|
|
40
32
|
"./src/index.ts"
|
|
@@ -47,23 +39,23 @@
|
|
|
47
39
|
"@clack/prompts": "^0.10.0"
|
|
48
40
|
},
|
|
49
41
|
"peerDependencies": {
|
|
50
|
-
"@mariozechner/pi-coding-agent": "*",
|
|
51
42
|
"@oh-my-pi/pi-coding-agent": "*",
|
|
52
43
|
"@sinclair/typebox": "*"
|
|
53
44
|
},
|
|
54
45
|
"peerDependenciesMeta": {
|
|
55
|
-
"@
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
"@oh-my-pi/pi-coding-agent": {
|
|
47
|
+
"optional": true
|
|
48
|
+
},
|
|
49
|
+
"@oh-my-pi/pi-tui": {
|
|
50
|
+
"optional": true
|
|
51
|
+
}
|
|
58
52
|
},
|
|
59
53
|
"devDependencies": {
|
|
60
54
|
"@oh-my-pi/pi-coding-agent": "latest",
|
|
61
55
|
"@oh-my-pi/pi-tui": "latest",
|
|
62
56
|
"@sinclair/typebox": "^0.34.48",
|
|
63
57
|
"@types/node": "^22.0.0",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"typescript": "^5.9.3",
|
|
67
|
-
"vitest": "^4.0.0"
|
|
58
|
+
"bun-types": "^1.3.11",
|
|
59
|
+
"typescript": "^5.9.3"
|
|
68
60
|
}
|
|
69
61
|
}
|
package/skills/planning/SKILL.md
CHANGED
|
@@ -18,6 +18,7 @@ Follow these phases in order. Do not skip or combine them.
|
|
|
18
18
|
### Phase 1: Explore Project Context
|
|
19
19
|
|
|
20
20
|
Before asking questions, understand the current state:
|
|
21
|
+
|
|
21
22
|
- Check files, docs, recent commits
|
|
22
23
|
- Understand existing architecture and patterns
|
|
23
24
|
- If the request covers multiple independent subsystems, flag it immediately and help decompose into sub-projects
|
|
@@ -38,6 +39,7 @@ Before asking questions, understand the current state:
|
|
|
38
39
|
### Phase 4: Present Design
|
|
39
40
|
|
|
40
41
|
Once aligned on approach:
|
|
42
|
+
|
|
41
43
|
- Scale each section to its complexity (a few sentences if straightforward, up to 200-300 words if nuanced)
|
|
42
44
|
- Cover: architecture, components, data flow, error handling, testing
|
|
43
45
|
- Ask after each section whether it looks right so far
|
|
@@ -47,13 +49,15 @@ Once aligned on approach:
|
|
|
47
49
|
### Phase 5: Write Design Doc
|
|
48
50
|
|
|
49
51
|
Once the user approves the design:
|
|
50
|
-
|
|
52
|
+
|
|
53
|
+
- Save to `.omp/supipowers/specs/YYYY-MM-DD-<topic>-design.md`
|
|
51
54
|
- Use clear, concise writing
|
|
52
55
|
- Commit the design document to git
|
|
53
56
|
|
|
54
57
|
### Phase 6: Spec Review Loop
|
|
55
58
|
|
|
56
59
|
After writing the design doc:
|
|
60
|
+
|
|
57
61
|
1. Dispatch a spec-document-reviewer sub-agent to verify completeness
|
|
58
62
|
2. If **Issues Found**: fix the issues, re-dispatch the reviewer
|
|
59
63
|
3. Repeat until **Approved** (max 5 iterations, then surface to human)
|
|
@@ -69,7 +73,8 @@ Wait for their response. Only proceed once approved.
|
|
|
69
73
|
### Phase 8: Create Implementation Plan
|
|
70
74
|
|
|
71
75
|
Break into bite-sized tasks (2-5 minutes each). Each task must have:
|
|
72
|
-
|
|
76
|
+
|
|
77
|
+
- Name
|
|
73
78
|
- **files**: Exact paths the agent will touch
|
|
74
79
|
- **criteria**: Acceptance criteria (testable)
|
|
75
80
|
- **complexity**: `small` | `medium` | `large`
|
|
@@ -92,7 +97,7 @@ tags: [<relevant>, <tags>]
|
|
|
92
97
|
|
|
93
98
|
## Tasks
|
|
94
99
|
|
|
95
|
-
### 1. <Task name>
|
|
100
|
+
### 1. <Task name>
|
|
96
101
|
- **files**: src/path/to/file.ts
|
|
97
102
|
- **criteria**: <what success looks like>
|
|
98
103
|
- **complexity**: small
|
|
@@ -107,8 +112,6 @@ tags: [<relevant>, <tags>]
|
|
|
107
112
|
## Principles
|
|
108
113
|
|
|
109
114
|
- Each task should be completable in 2-5 minutes
|
|
110
|
-
- Tasks that touch different files are parallel-safe
|
|
111
|
-
- Tasks that depend on others' output are sequential
|
|
112
115
|
- Include test files in the files list
|
|
113
116
|
- Prefer small, focused tasks over large ones
|
|
114
117
|
- DRY, YAGNI, TDD, frequent commits
|