codebyplan 1.13.49 → 1.13.51

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 (34) hide show
  1. package/dist/cli.js +447 -14
  2. package/package.json +1 -1
  3. package/templates/agents/cbp-round-executor.md +1 -6
  4. package/templates/agents/cbp-task-planner.md +2 -2
  5. package/templates/hooks/cbp-skill-context-guard.sh +52 -0
  6. package/templates/hooks/cbp-test-hooks.sh +144 -0
  7. package/templates/hooks/hooks.json +9 -0
  8. package/templates/rules/model-invocation-convention.md +40 -0
  9. package/templates/rules/parallel-waves.md +1 -1
  10. package/templates/rules/supabase-branch-lifecycle.md +2 -3
  11. package/templates/rules/task-routing-recommendation.md +1 -1
  12. package/templates/settings.project.base.json +2 -3
  13. package/templates/skills/cbp-build-cc-mode/SKILL.md +1 -1
  14. package/templates/skills/cbp-build-cc-settings/reference/cbp-permission-policy.md +42 -0
  15. package/templates/skills/cbp-checkpoint-create/SKILL.md +1 -0
  16. package/templates/skills/cbp-checkpoint-start/SKILL.md +1 -0
  17. package/templates/skills/cbp-clear-continue/SKILL.md +86 -0
  18. package/templates/skills/cbp-clear-prep/SKILL.md +121 -0
  19. package/templates/skills/cbp-round-start/SKILL.md +1 -1
  20. package/templates/skills/cbp-session-end/SKILL.md +2 -18
  21. package/templates/skills/cbp-session-start/SKILL.md +4 -18
  22. package/templates/skills/cbp-supabase-migrate/SKILL.md +1 -1
  23. package/templates/skills/cbp-task-check/SKILL.md +12 -5
  24. package/templates/skills/cbp-task-complete/SKILL.md +9 -11
  25. package/templates/skills/cbp-task-complete/reference/checkpoint-done-branching.md +14 -21
  26. package/templates/skills/cbp-task-complete/reference/next-step-heuristic.md +4 -6
  27. package/templates/skills/cbp-task-testing/SKILL.md +9 -14
  28. package/templates/skills/cbp-frontend-a11y/SKILL.md +0 -108
  29. package/templates/skills/cbp-frontend-a11y/reference/aria-roles-states.md +0 -130
  30. package/templates/skills/cbp-frontend-a11y/reference/contrast-visual.md +0 -122
  31. package/templates/skills/cbp-frontend-a11y/reference/keyboard-patterns.md +0 -154
  32. package/templates/skills/cbp-frontend-a11y/reference/semantic-html.md +0 -111
  33. package/templates/skills/cbp-git-worktree-create/SKILL.md +0 -199
  34. package/templates/skills/cbp-git-worktree-remove/SKILL.md +0 -144
