@vocdoni/skills 0.5.3 → 0.7.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 (77) hide show
  1. package/.claude-plugin/marketplace.json +29 -27
  2. package/CHANGELOG.md +38 -0
  3. package/README.md +66 -41
  4. package/bin/install.js +13 -2
  5. package/package.json +1 -1
  6. package/plugins/agentic-dev/.claude-plugin/plugin.json +2 -2
  7. package/plugins/agentic-dev/agents/model-router.md +105 -0
  8. package/plugins/agentic-dev/skills/subagent-driven-development/SKILL.md +25 -13
  9. package/plugins/agentic-dev/skills/subagent-driven-development/references/audits.md +20 -13
  10. package/plugins/agentic-dev/skills/subagent-driven-development/references/dispatch.md +42 -1
  11. package/plugins/agentic-dev/skills/subagent-driven-development/references/ledger.md +11 -6
  12. package/plugins/agentic-dev/skills/subagent-driven-development/references/model-catalog.md +118 -0
  13. package/plugins/agentic-dev/skills/subagent-driven-development/references/models.md +126 -71
  14. package/plugins/agentic-dev/skills/subagent-driven-development/scripts/init-workspace.sh +2 -1
  15. package/plugins/agentic-dev/skills/subagent-driven-development/scripts/model-inventory.sh +142 -0
  16. package/plugins/claude-pi-subagent/plugins/pi-subagent/package-lock.json +4 -3
  17. package/plugins/vocdoni-comments/.claude-plugin/plugin.json +2 -2
  18. package/plugins/vocdoni-comments/hooks/hooks.json +28 -0
  19. package/plugins/vocdoni-comments/hooks/session-start.sh +45 -0
  20. package/plugins/vocdoni-contributing/.claude-plugin/plugin.json +3 -2
  21. package/plugins/vocdoni-contributing/hooks/hooks.json +14 -2
  22. package/plugins/vocdoni-contributing/hooks/session-start.sh +18 -6
  23. package/plugins/vocdoni-contributing/skills/contributing/SKILL.md +41 -7
  24. package/plugins/vocdoni-go/.claude-plugin/plugin.json +2 -2
  25. package/plugins/vocdoni-go/skills/vocdoni-backend-review/SKILL.md +522 -0
  26. package/plugins/vocdoni-go/skills/vocdoni-backend-review/references/prompts.md +260 -0
  27. package/plugins/vocdoni-go/skills/vocdoni-backend-review/scripts/untracked-list.sh +35 -0
  28. package/plugins/vocdoni-sdk/.claude-plugin/plugin.json +4 -5
  29. package/plugins/vocdoni-sdk/skills/vocdoni-ballot-protocol/SKILL.md +61 -38
  30. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/SKILL.md +35 -21
  31. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/recipes/approval-vote.ts +3 -3
  32. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/recipes/basic-poll.ts +6 -6
  33. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/recipes/csp-vote.ts +12 -7
  34. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/recipes/multichoice-vote.ts +3 -3
  35. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/recipes/quadratic-vote.ts +3 -3
  36. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/recipes/ranked-vote.ts +3 -3
  37. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/recipes/weighted-census.ts +3 -3
  38. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/references/accounts.md +26 -15
  39. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/references/census.md +9 -10
  40. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/references/client.md +15 -13
  41. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/references/csp.md +43 -18
  42. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/references/elections.md +4 -4
  43. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/references/errors.md +24 -21
  44. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/references/removed-features.md +98 -0
  45. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/references/results.md +0 -1
  46. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/references/voting.md +30 -34
  47. package/plugins/vocdoni-sequencer/.claude-plugin/plugin.json +21 -0
  48. package/plugins/vocdoni-sequencer/skills/vocdoni-sequencer/SKILL.md +169 -0
  49. package/plugins/vocdoni-sequencer/skills/vocdoni-sequencer/references/removed-routes.md +60 -0
  50. package/plugins/davinci-sdk/.claude-plugin/plugin.json +0 -13
  51. package/plugins/davinci-sdk/skills/davinci-sdk/SKILL.md +0 -120
  52. package/plugins/davinci-sdk/skills/davinci-sdk/recipes/bootstrap.ts +0 -61
  53. package/plugins/davinci-sdk/skills/davinci-sdk/recipes/cast-vote.ts +0 -78
  54. package/plugins/davinci-sdk/skills/davinci-sdk/recipes/create-process.ts +0 -102
  55. package/plugins/davinci-sdk/skills/davinci-sdk/recipes/full-election.ts +0 -128
  56. package/plugins/davinci-sdk/skills/davinci-sdk/recipes/read-results.ts +0 -73
  57. package/plugins/davinci-sdk/skills/davinci-sdk/recipes/token-census.ts +0 -111
  58. package/plugins/davinci-sdk/skills/davinci-sdk/references/ballot-modes.md +0 -125
  59. package/plugins/davinci-sdk/skills/davinci-sdk/references/census.md +0 -168
  60. package/plugins/davinci-sdk/skills/davinci-sdk/references/contracts.md +0 -133
  61. package/plugins/davinci-sdk/skills/davinci-sdk/references/errors.md +0 -83
  62. package/plugins/davinci-sdk/skills/davinci-sdk/references/process.md +0 -225
  63. package/plugins/davinci-sdk/skills/davinci-sdk/references/protocol.md +0 -65
  64. package/plugins/davinci-sdk/skills/davinci-sdk/references/sequencer.md +0 -135
  65. package/plugins/davinci-sdk/skills/davinci-sdk/references/setup.md +0 -123
  66. package/plugins/davinci-sdk/skills/davinci-sdk/references/voting.md +0 -128
  67. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/recipes/anonymous-vote.ts +0 -108
  68. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/recipes/token-census.ts +0 -121
  69. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/references/anonymous.md +0 -183
  70. package/plugins/vocdoni-sdk/skills/vocdoni-sdk/references/census3.md +0 -308
  71. package/plugins/vocdoni-stripe/.claude-plugin/plugin.json +0 -22
  72. package/plugins/vocdoni-stripe/skills/stripe-subscription/SKILL.md +0 -276
  73. package/plugins/vocdoni-stripe/skills/stripe-subscription/references/backend-contract.md +0 -142
  74. package/plugins/vocdoni-stripe/skills/stripe-subscription/references/product-templates.md +0 -132
  75. package/plugins/vocdoni-stripe/skills/stripe-subscription/references/stripe-cli.md +0 -212
  76. package/plugins/vocdoni-stripe/skills/stripe-subscription/scripts/clone-product.sh +0 -247
  77. package/plugins/vocdoni-stripe/skills/stripe-subscription/scripts/stripe-json.sh +0 -223
