codebyplan 1.5.1 → 1.9.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.
- package/dist/cli.js +4462 -748
- package/package.json +5 -1
- package/templates/.gitkeep +0 -0
- package/templates/README.md +20 -0
- package/templates/agents/cbp-cc-executor.md +213 -0
- package/templates/agents/cbp-database-agent.md +229 -0
- package/templates/agents/cbp-improve-claude.md +245 -0
- package/templates/agents/cbp-improve-round.md +284 -0
- package/templates/agents/cbp-mechanical-edits.md +111 -0
- package/templates/agents/cbp-research.md +282 -0
- package/templates/agents/cbp-round-executor.md +604 -0
- package/templates/agents/cbp-security-agent.md +134 -0
- package/templates/agents/cbp-task-check.md +213 -0
- package/templates/agents/cbp-task-planner.md +582 -0
- package/templates/agents/cbp-test-e2e-agent.md +363 -0
- package/templates/agents/cbp-testing-qa-agent.md +400 -0
- package/templates/context/mcp-docs.md +139 -0
- package/templates/hooks/README.md +236 -0
- package/templates/hooks/cbp-auto-test-hooks.sh +44 -0
- package/templates/hooks/cbp-lint-format-on-edit.sh +159 -0
- package/templates/hooks/cbp-maestro-yaml-validate.sh +100 -0
- package/templates/hooks/cbp-mcp-migration-guard.sh +32 -0
- package/templates/hooks/cbp-mcp-round-sync.sh +79 -0
- package/templates/hooks/cbp-mcp-worktree-inject.sh +76 -0
- package/templates/hooks/cbp-notify.sh +68 -0
- package/templates/hooks/cbp-plugin-dispatch.sh +29 -0
- package/templates/hooks/cbp-pre-commit-quality-gate.sh +204 -0
- package/templates/hooks/cbp-statusline.sh +347 -0
- package/templates/hooks/cbp-subagent-statusline.sh +182 -0
- package/templates/hooks/cbp-test-coverage-gate.sh +144 -0
- package/templates/hooks/cbp-test-hooks.sh +320 -0
- package/templates/hooks/hooks.json +85 -0
- package/templates/hooks/validate-context-usage.sh +59 -0
- package/templates/hooks/validate-git-commit.sh +78 -0
- package/templates/hooks/validate-git-stash-deny.sh +32 -0
- package/templates/hooks/validate-structure-lengths.sh +57 -0
- package/templates/hooks/validate-structure-lib.sh +104 -0
- package/templates/hooks/validate-structure-patterns.sh +54 -0
- package/templates/hooks/validate-structure-scope.sh +33 -0
- package/templates/hooks/validate-structure-smoke.sh +95 -0
- package/templates/hooks/validate-structure-templates.sh +34 -0
- package/templates/hooks/validate-structure.sh +69 -0
- package/templates/rules/.gitkeep +0 -0
- package/templates/rules/README.md +47 -0
- package/templates/rules/context-file-loading.md +52 -0
- package/templates/rules/scope-vocabulary.md +64 -0
- package/templates/rules/todo-backend.md +109 -0
- package/templates/settings.project.base.json +55 -0
- package/templates/settings.user.base.json +25 -0
- package/templates/skills/cbp-build-cc-agent/SKILL.md +139 -0
- package/templates/skills/cbp-build-cc-agent/examples/read-only-reviewer.md +32 -0
- package/templates/skills/cbp-build-cc-agent/examples/with-hooks.md +41 -0
- package/templates/skills/cbp-build-cc-agent/examples/with-skills-preload.md +25 -0
- package/templates/skills/cbp-build-cc-agent/reference/cbp-quality.md +153 -0
- package/templates/skills/cbp-build-cc-agent/reference/frontmatter-fields.md +37 -0
- package/templates/skills/cbp-build-cc-agent/reference/permission-modes.md +18 -0
- package/templates/skills/cbp-build-cc-agent/scripts/validate-agent.sh +67 -0
- package/templates/skills/cbp-build-cc-agent/templates/agent.md +66 -0
- package/templates/skills/cbp-build-cc-claude-file/SKILL.md +178 -0
- package/templates/skills/cbp-build-cc-claude-file/examples/minimal-project.md +33 -0
- package/templates/skills/cbp-build-cc-claude-file/examples/monorepo-with-imports.md +39 -0
- package/templates/skills/cbp-build-cc-claude-file/reference/imports.md +72 -0
- package/templates/skills/cbp-build-cc-claude-file/reference/what-belongs.md +39 -0
- package/templates/skills/cbp-build-cc-claude-file/templates/project-claude-md.md +48 -0
- package/templates/skills/cbp-build-cc-claude-file/templates/user-claude-md.md +22 -0
- package/templates/skills/cbp-build-cc-memory/SKILL.md +201 -0
- package/templates/skills/cbp-build-cc-memory/examples/feedback-memory.md +11 -0
- package/templates/skills/cbp-build-cc-memory/examples/project-memory.md +11 -0
- package/templates/skills/cbp-build-cc-memory/examples/reference-memory.md +13 -0
- package/templates/skills/cbp-build-cc-memory/examples/user-memory.md +14 -0
- package/templates/skills/cbp-build-cc-memory/reference/memory-types.md +59 -0
- package/templates/skills/cbp-build-cc-memory/reference/when-to-save.md +62 -0
- package/templates/skills/cbp-build-cc-memory/templates/MEMORY-index.md +4 -0
- package/templates/skills/cbp-build-cc-memory/templates/memory-entry.md +15 -0
- package/templates/skills/cbp-build-cc-mode/SKILL.md +99 -0
- package/templates/skills/cbp-build-cc-rule/SKILL.md +176 -0
- package/templates/skills/cbp-build-cc-rule/examples/global-rule.md +19 -0
- package/templates/skills/cbp-build-cc-rule/examples/scoped-rule.md +41 -0
- package/templates/skills/cbp-build-cc-rule/reference/paths-patterns.md +48 -0
- package/templates/skills/cbp-build-cc-rule/templates/rule.md +32 -0
- package/templates/skills/cbp-build-cc-settings/SKILL.md +220 -0
- package/templates/skills/cbp-build-cc-settings/examples/hooks-config.json +64 -0
- package/templates/skills/cbp-build-cc-settings/examples/permissions-config.json +34 -0
- package/templates/skills/cbp-build-cc-settings/examples/sandbox-config.json +42 -0
- package/templates/skills/cbp-build-cc-settings/reference/cbp-conventions.md +104 -0
- package/templates/skills/cbp-build-cc-settings/reference/permission-rules.md +61 -0
- package/templates/skills/cbp-build-cc-settings/reference/scope-precedence.md +73 -0
- package/templates/skills/cbp-build-cc-settings/reference/settings-fields.md +166 -0
- package/templates/skills/cbp-build-cc-settings/templates/settings.json +23 -0
- package/templates/skills/cbp-build-cc-settings/templates/settings.local.json +10 -0
- package/templates/skills/cbp-build-cc-skill/SKILL.md +154 -0
- package/templates/skills/cbp-build-cc-skill/examples/dynamic-context.md +31 -0
- package/templates/skills/cbp-build-cc-skill/examples/fork-skill.md +22 -0
- package/templates/skills/cbp-build-cc-skill/examples/knowledge-skill.md +25 -0
- package/templates/skills/cbp-build-cc-skill/examples/task-skill.md +29 -0
- package/templates/skills/cbp-build-cc-skill/reference/cbp-quality.md +157 -0
- package/templates/skills/cbp-build-cc-skill/reference/frontmatter-fields.md +35 -0
- package/templates/skills/cbp-build-cc-skill/reference/string-substitutions.md +60 -0
- package/templates/skills/cbp-build-cc-skill/scripts/validate-skill.sh +90 -0
- package/templates/skills/cbp-build-cc-skill/templates/skill.md +51 -0
- package/templates/skills/cbp-checkpoint-check/SKILL.md +156 -0
- package/templates/skills/cbp-checkpoint-complete/SKILL.md +109 -0
- package/templates/skills/cbp-checkpoint-create/SKILL.md +116 -0
- package/templates/skills/cbp-checkpoint-end/SKILL.md +241 -0
- package/templates/skills/cbp-checkpoint-plan/SKILL.md +137 -0
- package/templates/skills/cbp-checkpoint-plan/reference/alternative-comparison-template.md +54 -0
- package/templates/skills/cbp-checkpoint-plan/reference/dep-decision-rubric.md +50 -0
- package/templates/skills/cbp-checkpoint-plan/reference/e2e-discovery-probe.md +57 -0
- package/templates/skills/cbp-checkpoint-plan/reference/gap-analysis-playbook.md +47 -0
- package/templates/skills/cbp-checkpoint-start/SKILL.md +84 -0
- package/templates/skills/cbp-checkpoint-update/SKILL.md +115 -0
- package/templates/skills/cbp-frontend-a11y/SKILL.md +109 -0
- package/templates/skills/cbp-frontend-a11y/reference/aria-roles-states.md +130 -0
- package/templates/skills/cbp-frontend-a11y/reference/contrast-visual.md +122 -0
- package/templates/skills/cbp-frontend-a11y/reference/keyboard-patterns.md +154 -0
- package/templates/skills/cbp-frontend-a11y/reference/semantic-html.md +111 -0
- package/templates/skills/cbp-frontend-design/SKILL.md +145 -0
- package/templates/skills/cbp-frontend-design/reference/nextjs-scss.md +118 -0
- package/templates/skills/cbp-frontend-design/reference/rn-expo.md +101 -0
- package/templates/skills/cbp-frontend-design/reference/tauri-react.md +82 -0
- package/templates/skills/cbp-frontend-ui/SKILL.md +262 -0
- package/templates/skills/cbp-frontend-ui/reference/ui-label-maps.md +42 -0
- package/templates/skills/cbp-frontend-ui/reference/ui-layout-patterns.md +105 -0
- package/templates/skills/cbp-frontend-ui/reference/variant-defaults.md +149 -0
- package/templates/skills/cbp-frontend-ux/SKILL.md +181 -0
- package/templates/skills/cbp-git-branch-feat-create/SKILL.md +115 -0
- package/templates/skills/cbp-git-commit/SKILL.md +278 -0
- package/templates/skills/cbp-git-worktree-create/SKILL.md +226 -0
- package/templates/skills/cbp-git-worktree-remove/SKILL.md +145 -0
- package/templates/skills/cbp-merge-main/SKILL.md +228 -0
- package/templates/skills/cbp-round-check/SKILL.md +104 -0
- package/templates/skills/cbp-round-end/SKILL.md +183 -0
- package/templates/skills/cbp-round-end/reference/findings-presentation.md +44 -0
- package/templates/skills/cbp-round-end/reference/inline-fallback.md +35 -0
- package/templates/skills/cbp-round-execute/SKILL.md +211 -0
- package/templates/skills/cbp-round-execute/reference/inline-fallback.md +59 -0
- package/templates/skills/cbp-round-input/SKILL.md +165 -0
- package/templates/skills/cbp-round-start/SKILL.md +222 -0
- package/templates/skills/cbp-round-update/SKILL.md +163 -0
- package/templates/skills/cbp-session-end/SKILL.md +187 -0
- package/templates/skills/cbp-session-start/SKILL.md +155 -0
- package/templates/skills/cbp-ship/SKILL.md +332 -0
- package/templates/skills/cbp-ship/reference/changesets-overview.md +120 -0
- package/templates/skills/cbp-ship/reference/eas-cli-overview.md +60 -0
- package/templates/skills/cbp-ship/reference/gh-cli-overview.md +135 -0
- package/templates/skills/cbp-ship/reference/gh-cli-shipment-commands.md +283 -0
- package/templates/skills/cbp-ship/reference/npm-publish-monorepo.md +252 -0
- package/templates/skills/cbp-ship/reference/npm-publish-oidc-trusted.md +157 -0
- package/templates/skills/cbp-ship/reference/npm-publish-overview.md +171 -0
- package/templates/skills/cbp-ship/reference/preflight-checklist.md +88 -0
- package/templates/skills/cbp-ship/reference/railway-nestjs-deployment.md +169 -0
- package/templates/skills/cbp-ship/reference/railway-overview.md +120 -0
- package/templates/skills/cbp-ship/reference/railway-troubleshooting.md +168 -0
- package/templates/skills/cbp-ship/reference/release-please-overview.md +99 -0
- package/templates/skills/cbp-ship/reference/surface-expo-eas.md +155 -0
- package/templates/skills/cbp-ship/reference/surface-npm.md +180 -0
- package/templates/skills/cbp-ship/reference/surface-railway.md +152 -0
- package/templates/skills/cbp-ship/reference/surface-supabase.md +178 -0
- package/templates/skills/cbp-ship/reference/surface-tauri.md +138 -0
- package/templates/skills/cbp-ship/reference/surface-vercel.md +124 -0
- package/templates/skills/cbp-ship/reference/surface-vscode-ext.md +144 -0
- package/templates/skills/cbp-ship/reference/surfaces.md +60 -0
- package/templates/skills/cbp-ship/reference/testflight-automation.md +215 -0
- package/templates/skills/cbp-ship/reference/testflight-internal-vs-external.md +69 -0
- package/templates/skills/cbp-ship/reference/testflight-overview.md +98 -0
- package/templates/skills/cbp-ship/reference/versioning.md +116 -0
- package/templates/skills/cbp-ship/scripts/detect-surfaces.sh +217 -0
- package/templates/skills/cbp-ship/scripts/verify-expo-eas.sh +35 -0
- package/templates/skills/cbp-ship/scripts/verify-npm.sh +21 -0
- package/templates/skills/cbp-ship/scripts/verify-railway.sh +41 -0
- package/templates/skills/cbp-ship/scripts/verify-supabase.sh +19 -0
- package/templates/skills/cbp-ship/scripts/verify-tauri.sh +24 -0
- package/templates/skills/cbp-ship/scripts/verify-vercel.sh +32 -0
- package/templates/skills/cbp-ship/scripts/verify-vscode-ext.sh +25 -0
- package/templates/skills/cbp-ship/templates/eas.json +66 -0
- package/templates/skills/cbp-ship/templates/railway.toml +15 -0
- package/templates/skills/cbp-ship/templates/release-please-config.json +17 -0
- package/templates/skills/cbp-ship/templates/vercel.json +19 -0
- package/templates/skills/cbp-ship/templates/vscodeignore +21 -0
- package/templates/skills/cbp-ship/templates/workflow-changesets.yml +41 -0
- package/templates/skills/cbp-ship/templates/workflow-eas-submit.yml +53 -0
- package/templates/skills/cbp-ship/templates/workflow-npm-publish.yml +36 -0
- package/templates/skills/cbp-ship/templates/workflow-release-please.yml +21 -0
- package/templates/skills/cbp-ship/templates/workflow-tauri-release.yml +69 -0
- package/templates/skills/cbp-ship/templates/workflow-vsce-publish.yml +31 -0
- package/templates/skills/cbp-ship-configure/SKILL.md +296 -0
- package/templates/skills/cbp-ship-configure/reference/expo-mobile.md +204 -0
- package/templates/skills/cbp-ship-configure/reference/npm-package.md +165 -0
- package/templates/skills/cbp-ship-configure/reference/railway-backend.md +199 -0
- package/templates/skills/cbp-ship-configure/reference/supabase.md +200 -0
- package/templates/skills/cbp-ship-configure/reference/tauri-desktop.md +181 -0
- package/templates/skills/cbp-ship-configure/reference/vercel.md +117 -0
- package/templates/skills/cbp-ship-configure/reference/vscode-ext.md +155 -0
- package/templates/skills/cbp-ship-main/SKILL.md +65 -0
- package/templates/skills/cbp-supabase-branch-check/SKILL.md +337 -0
- package/templates/skills/cbp-supabase-branch-check/reference/dag-steps.md +29 -0
- package/templates/skills/cbp-supabase-migrate/SKILL.md +314 -0
- package/templates/skills/cbp-supabase-migrate/reference/advisor-triage.md +70 -0
- package/templates/skills/cbp-supabase-migrate/reference/cli-fallback.md +87 -0
- package/templates/skills/cbp-supabase-migrate/reference/preflight-dry-run.md +58 -0
- package/templates/skills/cbp-supabase-setup/SKILL.md +239 -0
- package/templates/skills/cbp-supabase-setup/reference/branching-setup.md +121 -0
- package/templates/skills/cbp-supabase-setup/reference/cli-fallback.md +109 -0
- package/templates/skills/cbp-task-check/SKILL.md +166 -0
- package/templates/skills/cbp-task-complete/SKILL.md +206 -0
- package/templates/skills/cbp-task-complete/reference/checkpoint-done-branching.md +48 -0
- package/templates/skills/cbp-task-complete/reference/next-step-heuristic.md +56 -0
- package/templates/skills/cbp-task-create/SKILL.md +167 -0
- package/templates/skills/cbp-task-start/SKILL.md +239 -0
- package/templates/skills/cbp-task-testing/SKILL.md +277 -0
- package/templates/skills/cbp-todo/SKILL.md +111 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: org-shared
|
|
3
|
+
name: cbp-checkpoint-complete
|
|
4
|
+
description: Complete a checkpoint after all tasks are done
|
|
5
|
+
argument-hint: [checkpoint-number]
|
|
6
|
+
effort: low
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Checkpoint Complete Command
|
|
10
|
+
|
|
11
|
+
Finalize a checkpoint after all tasks are completed.
|
|
12
|
+
|
|
13
|
+
## Instructions
|
|
14
|
+
|
|
15
|
+
### Step 0.5: Parse `$ARGUMENTS`
|
|
16
|
+
|
|
17
|
+
Parse the argument:
|
|
18
|
+
|
|
19
|
+
| Shape | Regex | Resolves to |
|
|
20
|
+
|-------|-------|-------------|
|
|
21
|
+
| `{chk}` (e.g. `108`) | `^[0-9]+$` | Target CHK-{chk} |
|
|
22
|
+
| _(empty)_ | — | Use MCP `get_current_task` to find the active checkpoint |
|
|
23
|
+
|
|
24
|
+
Anything else is malformed — surface this error and stop:
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
checkpoint-complete: invalid argument `{value}`. Expected:
|
|
28
|
+
108 → CHK-108
|
|
29
|
+
(empty) → active checkpoint
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
#### Worked examples
|
|
33
|
+
|
|
34
|
+
- `checkpoint-complete 108` → CHK-108
|
|
35
|
+
- `checkpoint-complete` (no arg) → active checkpoint via `get_current_task`
|
|
36
|
+
- `checkpoint-complete abc` → error: malformed
|
|
37
|
+
- `checkpoint-complete 108-1` → error: malformed (that is task-start's shape)
|
|
38
|
+
|
|
39
|
+
### Step 1: Get Active Checkpoint
|
|
40
|
+
|
|
41
|
+
Given the parse from Step 0.5:
|
|
42
|
+
|
|
43
|
+
| Parse | Resolution path |
|
|
44
|
+
|-------|-----------------|
|
|
45
|
+
| `{chk}` | MCP `get_checkpoints(repo_id)` → filter `number === {chk}` (must exist). |
|
|
46
|
+
| _(empty)_ | MCP `get_current_task` with repo_id. Get the active checkpoint. If no active checkpoint, show error and stop. |
|
|
47
|
+
|
|
48
|
+
### Step 2: Verify Checkpoint End Has Run
|
|
49
|
+
|
|
50
|
+
Check `checkpoint.context.shipment` — must exist with at least `feat_to_dev.merged: true`.
|
|
51
|
+
|
|
52
|
+
If not:
|
|
53
|
+
```
|
|
54
|
+
## Cannot Complete Checkpoint
|
|
55
|
+
|
|
56
|
+
Checkpoint has not been shipped yet. Run `/cbp-checkpoint-end` first to merge feat branch to development.
|
|
57
|
+
```
|
|
58
|
+
Stop here.
|
|
59
|
+
|
|
60
|
+
### Step 2.5: Verify All Tasks Complete
|
|
61
|
+
|
|
62
|
+
Use MCP `get_tasks` for the checkpoint. Verify all tasks have status `completed`.
|
|
63
|
+
|
|
64
|
+
If incomplete tasks remain:
|
|
65
|
+
```
|
|
66
|
+
## Cannot Complete Checkpoint
|
|
67
|
+
|
|
68
|
+
CHK-[NNN] has [N] incomplete tasks:
|
|
69
|
+
- TASK-[N]: [title] (status: [status])
|
|
70
|
+
|
|
71
|
+
Complete remaining tasks first, then run `/cbp-checkpoint-complete`.
|
|
72
|
+
```
|
|
73
|
+
Stop here.
|
|
74
|
+
|
|
75
|
+
### Step 3: Aggregate QA
|
|
76
|
+
|
|
77
|
+
Collect QA results from all tasks and rounds. Build checkpoint-level QA summary:
|
|
78
|
+
- Count auto checks passed/failed
|
|
79
|
+
- List user QA items pending review
|
|
80
|
+
|
|
81
|
+
If any critical failures, warn the user but don't block.
|
|
82
|
+
|
|
83
|
+
### Step 4: Complete Checkpoint
|
|
84
|
+
|
|
85
|
+
Use MCP `complete_checkpoint(checkpoint_id)`.
|
|
86
|
+
|
|
87
|
+
This automatically:
|
|
88
|
+
- Sets status to `completed`
|
|
89
|
+
- Sets `completed_at` to now
|
|
90
|
+
- Triggers auto-push to main if enabled
|
|
91
|
+
|
|
92
|
+
### Step 5: Show Result and Route
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
## Checkpoint Completed
|
|
96
|
+
|
|
97
|
+
**CHK-[NNN]**: [Title]
|
|
98
|
+
**Tasks**: [N] completed
|
|
99
|
+
**QA**: [summary]
|
|
100
|
+
**Auto-push**: [result]
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Next**: Run `/clear`, then `/cbp-todo` to find the next checkpoint or standalone task.
|
|
104
|
+
|
|
105
|
+
## Integration
|
|
106
|
+
|
|
107
|
+
- **Triggered by**: `/cbp-checkpoint-end` (auto, after successful shipment)
|
|
108
|
+
- **Reads**: MCP `get_current_task`, `get_tasks`, `get_rounds`
|
|
109
|
+
- **Writes**: MCP `complete_checkpoint`
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: org-shared
|
|
3
|
+
name: cbp-checkpoint-create
|
|
4
|
+
description: Mechanical checkpoint creation — capture the user's description, infer title + goal, dedup against existing modules, create the checkpoint row + feat branch, then hand off to /cbp-checkpoint-plan for deep planning. Creates ZERO tasks.
|
|
5
|
+
argument-hint: [checkpoint description]
|
|
6
|
+
effort: high
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Checkpoint Create Command
|
|
10
|
+
|
|
11
|
+
Runs INLINE. This is the **mechanical** stage only: capture raw user input, infer a title/goal, run a cheap module-overlap check, create the checkpoint row, create + switch to the feat branch, then auto-trigger `/cbp-checkpoint-plan`. It does **NOT** assess the idea, run research, conduct exhaustive Q&A, generate a plan, or create tasks — all of that is `/cbp-checkpoint-plan`'s job.
|
|
12
|
+
|
|
13
|
+
## Pipeline
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
/cbp-checkpoint-create (mechanical, here) → /cbp-checkpoint-plan (deep planning + tasks) → /cbp-checkpoint-start (activate + claim)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Instructions
|
|
20
|
+
|
|
21
|
+
### Step 1: Check for Existing Checkpoint Data
|
|
22
|
+
|
|
23
|
+
Source `repo_id` from `.codebyplan/repo.json`. If `$ARGUMENTS` contains a checkpoint number, or MCP `get_next_action` returns one, load it via MCP `get_checkpoints`. If the checkpoint already has `ideas[]` with descriptions, reuse `ideas[].description` (do not re-ask) and skip Step 2.
|
|
24
|
+
|
|
25
|
+
### Step 2: Get Checkpoint Description
|
|
26
|
+
|
|
27
|
+
**If `$ARGUMENTS` provided:** use it as the description. **Else** ask via AskUserQuestion: "What should this checkpoint accomplish? Describe the work in a sentence or two."
|
|
28
|
+
|
|
29
|
+
Data routing: `ideas[].description` = the user's raw words (immutable; never overwrite). Do NOT write any Claude analysis into `user_context` — that field is raw user text only. Assessment, decisions, and discoveries are written later by `/cbp-checkpoint-plan`.
|
|
30
|
+
|
|
31
|
+
### Step 3: Prompt for Deadline
|
|
32
|
+
|
|
33
|
+
Skip if a deadline is already set. Else ask via AskUserQuestion: Today / Tomorrow / This week (Friday) / Custom date.
|
|
34
|
+
|
|
35
|
+
### Step 4: Semantic-Domain Module Dedup
|
|
36
|
+
|
|
37
|
+
Cheap module-overlap pre-flight — catching "is this even a new module?" here halves the planner's round-1 surface area for duplicate-feature checkpoints.
|
|
38
|
+
|
|
39
|
+
**Trigger**: the description contains a feature verb/noun in a user-facing semantic domain:
|
|
40
|
+
|
|
41
|
+
| Domain | Trigger verbs / nouns | Glob target |
|
|
42
|
+
|--------|----------------------|-------------|
|
|
43
|
+
| Eating | eat, meal, food, recipe, ingredient, nutrition, kitchen | `apps/mobile/src/features/modules/food*/`, `apps/mobile/src/features/modules/eating*/` |
|
|
44
|
+
| Sleeping | sleep, nap, bedtime, wake, dream, rest | `apps/mobile/src/features/modules/sleep*/` |
|
|
45
|
+
| Fitness | workout, exercise, fitness, training, run, lift, rep | `apps/mobile/src/features/modules/fitness*/` |
|
|
46
|
+
| Hobbies | hobby, leisure, craft, game | `apps/mobile/src/features/modules/hobb*/` |
|
|
47
|
+
| Finance | money, expense, budget, transaction, pay, income | `apps/mobile/src/features/modules/finance*/`, `apps/mobile/src/features/modules/money*/` |
|
|
48
|
+
| Mood | mood, emotion, feeling, journal, reflect | `apps/mobile/src/features/modules/mood*/` |
|
|
49
|
+
| Social | friend, contact, message, share, social | `apps/mobile/src/features/modules/social*/` |
|
|
50
|
+
| Reading | read, book, chapter, library | `apps/mobile/src/features/modules/reading*/` |
|
|
51
|
+
| Self-care | selfcare, hygiene, skincare, wellness | `apps/mobile/src/features/modules/selfcare*/`, `apps/mobile/src/features/modules/hygiene*/` |
|
|
52
|
+
| Pets | pet, dog, cat, animal | `apps/mobile/src/features/modules/pet*/` |
|
|
53
|
+
| Work | work, job, task, productivity | `apps/mobile/src/features/modules/work*/` |
|
|
54
|
+
|
|
55
|
+
**Procedure**: tokenise the description; for each matched domain, Glob the target. Zero entries → proceed. One+ existing modules → ask via AskUserQuestion before continuing: (A) extend the existing module, (B) build a separate module — give the 1–2 sentence distinction, (C) unrelated, (D) cancel. Save the answer as a `locked: true` decision in `context.decisions[]` so `/cbp-checkpoint-plan` honors it.
|
|
56
|
+
|
|
57
|
+
Skip when the description has zero domain matches OR the user already named a target module path.
|
|
58
|
+
|
|
59
|
+
### Step 5: Infer Title + Goal
|
|
60
|
+
|
|
61
|
+
Lightweight inference from the description — no deep analysis. **Title**: concise, ≤80 chars. **Goal**: ≤300 chars, a faithful restatement of intent (not a plan).
|
|
62
|
+
|
|
63
|
+
### Step 6: Claim-or-Open Prompt
|
|
64
|
+
|
|
65
|
+
Ask the user via AskUserQuestion whether to claim this checkpoint now:
|
|
66
|
+
|
|
67
|
+
- **Claim for me + this worktree** (default) — resolve `npx codebyplan resolve-worktree 2>/dev/null` and set it as the checkpoint `worktree_id` at create. The creator carries momentum straight through plan → start.
|
|
68
|
+
- **Leave it open** — create with `worktree_id` null so anyone free can claim it later via `/cbp-checkpoint-start`.
|
|
69
|
+
|
|
70
|
+
Record the choice; it drives both the create call (Step 8) and the plan→start routing in `/cbp-checkpoint-plan`.
|
|
71
|
+
|
|
72
|
+
### Step 7: Determine Next Checkpoint Number
|
|
73
|
+
|
|
74
|
+
MCP `get_checkpoints` for the repo; highest `number` + 1.
|
|
75
|
+
|
|
76
|
+
### Step 8: Create Checkpoint Row
|
|
77
|
+
|
|
78
|
+
MCP `create_checkpoint`:
|
|
79
|
+
- `repo_id` (from `.codebyplan/repo.json`), `number`, `title`, `goal`, `deadline`, `status: "pending"`
|
|
80
|
+
- `ideas`: `[{ description: <raw user text> }]`
|
|
81
|
+
- `worktree_id`: the resolved worktree from Step 6 **only if the user chose "claim"**; omit when "leave open"
|
|
82
|
+
|
|
83
|
+
This is the first identity-stamping point — when claiming, passing `worktree_id` here engages the CHK-104 hard-lock from birth. No `context`, `research`, `plan`, or tasks are written here.
|
|
84
|
+
|
|
85
|
+
### Step 9: Create + Switch to Feat Branch
|
|
86
|
+
|
|
87
|
+
Read `.codebyplan/git.json` `branch_config.production` (default `"main"`) as `BASE`. codebyplan repos are main-only — never create or branch from a `development`/integration branch.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
git fetch origin "$BASE" 2>/dev/null || true
|
|
91
|
+
git checkout -b "feat/CHK-{NNN}-{slug}" "origin/$BASE" 2>/dev/null \
|
|
92
|
+
|| git checkout -b "feat/CHK-{NNN}-{slug}" "$BASE"
|
|
93
|
+
git push -u origin "feat/CHK-{NNN}-{slug}"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Slug: lowercase, dash-joined, punctuation dropped, ≤40 chars. Persist the branch via MCP `update_checkpoint(checkpoint_id, branch_name: "feat/CHK-{NNN}-{slug}")`. (The dedicated `/cbp-git-branch-feat-create` skill is the canonical config-driven helper if you prefer to delegate.)
|
|
97
|
+
|
|
98
|
+
### Step 10: Show Result + Auto-Trigger Plan
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
## Checkpoint Created
|
|
102
|
+
|
|
103
|
+
**CHK-NNN**: [title] • **Deadline**: [date] • **Branch**: feat/CHK-NNN-slug
|
|
104
|
+
**Claim**: [claimed by this worktree / left open]
|
|
105
|
+
|
|
106
|
+
Now planning CHK-NNN… handing off to /cbp-checkpoint-plan.
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Auto-trigger `/cbp-checkpoint-plan {NNN}` in the same context. This skill created ZERO tasks — the plan skill produces them.
|
|
110
|
+
|
|
111
|
+
## Integration
|
|
112
|
+
|
|
113
|
+
- **Runs inline**: mechanical setup only — no assessment, research, Q&A, plan, or tasks
|
|
114
|
+
- **Reads**: MCP `get_next_action`, `get_checkpoints`; `.codebyplan/repo.json`, `.codebyplan/git.json`; `npx codebyplan resolve-worktree`
|
|
115
|
+
- **Writes**: MCP `create_checkpoint` (description-only ideas + deadline + optional worktree_id), `update_checkpoint` (branch_name)
|
|
116
|
+
- **Triggers**: `/cbp-checkpoint-plan` (auto)
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: org-shared
|
|
3
|
+
name: cbp-checkpoint-end
|
|
4
|
+
description: Single point for all shipment — branch promotion to main via /cbp-ship-main, runtime deploy via /cbp-ship, branch cleanup, summary. Standalone tasks bypass shipment entirely.
|
|
5
|
+
effort: xhigh
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Checkpoint End Command
|
|
9
|
+
|
|
10
|
+
Ship the checkpoint in three phases:
|
|
11
|
+
1. **Branch promotion** — merge feat → main via `/cbp-ship-main` (which runs `codebyplan ship`)
|
|
12
|
+
2. **Runtime deploy** — call `/cbp-ship` to deploy every configured surface (Vercel, EAS, npm, Tauri, Railway, Supabase migrations, VS Code marketplace)
|
|
13
|
+
3. **Cleanup + summary** — stale feat branch removal, comprehensive shipment record
|
|
14
|
+
|
|
15
|
+
Standalone tasks (per `task-start.md`) do NOT go through `/cbp-checkpoint-end` — only checkpoint-bound tasks ship.
|
|
16
|
+
|
|
17
|
+
## When to Use
|
|
18
|
+
|
|
19
|
+
- After `/cbp-checkpoint-check` confirms checkpoint is ready
|
|
20
|
+
- Before `/cbp-checkpoint-complete`
|
|
21
|
+
- Checkpoint CANNOT be completed without successful shipment
|
|
22
|
+
|
|
23
|
+
## Instructions
|
|
24
|
+
|
|
25
|
+
### Step 0: Sync with Main (mandatory)
|
|
26
|
+
|
|
27
|
+
Before any shipment logic, ensure the feat branch is current against main. Shipment from a stale feat branch causes preventable PR-time conflicts and a noisy merge history.
|
|
28
|
+
|
|
29
|
+
1. Trigger `/cbp-merge-main`.
|
|
30
|
+
2. If the skill exits with failure (offline, unresolved conflicts, user-aborted): surface the failure and STOP `/cbp-checkpoint-end` — shipment is not safe until the branch is reconciled. The user resolves and re-invokes.
|
|
31
|
+
3. On clean success: continue to Step 1.
|
|
32
|
+
|
|
33
|
+
### Step 1: Get Active Checkpoint
|
|
34
|
+
|
|
35
|
+
Use MCP `get_current_task` with repo_id. Get the active checkpoint.
|
|
36
|
+
|
|
37
|
+
If no active checkpoint, show error and stop.
|
|
38
|
+
|
|
39
|
+
### Step 2: Verify Checkpoint Check Passed
|
|
40
|
+
|
|
41
|
+
Check `checkpoint.context.check_results` — must exist.
|
|
42
|
+
|
|
43
|
+
If not: `Run /cbp-checkpoint-check first.`
|
|
44
|
+
|
|
45
|
+
### Step 3: Read Branch Config
|
|
46
|
+
|
|
47
|
+
Read `.codebyplan/git.json` and extract `branch_config` (handle missing file gracefully):
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
BASE = branch_config.base ?? branch_config.production ?? "main"
|
|
51
|
+
PROTECTED = branch_config.protected (default: ["main"])
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Read `.codebyplan/server.json` and extract `auto_push_enabled` (default: false).
|
|
55
|
+
|
|
56
|
+
If `branch_config` is absent, use defaults above.
|
|
57
|
+
|
|
58
|
+
### Step 4: Verify Branch Existence
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
git fetch origin
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Check that the base branch exists remotely:
|
|
65
|
+
|
|
66
|
+
| Branch | Required | If Missing |
|
|
67
|
+
|--------|----------|------------|
|
|
68
|
+
| BASE | Yes | **STOP** — cannot ship without production branch |
|
|
69
|
+
|
|
70
|
+
### Step 5: Ship to Production
|
|
71
|
+
|
|
72
|
+
If `auto_push_enabled` is true, run `/cbp-ship-main`.
|
|
73
|
+
|
|
74
|
+
If false, inform user:
|
|
75
|
+
```
|
|
76
|
+
Auto-push is disabled. To ship to production, run `/cbp-ship-main` manually.
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Wait for result. If `/cbp-ship-main` exits with failure (checks failed, PR conflicts, auth error), investigate and fix.
|
|
80
|
+
|
|
81
|
+
If merge conflicts arise at PR time:
|
|
82
|
+
1. Show the conflicts
|
|
83
|
+
2. Suggest: run `/cbp-merge-main` on the feat branch to resolve conflicts (Step 0 should have caught this — if Step 0 was skipped or new conflicts appeared since, this re-runs the merge gate). NEVER rebase.
|
|
84
|
+
3. **STOP** — wait for user to resolve
|
|
85
|
+
|
|
86
|
+
### Step 6: Verify Merge Landed
|
|
87
|
+
|
|
88
|
+
After `/cbp-ship-main` completes, verify the merge landed:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
PR_DATA=$(gh pr view --json mergedAt,mergeCommit,statusCheckRollup)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Runtime deployment for the base branch is handled in Step 7 by `/cbp-ship` (which detects + verifies all surfaces uniformly). Do NOT do per-surface verification inline here — that duplicates `/cbp-ship` and skips uncovered surfaces.
|
|
95
|
+
|
|
96
|
+
### Step 7: Runtime Shipment via `/cbp-ship`
|
|
97
|
+
|
|
98
|
+
After branch promotion to main completes, invoke `/cbp-ship` to deploy every configured surface:
|
|
99
|
+
|
|
100
|
+
- Vercel auto-deploy verification
|
|
101
|
+
- Mobile shipment (asks user: skip / EAS internal TestFlight / EAS external TestFlight)
|
|
102
|
+
- Tauri desktop release (if version bumped)
|
|
103
|
+
- npm package publish (if version bumped — interactive 2FA)
|
|
104
|
+
- VS Code extension publish (if version bumped)
|
|
105
|
+
- Railway backend deploy
|
|
106
|
+
- Supabase migration push (interactive review per migration)
|
|
107
|
+
|
|
108
|
+
`/cbp-ship` handles its own confirmation + per-surface verification. Wait for it to complete before continuing.
|
|
109
|
+
|
|
110
|
+
If `/cbp-ship` reports `aborted_at` (user aborted) or any surface failed verification, halt — do NOT proceed to cleanup. Surface the failure to the user; resolve, then re-run `/cbp-checkpoint-end`.
|
|
111
|
+
|
|
112
|
+
If the repo has zero configured surfaces (very early-stage), `/cbp-ship` exits with `## No deployable surfaces configured` — that's a success state, continue to cleanup.
|
|
113
|
+
|
|
114
|
+
### Step 8: Stale Feat Branch Cleanup
|
|
115
|
+
|
|
116
|
+
After successful shipment, identify stale remote feat branches:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
git branch -r --list 'origin/feat/*' | sed 's|origin/||'
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
For each feat branch (excluding current):
|
|
123
|
+
- Check if associated checkpoint is completed (via MCP or branch name matching)
|
|
124
|
+
- Check age: `git log -1 --format=%ci "origin/$BRANCH"`
|
|
125
|
+
- Flag as stale if: checkpoint completed OR older than 30 days
|
|
126
|
+
|
|
127
|
+
If stale branches found, present list to user via AskUserQuestion:
|
|
128
|
+
```
|
|
129
|
+
Found [N] stale feat branches:
|
|
130
|
+
|
|
131
|
+
| Branch | Last Commit | Status |
|
|
132
|
+
|--------|-------------|--------|
|
|
133
|
+
| feat/CHK-XXX-... | YYYY-MM-DD | completed / >30 days old |
|
|
134
|
+
|
|
135
|
+
Delete these branches? (both local and remote)
|
|
136
|
+
Options:
|
|
137
|
+
A) Delete all listed
|
|
138
|
+
B) Delete specific ones (list numbers)
|
|
139
|
+
C) Keep all
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Only delete with explicit user confirmation. Delete both local and remote:
|
|
143
|
+
```bash
|
|
144
|
+
git branch -d "$BRANCH" 2>/dev/null
|
|
145
|
+
git push origin --delete "$BRANCH"
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Step 9: Current Feat Branch Cleanup
|
|
149
|
+
|
|
150
|
+
Present comprehensive summary first (Step 10), then ask about current feat branch via AskUserQuestion:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
The current feat branch [BRANCH] has been fully merged.
|
|
154
|
+
|
|
155
|
+
Delete this branch? (both local and remote)
|
|
156
|
+
A) Yes, delete
|
|
157
|
+
B) No, keep it
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Never auto-delete.** Only delete with explicit user confirmation.
|
|
161
|
+
|
|
162
|
+
If user confirms:
|
|
163
|
+
```bash
|
|
164
|
+
git checkout "$BASE"
|
|
165
|
+
git branch -d "$FEAT_BRANCH"
|
|
166
|
+
git push origin --delete "$FEAT_BRANCH"
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Step 10: Save Shipment Results and Summary
|
|
170
|
+
|
|
171
|
+
Update checkpoint context via MCP `update_checkpoint`. The `shipment` block contains both branch promotion AND runtime surface results (from `/cbp-ship` Step 7):
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
context.shipment: {
|
|
175
|
+
timestamp: [ISO],
|
|
176
|
+
branch_config: { base, protected },
|
|
177
|
+
feat_to_base: { pr_url, merged: true/false },
|
|
178
|
+
surfaces: [...], // populated by /cbp-ship — per-surface deploy results
|
|
179
|
+
skipped: [...], // populated by /cbp-ship — surfaces explicitly skipped
|
|
180
|
+
stale_branches_cleaned: [list of deleted branches],
|
|
181
|
+
feat_branch_deleted: true/false
|
|
182
|
+
}
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Present summary:
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
## Checkpoint Shipment Summary
|
|
189
|
+
|
|
190
|
+
### Branch Promotion
|
|
191
|
+
- **feat -> [BASE]**: [PR URL] (merged)
|
|
192
|
+
|
|
193
|
+
### Runtime Surfaces (via /cbp-ship)
|
|
194
|
+
| Surface | Variant | Status | URL/ID |
|
|
195
|
+
| ... | ... | ... | ... |
|
|
196
|
+
(Table populated from context.shipment.surfaces[])
|
|
197
|
+
|
|
198
|
+
### Branch Operations
|
|
199
|
+
- Stale branches deleted: [N] ([list])
|
|
200
|
+
- Feat branch: [deleted/kept]
|
|
201
|
+
|
|
202
|
+
### Before/After Branch State
|
|
203
|
+
- Before: [list of feat/* branches]
|
|
204
|
+
- After: [list of remaining feat/* branches]
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Auto-trigger `/cbp-checkpoint-complete`.
|
|
208
|
+
|
|
209
|
+
## Error Handling
|
|
210
|
+
|
|
211
|
+
| Error | Action |
|
|
212
|
+
|-------|--------|
|
|
213
|
+
| Merge fails (conflicts) | Keep feat branch, report failure, suggest resolution via feat branch |
|
|
214
|
+
| Merge fails (CI/review) | Keep feat branch, report status, wait for user |
|
|
215
|
+
| Vercel deployment fails | Keep feat branch, report status, do NOT proceed to cleanup |
|
|
216
|
+
| Branch creation fails | Report error, suggest manual resolution |
|
|
217
|
+
| gh CLI not authenticated | **STOP** — `Run: gh auth login` |
|
|
218
|
+
|
|
219
|
+
**On any shipment failure:**
|
|
220
|
+
1. Keep the feat branch intact
|
|
221
|
+
2. Report which step failed and why
|
|
222
|
+
3. Suggest resolution path
|
|
223
|
+
4. Route to error recovery (user fixes, then re-runs `/cbp-checkpoint-end`)
|
|
224
|
+
|
|
225
|
+
## Key Rules
|
|
226
|
+
|
|
227
|
+
- **Never skip shipment errors** — investigate and fix
|
|
228
|
+
- **PRs only** — never direct push to protected branches
|
|
229
|
+
- **Checkpoint completion is blocked** until shipment succeeds
|
|
230
|
+
- **All merges use `--merge`** — never squash or rebase
|
|
231
|
+
- **Never auto-delete any branch** — always ask user first
|
|
232
|
+
- **Protected branches are NEVER deleted** — read from `branch_config.protected`
|
|
233
|
+
- **Read all branch names from config** — never hardcode
|
|
234
|
+
|
|
235
|
+
## Integration
|
|
236
|
+
|
|
237
|
+
- **Triggered by**: `/cbp-checkpoint-check` (auto, when ready)
|
|
238
|
+
- **Reads**: MCP `get_current_task`, `.codebyplan/git.json` (`branch_config`), `.codebyplan/server.json` (`auto_push_enabled`), `.codebyplan/shipment.json` (`shipment`), git branches
|
|
239
|
+
- **Writes**: MCP `update_checkpoint` (context.shipment — both branch promotion and runtime surface results)
|
|
240
|
+
- **Calls**: `/cbp-merge-main` (Step 0, sync); `/cbp-ship-main` (Step 5, branch promotion to main); `/cbp-ship` (Step 7, runtime surface deploy + verification)
|
|
241
|
+
- **Triggers**: `/cbp-checkpoint-complete` (auto, after successful shipment)
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: org-shared
|
|
3
|
+
name: cbp-checkpoint-plan
|
|
4
|
+
description: Deep inline planning for a checkpoint — assess, gap-analyse, decide dependencies, compare alternatives, optionally e2e-probe a suspected-broken area, then create tasks as vertical slices. Runs after /cbp-checkpoint-create (mechanical) and before /cbp-checkpoint-start (activate + claim). Does NOT activate or claim.
|
|
5
|
+
argument-hint: [checkpoint-number]
|
|
6
|
+
effort: xhigh
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Checkpoint Plan Command
|
|
10
|
+
|
|
11
|
+
Runs INLINE (no subagent) — all analysis and Q&A stay in the main session. This is the rigour stage that prevents half-baked plans: it discovers shortcomings, decides whether existing dependencies suffice or a new one is warranted, compares competing approaches, and only THEN creates tasks. It produces `plan.steps[]` + tasks but **never activates the checkpoint and never claims a user/worktree** — that is `/cbp-checkpoint-start`.
|
|
12
|
+
|
|
13
|
+
## Pipeline
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
/cbp-checkpoint-create (mechanical) → /cbp-checkpoint-plan (deep planning, here) → /cbp-checkpoint-start (activate + claim)
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Semantic-domain module dedup already ran in `/cbp-checkpoint-create` (its Step 4) — do NOT repeat it here. This skill assumes the checkpoint row, title, goal, branch, and any module-overlap decision already exist.
|
|
20
|
+
|
|
21
|
+
## Instructions
|
|
22
|
+
|
|
23
|
+
### Step 0: Parse `$ARGUMENTS`
|
|
24
|
+
|
|
25
|
+
Source `repo_id` from `.codebyplan/repo.json` — every MCP call below that takes `repo_id` uses it.
|
|
26
|
+
|
|
27
|
+
| Shape | Resolves to |
|
|
28
|
+
|-------|-------------|
|
|
29
|
+
| `{chk}` (e.g. `138`) | CHK-{chk} via MCP `get_checkpoints` filtered by `number` |
|
|
30
|
+
| _(empty)_ | Active/pending checkpoint via MCP `get_current_task`; if none in progress, the most recent `pending` checkpoint that has no `plan.steps` |
|
|
31
|
+
|
|
32
|
+
Malformed (non-numeric, contains `-`): surface `checkpoint-plan: invalid argument` and stop.
|
|
33
|
+
|
|
34
|
+
### Step 1: Load Checkpoint + Existing Tasks
|
|
35
|
+
|
|
36
|
+
1. Resolve the checkpoint (Step 0). Load `user_context`, `ideas[]`, `context` (decisions / discoveries / dependencies / constraints / qa_answers / alternatives), `research`, `plan`.
|
|
37
|
+
2. MCP `get_tasks(checkpoint_id)` — load existing tasks. This sets the mode:
|
|
38
|
+
- **fresh** — zero tasks: full plan + create all tasks.
|
|
39
|
+
- **additive re-plan** — tasks exist: gap-analyse against them; only ADD new tasks or refine requirements for gaps. NEVER delete or overwrite an in-flight task.
|
|
40
|
+
3. Note whether `worktree_id` is set (claimed at create) — drives routing in Step 11.
|
|
41
|
+
|
|
42
|
+
### Step 2: Assess Ideas + Codebase
|
|
43
|
+
|
|
44
|
+
Iterate ALL `ideas[]` (not just the first). For each:
|
|
45
|
+
|
|
46
|
+
1. **Discovery level** — 0 (trivial) · 1 (check existing patterns) · 2 (read docs/APIs) · 3 (unfamiliar territory).
|
|
47
|
+
2. **Codebase analysis** — Glob/Grep/Read the related code: existing patterns to follow, files that will change, integration points.
|
|
48
|
+
3. **Research (level 2+ only)** — spawn a single `cbp-research` subagent for web/library research. Persist findings to `checkpoint.research` via MCP `update_checkpoint` — never to local docs. In additive re-plan mode, read the existing `research` (loaded in Step 1) and append — do not replace the object.
|
|
49
|
+
4. **Cross-reference** ideas against each other: overlaps, conflicts, shared dependencies.
|
|
50
|
+
|
|
51
|
+
Write each idea's analysis into `ideas[N].assessment` (Claude-authored; never touch `description`, which is the user's words).
|
|
52
|
+
|
|
53
|
+
### Step 3: Gap Analysis
|
|
54
|
+
|
|
55
|
+
Find what the raw request misses — this is the core anti-"half-ass" step. Load `reference/gap-analysis-playbook.md` and run its two passes:
|
|
56
|
+
|
|
57
|
+
- **Pass 1 (in-scope gaps)** — shortcomings, half-implemented patterns, and missing foundations WITHIN the stated scope. Record each as a `context.discoveries[]` entry.
|
|
58
|
+
- **Pass 2 (adjacent findings)** — problems in the same neighbourhood but outside the literal request. Per locked policy, adjacent findings are **pulled INTO this checkpoint** as additional plan steps / tasks (scope absorption) rather than deferred — unless the user explicitly scopes them out in Step 7, or absorbing them would push the checkpoint past its deadline (surface in Step 7 for confirmation before absorbing).
|
|
59
|
+
|
|
60
|
+
### Step 4: E2E Discovery Probe (opt-in)
|
|
61
|
+
|
|
62
|
+
Only relevant when an idea touches a UI surface AND you SUSPECT an existing flow is already broken. Load `reference/e2e-discovery-probe.md`.
|
|
63
|
+
|
|
64
|
+
1. Surface the suspicion: name the area + the specific pages/screens, and why you think it is broken.
|
|
65
|
+
2. Ask the user via AskUserQuestion to confirm running the probe (it needs a running dev server).
|
|
66
|
+
3. On confirm, spawn `cbp-test-e2e-agent` with `whole_checkpoint_mode: true`, `round_number: 0`, `files_changed: []`, the `pages_affected` you proposed, plus `repo_id` / `test_strategy` / `has_auth` / `dev_server_port`. Resolve `test_strategy` and `dev_server_port` per `reference/e2e-discovery-probe.md` (do not pass placeholder strings).
|
|
67
|
+
4. Record the probe outcome (what actually failed vs. what you assumed) in `context.discoveries[]` so the plan targets real defects.
|
|
68
|
+
|
|
69
|
+
Skip this step entirely for non-UI checkpoints or when no breakage is suspected.
|
|
70
|
+
|
|
71
|
+
### Step 5: Dependency Decisions
|
|
72
|
+
|
|
73
|
+
When an idea could be built by extending something already installed OR by adding a new dependency, do NOT silently pick one. Load `reference/dep-decision-rubric.md` and:
|
|
74
|
+
|
|
75
|
+
1. Identify the capability needed and whether an existing dependency already covers it.
|
|
76
|
+
2. If a new dependency is a candidate, surface the trade-off (capability gap, bundle weight, maintenance, vendor-docs availability) — via AskUserQuestion when the choice is consequential.
|
|
77
|
+
3. Lock the outcome as a `context.decisions[]` entry with `locked: true` and a rationale.
|
|
78
|
+
|
|
79
|
+
### Step 6: Alternative Comparison
|
|
80
|
+
|
|
81
|
+
When more than one viable approach exists for a meaningful design fork, present the alternatives before committing. Load `reference/alternative-comparison-template.md`:
|
|
82
|
+
|
|
83
|
+
1. Build 2–4 options with a one-line trade-off each; mark a recommendation.
|
|
84
|
+
2. Ask via AskUserQuestion (use `preview` for code/layout comparisons).
|
|
85
|
+
3. Save the comparison + the user's choice to `context.alternatives[]` and mirror the chosen path as a `context.decisions[]` entry.
|
|
86
|
+
|
|
87
|
+
### Step 7: Exhaustive Q&A
|
|
88
|
+
|
|
89
|
+
Resolve every remaining ambiguity. Ask via AskUserQuestion (max 4 per batch). After each batch, append to `context.qa_answers[]`. Continue until nothing material is unresolved — including confirming the scope-absorption candidates from Step 3 Pass 2 (keep / drop each).
|
|
90
|
+
|
|
91
|
+
### Step 8: Generate or Extend `plan.steps[]`
|
|
92
|
+
|
|
93
|
+
Build an ordered `plan.steps[]` where each step is `{ title, description, scope }` (`scope` = which idea/requirement it addresses). Every `ideas[].requirements` item AND every kept gap finding must be covered by ≥1 step. In additive mode, append/refine steps — do not drop steps that map to existing tasks. Save via MCP `update_checkpoint(checkpoint_id, plan: { steps: [...] })` — `plan` is a top-level checkpoint field, so this write does not touch `context` or `research`; the context-replaces rule in Step 10 applies only to the `context` JSONB.
|
|
94
|
+
|
|
95
|
+
### Step 9: Create Tasks as Vertical Slices
|
|
96
|
+
|
|
97
|
+
Each task is a complete, independently shippable vertical slice — group by theme, not by layer.
|
|
98
|
+
|
|
99
|
+
**BAD (horizontal layers):** TASK-1 DB functions · TASK-2 API routes · TASK-3 UI.
|
|
100
|
+
**GOOD (vertical slices):** TASK-1 user auth (DB + API + UI) · TASK-2 profile page (DB + API + UI).
|
|
101
|
+
**GOOD (infra by theme):** TASK-1 config rule + Step-0 removal · TASK-2 task-sizing + round-workflow.
|
|
102
|
+
|
|
103
|
+
Sizing: with a 1M-token context, tasks can be large — group by coherent purpose; a single task touching 30+ files is fine if they serve one theme. Only split when themes are genuinely independent.
|
|
104
|
+
|
|
105
|
+
For each task use MCP `create_task` (`checkpoint_id`, sequential `number` after the current max, `title`, `requirements`, `context` with the relevant decisions/discoveries). **Additive mode:** create only tasks for steps not already covered by an existing task; never delete in-flight tasks. **Coverage check** — a plan step counts as covered only when an existing task's requirements address its full scope; when uncertain, create the task and note in its requirements `may overlap with TASK-N — review before executing`.
|
|
106
|
+
|
|
107
|
+
### Step 10: Persist Full Context
|
|
108
|
+
|
|
109
|
+
Final write of the complete `checkpoint.context` JSONB via MCP `update_checkpoint`. Honor the **context-replaces-not-merges** contract: read the current context, merge your additions in memory, write the FULL object (`decisions` + `discoveries` + `dependencies` + `constraints` + `qa_answers` + `alternatives`). A partial write clobbers sibling keys. Phrase any database-verb words as prose in payloads (WAF gate).
|
|
110
|
+
|
|
111
|
+
### Step 11: Show Result + Route
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
## Checkpoint Planned
|
|
115
|
+
|
|
116
|
+
**CHK-NNN**: [title]
|
|
117
|
+
**Tasks**: [created N] (additive: [+M new]) • **Plan steps**: [count]
|
|
118
|
+
**Locked decisions**: [count] • **E2E probe**: [fired / skipped]
|
|
119
|
+
|
|
120
|
+
### Tasks
|
|
121
|
+
1. TASK-1: [title]
|
|
122
|
+
...
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
This skill does **NOT** activate the checkpoint and does **NOT** claim a user/worktree.
|
|
126
|
+
|
|
127
|
+
- **Claimed by THIS session** — `worktree_id` is set AND equals `npx codebyplan resolve-worktree 2>/dev/null`: auto-trigger `/cbp-checkpoint-start` in the same context (the creator carries momentum into activation).
|
|
128
|
+
- **Otherwise** — `worktree_id` is null, set to a different worktree, or `resolve-worktree` is empty: surface a single directive — `Next: /cbp-checkpoint-start` — so the owning session (or anyone free, if open) claims and starts it. Never auto-activate a checkpoint owned by a different worktree.
|
|
129
|
+
|
|
130
|
+
## Integration
|
|
131
|
+
|
|
132
|
+
- **Reads**: MCP `get_current_task`, `get_checkpoints`, `get_tasks`
|
|
133
|
+
- **Writes**: MCP `update_checkpoint` (ideas assessment, context, plan, research), `create_task`
|
|
134
|
+
- **Spawns**: `cbp-research` (level 2+ only), `cbp-test-e2e-agent` (opt-in discovery probe, `whole_checkpoint_mode`)
|
|
135
|
+
- **Triggered by**: `/cbp-checkpoint-create` (auto), or user directly
|
|
136
|
+
- **Triggers**: `/cbp-checkpoint-start` (auto when claimed at create; directive when left open)
|
|
137
|
+
- **Never**: activates the checkpoint or claims a user/worktree — that is `/cbp-checkpoint-start`
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: org-shared
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Alternative Comparison Template
|
|
6
|
+
|
|
7
|
+
Loaded by `/cbp-checkpoint-plan` Step 6. Use when a meaningful design fork has more than one viable answer. Surfacing the alternatives — instead of silently picking one — is what lets the user redirect before tasks are created.
|
|
8
|
+
|
|
9
|
+
## When a fork warrants a question
|
|
10
|
+
|
|
11
|
+
Ask the user when ALL of these hold:
|
|
12
|
+
|
|
13
|
+
- There are 2–4 genuinely viable options (not one obvious winner).
|
|
14
|
+
- The choice is hard to reverse later (architecture, data shape, public API, a one-way dependency).
|
|
15
|
+
- The options have materially different trade-offs the user would care about.
|
|
16
|
+
|
|
17
|
+
Resolve inline (record a decision, no question) when the choice is reversible, low-stakes, or has a single defensible answer.
|
|
18
|
+
|
|
19
|
+
## How to present
|
|
20
|
+
|
|
21
|
+
Use AskUserQuestion. Lead with your recommendation as the first option and tag it `(Recommended)`. Give each option a one-line trade-off. For code/layout/config forks, use the `preview` field to show concrete snippets side by side.
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
Question: "How should X be structured?"
|
|
25
|
+
Options:
|
|
26
|
+
- "Approach A (Recommended)" — <one-line trade-off>
|
|
27
|
+
- "Approach B" — <one-line trade-off>
|
|
28
|
+
- "Approach C" — <one-line trade-off>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Record format
|
|
32
|
+
|
|
33
|
+
Persist to `context.alternatives[]` (a JSONB key introduced by this skill — schema-flexible; declare it as below). Read-merge-write the full context per Step 10.
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"question": "How should X be structured?",
|
|
38
|
+
"options": [
|
|
39
|
+
{ "label": "Approach A", "tradeoff": "...", "recommended": true },
|
|
40
|
+
{ "label": "Approach B", "tradeoff": "..." }
|
|
41
|
+
],
|
|
42
|
+
"chosen": "Approach A",
|
|
43
|
+
"rationale": "user picked A because ...",
|
|
44
|
+
"decided_at": "2026-06-01T..."
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Mirror the chosen path as a `context.decisions[]` entry with `locked: true` so the executor treats it as settled and the planner does not re-ask on a re-run.
|
|
49
|
+
|
|
50
|
+
## Notes
|
|
51
|
+
|
|
52
|
+
- One question per fork; do not bundle unrelated forks into one multi-select.
|
|
53
|
+
- If the user picks "Other" and writes a custom answer, record their text verbatim as the rationale.
|
|
54
|
+
- Keep the options mutually exclusive — overlapping options produce ambiguous decisions.
|