@@ -1,144 +0,0 @@
1
- ---
2
- name: cbp-git-worktree-remove
3
- description: Remove git worktree and deregister from CodeByPlan
4
- argument-hint: <name> e.g. codebyplan-app
5
- effort: low
6
- ---
7
-
8
- # Git Worktree Remove
9
-
10
- Remove a git worktree folder, deregister it from CodeByPlan, and optionally delete its branch.
11
-
12
- ## Arguments
13
-
14
- `$ARGUMENTS`: worktree name or path to remove.
15
-
16
- ## Prerequisites
17
-
18
- - Must run from the **main repo** (not from the worktree being removed)
19
-
20
- ## Instructions
21
-
22
- ### Step 1: Verify Main Repo
23
-
24
- ```bash
25
- MAIN_REPO="$(git rev-parse --show-toplevel)"
26
- ```
27
-
28
- Verify not in a worktree (`.git` should be a directory, not a file).
29
-
30
- ### Step 2: List Worktrees
31
-
32
- ```bash
33
- git worktree list
34
- ```
35
-
36
- If `$ARGUMENTS` is empty, show the list and ask which to remove.
37
-
38
- ### Step 3: Resolve Worktree
39
-
40
- Find matching worktree from the list. Match by:
41
- 1. Exact path
42
- 2. Folder name (e.g. `codebyplan-app`)
43
- 3. Branch name
44
-
45
- If no match found, show available worktrees and stop.
46
-
47
- Set:
48
- - `WORKTREE_PATH` = resolved path
49
- - `BRANCH_NAME` = branch checked out in that worktree
50
-
51
- ### Step 4: Look Up and Deregister Worktree in CodeByPlan
52
-
53
- Run `codebyplan worktree remove "$BRANCH_NAME"` and parse the JSON output (`{ mcp_deregistered: boolean, warn? }`):
54
-
55
- - If `warn` is present: surface it as a non-blocking warning. The worktree was not found in CodeByPlan or deregistration failed, but local removal will proceed.
56
- - If `mcp_deregistered === true`: worktree was successfully deregistered.
57
- - If `mcp_deregistered === false`: worktree was not registered or deregistration failed; continue with local removal.
58
-
59
- ### Step 5: Check for Assigned Checkpoints
60
-
61
- If the worktree was successfully deregistered in Step 4 (`mcp_deregistered === true`), any checkpoints that were assigned to it will become unassigned. This is expected behavior and requires no additional action.
62
-
63
- ### Step 6: Confirm with User
64
-
65
- ```
66
- ## Remove Worktree
67
-
68
- **Path**: [worktree-path]
69
- **Branch**: [branch-name]
70
- **CodeByPlan**: [registered | not registered]
71
-
72
- Remove worktree and delete the branch? (The main repo is not affected)
73
- ```
74
-
75
- Ask:
76
- 1. Remove worktree only (keep branch)
77
- 2. Remove worktree and delete branch
78
- 3. Cancel
79
-
80
- ### Step 7: Remove Git Worktree
81
-
82
- ```bash
83
- git worktree remove "$WORKTREE_PATH"
84
- ```
85
-
86
- If force needed (uncommitted changes):
87
- ```bash
88
- git worktree remove --force "$WORKTREE_PATH"
89
- ```
90
-
91
- Only use `--force` if the user confirms.
92
-
93
- ### Step 8: Delete Branch (if requested)
94
-
95
- **Protected branch check:** Read the protected set from `.codebyplan/git.json`:
96
- ```bash
97
- PRODUCTION=$(jq -r '.branch_config.production // "main"' .codebyplan/git.json)
98
- PROTECTED=$(jq -r '.branch_config.protected[]? // empty' .codebyplan/git.json)
99
- ```
100
- If `$BRANCH_NAME` equals `$PRODUCTION` or appears in `$PROTECTED` — refuse deletion and stop.
101
-
102
- **Checkpoint verification:** Before deleting a feat branch, verify that the associated checkpoint has completed via `/cbp-checkpoint-end`. If the checkpoint is still active, warn the user that unshipped work may be lost.
103
-
104
- ```bash
105
- git branch -d "$BRANCH_NAME" && git push origin --delete "$BRANCH_NAME"
106
- ```
107
-
108
- Use `-d` (not `-D`) to prevent deleting unmerged work. If it fails because the branch is not fully merged, inform the user and ask if they want to force delete with `-D`.
109
-
110
- After the git branch delete succeeds, run a conditional Supabase preview-branch teardown for `$BRANCH_NAME`:
111
-
112
- > Lifecycle contract: see [[supabase-branch-lifecycle]].
113
-
114
- - Resolve the parent project ref and apply the lifecycle guard in one deterministic call:
115
-
116
- ```bash
117
- codebyplan supabase teardown-preview "$BRANCH_NAME"
118
- ```
119
-
120
- Parse its JSON `{ status, parent_ref, project_ref, reason }`. The command never deletes anything — it reads the parent ref from `.codebyplan/shipment.json` (`.shipment.surfaces.supabase.project_ref`) and applies the protected / production / parent-ref guard from [[supabase-branch-lifecycle]].
121
- - If `status === "rejected"`: STOP the teardown and surface `reason` — never delete a production / protected / integration branch or one whose preview ref equals the parent.
122
- - Otherwise (`allowed` or `not_found`), use `parent_ref` for the live existence check — `mcp__supabase__list_branches` with `project_id: <parent_ref>`, then scan for an entry whose `name` exactly equals `$BRANCH_NAME`:
123
- - If found: call `mcp__supabase__delete_branch` with its `branch_id`. Report "Supabase preview branch deleted: `$BRANCH_NAME`".
124
- - If not found: no-op silently — the GitHub integration may have already removed it on PR close; not-found is success, NOT an error.
125
- - If the `list_branches` call itself fails (network, auth, or a non-success response — distinct from a successful lookup that returns no match): emit a non-blocking warning that the Supabase preview branch for `$BRANCH_NAME` may still exist and should be verified in the dashboard. Do not treat an API failure as a not-found success.
126
- - Never delete the parent project (`parent_ref` from `codebyplan supabase teardown-preview`) itself or any persistent/production branch — the `teardown-preview` guard enforces this.
127
-
128
- ### Step 9: Show Result
129
-
130
- ```
131
- ## Worktree Removed
132
-
133
- **Removed**: [worktree-path]
134
- **Branch**: [deleted | kept]
135
- **CodeByPlan**: [deregistered | was not registered]
136
-
137
- ### Remaining Worktrees
138
- [output of git worktree list]
139
- ```
140
-
141
- ## Integration
142
-
143
- - **Related**: `/cbp-git-worktree-create` (create and register)
144
- - **CLI**: `codebyplan worktree remove <name>` (Step 4 — deregister from CodeByPlan)