@vocdoni/skills 0.1.1 → 0.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.
Files changed (65) hide show
  1. package/.claude-plugin/marketplace.json +12 -2
  2. package/CHANGELOG.md +12 -0
  3. package/README.md +13 -0
  4. package/package.json +1 -1
  5. package/plugins/agentic-dev/.claude-plugin/plugin.json +1 -1
  6. package/plugins/agentic-dev/skills/subagent-driven-development/SKILL.md +10 -5
  7. package/plugins/agentic-dev/skills/subagent-driven-development/references/dispatch.md +20 -0
  8. package/plugins/agentic-dev/skills/subagent-driven-development/references/ledger.md +1 -0
  9. package/plugins/agentic-dev/skills/subagent-driven-development/scripts/task-brief.sh +2 -0
  10. package/plugins/agentic-dev/skills/subagent-driven-development/templates/plan.md +4 -0
  11. package/plugins/claude-pi-subagent/.claude-plugin/marketplace.json +1 -1
  12. package/plugins/claude-pi-subagent/plugins/pi-subagent/.claude-plugin/plugin.json +1 -1
  13. package/plugins/claude-pi-subagent/plugins/pi-subagent/dist/server.mjs +75 -12
  14. package/plugins/claude-pi-subagent/plugins/pi-subagent/package-lock.json +89 -89
  15. package/plugins/claude-pi-subagent/plugins/pi-subagent/package.json +2 -2
  16. package/plugins/claude-pi-subagent/plugins/pi-subagent/src/server.ts +1 -1
  17. package/plugins/vocdoni-ui-style/.claude-plugin/plugin.json +25 -0
  18. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/SKILL.md +99 -0
  19. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/components/chakra/product.tsx +263 -0
  20. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/components/shadcn/brand.tsx +195 -0
  21. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/components/shadcn/button.tsx +67 -0
  22. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/components/shadcn/status-badge.tsx +93 -0
  23. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/logo/vocdoni-logo-ink.svg +15 -0
  24. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/logo/vocdoni-logo-white.svg +15 -0
  25. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/logo/vocdoni-logo.svg +15 -0
  26. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/logo/vocdoni-mark-ink.svg +7 -0
  27. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/logo/vocdoni-mark-white.svg +7 -0
  28. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/logo/vocdoni-mark.svg +7 -0
  29. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/editorial-footer.webp +0 -0
  30. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/editorial-home-hero.webp +0 -0
  31. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/editorial-mobile.webp +0 -0
  32. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/editorial-stats-and-panels.webp +0 -0
  33. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/editorial-vertical-hero.webp +0 -0
  34. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/editorial-washes-and-comparison.webp +0 -0
  35. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/product-process-results.webp +0 -0
  36. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/reference/product-signin.webp +0 -0
  37. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/tokens/editorial.chakra.ts +285 -0
  38. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/tokens/editorial.css +847 -0
  39. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/tokens/editorial.tailwind.css +352 -0
  40. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/tokens/product.chakra.ts +410 -0
  41. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/tokens/product.css +1116 -0
  42. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/assets/tokens/product.tailwind.css +289 -0
  43. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/examples/editorial-landing.html +358 -0
  44. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/examples/email-vote-invitation.html +58 -0
  45. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/examples/product-auth.html +81 -0
  46. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/examples/product-builder.html +147 -0
  47. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/examples/product-dashboard.html +185 -0
  48. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/examples/product-voting.html +326 -0
  49. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/references/brand-core.md +166 -0
  50. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/references/editorial.md +198 -0
  51. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/references/product.md +173 -0
  52. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/references/recipes.md +264 -0
  53. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/references/stacks.md +196 -0
  54. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/references/ux-flows.md +110 -0
  55. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/bad-editorial.tsx +15 -0
  56. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/bad-product.tsx +9 -0
  57. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/doc.md +10 -0
  58. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/escaped.json +1 -0
  59. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/good-editorial.tsx +16 -0
  60. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/good-product.css +6 -0
  61. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/locale.json +1 -0
  62. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/multiline-attr.tsx +8 -0
  63. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/multiline-copy.tsx +10 -0
  64. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style-fixtures/regex-literal.tsx +5 -0
  65. package/plugins/vocdoni-ui-style/skills/vocdoni-ui-style/scripts/check-style.mjs +436 -0
