@mcpbox/mcpbox-claude 0.1.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/.claude-plugin/plugin.json +21 -0
- package/README.md +37 -0
- package/bin/mcpbox-claude.mjs +204 -0
- package/commands/capture.md +14 -0
- package/commands/close.md +15 -0
- package/commands/doctor.md +15 -0
- package/commands/mine.md +12 -0
- package/commands/next.md +37 -0
- package/commands/pipeline-run.md +25 -0
- package/commands/plan.md +25 -0
- package/commands/status.md +25 -0
- package/commands/sync.md +13 -0
- package/commands/tasks.md +34 -0
- package/commands/trace.md +22 -0
- package/hooks/hooks.json +39 -0
- package/hooks/session-start.mjs +136 -0
- package/hooks/stop.mjs +31 -0
- package/hooks/user-prompt-submit.mjs +53 -0
- package/lib/codex.mjs +70 -0
- package/lib/cursor.mjs +121 -0
- package/lib/mcp-client.mjs +178 -0
- package/lib/policy.mjs +300 -0
- package/package.json +27 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "mcpbox-claude",
|
|
3
|
+
"description": "MCPBox × Claude Code glue. Drives the mcpbox MCP server (daruma tracker + full MeiSei pipeline torii→…→fujin→daruma). Ships /mcpbox:{tasks,plan,next,mine,status,close,sync,capture,doctor} and pipeline commands, SessionStart/Stop/UserPromptSubmit hooks, and a managed CLAUDE.md policy that makes mcpbox the default tracker AND pipeline substrate.",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "tupical"
|
|
7
|
+
},
|
|
8
|
+
"license": "UNLICENSED",
|
|
9
|
+
"homepage": "https://mcpbox.ru",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"claude-code",
|
|
12
|
+
"claude-code-plugin",
|
|
13
|
+
"mcpbox",
|
|
14
|
+
"daruma",
|
|
15
|
+
"pipeline",
|
|
16
|
+
"orchestration",
|
|
17
|
+
"agent",
|
|
18
|
+
"plugin"
|
|
19
|
+
],
|
|
20
|
+
"commands": "./commands/"
|
|
21
|
+
}
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @mcpbox/mcpbox-claude
|
|
2
|
+
|
|
3
|
+
MCPBox agent harness for **Claude Code**, **Codex**, and **Cursor**. Wires the
|
|
4
|
+
single canonical MCP server (`https://mcpbox.ru/v1/mcp` — the daruma tracker
|
|
5
|
+
tools plus the platform pipeline `torii→satori→enma→yatagarasu→fujin→daruma`)
|
|
6
|
+
and drops a managed policy into each agent's native config file.
|
|
7
|
+
|
|
8
|
+
Normally installed for you by `npx @mcpbox/mcpbox setup` (or
|
|
9
|
+
`curl -fsSL https://mcpbox.ru/install.sh | sh`), which also registers the MCP
|
|
10
|
+
server and picks Global vs Repository scope. Use this CLI directly to manage
|
|
11
|
+
just the policy.
|
|
12
|
+
|
|
13
|
+
## What it manages
|
|
14
|
+
|
|
15
|
+
| Agent | Policy surface | MCP server |
|
|
16
|
+
|--------|----------------------------------------|-------------------------------------|
|
|
17
|
+
| Claude | `CLAUDE.md` block + plugin (hooks, `/mcpbox:*`) | `claude mcp add` (`.mcp.json` / `~/.claude.json`) |
|
|
18
|
+
| Codex | `AGENTS.md` block (`mcpbox:policy`) | `[mcp_servers.mcpbox]` in `~/.codex/config.toml` |
|
|
19
|
+
| Cursor | `.cursor/rules/mcpbox-policy.mdc` (`alwaysApply`) | `mcpbox` entry in `.cursor/mcp.json` |
|
|
20
|
+
|
|
21
|
+
## CLI
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
mcpbox-claude init [--dir DIR] Managed CLAUDE.md policy block. Idempotent.
|
|
25
|
+
mcpbox-claude uninit [--dir DIR] Remove the CLAUDE.md policy block.
|
|
26
|
+
mcpbox-claude codex-init [--dir DIR] AGENTS.md policy + ~/.codex/config.toml server.
|
|
27
|
+
mcpbox-claude codex-uninit [--dir DIR]
|
|
28
|
+
mcpbox-claude cursor-init [--dir DIR] .cursor/rules policy + .cursor/mcp.json server.
|
|
29
|
+
mcpbox-claude cursor-uninit [--dir DIR]
|
|
30
|
+
mcpbox-claude doctor [--json] Check the mcpbox MCP server + policy are wired.
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
All writes are idempotent and preserve surrounding hand-written content.
|
|
34
|
+
|
|
35
|
+
## License
|
|
36
|
+
|
|
37
|
+
UNLICENSED — MCPBox is a closed SaaS.
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// `mcpbox-claude` — project-scoped harness entry point.
|
|
3
|
+
//
|
|
4
|
+
// Subcommands:
|
|
5
|
+
// mcpbox-claude init [--dir DIR] Write the managed CLAUDE.md policy block
|
|
6
|
+
// (daruma tracker + full pipeline). Idempotent.
|
|
7
|
+
// mcpbox-claude uninit [--dir DIR] Remove the managed policy block.
|
|
8
|
+
// mcpbox-claude doctor [--json] Check the mcpbox MCP server + policy are wired.
|
|
9
|
+
// mcpbox-claude --version | --help
|
|
10
|
+
//
|
|
11
|
+
// ponytail: no orchestrator (start/team-from-plan) or self-update here — the
|
|
12
|
+
// mcpbox server already exposes the pipeline tools; add an omc-team driver only
|
|
13
|
+
// if a CLI-driven execution loop is actually requested.
|
|
14
|
+
|
|
15
|
+
import { readFileSync } from "node:fs";
|
|
16
|
+
import { promises as fs } from "node:fs";
|
|
17
|
+
import { fileURLToPath } from "node:url";
|
|
18
|
+
import { dirname, join, resolve } from "node:path";
|
|
19
|
+
import { spawnSync } from "node:child_process";
|
|
20
|
+
import { installPolicy, removePolicy, BEGIN } from "../lib/policy.mjs";
|
|
21
|
+
import { installCodex, removeCodex, installCodexPolicy } from "../lib/codex.mjs";
|
|
22
|
+
import { installCursor, removeCursor, installCursorRule } from "../lib/cursor.mjs";
|
|
23
|
+
|
|
24
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
25
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf8"));
|
|
26
|
+
|
|
27
|
+
const HELP = `mcpbox-claude v${pkg.version} — MCPBox agent harness (Claude / Codex / Cursor)
|
|
28
|
+
|
|
29
|
+
Usage:
|
|
30
|
+
mcpbox-claude init [--dir DIR] Write the managed CLAUDE.md policy block
|
|
31
|
+
(daruma tracker + full pipeline). Idempotent.
|
|
32
|
+
mcpbox-claude uninit [--dir DIR] Remove the managed CLAUDE.md policy block.
|
|
33
|
+
mcpbox-claude codex-init [--dir DIR] Write AGENTS.md policy + ~/.codex/config.toml
|
|
34
|
+
[mcp_servers.mcpbox]. Idempotent.
|
|
35
|
+
mcpbox-claude codex-uninit [--dir DIR]
|
|
36
|
+
mcpbox-claude cursor-init [--dir DIR] Write .cursor/rules/mcpbox-policy.mdc +
|
|
37
|
+
.cursor/mcp.json mcpbox entry. Idempotent.
|
|
38
|
+
mcpbox-claude cursor-uninit [--dir DIR]
|
|
39
|
+
mcpbox-claude doctor [--json] Check the mcpbox MCP server + policy are wired.
|
|
40
|
+
mcpbox-claude --version | -v
|
|
41
|
+
mcpbox-claude --help | -h
|
|
42
|
+
`;
|
|
43
|
+
|
|
44
|
+
function parseDirFlag(rest) {
|
|
45
|
+
let projectDir;
|
|
46
|
+
for (let i = 0; i < rest.length; i++) {
|
|
47
|
+
if (rest[i] === "--dir") {
|
|
48
|
+
const v = rest[++i];
|
|
49
|
+
if (!v || v.startsWith("--")) throw new Error("--dir requires a directory");
|
|
50
|
+
projectDir = v;
|
|
51
|
+
} else {
|
|
52
|
+
throw new Error(`Unknown flag: ${rest[i]}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return { projectDir };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const VERB = {
|
|
59
|
+
installed: "Created",
|
|
60
|
+
updated: "Refreshed mcpbox block in",
|
|
61
|
+
appended: "Appended mcpbox block to",
|
|
62
|
+
unchanged: "Already current:",
|
|
63
|
+
"removed-block": "Removed mcpbox block from",
|
|
64
|
+
"removed-file": "Removed",
|
|
65
|
+
missing: "No mcpbox block found at",
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
async function cmdInit(rest) {
|
|
69
|
+
const { projectDir } = parseDirFlag(rest);
|
|
70
|
+
const r = await installPolicy({ projectDir });
|
|
71
|
+
process.stdout.write(`✓ ${VERB[r.action] ?? r.action} ${r.path}\n`);
|
|
72
|
+
process.stdout.write("Open Claude Code in this directory to pick it up.\n");
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
async function cmdUninit(rest) {
|
|
76
|
+
const { projectDir } = parseDirFlag(rest);
|
|
77
|
+
const r = await removePolicy({ projectDir });
|
|
78
|
+
process.stdout.write(`✓ ${VERB[r.action] ?? r.action} ${r.path}\n`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function report(r) {
|
|
82
|
+
process.stdout.write(`✓ ${VERB[r.action] ?? r.action} ${r.path}\n`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
async function cmdCodexInit(rest) {
|
|
86
|
+
const { projectDir } = parseDirFlag(rest);
|
|
87
|
+
const { policy, mcp } = await installCodex({ projectDir });
|
|
88
|
+
report(policy);
|
|
89
|
+
report(mcp);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
async function cmdCodexUninit(rest) {
|
|
93
|
+
const { projectDir } = parseDirFlag(rest);
|
|
94
|
+
const { policy, mcp } = await removeCodex({ projectDir });
|
|
95
|
+
report(policy);
|
|
96
|
+
report(mcp);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
async function cmdCursorInit(rest) {
|
|
100
|
+
const { projectDir } = parseDirFlag(rest);
|
|
101
|
+
const { rule, mcp } = await installCursor({ projectDir });
|
|
102
|
+
report(rule);
|
|
103
|
+
report(mcp);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
async function cmdCursorUninit(rest) {
|
|
107
|
+
const { projectDir } = parseDirFlag(rest);
|
|
108
|
+
const { rule, mcp } = await removeCursor({ projectDir });
|
|
109
|
+
report(rule);
|
|
110
|
+
report(mcp);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Policy-only variants — for callers (mcpbox-cli setup) that already own the
|
|
114
|
+
// MCP-server wiring and just need the managed policy file dropped.
|
|
115
|
+
async function cmdCodexPolicy(rest) {
|
|
116
|
+
const { projectDir } = parseDirFlag(rest);
|
|
117
|
+
report(await installCodexPolicy({ projectDir }));
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
async function cmdCursorPolicy(rest) {
|
|
121
|
+
const { projectDir } = parseDirFlag(rest);
|
|
122
|
+
report(await installCursorRule({ projectDir }));
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
async function policyPresent(projectDir) {
|
|
126
|
+
const target = join(projectDir ? resolve(projectDir) : process.cwd(), "CLAUDE.md");
|
|
127
|
+
try {
|
|
128
|
+
return (await fs.readFile(target, "utf8")).includes(BEGIN);
|
|
129
|
+
} catch (err) {
|
|
130
|
+
if (err.code === "ENOENT") return false;
|
|
131
|
+
throw err;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function mcpServerPresent() {
|
|
136
|
+
// `claude mcp list` prints one server per line as "name: url ...".
|
|
137
|
+
const r = spawnSync("claude", ["mcp", "list"], { encoding: "utf8" });
|
|
138
|
+
if (r.error || r.status !== 0) return null; // claude CLI missing / errored
|
|
139
|
+
return /(^|\n)\s*mcpbox\b/.test(r.stdout);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
async function cmdDoctor(rest) {
|
|
143
|
+
const json = rest.includes("--json");
|
|
144
|
+
const flags = rest.filter((a) => a !== "--json");
|
|
145
|
+
const { projectDir } = parseDirFlag(flags);
|
|
146
|
+
|
|
147
|
+
const policy = await policyPresent(projectDir);
|
|
148
|
+
const mcp = mcpServerPresent();
|
|
149
|
+
const ready = policy && mcp === true;
|
|
150
|
+
|
|
151
|
+
if (json) {
|
|
152
|
+
process.stdout.write(JSON.stringify({ ready, policy, mcp }) + "\n");
|
|
153
|
+
} else {
|
|
154
|
+
const mark = (v) => (v === true ? "✓" : v === false ? "✗" : "?");
|
|
155
|
+
process.stdout.write(
|
|
156
|
+
`mcpbox MCP server: ${mark(mcp)}${mcp === null ? " (claude CLI not found)" : ""}\n` +
|
|
157
|
+
`CLAUDE.md policy: ${mark(policy)}\n` +
|
|
158
|
+
`${ready ? "READY" : "NOT READY — run: npx @mcpbox/mcpbox setup"}\n`
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
process.exit(ready ? 0 : 1);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
async function main(argv) {
|
|
165
|
+
const [, , cmd, ...rest] = argv;
|
|
166
|
+
switch (cmd) {
|
|
167
|
+
case undefined:
|
|
168
|
+
case "--help":
|
|
169
|
+
case "-h":
|
|
170
|
+
case "help":
|
|
171
|
+
process.stdout.write(HELP);
|
|
172
|
+
return;
|
|
173
|
+
case "--version":
|
|
174
|
+
case "-v":
|
|
175
|
+
process.stdout.write(pkg.version + "\n");
|
|
176
|
+
return;
|
|
177
|
+
case "init":
|
|
178
|
+
return cmdInit(rest);
|
|
179
|
+
case "uninit":
|
|
180
|
+
return cmdUninit(rest);
|
|
181
|
+
case "codex-init":
|
|
182
|
+
return cmdCodexInit(rest);
|
|
183
|
+
case "codex-uninit":
|
|
184
|
+
return cmdCodexUninit(rest);
|
|
185
|
+
case "cursor-init":
|
|
186
|
+
return cmdCursorInit(rest);
|
|
187
|
+
case "cursor-uninit":
|
|
188
|
+
return cmdCursorUninit(rest);
|
|
189
|
+
case "codex-policy":
|
|
190
|
+
return cmdCodexPolicy(rest);
|
|
191
|
+
case "cursor-policy":
|
|
192
|
+
return cmdCursorPolicy(rest);
|
|
193
|
+
case "doctor":
|
|
194
|
+
return cmdDoctor(rest);
|
|
195
|
+
default:
|
|
196
|
+
process.stderr.write(`Unknown command: ${cmd}\n\n${HELP}`);
|
|
197
|
+
process.exit(2);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
main(process.argv).catch((err) => {
|
|
202
|
+
process.stderr.write(`mcpbox-claude: ${err.stack ?? err.message ?? err}\n`);
|
|
203
|
+
process.exit(1);
|
|
204
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Capture a durable, reusable lesson from this session into mcpbox.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/mcpbox:capture` (optionally with the lesson text in `$ARGUMENTS`).
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. Distill ONE concrete reusable lesson from the session: a command, invariant, bug
|
|
10
|
+
pattern, or file path — not a generic summary. If nothing durable, say so and stop.
|
|
11
|
+
2. Attach it where it belongs:
|
|
12
|
+
- If a task is in progress, `daruma_comment task_id=<id> body="lesson: <lesson>"`.
|
|
13
|
+
- Else, if the project uses docs, `daruma_doc_append` to the relevant doc.
|
|
14
|
+
3. Keep it to one or two sentences. Confirm what was recorded and where.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Close an mcpbox task as done, with an optional completion note.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/mcpbox:close` (optionally with a task id or title in `$ARGUMENTS`).
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. Identify the task:
|
|
10
|
+
- If `$ARGUMENTS` has a task id, use it.
|
|
11
|
+
- Else resolve the current in-progress task via `daruma_list status=in_progress`
|
|
12
|
+
(if exactly one, use it; if several, list them and ask which).
|
|
13
|
+
2. If the user gave a summary, first `daruma_comment task_id=<id> body="<summary>"`.
|
|
14
|
+
3. `daruma_complete task_id=<id>` (preferred) or `daruma_set_status status=done`.
|
|
15
|
+
4. Confirm: `✓ closed <id> — <title>`. Do not touch other tasks.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Check the mcpbox harness is wired — MCP server, policy block, reachability.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/mcpbox:doctor`.
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. MCP server: confirm the `mcpbox` server is connected (its `daruma_*` / `mcpbox_*`
|
|
10
|
+
tools are available as `mcp__mcpbox__*`). If absent, tell the user to run
|
|
11
|
+
`npx @mcpbox/mcpbox setup` and restart Claude Code.
|
|
12
|
+
2. Reachability: `daruma_healthz`. Report version + git_sha, or the failure verbatim.
|
|
13
|
+
3. Policy: confirm this project's `CLAUDE.md` contains the `mcpbox:policy` managed block.
|
|
14
|
+
If missing, `npx -y @mcpbox/mcpbox-claude init` (or re-run setup).
|
|
15
|
+
4. Render a short checklist with ✓ / ✗ per item and a final READY / NOT READY line.
|
package/commands/mine.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show mcpbox tasks currently claimed / in progress for this session.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/mcpbox:mine`.
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. Resolve project (`daruma_workspace_info` → `default_project`).
|
|
10
|
+
2. `daruma_list` with `project_id = <resolved>`, `status = ["in_progress","in_review"]`, limit ~30.
|
|
11
|
+
3. Render the same compact table as `/mcpbox:tasks`, titled `## In progress — <N>`.
|
|
12
|
+
4. If empty: "nothing claimed — `/mcpbox:next` to claim the next ready task." Read-only.
|
package/commands/next.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Claim the next ready task from the active mcpbox plan and show its briefing.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/mcpbox:next`. This claims a task — afterward, control returns
|
|
6
|
+
to the user/agent to actually execute it.
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. Resolve project (`daruma_workspace_info` → `default_project`).
|
|
11
|
+
2. Active plan: `daruma_plan_list` filtered to `status = ["active","in_progress"]`, most recent.
|
|
12
|
+
If none, stop with "no active plan — `daruma_plan_create` first".
|
|
13
|
+
3. `daruma_plan_next_task` with the plan id. The server atomically picks the next
|
|
14
|
+
ready (unblocked) task and transitions `todo → in_progress`.
|
|
15
|
+
4. If "no ready task": print the server reason (e.g. "3 tasks blocked by X") and
|
|
16
|
+
suggest `/mcpbox:plan` to inspect dependencies. Stop.
|
|
17
|
+
5. Otherwise render the briefing:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
## Next task: <title>
|
|
21
|
+
|
|
22
|
+
id: <task_id>
|
|
23
|
+
plan: <plan_id>
|
|
24
|
+
priority: <pX>
|
|
25
|
+
status: 🟢 in_progress
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then `### Description` verbatim, and when non-empty `### Dependencies` and
|
|
29
|
+
`### Related (links)`.
|
|
30
|
+
6. End with:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
→ When done: daruma_complete task_id=<task_id> [comment="<summary>"]
|
|
34
|
+
→ On failure: daruma_comment + daruma_set_status status=todo
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
7. Briefing only — do not start executing the task in this command.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Open an mcpbox maturity run from raw input (torii→…→fujin→handoff to daruma).
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/mcpbox:pipeline-run` with a raw idea/request in `$ARGUMENTS`.
|
|
6
|
+
|
|
7
|
+
Raw input matures through the layers; a daruma task is created **only** via handoff,
|
|
8
|
+
never by `daruma_create` directly. The server enforces the layer order (skip / `torii`
|
|
9
|
+
as target → `422`).
|
|
10
|
+
|
|
11
|
+
## Steps
|
|
12
|
+
|
|
13
|
+
1. If `$ARGUMENTS` is empty, ask for the raw idea/request and stop.
|
|
14
|
+
2. Open the run:
|
|
15
|
+
- Autopilot (default): `mcpbox_pipeline_run { source, kind:"text", body:"<idea>" }`
|
|
16
|
+
→ returns `run_id`, lineage, `action_packet`.
|
|
17
|
+
- Strict step mode (if the user wants control): open with `mcpbox_pipeline_run`, then
|
|
18
|
+
one `mcpbox_pipeline_advance { run_id, layer }` per layer satori→enma→yatagarasu→fujin.
|
|
19
|
+
Carry ONLY `run_id` between steps — do not paste intermediate artifacts.
|
|
20
|
+
3. On a layer failure / `422` / fujin maturity gate: return to the previous layer, fix its
|
|
21
|
+
input, and re-`advance` — do not skip. The reason is in `mcpbox_trace_get`.
|
|
22
|
+
4. Once `fujin` produced a mature Action Packet: `mcpbox_pipeline_handoff { run_id, project_slug? }`
|
|
23
|
+
→ materializes the daruma task, returns `task_id`.
|
|
24
|
+
5. Verify with `mcpbox_trace_get { run_id }` (expect `status=handed_off`, a `task_id`) and
|
|
25
|
+
report the run_id + task_id.
|
package/commands/plan.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show the active mcpbox plan with a progress bar and dependency state.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/mcpbox:plan`.
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. Resolve project (`daruma_workspace_info` → `default_project`).
|
|
10
|
+
2. `daruma_plan_list` filtered to `status = ["draft","active","in_progress"]`, most recent first.
|
|
11
|
+
If none, stop with "no active plan".
|
|
12
|
+
3. For the chosen plan, `daruma_plan_get` (single call — do not enumerate the archive).
|
|
13
|
+
4. Render:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
## <plan title>
|
|
17
|
+
goal: <goal>
|
|
18
|
+
progress: [████░░░░] 4/9 done
|
|
19
|
+
|
|
20
|
+
| # | Status | Pri | Task | Depends on |
|
|
21
|
+
|---|--------|-----|------|-----------|
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- Progress bar from done/total; blocked tasks marked ⛔ with their blocker ids.
|
|
25
|
+
5. Do not call `daruma_plan_list status=completed` (token-heavy). Read-only.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show mcpbox server + pipeline health — daruma_healthz, open count, recent runs.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/mcpbox:status`.
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. `daruma_healthz` — if it fails, report "mcpbox unreachable" and how to start the
|
|
10
|
+
server; stop (do not fall back to `.omc/plans/` or markdown).
|
|
11
|
+
2. Resolve project (`daruma_workspace_info` → `default_project`).
|
|
12
|
+
3. One scoped `daruma_list status=active` → count open tasks (do not enumerate the archive).
|
|
13
|
+
4. `mcpbox_runs_list` with `limit=5` (and `status=failed` if the user asked about failures)
|
|
14
|
+
→ recent pipeline runs.
|
|
15
|
+
5. Render:
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
## mcpbox status
|
|
19
|
+
server: ok (v<version>, sha <git_sha>)
|
|
20
|
+
project: <title>
|
|
21
|
+
open: <N> tasks
|
|
22
|
+
runs: <run_id> <status> · <run_id> <status> …
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
6. Read-only.
|
package/commands/sync.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Refresh the mcpbox task/plan view for the active project from the server.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/mcpbox:sync`.
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. Resolve project (`daruma_workspace_info` → `default_project`).
|
|
10
|
+
2. Re-fetch server-side: one scoped `daruma_list status=active`, and if a plan is active,
|
|
11
|
+
one `daruma_plan_get`.
|
|
12
|
+
3. Summarize what changed since the session's last view (new / closed / newly blocked),
|
|
13
|
+
in ≤5 lines. Read-only — this only refreshes context, it does not transition tasks.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Show open mcpbox tasks for the active project as a compact markdown table.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/mcpbox:tasks`.
|
|
6
|
+
|
|
7
|
+
Drive the mcpbox MCP server (do not invent IDs, do not write to `.omc/plans/`).
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. Resolve project:
|
|
12
|
+
- `daruma_workspace_info` → use `default_project` if set.
|
|
13
|
+
- Else `daruma_project_list` → pick first. If none, say "no projects yet" and stop.
|
|
14
|
+
|
|
15
|
+
2. Fetch tasks server-side (don't filter locally):
|
|
16
|
+
- `daruma_list` with `project_id = <resolved>`, `status = ["inbox","todo","in_progress"]`, limit ~50.
|
|
17
|
+
- **Never** use `status=all` unless the user explicitly asked for the full archive; it is token-heavy.
|
|
18
|
+
|
|
19
|
+
3. Render exactly this format:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
## <project title> — <N> open tasks
|
|
23
|
+
|
|
24
|
+
| # | Status | Pri | Title | Plan |
|
|
25
|
+
|---|--------|-----|-------|------|
|
|
26
|
+
| 1 | 🟢 in_progress | p1 | <truncated title> | <plan_short> |
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- Status emoji: 📥 inbox, ⬜ todo, 🟢 in_progress, ✅ done.
|
|
30
|
+
- Title truncated to 60 chars with `…`; `Plan` = last 8 chars of `plan_id` or `—`.
|
|
31
|
+
|
|
32
|
+
4. If >30 rows: show first 30, footer `…and <N> more — narrow with /mcpbox:mine`.
|
|
33
|
+
5. On `daruma_list` error: print it verbatim and stop.
|
|
34
|
+
6. Read-only — do not transition any task in this command.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Trace an mcpbox pipeline run — lineage chain, per-hop status, artifacts.
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
The user invoked `/mcpbox:trace` with a `run_id` in `$ARGUMENTS` (or asked about recent runs).
|
|
6
|
+
|
|
7
|
+
## Steps
|
|
8
|
+
|
|
9
|
+
1. If no `run_id`: `mcpbox_runs_list { limit:5 }` (add `status:"failed"` if the user asked
|
|
10
|
+
about failures), list them, and ask which to trace (or trace the most recent).
|
|
11
|
+
2. `mcpbox_trace_get { run_id }`.
|
|
12
|
+
3. Render:
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
## run <run_id> — <status>
|
|
16
|
+
torii → satori → enma → yatagarasu → fujin → daruma
|
|
17
|
+
<per-hop: layer, ok/failed, ms, lineage id>
|
|
18
|
+
handoff: <task_id or —>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
4. If `status=failed`, surface the failing layer + reason and suggest re-running
|
|
22
|
+
`/mcpbox:pipeline-run` from the previous layer. Read-only.
|
package/hooks/hooks.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"description": "mcpbox-claude hooks: proactive session summary, capture/pipeline hints, and auto-record",
|
|
3
|
+
"hooks": {
|
|
4
|
+
"SessionStart": [
|
|
5
|
+
{
|
|
6
|
+
"hooks": [
|
|
7
|
+
{
|
|
8
|
+
"type": "command",
|
|
9
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.mjs\"",
|
|
10
|
+
"timeout": 15
|
|
11
|
+
}
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"UserPromptSubmit": [
|
|
16
|
+
{
|
|
17
|
+
"hooks": [
|
|
18
|
+
{
|
|
19
|
+
"type": "command",
|
|
20
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/user-prompt-submit.mjs\""
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"Stop": [
|
|
26
|
+
{
|
|
27
|
+
"hooks": [
|
|
28
|
+
{
|
|
29
|
+
"type": "command",
|
|
30
|
+
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/stop.mjs\"",
|
|
31
|
+
"asyncRewake": true,
|
|
32
|
+
"rewakeMessage": "mcpbox-claude auto-record: a reusable lesson was captured from this session. Acknowledge or skip.",
|
|
33
|
+
"rewakeSummary": "mcpbox-claude captured a session lesson"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
}
|