@mcpbox/mcpbox-claude 0.1.17 → 0.1.19
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 +1 -1
- package/.codex-plugin/plugin.json +3 -2
- package/README.md +72 -4
- package/bin/mcpbox-claude.mjs +54 -18
- package/commands/capture.md +3 -3
- package/commands/close.md +7 -3
- package/commands/doctor.md +5 -1
- package/commands/mode.md +2 -2
- package/commands/next.md +7 -6
- package/commands/status.md +10 -9
- package/commands/trace.md +2 -2
- package/hooks/acceptance-guard.mjs +64 -0
- package/hooks/hooks.json +23 -1
- package/hooks/session-start.mjs +38 -7
- package/hooks/user-prompt-submit.mjs +98 -36
- package/lib/cloud-knowledge.mjs +196 -0
- package/lib/codex.mjs +33 -47
- package/lib/kimi.mjs +66 -0
- package/lib/policy.mjs +325 -295
- package/lib/version.mjs +1 -1
- package/package.json +4 -1
- package/skills/mcpbox-capture/SKILL.md +15 -0
- package/skills/mcpbox-close/SKILL.md +20 -0
- package/skills/mcpbox-doctor/SKILL.md +20 -0
- package/skills/mcpbox-mine/SKILL.md +13 -0
- package/skills/mcpbox-mode/SKILL.md +34 -0
- package/skills/mcpbox-next/SKILL.md +39 -0
- package/skills/mcpbox-pipeline-run/SKILL.md +26 -0
- package/skills/mcpbox-plan/SKILL.md +26 -0
- package/skills/mcpbox-status/SKILL.md +43 -0
- package/skills/mcpbox-sync/SKILL.md +14 -0
- package/skills/mcpbox-tasks/SKILL.md +35 -0
- package/skills/mcpbox-trace/SKILL.md +23 -0
package/lib/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.1.
|
|
1
|
+
export const VERSION = "0.1.19";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcpbox/mcpbox-claude",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.19",
|
|
4
4
|
"description": "MCPBox agent harness for Claude Code: managed policy (daruma tracker + full pipeline), hooks, and slash commands over the single mcpbox MCP server.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"bin/",
|
|
14
14
|
"lib/",
|
|
15
15
|
"commands/",
|
|
16
|
+
"skills/",
|
|
16
17
|
"hooks/",
|
|
17
18
|
".claude-plugin/",
|
|
18
19
|
".codex-plugin/",
|
|
@@ -25,6 +26,8 @@
|
|
|
25
26
|
},
|
|
26
27
|
"scripts": {
|
|
27
28
|
"test": "node --test tests/*.test.mjs",
|
|
29
|
+
"prepack": "node scripts/generate-codex-skills.mjs",
|
|
30
|
+
"postpack": "node scripts/generate-codex-skills.mjs --clean",
|
|
28
31
|
"version": "node scripts/sync-version.mjs && git add lib/version.mjs .claude-plugin/plugin.json .codex-plugin/plugin.json"
|
|
29
32
|
},
|
|
30
33
|
"license": "UNLICENSED"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcpbox-capture
|
|
3
|
+
description: Capture a durable, reusable lesson from this session into mcpbox.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The user invoked `/mcpbox:capture` (optionally with the lesson text in `$ARGUMENTS`).
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. Distill ONE concrete reusable lesson from the session: a command, invariant, bug
|
|
11
|
+
pattern, or file path — not a generic summary. If nothing durable, say so and stop.
|
|
12
|
+
2. Persist it with `mcpbox_knowledge_write` (kind `constraint`, `decision`,
|
|
13
|
+
`project_context` or `research_note`; scope=project with the resolved `project_id`).
|
|
14
|
+
If it only matters to one in-progress task, a `daruma_comment` on that task is enough.
|
|
15
|
+
3. Keep it to one or two sentences. Confirm what was recorded and where.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcpbox-close
|
|
3
|
+
description: Close an mcpbox task as done, with an optional completion note.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The user invoked `/mcpbox:close` (optionally with a task id or title in `$ARGUMENTS`).
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. Identify the task:
|
|
11
|
+
- If `$ARGUMENTS` has a task id, use it.
|
|
12
|
+
- Else resolve the current in-progress task via `daruma_list status=in_progress`
|
|
13
|
+
(if exactly one, use it; if several, list them and ask which).
|
|
14
|
+
2. `daruma_complete id=<id>` (preferred) — if the user gave a summary, pass it
|
|
15
|
+
as `result_summary="<summary>"` (plus `reason` / `related_artifacts` when
|
|
16
|
+
known); the completion note replaces a preliminary
|
|
17
|
+
comment, so no separate `daruma_comment` call. Fallback:
|
|
18
|
+
`daruma_set_status status=done comment={ body: "<summary>", kind: "outcome" }`
|
|
19
|
+
(the comment lands atomically with the transition).
|
|
20
|
+
3. Confirm: `✓ closed <id> — <title>`. Do not touch other tasks.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcpbox-doctor
|
|
3
|
+
description: Check the mcpbox harness is wired — MCP server, policy block, reachability.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The user invoked `/mcpbox:doctor`.
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. MCP server: confirm the `mcpbox` server is connected (its `daruma_*` / `mcpbox_*`
|
|
11
|
+
tools are available as `mcp__mcpbox__*`). If absent, tell the user to run
|
|
12
|
+
`npx @mcpbox/mcpbox setup` and restart Claude Code.
|
|
13
|
+
2. Reachability: `daruma_healthz`. Report version + git_sha, or the failure verbatim.
|
|
14
|
+
3. Policy: confirm this project's `CLAUDE.md` contains the `mcpbox:policy` managed block.
|
|
15
|
+
If missing, `npx -y @mcpbox/mcpbox-claude init` (or re-run setup). If
|
|
16
|
+
`npx -y @mcpbox/mcpbox-claude doctor --json` reports `policy_stale`, the block
|
|
17
|
+
predates the installed plugin; the next session start refreshes it. Paths in
|
|
18
|
+
`policy_competing_paths` also carry a daruma CLI policy block
|
|
19
|
+
(`daruma-claude` / `daruma-codex`); tell the user to keep one of the two.
|
|
20
|
+
4. Render a short checklist with ✓ / ✗ per item and a final READY / NOT READY line.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcpbox-mine
|
|
3
|
+
description: Show mcpbox tasks currently claimed / in progress for this session.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The user invoked `/mcpbox:mine`.
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. Resolve project (`daruma_workspace_info` → `default_project`).
|
|
11
|
+
2. `daruma_list` with `project_id = <resolved>`, `status = ["in_progress","in_review"]`, limit ~30.
|
|
12
|
+
3. Render the same compact table as `/mcpbox:tasks`, titled `## In progress — <N>`.
|
|
13
|
+
4. If empty: "nothing claimed — `/mcpbox:next` to claim the next ready task." Read-only.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcpbox-mode
|
|
3
|
+
description: Set how strictly raw ideas route through the mcpbox maturity pipeline (off | lite | full).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The user invoked `/mcpbox:mode` with `$ARGUMENTS` = `off` | `lite` | `full` (empty → show current).
|
|
7
|
+
|
|
8
|
+
## What each level does
|
|
9
|
+
|
|
10
|
+
- **off** — no pipeline nudging; don't raise the pipeline on your own. Raw material still
|
|
11
|
+
isn't materialized straight into daruma — ask the user instead.
|
|
12
|
+
- **lite** (default) — nudge toward the pipeline only when the input explicitly mentions it
|
|
13
|
+
(pipeline / maturity / handoff / конвейер …).
|
|
14
|
+
- **full** — assess every substantive request for **rawness**. A raw idea, hypothesis, or
|
|
15
|
+
undecided direction matures through the pipeline (`mcpbox_pipeline_run` → …fujin → handoff)
|
|
16
|
+
before it becomes a task.
|
|
17
|
+
|
|
18
|
+
The mode only tunes how actively you *offer* the pipeline. It does not change where work
|
|
19
|
+
lands — that is the one routing rule in the MCP server's `initialize` instructions (tool descriptions
|
|
20
|
+
point to it): decided-and-bounded work and
|
|
21
|
+
follow-ups extending a run that already handed off go straight to daruma; raw material — and
|
|
22
|
+
anything belonging to a run still in flight — goes through the pipeline.
|
|
23
|
+
|
|
24
|
+
The level persists across sessions (stored in `~/.agents/mcpbox/mode`) and is read by the
|
|
25
|
+
UserPromptSubmit hook, which injects the matching reminder on each prompt.
|
|
26
|
+
|
|
27
|
+
## Steps
|
|
28
|
+
|
|
29
|
+
1. Run:
|
|
30
|
+
- Claude plugin: `node "${CLAUDE_PLUGIN_ROOT}/bin/mcpbox-claude.mjs" mode $ARGUMENTS`
|
|
31
|
+
- Other agents: `npx -y @mcpbox/mcpbox-claude@latest mode $ARGUMENTS`
|
|
32
|
+
- empty `$ARGUMENTS` → prints the current mode.
|
|
33
|
+
- invalid value → the CLI errors with the allowed set (`off | lite | full`); relay it verbatim.
|
|
34
|
+
2. Report the resulting mode in one line.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcpbox-next
|
|
3
|
+
description: Claim the next ready task from the active mcpbox plan and show its briefing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The user invoked `/mcpbox:next`. This claims a task — afterward, control returns
|
|
7
|
+
to the user/agent to actually execute it.
|
|
8
|
+
|
|
9
|
+
## Steps
|
|
10
|
+
|
|
11
|
+
1. Resolve project (`daruma_workspace_info` → `default_project`).
|
|
12
|
+
2. Active plan: `daruma_plan_list` filtered to `status = "active"`, most recent.
|
|
13
|
+
If none, stop with "no active plan — create one with `daruma_plan_materialize`".
|
|
14
|
+
3. `daruma_plan_drain_next` with the plan id. The server atomically picks the next
|
|
15
|
+
ready (unblocked) task and claims it for this session; it returns null when no
|
|
16
|
+
unclaimed ready task remains.
|
|
17
|
+
4. If "no ready task": print the server reason (e.g. "3 tasks blocked by X") and
|
|
18
|
+
suggest `/mcpbox:plan` to inspect dependencies. Stop.
|
|
19
|
+
5. Otherwise render the briefing:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
## Next task: <title>
|
|
23
|
+
|
|
24
|
+
id: <task_id>
|
|
25
|
+
plan: <plan_id>
|
|
26
|
+
priority: <pX>
|
|
27
|
+
status: 🟢 in_progress
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Then `### Description` verbatim, and when non-empty `### Dependencies` and
|
|
31
|
+
`### Related (links)`.
|
|
32
|
+
6. End with:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
→ When done: daruma_complete id=<task_id> [result_summary="<summary>"]
|
|
36
|
+
→ On failure: daruma_set_status status=todo comment={ body, kind: "blocker" }
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
7. Briefing only — do not start executing the task in this command.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcpbox-pipeline-run
|
|
3
|
+
description: Open an mcpbox maturity run from raw input (torii→…→fujin→handoff to daruma).
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The user invoked `/mcpbox:pipeline-run` with a raw idea/request in `$ARGUMENTS`.
|
|
7
|
+
|
|
8
|
+
Raw input matures through the layers; a daruma task is created **only** via handoff,
|
|
9
|
+
never by materializing a daruma task directly. The server enforces the layer order
|
|
10
|
+
(skip / `torii` as target → `422`).
|
|
11
|
+
|
|
12
|
+
## Steps
|
|
13
|
+
|
|
14
|
+
1. If `$ARGUMENTS` is empty, ask for the raw idea/request and stop.
|
|
15
|
+
2. Call `mcpbox_pipeline_run { source, kind:"text", body:"<idea>" }`. It returns
|
|
16
|
+
`run_id` immediately while all five hops run in the background. Poll
|
|
17
|
+
`mcpbox_trace_get { run_id }` until the status is no longer `running`.
|
|
18
|
+
3. On failure, report the reason from `mcpbox_trace_get`; do not hand off an
|
|
19
|
+
incomplete run.
|
|
20
|
+
4. Once `fujin` produced a mature Action Packet, call
|
|
21
|
+
`mcpbox_pipeline_handoff { run_id, action_packet, policy_snapshot, project_slug? }`,
|
|
22
|
+
taking `action_packet` from `artifacts.fujin.action_packet` and
|
|
23
|
+
`policy_snapshot` from `artifacts.policy_snapshot` in the trace. This
|
|
24
|
+
materializes the daruma task and returns `task_id`.
|
|
25
|
+
5. Verify with `mcpbox_trace_get { run_id }` (expect `status=handed_off`, a `task_id`) and
|
|
26
|
+
report the run_id + task_id.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcpbox-plan
|
|
3
|
+
description: Show the active mcpbox plan with a progress bar and dependency state.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The user invoked `/mcpbox:plan`.
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. Resolve project (`daruma_workspace_info` → `default_project`).
|
|
11
|
+
2. `daruma_plan_list` filtered to `status = ["draft","active","in_progress"]`, most recent first.
|
|
12
|
+
If none, stop with "no active plan".
|
|
13
|
+
3. For the chosen plan, `daruma_plan_get` (single call — do not enumerate the archive).
|
|
14
|
+
4. Render:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
## <plan title>
|
|
18
|
+
goal: <goal>
|
|
19
|
+
progress: [████░░░░] 4/9 done
|
|
20
|
+
|
|
21
|
+
| # | Status | Pri | Task | Depends on |
|
|
22
|
+
|---|--------|-----|------|-----------|
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Progress bar from done/total; blocked tasks marked ⛔ with their blocker ids.
|
|
26
|
+
5. Do not call `daruma_plan_list status=completed` (token-heavy). Read-only.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcpbox-status
|
|
3
|
+
description: Show who and where you are on mcpbox — workspace, account, this repo's project — plus server and pipeline health.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The user invoked `/mcpbox:status`.
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. `daruma_workspace_info` — one call carries most of the answer. If it fails
|
|
11
|
+
with a transport error, report "mcpbox unreachable" and how to start the
|
|
12
|
+
server; stop (do not fall back to `.omc/plans/` or markdown). No separate
|
|
13
|
+
health probe: the first real call is the probe.
|
|
14
|
+
- `workspace.slug` / `workspace.title` — the authorized workspace;
|
|
15
|
+
- `account.email` — who this MCP session is authenticated as;
|
|
16
|
+
- `scopes[]` — repo→project bindings; match the current working directory
|
|
17
|
+
against `scope` (longest matching prefix wins, since repos nest) to find
|
|
18
|
+
this repo's `project_id`.
|
|
19
|
+
- Self-hosted installs have no cloud account, so `workspace` and `account`
|
|
20
|
+
may be absent. Omit the line entirely — never print `null` or a bare UUID.
|
|
21
|
+
2. Resolve the project **title** for that `project_id` via `daruma_project_list`
|
|
22
|
+
(the `name` inside `scopes` is only the directory basename, not the project's
|
|
23
|
+
title). Skip if the cwd matches no scope.
|
|
24
|
+
3. One scoped `daruma_list status=active` → count open tasks (do not enumerate
|
|
25
|
+
the archive).
|
|
26
|
+
4. `mcpbox_runs_list` with `limit=5` (and `status=failed` if the user asked about
|
|
27
|
+
failures) → recent pipeline runs.
|
|
28
|
+
5. Render, dropping any line whose value is unknown:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
## mcpbox status
|
|
32
|
+
workspace: <title> (<slug>)
|
|
33
|
+
account: <email>
|
|
34
|
+
project: <project title> — <repo path>
|
|
35
|
+
open: <N> tasks
|
|
36
|
+
server: ok (v<version>, sha <git_sha>) — only when `/mcpbox:doctor` ran
|
|
37
|
+
runs: <run_id> <status> · <run_id> <status> …
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Identity first: "which workspace am I in, as whom, on what project" is the
|
|
41
|
+
question this command exists to answer; server health is the footnote.
|
|
42
|
+
|
|
43
|
+
6. Read-only.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcpbox-sync
|
|
3
|
+
description: Refresh the mcpbox task/plan view for the active project from the server.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The user invoked `/mcpbox:sync`.
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. Resolve project (`daruma_workspace_info` → `default_project`).
|
|
11
|
+
2. Re-fetch server-side: one scoped `daruma_list status=active`, and if a plan is active,
|
|
12
|
+
one `daruma_plan_get`.
|
|
13
|
+
3. Summarize what changed since the session's last view (new / closed / newly blocked),
|
|
14
|
+
in ≤5 lines. Read-only — this only refreshes context, it does not transition tasks.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcpbox-tasks
|
|
3
|
+
description: Show open mcpbox tasks for the active project as a compact markdown table.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The user invoked `/mcpbox:tasks`.
|
|
7
|
+
|
|
8
|
+
Drive the mcpbox MCP server (do not invent IDs, do not write to `.omc/plans/`).
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. Resolve project:
|
|
13
|
+
- `daruma_workspace_info` → use `default_project` if set.
|
|
14
|
+
- Else `daruma_project_list` → pick first. If none, say "no projects yet" and stop.
|
|
15
|
+
|
|
16
|
+
2. Fetch tasks server-side (don't filter locally):
|
|
17
|
+
- `daruma_list` with `project_id = <resolved>`, `status = ["inbox","todo","in_progress"]`, limit ~50.
|
|
18
|
+
- **Never** use `status=all` unless the user explicitly asked for the full archive; it is token-heavy.
|
|
19
|
+
|
|
20
|
+
3. Render exactly this format:
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
## <project title> — <N> open tasks
|
|
24
|
+
|
|
25
|
+
| # | Status | Pri | Title | Plan |
|
|
26
|
+
|---|--------|-----|-------|------|
|
|
27
|
+
| 1 | 🟢 in_progress | p1 | <truncated title> | <plan_short> |
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- Status emoji: 📥 inbox, ⬜ todo, 🟢 in_progress, ✅ done.
|
|
31
|
+
- Title truncated to 60 chars with `…`; `Plan` = last 8 chars of `plan_id` or `—`.
|
|
32
|
+
|
|
33
|
+
4. If >30 rows: show first 30, footer `…and <N> more — narrow with /mcpbox:mine`.
|
|
34
|
+
5. On `daruma_list` error: print it verbatim and stop.
|
|
35
|
+
6. Read-only — do not transition any task in this command.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: mcpbox-trace
|
|
3
|
+
description: Trace an mcpbox pipeline run — lineage chain, per-hop status, artifacts.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
The user invoked `/mcpbox:trace` with a `run_id` in `$ARGUMENTS` (or asked about recent runs).
|
|
7
|
+
|
|
8
|
+
## Steps
|
|
9
|
+
|
|
10
|
+
1. If no `run_id`: `mcpbox_runs_list { limit:5 }` (add `status:"failed"` if the user asked
|
|
11
|
+
about failures), list them, and ask which to trace (or trace the most recent).
|
|
12
|
+
2. `mcpbox_trace_get { run_id }`.
|
|
13
|
+
3. Render:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
## run <run_id> — <status>
|
|
17
|
+
torii → satori → enma → yatagarasu → fujin → daruma
|
|
18
|
+
<per-hop: layer, ok/failed, ms, lineage id>
|
|
19
|
+
handoff: <task_id or —>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
4. If `status=failed`, surface the failing layer + reason and suggest retrying that
|
|
23
|
+
hop with `mcpbox_pipeline_advance { run_id, layer }` once its input is fixed. Read-only.
|