codebyplan 1.12.0 → 1.13.3
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/dist/cli.js +2648 -2033
- package/package.json +2 -2
- package/templates/github-workflows/publish.yml +207 -0
- package/templates/hooks/README.md +1 -13
- package/templates/hooks/cbp-test-coverage-gate.sh +8 -0
- package/templates/hooks/cbp-test-hooks.sh +0 -42
- package/templates/hooks/hooks.json +0 -9
- package/templates/settings.project.base.json +154 -3
- package/templates/skills/cbp-build-cc-settings/SKILL.md +2 -0
- package/templates/skills/cbp-build-cc-settings/reference/cbp-permission-policy.md +48 -0
- package/templates/skills/cbp-checkpoint-end/SKILL.md +7 -0
- package/templates/skills/cbp-checkpoint-start/SKILL.md +2 -2
- package/templates/skills/cbp-session-start/SKILL.md +1 -1
- package/templates/skills/{cbp-e2e-setup → cbp-setup-e2e}/SKILL.md +1 -1
- package/templates/skills/cbp-setup-eslint/SKILL.md +199 -0
- package/templates/skills/cbp-setup-eslint/reference/base.md +82 -0
- package/templates/skills/cbp-setup-eslint/reference/cli.md +56 -0
- package/templates/skills/cbp-setup-eslint/reference/e2e.md +68 -0
- package/templates/skills/cbp-setup-eslint/reference/jest.md +59 -0
- package/templates/skills/cbp-setup-eslint/reference/nestjs.md +69 -0
- package/templates/skills/cbp-setup-eslint/reference/nextjs.md +63 -0
- package/templates/skills/cbp-setup-eslint/reference/node.md +74 -0
- package/templates/skills/cbp-setup-eslint/reference/react-native.md +60 -0
- package/templates/skills/cbp-setup-eslint/reference/react.md +82 -0
- package/templates/skills/cbp-setup-eslint/reference/tailwind.md +64 -0
- package/templates/skills/cbp-setup-eslint/reference/testing-react.md +57 -0
- package/templates/skills/cbp-setup-eslint/reference/vitest.md +62 -0
- package/templates/skills/cbp-ship/reference/versioning.md +31 -3
- package/templates/skills/cbp-ship-configure/SKILL.md +16 -36
- package/templates/skills/cbp-ship-configure/reference/npm-package.md +15 -6
- package/templates/skills/cbp-ship-main/SKILL.md +4 -0
- package/templates/skills/cbp-task-complete/SKILL.md +1 -3
- package/templates/skills/cbp-task-start/SKILL.md +3 -3
- package/templates/hooks/cbp-mcp-worktree-inject.sh +0 -76
- /package/templates/skills/{cbp-e2e-setup → cbp-setup-e2e}/reference/maestro.md +0 -0
- /package/templates/skills/{cbp-e2e-setup → cbp-setup-e2e}/reference/playwright.md +0 -0
- /package/templates/skills/{cbp-e2e-setup → cbp-setup-e2e}/reference/tauri.md +0 -0
- /package/templates/skills/{cbp-e2e-setup → cbp-setup-e2e}/reference/vscode.md +0 -0
- /package/templates/skills/{cbp-e2e-setup → cbp-setup-e2e}/reference/xcuitest.md +0 -0
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# @scope: org-shared
|
|
3
|
-
# Hook: PreToolUse mcp__codebyplan__(update_task|complete_task|complete_round|update_checkpoint)
|
|
4
|
-
# Purpose: Auto-inject caller_worktree_id into MCP mutation calls when not already
|
|
5
|
-
# present. Uses the PreToolUse hookSpecificOutput.updatedInput contract
|
|
6
|
-
# (Claude Code v2.1 — see hooks.md "PreToolUse decision control"):
|
|
7
|
-
# - Output JSON with hookSpecificOutput.permissionDecision="allow" and
|
|
8
|
-
# hookSpecificOutput.updatedInput containing the full modified tool_input.
|
|
9
|
-
# This hook NEVER exits non-zero — it is a no-op on all failure paths.
|
|
10
|
-
#
|
|
11
|
-
# Fallback chain:
|
|
12
|
-
# 1. caller_worktree_id already present in tool_input → passthrough (no-op)
|
|
13
|
-
# 2. Primary: npx codebyplan resolve-worktree → UUID found → inject
|
|
14
|
-
# 3. Secondary: npx codebyplan resolve-worktree --fallback-from-branch → UUID found → inject
|
|
15
|
-
# 4. Both empty → passthrough (server pre-guard skips when absent)
|
|
16
|
-
#
|
|
17
|
-
# NEVER exit non-zero — backwards-compat passthrough when resolver is broken.
|
|
18
|
-
|
|
19
|
-
INPUT=$(cat)
|
|
20
|
-
|
|
21
|
-
TOOL_NAME=$(echo "$INPUT" | jq -r '.tool_name // empty' 2>/dev/null)
|
|
22
|
-
|
|
23
|
-
# Only intercept matching MCP mutation tools
|
|
24
|
-
case "$TOOL_NAME" in
|
|
25
|
-
mcp__codebyplan__update_task|\
|
|
26
|
-
mcp__codebyplan__complete_task|\
|
|
27
|
-
mcp__codebyplan__complete_round|\
|
|
28
|
-
mcp__codebyplan__update_checkpoint) ;;
|
|
29
|
-
*) exit 0 ;;
|
|
30
|
-
esac
|
|
31
|
-
|
|
32
|
-
# If caller_worktree_id is already present, pass through unchanged
|
|
33
|
-
EXISTING=$(echo "$INPUT" | jq -r '.tool_input.caller_worktree_id // empty' 2>/dev/null)
|
|
34
|
-
if [ -n "$EXISTING" ]; then
|
|
35
|
-
exit 0
|
|
36
|
-
fi
|
|
37
|
-
|
|
38
|
-
# Try primary resolver
|
|
39
|
-
UUID=$(npx --yes codebyplan resolve-worktree 2>/dev/null)
|
|
40
|
-
|
|
41
|
-
# Try fallback if primary returned empty
|
|
42
|
-
if [ -z "$UUID" ]; then
|
|
43
|
-
UUID=$(npx --yes codebyplan resolve-worktree --fallback-from-branch 2>/dev/null)
|
|
44
|
-
fi
|
|
45
|
-
|
|
46
|
-
# If no UUID resolved, passthrough unchanged
|
|
47
|
-
if [ -z "$UUID" ]; then
|
|
48
|
-
exit 0
|
|
49
|
-
fi
|
|
50
|
-
|
|
51
|
-
# Extract tool_input and guard against null before merging
|
|
52
|
-
TOOL_INPUT=$(echo "$INPUT" | jq -c '.tool_input' 2>/dev/null)
|
|
53
|
-
if [ -z "$TOOL_INPUT" ] || [ "$TOOL_INPUT" = "null" ]; then
|
|
54
|
-
# No tool_input to mutate — output original input unchanged
|
|
55
|
-
echo "$INPUT"
|
|
56
|
-
exit 0
|
|
57
|
-
fi
|
|
58
|
-
|
|
59
|
-
MERGED_TOOL_INPUT=$(echo "$TOOL_INPUT" | jq -c --arg uuid "$UUID" '. + {caller_worktree_id: $uuid}' 2>/dev/null)
|
|
60
|
-
if [ -z "$MERGED_TOOL_INPUT" ] || [ "$MERGED_TOOL_INPUT" = "null" ]; then
|
|
61
|
-
echo "$INPUT"
|
|
62
|
-
exit 0
|
|
63
|
-
fi
|
|
64
|
-
|
|
65
|
-
# Output PreToolUse hookSpecificOutput with updatedInput
|
|
66
|
-
jq -n \
|
|
67
|
-
--argjson updated "$MERGED_TOOL_INPUT" \
|
|
68
|
-
'{
|
|
69
|
-
hookSpecificOutput: {
|
|
70
|
-
hookEventName: "PreToolUse",
|
|
71
|
-
permissionDecision: "allow",
|
|
72
|
-
updatedInput: $updated
|
|
73
|
-
}
|
|
74
|
-
}'
|
|
75
|
-
|
|
76
|
-
exit 0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|