@@ -36,11 +36,21 @@
36
36
  "license": "AGPL-3.0-or-later",
37
37
  "homepage": "https://github.com/vocdoni/skills"
38
38
  },
39
+ {
40
+ "name": "vocdoni-ui-style",
41
+ "source": "./plugins/vocdoni-ui-style",
42
+ "description": "Vocdoni look and feel for any UI: editorial (vocdoni.io) and product (vocdoni-app) modes, tokens for Tailwind/shadcn, Chakra v3 and plain CSS, components, logos, HTML examples, voting UX flows and a style checker.",
43
+ "version": "0.1.0",
44
+ "category": "design",
45
+ "tags": ["vocdoni", "design-system", "ui", "ux", "brand", "tailwind", "shadcn", "chakra-ui"],
46
+ "license": "AGPL-3.0-or-later",
47
+ "homepage": "https://github.com/vocdoni/skills"
48
+ },
39
49
  {
40
50
  "name": "agentic-dev",
41
51
  "source": "./plugins/agentic-dev",
42
52
  "description": "Run non-trivial engineering work as a controlled delivery: sized work, audited spec and plan, subagents implementing task by task, every diff reviewed, a strict gate audit before merge, and releases only on the owner's OK. A SessionStart hook makes the model load it without being asked.",
43
- "version": "0.2.0",
53
+ "version": "0.3.0",
44
54
  "category": "engineering",
45
55
  "tags": ["subagents", "orchestration", "planning", "code-review", "audit", "workflow"],
46
56
  "license": "AGPL-3.0-or-later",
@@ -82,7 +92,7 @@
82
92
  "name": "pi-subagent",
83
93
  "source": "./plugins/claude-pi-subagent/plugins/pi-subagent",
84
94
  "description": "Delegate to named Pi subagents (.md persona + model + tools, incl. MCP) and bounded coding tasks from Claude Code. Bundles a local stdio MCP server that launches Pi (pi --mode rpc), isolates code edits in git worktrees, and returns compact summaries plus diff paths — never applying changes automatically.",
85
- "version": "0.2.0",
95
+ "version": "0.2.1",
86
96
  "category": "engineering",
87
97
  "tags": ["pi", "subagent", "mcp", "delegation", "worktree", "coding-agent", "agents"],
88
98
  "license": "MIT",
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @vocdoni/skills
2
2
 
3
+ ## 0.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#36](https://github.com/vocdoni/skills/pull/36) [`cc670d3`](https://github.com/vocdoni/skills/commit/cc670d3447a9d73e112c66b1ac20a88b81a3d8c3) Thanks [@altergui](https://github.com/altergui)! - The agentic-dev subagent-driven-development skill now keeps the plan drafter's validated code as per-task patches. The drafter commits once per task in a scratch git checkout of the base commit and exports each commit as `.delivery/<topic>/patches/task-<N>.patch`. Implementers apply patches with `git am -3` before adapting, so the drafter's validated code reaches production without re-transcription.
8
+
9
+ - [#40](https://github.com/vocdoni/skills/pull/40) [`f4c35d4`](https://github.com/vocdoni/skills/commit/f4c35d4ba763e7a11e847064edbcdc150448e9cb) Thanks [@p4u](https://github.com/p4u)! - New plugin `vocdoni-ui-style` (`npx @vocdoni/skills install --plugin ui-style`): builds UIs with Vocdoni's look and feel in its two visual modes, editorial (vocdoni.io) and product (vocdoni-app, with white-label support). It ships design tokens for Tailwind v4 + shadcn/ui, Chakra UI v3 and plain CSS, React components, logos, reference screenshots, runnable HTML examples, worked React recipes, step-by-step UX flows for voting and vote building, copy rules, and a brand style checker.
10
+
11
+ ### Patch Changes
12
+
13
+ - [#39](https://github.com/vocdoni/skills/pull/39) [`1443132`](https://github.com/vocdoni/skills/commit/1443132c7ac9dfb2209d3fc9e7183fda3edbfb1e) Thanks [@p4u](https://github.com/p4u)! - pi-subagent 0.2.1 bundles MCP SDK 1.32 in its server: task lookups and task message queues are scoped to the session that owns them, and tool inputs get an element-count limit. Dependencies hono (security fixes) and vite are also updated; neither is part of the bundled server.
14
+
3
15
  ## 0.1.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -15,6 +15,7 @@ claude plugin install vocdoni-integrator-sdk@vocdoni
15
15
  claude plugin install vocdoni-go@vocdoni
16
16
  claude plugin install vocdoni-stripe@vocdoni
17
17
  claude plugin install vocdoni-internal-oauth@vocdoni
18
+ claude plugin install vocdoni-ui-style@vocdoni
18
19
  claude plugin install agentic-dev@vocdoni
19
20
  claude plugin install pi-subagent@vocdoni # MCP server + agents — needs Pi (see its README)
20
21
 
@@ -53,6 +54,8 @@ SDK references for anyone building voting on Vocdoni — clients, partners, and
53
54
 
54
55
  This is a **remote plugin**: the skill lives in the [vocdoni-integrator-sdk repo][integrator-sdk] and is cloned (or pulled) on demand by the npx CLI — pass `--offline` to skip fetching and use the cached clone.
55
56
 
57
+ Building the voting UI itself? [`vocdoni-ui-style`](#-vocdoni-ui-style--vocdoni-look-and-feel) (listed under the team skills) carries the product look of the Vocdoni app, including the white-label accent for an organization's own color.
58
+
56
59
  ---
57
60
 
58
61
  ## Skills for the Vocdoni team
@@ -81,6 +84,12 @@ Requires `jq` and either the [Stripe CLI](https://docs.stripe.com/stripe-cli) wi
81
84
  | ------------------------ | -------------- |
82
85
  | `vocdoni-internal-oauth` | Add Google sign-in for `@vocdoni.org` accounts to an existing internal web tool through the central OpenID Connect provider at `oauth.vocdoni.org`: register the tool as a client in [vocdoni/oauth][oauth], wire the Go kit (`vocauth`) or the Node/TypeScript kit (`@vocdoni/oauth`, Express and Fetch-API frameworks), use any OIDC library or oauth2-proxy for other stacks, develop locally against the dev provider, migrate away from a shared password, rotate cookie keys and troubleshoot. |
83
86
 
87
+ ### 🎨 `vocdoni-ui-style` — Vocdoni look and feel
88
+
89
+ | Skill | What it covers |
90
+ | ------------------ | -------------- |
91
+ | `vocdoni-ui-style` | Build UIs that look and behave like Vocdoni's products, in its two visual modes: **editorial** (vocdoni.io: cream surfaces, warm ink, Fraunces serif headings, green accent, yellow eyebrow dot) for marketing, landing and docs pages, and **product** (vocdoni-app: white, Inter at light weights, monochrome or white-label accent) for dashboards, voting pages and admin tools. Ships tokens for Tailwind v4 + shadcn/ui, Chakra UI v3 and plain CSS, React components, logo files, reference screenshots, runnable HTML examples (landing, voting flow, dashboard, sign-in, vote builder, transactional email), worked React recipes, step-by-step UX flows for voting, vote building and onboarding, specs for docs sites and result PDFs, copy rules, and a brand style checker (`scripts/check-style.mjs`). |
92
+
84
93
  ### 🧭 `agentic-dev` — subagent-driven development with independent audits
85
94
 
86
95
  | Skill | What it covers |
@@ -121,6 +130,7 @@ claude plugin install vocdoni-integrator-sdk@vocdoni
121
130
  claude plugin install vocdoni-go@vocdoni
122
131
  claude plugin install vocdoni-stripe@vocdoni
123
132
  claude plugin install vocdoni-internal-oauth@vocdoni
133
+ claude plugin install vocdoni-ui-style@vocdoni
124
134
  claude plugin install agentic-dev@vocdoni
125
135
  claude plugin install pi-subagent@vocdoni # see plugins/claude-pi-subagent/plugins/pi-subagent/README.md
126
136
  ```
@@ -145,6 +155,7 @@ npx @vocdoni/skills install --plugin sdk
145
155
  npx @vocdoni/skills install --plugin integrator-sdk # remote plugin, cloned on demand
146
156
  npx @vocdoni/skills install --plugin davinci-sdk # full name (no vocdoni- prefix)
147
157
  npx @vocdoni/skills install --plugin agentic-dev # skill only; the SessionStart hook is Claude Code plugin-only
158
+ npx @vocdoni/skills install --plugin ui-style # 'ui-style' → 'vocdoni-ui-style'
148
159
 
149
160
  # A single skill, looked up across plugins
150
161
  npx @vocdoni/skills install go-modern
@@ -230,6 +241,8 @@ Copy the skill directories again over the old ones, or `git pull` if you symlink
230
241
  │ │ └── …
231
242
  │ ├── vocdoni-internal-oauth/
232
243
  │ │ └── …
244
+ │ ├── vocdoni-ui-style/ # skill + tokens, components, logos, examples
245
+ │ │ └── …
233
246
  │ ├── agentic-dev/ # skill + SessionStart hook (hooks/)
234
247
  │ │ └── …
235
248
  │ └── claude-pi-subagent/ # nested marketplace (pi-agent-tools)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vocdoni/skills",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Vocdoni's curated skills for AI coding assistants (Claude Code, Cursor, Cline, and other Anthropic-skill-compatible clients).",
5
5
  "bin": {
6
6
  "vocdoni-skills": "bin/install.js"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-dev",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "A controlled way to run non-trivial engineering work with Claude Code. The subagent-driven-development skill sizes the work, writes and audits a spec and plan, delegates implementation to subagents task by task, reviews every diff, runs a strict whole-branch gate audit, then merges and releases only with the owner's explicit OK. Ships audit and dispatch prompt templates, spec and plan templates, a ledger that survives context compaction, and scripts that generate per-task briefs. A SessionStart hook tells the model when to load the skill without being asked, and flags unfinished deliveries in the current repo.",
5
5
  "author": {
6
6
  "name": "Vocdoni",
@@ -114,11 +114,16 @@ match, the spec and the plan share one workspace.
114
114
 
115
115
  The plan has full code for each step, exact commands with expected output, Global Constraints,
116
116
  Review Focus, branch names with base commits, and a closing *Merge and release* section. The
117
- drafter checks every code block in a scratch copy outside the repo, under
118
- `~/.cache/<project>/scratch/`, never in `/tmp` or the working tree. Read the header, the
119
- constraints and the riskiest tasks yourself, then commit the plan. Then create the feature
120
- branch in every repo from the base commit named in the plan header (`git switch -c <branch>
121
- <base>`), and record the base SHAs in the ledger header.
117
+ drafter's scratch is a git checkout of the plan's base commit: `git worktree add
118
+ ~/.cache/<project>/scratch/<topic> <base>` in the main repo, or a clone on the build host when
119
+ builds must run remotely. The drafter runs every code block there, commits once per task with
120
+ the task's commit message, and exports each commit with `git format-patch -1 --stdout >
121
+ <repo>/.delivery/<topic>/patches/task-<N>.patch` into the main checkout. Patches are untracked
122
+ and survive the job. The plan's code must match the patches exactly: the plan is what gets
123
+ reviewed and audited, the patch is what gets applied. Keep the scratch until the delivery
124
+ merges. Read the header, the constraints and the riskiest tasks yourself, then commit the plan.
125
+ Then create the feature branch in every repo from the base commit named in the plan header
126
+ (`git switch -c <branch> <base>`), and record the base SHAs in the ledger header.
122
127
 
123
128
  **5. Pre-flight audit †.** Dispatch the auditor with the pre-flight prompt. It returns a conflict table
124
129
  (task pairs that share files or interfaces, and whether each task is consistent with itself)
@@ -20,6 +20,14 @@ turns the model role into the Agent tool's `model` value ([models.md](models.md)
20
20
  | a normal plan task: multi-file, some integration judgement | standard model |
21
21
  | concurrency, soundness, cryptography, a security path, or a fix after a Critical finding | strong model |
22
22
 
23
+ When a patch file is present in the brief, the model role reflects what the implementer does with
24
+ it, not the task's original complexity:
25
+
26
+ | Patch situation | Model role |
27
+ |---|---|
28
+ | patch applies cleanly and tests pass | fast model |
29
+ | patch does not apply or tests fail; implementer adapts minimally | standard model |
30
+
23
31
  When in doubt, pick the cheaper model role and let the escalation ladder catch failures. The
24
32
  exception is security-sensitive code, which starts at the strong model.
25
33
 
@@ -57,10 +65,22 @@ Constraints:
57
65
  - Gated or ignored tests must actually run: check the output for skip lines.
58
66
  <project constraints block, see below>
59
67
 
68
+ If the brief names a `Patch:` file, apply it first: `git am -3 <patch>`. `git am` creates the
69
+ task's commit with the drafter's message, so there is no separate commit step. Run the task's
70
+ tests. If they pass, you are done. If the patch does not apply, resolve the conflict and finish
71
+ with `git am --continue`. If tests fail, adapt the code minimally and fold the fix into the same
72
+ commit with `git commit --amend -- <paths>`. Rulings in the "Rulings for this task" section
73
+ override the patch: amend the commit the same way to satisfy the ruling. Record every deviation
74
+ in your report. If the brief carries no patch, follow the task's code as written.
75
+
60
76
  If the brief's code doesn't compile against the real tree, adapt it minimally and record the
61
77
  deviation in your report. If an interface that other tasks rely on would have to change, stop
62
78
  and reply NEEDS_CONTEXT with the reason. Do not redesign.
63
79
 
80
+ When a patch from an earlier task was modified during fix rounds after that task closed, later
81
+ patches may not apply cleanly. `git am -3` resolves most such conflicts; when it cannot, adapt
82
+ as above and report the deviation so the controller can update the plan.
83
+
64
84
  You do not dispatch subagents.
65
85
 
66
86
  Write your full report to <workspace>/task-<N>-report.md (format below). Your reply to me is
@@ -19,6 +19,7 @@ workspace:
19
19
  ├── progress.md # the ledger, the only file you edit by hand
20
20
  ├── audit-spec.md # spec audit (Architectural only)
21
21
  ├── preflight.md # plan pre-flight audit (Architectural only)
22
+ ├── patches/ # per-task patches from the drafter's scratch (task-<N>.patch)
22
23
  ├── task-<N>-brief.md # generated by task-brief.sh; regenerate after new rulings
23
24
  ├── task-<N>-report.md # written by the implementer
24
25
  ├── task-<N>-review.md # written by a task-reviewer (large tasks only)
@@ -53,11 +53,13 @@ focus=$(section h2 "Review Focus")
53
53
  # Accept "(Task N)", "(global)", comma lists such as "(Task 1, Task 3)", and any case.
54
54
  rulings=$(grep -iE "^Ruling R[0-9]+ \(([^)]*[^0-9])?(Task $n|global)([^0-9][^)]*)?\)" "$ledger" || true)
55
55
  plan_sha=$(git -C "$root" log -1 --format=%h -- "$plan" 2>/dev/null || true)
56
+ patch_file="$ws/patches/task-$n.patch"
56
57
 
57
58
  out="$ws/task-$n-brief.md"
58
59
  {
59
60
  echo "# Brief: Task $n"
60
61
  echo "Plan: ${plan#"$root"/} @ ${plan_sha:-uncommitted}"
62
+ if [[ -f $patch_file ]]; then echo "Patch: $patch_file"; fi
61
63
  echo "Generated: $(date '+%F %H:%M') (do not edit; regenerate with task-brief.sh)"
62
64
  echo
63
65
  echo "This brief is your single source of requirements. Rulings override the task text"
@@ -29,6 +29,7 @@ Repos and branches: <repo path> → <branch> (base <sha>) (one line per repo)
29
29
  ### Task 1: <title>
30
30
  Model: fast | standard | strong Repo: <path> Files: <exact paths>
31
31
  Goal: <one sentence, which acceptance criterion it serves>
32
+ Patch: .delivery/<topic>/patches/task-1.patch
32
33
 
33
34
  Step 1: write the failing test
34
35
  ```<lang>
@@ -50,6 +51,9 @@ Step 3: commit
50
51
  Interfaces this task provides to later tasks: <names and signatures>
51
52
 
52
53
  ### Task 2: <title>
54
+ Model: fast | standard | strong Repo: <path> Files: <exact paths>
55
+ Goal: <one sentence, which acceptance criterion it serves>
56
+ Patch: .delivery/<topic>/patches/task-2.patch
53
57
  ...
54
58
 
55
59
  ## Merge and release
@@ -9,7 +9,7 @@
9
9
  "name": "pi-subagent",
10
10
  "source": "./plugins/pi-subagent",
11
11
  "description": "Delegate to named Pi subagents (.md persona + model + tools, incl. MCP) and bounded coding tasks from Claude Code. Bundles a local stdio MCP server that launches Pi (pi --mode rpc), isolates code edits in git worktrees, and returns compact summaries plus diff paths — never applying changes automatically.",
12
- "version": "0.2.0",
12
+ "version": "0.2.1",
13
13
  "category": "engineering",
14
14
  "tags": ["pi", "subagent", "mcp", "delegation", "worktree", "coding-agent", "rpc", "agents"],
15
15
  "license": "MIT"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://anthropic.com/claude-code/plugin.schema.json",
3
3
  "name": "pi-subagent",
4
- "version": "0.2.0",
4
+ "version": "0.2.1",
5
5
  "description": "Delegate to named Pi subagents (.md persona + model + tools, incl. MCP) and bounded coding tasks from Claude Code. Bundles a local stdio MCP server that launches Pi (pi --mode rpc), isolates code edits in git worktrees, and returns compact summaries plus diff paths — never applying changes automatically.",
6
6
  "author": {
7
7
  "name": "Pau Escrich"
@@ -18758,6 +18758,9 @@ var Protocol = class {
18758
18758
  this.setRequestHandler(GetTaskPayloadRequestSchema, async (request, extra) => {
18759
18759
  const handleTaskResult = async () => {
18760
18760
  const taskId = request.params.taskId;
18761
+ if (!await this._taskStore.getTask(taskId, extra.sessionId)) {
18762
+ throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
18763
+ }
18761
18764
  if (this._taskMessageQueue) {
18762
18765
  let queuedMessage;
18763
18766
  while (queuedMessage = await this._taskMessageQueue.dequeue(taskId, extra.sessionId)) {
@@ -18788,12 +18791,12 @@ var Protocol = class {
18788
18791
  throw new McpError(ErrorCode.InvalidParams, `Task not found: ${taskId}`);
18789
18792
  }
18790
18793
  if (!isTerminal(task.status)) {
18791
- await this._waitForTaskUpdate(taskId, extra.signal);
18794
+ await this._waitForTaskUpdate(taskId, extra.signal, extra.sessionId);
18792
18795
  return await handleTaskResult();
18793
18796
  }
18794
18797
  if (isTerminal(task.status)) {
18795
18798
  const result = await this._taskStore.getTaskResult(taskId, extra.sessionId);
18796
- this._clearTaskQueue(taskId);
18799
+ this._clearTaskQueue(taskId, extra.sessionId);
18797
18800
  return {
18798
18801
  ...result,
18799
18802
  _meta: {
@@ -18830,7 +18833,7 @@ var Protocol = class {
18830
18833
  throw new McpError(ErrorCode.InvalidParams, `Cannot cancel task in terminal status: ${task.status}`);
18831
18834
  }
18832
18835
  await this._taskStore.updateTaskStatus(request.params.taskId, "cancelled", "Client cancelled task execution.", extra.sessionId);
18833
- this._clearTaskQueue(request.params.taskId);
18836
+ this._clearTaskQueue(request.params.taskId, extra.sessionId);
18834
18837
  const cancelledTask = await this._taskStore.getTask(request.params.taskId, extra.sessionId);
18835
18838
  if (!cancelledTask) {
18836
18839
  throw new McpError(ErrorCode.InvalidParams, `Task not found after cancellation: ${request.params.taskId}`);
@@ -18958,6 +18961,19 @@ var Protocol = class {
18958
18961
  const handler = this._requestHandlers.get(request.method) ?? this.fallbackRequestHandler;
18959
18962
  const capturedTransport = this._transport;
18960
18963
  const relatedTaskId = request.params?._meta?.[RELATED_TASK_META_KEY]?.taskId;
18964
+ const sessionId = capturedTransport?.sessionId;
18965
+ const store = this._taskStore;
18966
+ let relatedTaskFound = true;
18967
+ let relatedTaskLookup;
18968
+ if (relatedTaskId && store && this._taskMessageQueue && sessionId !== void 0) {
18969
+ relatedTaskFound = false;
18970
+ relatedTaskLookup = (async () => {
18971
+ if (!await store.getTask(relatedTaskId, sessionId)) {
18972
+ throw new McpError(ErrorCode.InvalidParams, `Task not found: ${relatedTaskId}`);
18973
+ }
18974
+ relatedTaskFound = true;
18975
+ })();
18976
+ }
18961
18977
  if (handler === void 0) {
18962
18978
  const errorResponse = {
18963
18979
  jsonrpc: "2.0",
@@ -18967,7 +18983,10 @@ var Protocol = class {
18967
18983
  message: "Method not found"
18968
18984
  }
18969
18985
  };
18970
- if (relatedTaskId && this._taskMessageQueue) {
18986
+ if (relatedTaskId && relatedTaskLookup) {
18987
+ const queuedError = { type: "error", message: errorResponse, timestamp: Date.now() };
18988
+ relatedTaskLookup.then(() => this._enqueueTaskMessage(relatedTaskId, queuedError, sessionId), () => capturedTransport?.send(errorResponse)).catch((error2) => this._onerror(new Error(`Failed to send an error response: ${error2}`)));
18989
+ } else if (relatedTaskId && this._taskMessageQueue) {
18971
18990
  this._enqueueTaskMessage(relatedTaskId, {
18972
18991
  type: "error",
18973
18992
  message: errorResponse,
@@ -19018,7 +19037,10 @@ var Protocol = class {
19018
19037
  closeSSEStream: extra?.closeSSEStream,
19019
19038
  closeStandaloneSSEStream: extra?.closeStandaloneSSEStream
19020
19039
  };
19021
- Promise.resolve().then(() => {
19040
+ (relatedTaskLookup ?? Promise.resolve()).then(() => {
19041
+ if (relatedTaskLookup && abortController.signal.aborted) {
19042
+ throw new McpError(ErrorCode.ConnectionClosed, "Request was cancelled");
19043
+ }
19022
19044
  if (taskCreationParams) {
19023
19045
  this.assertTaskHandlerCapability(request.method);
19024
19046
  }
@@ -19053,7 +19075,7 @@ var Protocol = class {
19053
19075
  ...error2["data"] !== void 0 && { data: error2["data"] }
19054
19076
  }
19055
19077
  };
19056
- if (relatedTaskId && this._taskMessageQueue) {
19078
+ if (relatedTaskId && this._taskMessageQueue && relatedTaskFound) {
19057
19079
  await this._enqueueTaskMessage(relatedTaskId, {
19058
19080
  type: "error",
19059
19081
  message: errorResponse,
@@ -19533,7 +19555,7 @@ var Protocol = class {
19533
19555
  throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");
19534
19556
  }
19535
19557
  const maxQueueSize = this._options?.maxTaskQueueSize;
19536
- await this._taskMessageQueue.enqueue(taskId, message, sessionId, maxQueueSize);
19558
+ await this._taskMessageQueue.enqueue(taskId, message, sessionId ?? this._transport?.sessionId, maxQueueSize);
19537
19559
  }
19538
19560
  /**
19539
19561
  * Clears the message queue for a task and rejects any pending request resolvers.
@@ -19562,12 +19584,13 @@ var Protocol = class {
19562
19584
  * Uses polling to check for updates at the task's configured poll interval.
19563
19585
  * @param taskId The task ID to wait for
19564
19586
  * @param signal Abort signal to cancel the wait
19587
+ * @param sessionId Session of the request that waits, passed to the task store
19565
19588
  * @returns Promise that resolves when an update occurs or rejects if aborted
19566
19589
  */
19567
- async _waitForTaskUpdate(taskId, signal) {
19590
+ async _waitForTaskUpdate(taskId, signal, sessionId) {
19568
19591
  let interval = this._options?.defaultTaskPollInterval ?? 1e3;
19569
19592
  try {
19570
- const task = await this._taskStore?.getTask(taskId);
19593
+ const task = await this._taskStore?.getTask(taskId, sessionId);
19571
19594
  if (task?.pollInterval) {
19572
19595
  interval = task.pollInterval;
19573
19596
  }
@@ -20433,6 +20456,42 @@ var ExperimentalMcpServerTasks = class {
20433
20456
  };
20434
20457
 
20435
20458
  // node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
20459
+ function toolInputElementCount(value, max) {
20460
+ let count = 0;
20461
+ const stack = [value];
20462
+ while (stack.length > 0) {
20463
+ const node = stack.pop();
20464
+ if (node === null || typeof node !== "object")
20465
+ continue;
20466
+ if (Array.isArray(node)) {
20467
+ for (const child of node) {
20468
+ if (++count > max)
20469
+ return count;
20470
+ if (child !== null && typeof child === "object")
20471
+ stack.push(child);
20472
+ }
20473
+ } else {
20474
+ for (const key in node) {
20475
+ if (!Object.prototype.hasOwnProperty.call(node, key))
20476
+ continue;
20477
+ if (++count > max)
20478
+ return count;
20479
+ const child = node[key];
20480
+ if (child !== null && typeof child === "object")
20481
+ stack.push(child);
20482
+ }
20483
+ }
20484
+ }
20485
+ return count;
20486
+ }
20487
+ function resolveMaxToolInputElements(value) {
20488
+ if (value === void 0 || value === Infinity)
20489
+ return void 0;
20490
+ if (typeof value !== "number" || Number.isNaN(value) || value < 1) {
20491
+ throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);
20492
+ }
20493
+ return value;
20494
+ }
20436
20495
  var McpServer = class {
20437
20496
  constructor(serverInfo, options) {
20438
20497
  this._registeredResources = {};
@@ -20444,6 +20503,7 @@ var McpServer = class {
20444
20503
  this._resourceHandlersInitialized = false;
20445
20504
  this._promptHandlersInitialized = false;
20446
20505
  this.server = new Server(serverInfo, options);
20506
+ this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
20447
20507
  }
20448
20508
  /**
20449
20509
  * Access experimental features.
@@ -20574,12 +20634,15 @@ var McpServer = class {
20574
20634
  * Validates tool input arguments against the tool's input schema.
20575
20635
  */
20576
20636
  async validateToolInput(tool, args, toolName) {
20637
+ if (this._maxToolInputElements !== void 0 && toolInputElementCount(args, this._maxToolInputElements) > this._maxToolInputElements) {
20638
+ throw new McpError(ErrorCode.InvalidParams, `Invalid arguments for tool ${toolName}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);
20639
+ }
20577
20640
  if (!tool.inputSchema) {
20578
20641
  return void 0;
20579
20642
  }
20580
20643
  const inputObj = normalizeObjectSchema(tool.inputSchema);
20581
20644
  const schemaToParse = inputObj ?? tool.inputSchema;
20582
- const parseResult = await safeParseAsync2(schemaToParse, args);
20645
+ const parseResult = await safeParseAsync2(schemaToParse, args ?? {});
20583
20646
  if (!parseResult.success) {
20584
20647
  const error2 = "error" in parseResult ? parseResult.error : "Unknown error";
20585
20648
  const errorMessage = getParseErrorMessage(error2);
@@ -20817,7 +20880,7 @@ var McpServer = class {
20817
20880
  }
20818
20881
  if (prompt.argsSchema) {
20819
20882
  const argsObj = normalizeObjectSchema(prompt.argsSchema);
20820
- const parseResult = await safeParseAsync2(argsObj, request.params.arguments);
20883
+ const parseResult = await safeParseAsync2(argsObj, request.params.arguments ?? {});
20821
20884
  if (!parseResult.success) {
20822
20885
  const error2 = "error" in parseResult ? parseResult.error : "Unknown error";
20823
20886
  const errorMessage = getParseErrorMessage(error2);
@@ -22760,7 +22823,7 @@ function errorResult(err) {
22760
22823
  function main() {
22761
22824
  const config2 = loadConfig();
22762
22825
  const manager = new PiTaskManager(config2);
22763
- const server = new McpServer({ name: "pi-subagent", version: "0.2.0" });
22826
+ const server = new McpServer({ name: "pi-subagent", version: "0.2.1" });
22764
22827
  server.registerTool(
22765
22828
  "pi_list_agents",
22766
22829
  {