@@ -0,0 +1,142 @@
1
+ #!/usr/bin/env bash
2
+ # Print what a delivery can dispatch right now, for the model-router agent and the controller.
3
+ # Usage: model-inventory.sh [--offline]
4
+ #
5
+ # Three plain-text sections:
6
+ # Gateway models id<TAB>display_name<TAB>created_at, from GET $ANTHROPIC_BASE_URL/v1/models
7
+ # (5 s limit), else ~/.claude/cache/gateway-models.json, else none.
8
+ # Aliases fable, opus, sonnet, haiku and the ANTHROPIC_DEFAULT_<X>_MODEL each resolves to,
9
+ # flagged when a newer version of the family is on the gateway list.
10
+ # Agents name<TAB>model<TAB>tools<TAB>description (first 100 chars)<TAB>effort for every
11
+ # agent file.
12
+ #
13
+ # --offline skips the network. Never prints the token. Writes nothing, never blocks, always exits 0.
14
+ # Plain bash 3.2 with sed, grep, awk and curl, so it runs on stock macOS.
15
+
16
+ offline=0
17
+ for arg in "$@"; do
18
+ [ "$arg" = "--offline" ] && offline=1
19
+ done
20
+
21
+ cache="$HOME/.claude/cache/gateway-models.json"
22
+
23
+ # One JSON model object per line, then id, display_name and created_at from each.
24
+ # shortcut: splits on "},{", so a model object holding an array of objects would be cut in two; use jq if that appears.
25
+ parse_models() {
26
+ awk '{ gsub(/\},\{/, "}\n{"); print }' | awk '
27
+ function f(k, m) {
28
+ if (!match($0, "\"" k "\":\"[^\"]*\"")) return ""
29
+ return substr($0, RSTART + length(k) + 4, RLENGTH - length(k) - 5)
30
+ }
31
+ { id = f("id"); if (id == "") next
32
+ d = substr(f("created_at"), 1, 10)
33
+ print id "\t" f("display_name") (d == "" ? "" : "\t" d) }'
34
+ }
35
+
36
+ models=""
37
+ source=""
38
+ if [ -z "${ANTHROPIC_BASE_URL:-}" ]; then
39
+ source="none: ANTHROPIC_BASE_URL is not set"
40
+ else
41
+ if [ $offline -eq 0 ] && command -v curl >/dev/null 2>&1; then
42
+ token=${ANTHROPIC_AUTH_TOKEN:-${ANTHROPIC_API_KEY:-}}
43
+ # Headers come from stdin so the token never shows in the process list.
44
+ body=$(printf 'Authorization: Bearer %s\nx-api-key: %s\nanthropic-version: 2023-06-01\n' "$token" "$token" |
45
+ curl -sf --max-time 5 -H @- "${ANTHROPIC_BASE_URL%/}/v1/models?limit=1000" 2>/dev/null || true)
46
+ models=$(printf '%s' "$body" | parse_models)
47
+ [ -n "$models" ] && source="live"
48
+ fi
49
+ if [ -z "$models" ] && [ -f "$cache" ]; then
50
+ models=$(parse_models < "$cache")
51
+ if [ -n "$models" ]; then
52
+ ms=$(sed -n 's/.*"fetchedAt":\([0-9]*\).*/\1/p' "$cache")
53
+ s=${ms%???}
54
+ when=$(date -u -d "@$s" +%Y-%m-%dT%H:%MZ 2>/dev/null || date -u -r "$s" +%Y-%m-%dT%H:%MZ 2>/dev/null || echo unknown)
55
+ source="cache dated $when"
56
+ fi
57
+ fi
58
+ [ -n "$source" ] || source="none: gateway unreachable and no usable cache at ~/.claude/cache/gateway-models.json"
59
+ fi
60
+
61
+ echo "Gateway models ($source)"
62
+ [ -n "$models" ] && printf '%s\n' "$models"
63
+
64
+ echo
65
+ echo "Aliases"
66
+ for alias in fable opus sonnet haiku; do
67
+ upper=$(printf '%s' "$alias" | tr '[:lower:]' '[:upper:]')
68
+ eval "resolved=\${ANTHROPIC_DEFAULT_${upper}_MODEL:-}"
69
+ if [ -z "$resolved" ]; then
70
+ printf '%s\t(gateway default)\n' "$alias"
71
+ continue
72
+ fi
73
+ # Versions are the dash-separated digits after claude-<family>-; 8-digit date suffixes are ignored.
74
+ note=$(printf '%s\n' "$models" | awk -F '\t' -v fam="$alias" -v want="$resolved" '
75
+ function ver(id, pre, v, n, i, p, out) {
76
+ pre = "claude-" fam "-"
77
+ if (index(id, pre) != 1) return ""
78
+ v = substr(id, length(pre) + 1); sub(/[^0-9-].*$/, "", v)
79
+ n = split(v, p, "-"); out = ""
80
+ for (i = 1; i <= n; i++) if (p[i] != "" && length(p[i]) < 8) out = out sprintf("%05d.", p[i])
81
+ return out
82
+ }
83
+ $1 == "" { next }
84
+ { seen++; if ($1 == want) found = 1
85
+ v = ver($1); if (v != "" && v > best) { best = v; newest = $1 } }
86
+ END {
87
+ if (!seen) exit
88
+ if (!found) out = "MISSING: not on the gateway list"
89
+ w = ver(want)
90
+ if (w != "" && best > w) out = (out == "" ? "" : out "; ") "STALE: lags " newest " on the gateway"
91
+ if (out != "") print out
92
+ }')
93
+ if [ -n "$note" ]; then
94
+ printf '%s\t%s\t%s\n' "$alias" "$resolved" "$note"
95
+ else
96
+ printf '%s\t%s\n' "$alias" "$resolved"
97
+ fi
98
+ done
99
+
100
+ # name<TAB>model<TAB>tools<TAB>description<TAB>effort for one agent file; $2 prefixes plugin agents.
101
+ agent_line() {
102
+ awk -v prefix="$2" -v base="$(basename "$1" .md)" '
103
+ { sub(/\r$/, "") }
104
+ NR == 1 { if ($0 != "---") exit; fm = 1; next }
105
+ $0 == "---" { exit }
106
+ block && /^[ \t]/ { l = $0; sub(/^[ \t]+/, "", l); desc = desc (desc == "" ? "" : " ") l; next }
107
+ { block = 0 }
108
+ /^[A-Za-z_-]+:/ {
109
+ key = $0; sub(/:.*/, "", key); val = $0; sub(/^[^:]*:[ \t]*/, "", val)
110
+ q = substr(val, 1, 1)
111
+ if ((q == "\"" || q == sprintf("%c", 39)) && length(val) > 1 && substr(val, length(val)) == q)
112
+ val = substr(val, 2, length(val) - 2)
113
+ if (key == "name") name = val
114
+ else if (key == "model") model = val
115
+ else if (key == "tools") tools = val
116
+ else if (key == "effort") effort = val
117
+ else if (key == "description") { if (val ~ /^[|>][-+]?$/) block = 1; else desc = val }
118
+ }
119
+ END {
120
+ if (!fm) exit
121
+ gsub(/\t/, " ", desc)
122
+ printf "%s%s\t%s\t%s\t%s\t%s\n", prefix, (name == "" ? base : name), (model == "" ? "(inherit)" : model),
123
+ (tools == "" ? "(all)" : tools), substr(desc, 1, 100), (effort == "" ? "(none)" : effort)
124
+ }' "$1" 2>/dev/null
125
+ }
126
+
127
+ echo
128
+ echo "Agents (plugin agents may belong to disabled plugins or old cached versions)"
129
+ root=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
130
+ for dir in "$HOME/.claude/agents" "$root/.claude/agents"; do
131
+ for f in "$dir"/*.md; do
132
+ [ -f "$f" ] && agent_line "$f" ""
133
+ done
134
+ done
135
+ for dir in "$HOME"/.claude/plugins/cache/*/*/*/agents; do
136
+ [ -d "$dir" ] || continue
137
+ plugin=$(basename "$(dirname "$(dirname "$dir")")")
138
+ for f in "$dir"/*.md; do
139
+ [ -f "$f" ] && agent_line "$f" "$plugin:"
140
+ done
141
+ done
142
+ exit 0
@@ -1536,9 +1536,10 @@
1536
1536
  }
1537
1537
  },
1538
1538
  "node_modules/cross-spawn": {
1539
- "version": "7.0.6",
1540
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
1541
- "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
1539
+ "version": "7.1.2",
1540
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.1.2.tgz",
1541
+ "integrity": "sha512-8BPK2r+sKWC8sDinRwLwrFMq2lXTBBwzYYEB9LiCznfMurOi4FOvQflq3XOLGG+HPdMSVpe+k/s96+AtDEOgPg==",
1542
+ "license": "MIT",
1542
1543
  "dependencies": {
1543
1544
  "path-key": "^3.1.0",
1544
1545
  "shebang-command": "^2.0.0",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vocdoni-comments",
3
- "version": "0.1.0",
4
- "description": "Vocdoni's code comment rules: comments of 1-3 lines that carry the why or a constraint the code can't show, never restated code, history or measurements. Includes a trim procedure, for a branch's added comments or a whole project or folder, that shortens long blocks without losing anything only the comment said, and reports where each dropped piece still lives.",
3
+ "version": "0.2.0",
4
+ "description": "Vocdoni's code comment rules: comments of 1-3 lines that carry the why or a constraint the code can't show, never restated code, history or measurements. Includes a trim procedure, for a branch's added comments or a whole project or folder, that shortens long blocks without losing anything only the comment said, and reports where each dropped piece still lives. SessionStart and SubagentStart hooks inject the same rules into every Claude Code session and subagent, so they apply when comments are written as one step of a coding task.",
5
5
  "author": {
6
6
  "name": "Vocdoni",
7
7
  "url": "https://vocdoni.io"
@@ -0,0 +1,28 @@
1
+ {
2
+ "description": "Injects the vocdoni-comments rules for writing code comments into every session and into every subagent except read-only and forked ones, by reading the skill body from SKILL.md",
3
+ "hooks": {
4
+ "SessionStart": [
5
+ {
6
+ "hooks": [
7
+ {
8
+ "type": "command",
9
+ "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh\" SessionStart",
10
+ "timeout": 10
11
+ }
12
+ ]
13
+ }
14
+ ],
15
+ "SubagentStart": [
16
+ {
17
+ "matcher": "^(?!(Explore|Plan|claude-code-guide|statusline-setup|fork)$)",
18
+ "hooks": [
19
+ {
20
+ "type": "command",
21
+ "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh\" SubagentStart",
22
+ "timeout": 10
23
+ }
24
+ ]
25
+ }
26
+ ]
27
+ }
28
+ }
@@ -0,0 +1,45 @@
1
+ #!/usr/bin/env bash
2
+ # SessionStart and SubagentStart hook for vocdoni-comments.
3
+ #
4
+ # Injects the comments skill body (SKILL.md, frontmatter dropped) into every session and subagent, so the
5
+ # rules apply when comments are one step of a task and the skill's description never matches.
6
+ # Reads the body from SKILL.md so there is one source of truth.
7
+ #
8
+ # Prints hookSpecificOutput JSON on stdout. Reads no input, writes nothing on error, never blocks, always exits 0.
9
+ # Plain bash 3.2 so it runs on stock macOS.
10
+
11
+ # Claude Code runs this for SessionStart and SubagentStart; the output must name the event it answers.
12
+ case "${1:-}" in
13
+ SubagentStart) event=SubagentStart ;;
14
+ *) event=SessionStart ;;
15
+ esac
16
+
17
+ script_dir=$(cd "$(dirname "$0")" 2>/dev/null && pwd)
18
+
19
+ skill=""
20
+ for root in "${CLAUDE_PLUGIN_ROOT:-}" "$script_dir/.."; do
21
+ if [ -n "$root" ] && [ -r "$root/skills/comments/SKILL.md" ]; then
22
+ skill="$root/skills/comments/SKILL.md"
23
+ break
24
+ fi
25
+ done
26
+ [ -n "$skill" ] || exit 0
27
+ trim="$(dirname "$skill")/trim.md"
28
+
29
+ # Drop control characters other than tab and newline, which json_escape would leave raw, then the
30
+ # frontmatter block (first line "---" up to the next "---"), then leading blank lines.
31
+ body=$(tr -d '\000-\010\013-\037' < "$skill" 2>/dev/null | awk 'NR == 1 && /^---$/ { fm = 1; next } fm && /^---$/ { fm = 0; next } !fm' | sed '/./,$!d')
32
+ [ -n "$body" ] || exit 0
33
+
34
+ tab=$(printf '\t')
35
+
36
+ json_escape() {
37
+ printf '%s' "$1" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e "s/$tab/\\\\t/g" | awk '{ printf "%s%s", (NR > 1 ? "\\n" : ""), $0 }'
38
+ }
39
+
40
+ msg="The vocdoni-comments plugin is installed. Follow these rules whenever you write or change a code comment, even as one step of a larger task. trim.md is not included here: before trimming or reviewing comments, load the comments skill (Skill tool, vocdoni-comments:comments), or read $trim if you have no Skill tool.
41
+
42
+ $body"
43
+
44
+ printf '{"hookSpecificOutput":{"hookEventName":"%s","additionalContext":"%s"}}\n' "$event" "$(json_escape "$msg")"
45
+ exit 0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vocdoni-contributing",
3
- "version": "0.4.0",
4
- "description": "Vocdoni's rules for what the agent writes on the git host: tying each change to an issue (found, or opened before the PR), stacking an epic's PRs with gh stack, who it introduces itself as, length and structure for PR/MR descriptions, issues, reviews and commits, how to post a review as a review, and how to reply to and resolve the review threads it addresses. A SessionStart hook injects the same rules into every Claude Code session, so they apply even when a PR is one step of a larger task.",
3
+ "version": "0.7.0",
4
+ "description": "Vocdoni's rules for what the agent writes on the git host: tying each change to an issue (found, or opened before the PR), one issue per PR or stack, stacking PRs with gh stack, wiring an epic with one sub-issue per repository, epic labels and blocked-by links, who it introduces itself as, length and structure for PR/MR descriptions, issues, reviews and commits, how to post a review as a review, and how to reply to and resolve the review threads it addresses. SessionStart and SubagentStart hooks inject the same rules into every Claude Code session and subagent, so they apply even when a PR is one step of a larger task.",
5
5
  "author": {
6
6
  "name": "Vocdoni",
7
7
  "url": "https://vocdoni.io"
@@ -9,6 +9,7 @@
9
9
  "homepage": "https://github.com/vocdoni/skills",
10
10
  "repository": "https://github.com/vocdoni/skills",
11
11
  "license": "AGPL-3.0-or-later",
12
+ "dependencies": ["vocdoni-comments"],
12
13
  "keywords": [
13
14
  "claude-code",
14
15
  "skills",
@@ -1,12 +1,24 @@
1
1
  {
2
- "description": "Injects the vocdoni-contributing rules (issue tracking, stacked PRs for epics, PR/MR descriptions, issues, reviews, review threads, commits) into every session by reading the skill body from SKILL.md",
2
+ "description": "Injects the vocdoni-contributing rules (issue tracking, stacked PRs for epics, PR/MR descriptions, issues, reviews, review threads, commits) into every session and into every subagent except read-only and forked ones, by reading the skill body from SKILL.md",
3
3
  "hooks": {
4
4
  "SessionStart": [
5
5
  {
6
6
  "hooks": [
7
7
  {
8
8
  "type": "command",
9
- "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh\"",
9
+ "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh\" SessionStart",
10
+ "timeout": 10
11
+ }
12
+ ]
13
+ }
14
+ ],
15
+ "SubagentStart": [
16
+ {
17
+ "matcher": "^(?!(Explore|Plan|claude-code-guide|statusline-setup|fork)$)",
18
+ "hooks": [
19
+ {
20
+ "type": "command",
21
+ "command": "bash \"${CLAUDE_PLUGIN_ROOT}/hooks/session-start.sh\" SubagentStart",
10
22
  "timeout": 10
11
23
  }
12
24
  ]
@@ -1,13 +1,19 @@
1
1
  #!/usr/bin/env bash
2
- # SessionStart hook for the vocdoni-contributing plugin.
2
+ # SessionStart and SubagentStart hook for vocdoni-contributing.
3
3
  #
4
- # Injects the contributing skill body (SKILL.md without its YAML frontmatter) into every session, so the
5
- # rules for tracking work in an issue, PR/MR descriptions, issues, reviews and commits apply even when they
6
- # are one step of a larger task and the skill's description never matches. Reads the body from SKILL.md so there is one source of truth.
4
+ # Injects the contributing skill body (SKILL.md, frontmatter dropped) into every session and subagent, so
5
+ # rules for tracking work in an issue, PR/MR descriptions, issues, reviews and commits apply even as one step
6
+ # of a task and the skill's description never matches. Reads the body from SKILL.md so there is one source of truth.
7
7
  #
8
8
  # Prints hookSpecificOutput JSON on stdout. Reads no input, writes nothing on error, never blocks, always exits 0.
9
9
  # Plain bash 3.2 so it runs on stock macOS.
10
10
 
11
+ # Claude Code runs this for SessionStart and SubagentStart; the output must name the event it answers.
12
+ case "${1:-}" in
13
+ SubagentStart) event=SubagentStart ;;
14
+ *) event=SessionStart ;;
15
+ esac
16
+
11
17
  script_dir=$(cd "$(dirname "$0")" 2>/dev/null && pwd)
12
18
 
13
19
  skill=""
@@ -29,9 +35,15 @@ json_escape() {
29
35
  printf '%s' "$1" | sed -e 's/\\/\\\\/g' -e 's/"/\\"/g' -e "s/$tab/\\\\t/g" | awk '{ printf "%s%s", (NR > 1 ? "\\n" : ""), $0 }'
30
36
  }
31
37
 
32
- msg="The vocdoni-contributing plugin is installed. Follow these rules whenever you start a change in a repository or write or post to the git host, even as one step of a larger task:
38
+ if [ "$event" = SubagentStart ]; then
39
+ msg="The vocdoni-contributing plugin is installed. Follow these rules for every commit message and anything you write to the git host. Finding or opening the tracking issue, opening the PR and wiring them belong to the session that delegated to you: skip those steps unless your task asks for them.
40
+
41
+ $body"
42
+ else
43
+ msg="The vocdoni-contributing plugin is installed. Follow these rules whenever you start a change in a repository or write or post to the git host, even as one step of a larger task:
33
44
 
34
45
  $body"
46
+ fi
35
47
 
36
- printf '{"hookSpecificOutput":{"hookEventName":"SessionStart","additionalContext":"%s"}}\n' "$(json_escape "$msg")"
48
+ printf '{"hookSpecificOutput":{"hookEventName":"%s","additionalContext":"%s"}}\n' "$event" "$(json_escape "$msg")"
37
49
  exit 0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: contributing
3
- description: Use whenever starting work on a change in a repository, or writing or posting a pull request or merge request description, an issue, a code review, a review comment or a commit message, or answering review comments on a pull request, on GitHub, GitLab or any other git host, through gh, glab or the web, including as one step of a larger task, and when an epic issue needs several pull requests. Sets how to tie the work to an issue (find one, or open one before the PR), how to stack an epic's PRs on each other with gh stack instead of opening them all against the base branch, how to introduce yourself as the agent acting for the user, length limits and structure for PRs, issues and reviews, how to post a review, and how to reply to and resolve the review threads you address.
3
+ description: Use whenever starting work on a change in a repository, or writing or posting a pull request or merge request description, an issue, a code review, a review comment or a commit message, or answering review comments on a pull request, on GitHub, GitLab or any other git host, through gh, glab or the web, including as one step of a larger task, and when an issue needs several pull requests or spans repositories. Sets how to tie the work to an issue (find one, or open one before the PR), how to stack an issue's PRs on each other with gh stack instead of opening them all against the base branch, how to wire an epic (one sub-issue per repository, PRs linked to their issue through the API, epic labels on issues and PRs, blocked-by for real dependencies), how to introduce yourself and say whether the user asked for or reviewed the post, length limits and structure for PRs, issues and reviews, how to post a review, and how to reply to and resolve the review threads you address.
4
4
  ---
5
5
 
6
6
  # Contributing
@@ -9,7 +9,14 @@ These rules cover the issue that tracks your work and everything you write on th
9
9
 
10
10
  ## Introduce yourself
11
11
 
12
- Start every PR description, issue, review and comment you post with one line saying which model you are and who you act for, such as "This is {model} speaking on behalf of {owner}." or "{model} here, on behalf of {owner}." `{owner}` is the login of the host CLI's user (`gh api user -q .login`, `glab api user | jq -r .username`), else `git config user.name`. Don't sign off at the end.
12
+ Start every PR description, issue, review and comment you post with one line saying which model you are and how `{owner}` stands behind the post. `{owner}` is the login of the host CLI's user (`gh api user -q .login`, `glab api user | jq -r .username`), else `git config user.name`.
13
+
14
+ - The user asked for this post in their own words in this conversation, or approved its text: "This is {model} speaking on behalf of {owner}."
15
+ - Anything else: "This is {model}, working from {owner}'s account. {owner} has not asked for or reviewed this message."
16
+
17
+ Judge each post separately. When the user asks for a PR, only the PR is asked for: the tracking issue you open for it and your later replies to reviewers are not, so they take the second line. So does anything you post while the user is away (a loop, a scheduled or headless run). Showing the user the text before you post it makes it the first line. If you can't tell which applies, use the second line.
18
+
19
+ <important>Don't sign off at the end.</important>
13
20
 
14
21
  Don't add a `Co-authored-by` trailer for yourself to commits. The person running you answers for the change.
15
22
 
@@ -17,21 +24,29 @@ Don't add a `Co-authored-by` trailer for yourself to commits. The person running
17
24
 
18
25
  Every change that ends in a PR links to an issue, so the work can be found later and isn't done twice. When you start, look for one that already covers it: the issue the user named, one linked from the branch (a host development link, or a name like `58-fix-x`) or from its open PR, else a search of the repository's issues, closed ones included (`gh issue list --state all --search "<keywords>"`, `glab issue list --all --search "<keywords>"`). Reopen a fitting issue that was completed if the problem is back; if it was closed as not planned, tell the user before going on. If none fits, open one following the rules below just before you open the PR. When the work will not end in a PR, ask the user before opening an issue.
19
26
 
20
- Link the issue from the PR description: `Closes #N` when the PR finishes it, `Refs #N` when it is one part. When an issue exists but there is no PR, put the same line in the final commit message. Questions, reviews and other work that changes nothing need no issue. If the repository has issues disabled, or you cannot search or create them, say so and carry on without one.
27
+ Link the issue from the PR description with `Closes #N` and, on GitHub, also through the API, which links it whatever the PR's base (the keyword alone links only PRs against the default branch). Either way the issue closes only when a linked PR merges into the default branch; a PR merged elsewhere leaves it open, so close it by hand:
28
+
29
+ ```sh
30
+ # node IDs: gh issue view N --json id -q .id ; gh pr view P --json id -q .id
31
+ gh api graphql -F issue=I_xxx -F pr=PR_xxx -f query='
32
+ mutation($issue:ID!,$pr:ID!){addCloseIssueReferences(input:{issueId:$issue,pullRequestIds:[$pr]}){issue{number}}}'
33
+ ```
34
+
35
+ Each PR, or stack of PRs, closes the issue it tracks, plus any others it resolves along the way. A follow-up gets its own issue with no parent, even while the original is still open: a sub-issue is a piece its parent needs to be done, not something its work turned up. Work across repositories becomes an epic (see [Epics: wire the issues](#epics-wire-the-issues)). Questions, reviews and other work that changes nothing need no issue. If the repository has issues disabled, or you cannot search or create them, say so and carry on without one.
21
36
 
22
37
  ## Pull requests
23
38
 
24
39
  Keep descriptions under ~15 lines of markdown, code blocks included: what changed and why, any non-obvious decisions, how it was tested, and **one** usage example if the change has a user-facing surface. Skip anything the diff or README already says.
25
40
 
26
- ## Epics: stack the PRs
41
+ ## Several PRs: stack them
27
42
 
28
- When an issue is an epic that takes several PRs, stack them: the first PR targets the base branch (`main`, `develop`) and each later one targets the branch of the PR before it. Don't open them all against the base branch: each then repeats or conflicts with the others' changes, reviewers can't see what is new in each, and every merge forces a rebase of the rest. Keep each PR to one reviewable step, and link the epic from each with `Refs #N`.
43
+ When an issue takes several PRs in one repository, stack them: the first PR targets the base branch (`main`, `develop`) and each later one targets the branch of the PR before it. Don't open them all against the base branch: each then repeats or conflicts with the others' changes, reviewers can't see what is new in each, and every merge forces a rebase of the rest. Keep each PR to one reviewable step and link each to the stack's issue. The issue closes with the first PR that reaches the default branch, so merge the stack in one go (`gh stack merge` on its top PR); merging bottom up instead, link only the top PR.
29
44
 
30
45
  On GitHub, manage the stack with the `gh stack` extension (`gh extension install github/gh-stack`) rather than chaining bases by hand:
31
46
 
32
47
  ```sh
33
- gh stack init --base develop epic-1-api # first branch, on the base branch
34
- gh stack add epic-2-ui # each next branch, on top of the last
48
+ gh stack init --base develop 58-1-api # first branch, on the base branch
49
+ gh stack add 58-2-ui # each next branch, on top of the last
35
50
  gh stack submit # push all, open or retarget the PRs, link them as a stack
36
51
  gh stack rebase # after fixing a lower PR, cascade the change up
37
52
  gh stack merge --squash # once the whole stack is approved
@@ -39,6 +54,25 @@ gh stack merge --squash # once the whole stack is approved
39
54
 
40
55
  `gh stack merge` merges every PR up to the one you pick into the base branch in one all-or-nothing operation, so you never squash one PR and then rebase and retarget each one above it. Merge only once every PR being merged is reviewed. To turn branches already open against the base branch into a stack, `gh stack init --base <base> <branch>...` adopts them bottom to top; then `gh stack rebase` and `gh stack submit`. Without the extension, or on GitLab, set each PR's base to the previous branch (`gh pr create --base <prev>`, `glab mr create --target-branch <prev>`) and merge from the bottom up, rebasing the rest after each merge.
41
56
 
57
+ ## Epics: wire the issues
58
+
59
+ An epic tracks one change across several PRs, often in several repositories. The host counts only what is wired, never what its body links:
60
+
61
+ - **One sub-issue per repository (its PR or stack), opened there and attached directly to the epic.** The epic's progress counts only direct children, so don't nest sub-epics. A follow-up joins the epic, directly, only when the epic isn't done without it.
62
+ - **Each PR closes its repository's sub-issue,** linked as in [Track the work in an issue](#track-the-work-in-an-issue).
63
+ - **Label the epic, its sub-issues and their PRs `epic-<slug>`,** so a PR list filters by epic. Labels are per repository: create the same name and color in each repository the epic touches, and give each epic its own color.
64
+ - **Mark "blocked by" only for a real dependency:** a piece that cannot be finished until another is merged or released (pinning a new proto version, adopting an SDK major). The order of releases towards production is not a blocker; say it in the epic body.
65
+ - **A project board doesn't inherit sub-issues.** Add the epic; add a sub-issue only when that board needs it as its own card.
66
+
67
+ ```sh
68
+ # replace OWNER/*REPO; the REST calls take an issue's numeric id, not its number
69
+ issue_id() { gh api "repos/$1/issues/$2" --jq .id; }
70
+ gh api -X POST repos/OWNER/EPIC_REPO/issues/E/sub_issues -F sub_issue_id="$(issue_id OWNER/SUB_REPO N)"
71
+ gh api -X POST repos/OWNER/REPO/issues/N/dependencies/blocked_by -F issue_id="$(issue_id OWNER/BLOCKER_REPO B)"
72
+ ```
73
+
74
+ On GitLab, attach child issues to the epic and use linked items marked "blocks" / "is blocked by".
75
+
42
76
  ## Issues
43
77
 
44
78
  Keep issues under ~15 lines of markdown too, code blocks included. Open with the problem in a sentence or two. For a bug, add what happens, what should happen and the shortest way to reproduce it. For a feature, add why it's needed and what "done" looks like. Then add pointers to the relevant code, PRs or issues, and a proposed approach if there's one. Quote only the log lines that matter, label guesses as guesses, and skip anything the title already says.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vocdoni-go",
3
- "version": "0.1.0",
4
- "description": "Vocdoni's Go skills: Rob Pike's proverbs, a production-grade quality checklist with a deep reference, and version-aware modern Go syntax.",
3
+ "version": "0.2.0",
4
+ "description": "Vocdoni's Go skills: Rob Pike's proverbs, a production-grade quality checklist with a deep reference, version-aware modern Go syntax, and an iterative multi-agent review of a Vocdoni Go backend branch.",
5
5
  "author": {
6
6
  "name": "Vocdoni",
7
7
  "url": "https://vocdoni.io"