codebyplan 1.13.13 → 1.13.14
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 +1 -1
- package/package.json +1 -1
- package/templates/rules/task-routing-recommendation.md +51 -0
- package/templates/skills/cbp-round-check/SKILL.md +28 -4
- package/templates/skills/cbp-round-end/SKILL.md +35 -12
- package/templates/skills/cbp-round-execute/SKILL.md +30 -7
- package/templates/skills/cbp-round-input/SKILL.md +31 -10
- package/templates/skills/cbp-round-start/SKILL.md +35 -14
- package/templates/skills/cbp-round-update/SKILL.md +43 -12
- package/templates/skills/cbp-standalone-task-check/SKILL.md +152 -0
- package/templates/skills/cbp-standalone-task-complete/SKILL.md +201 -0
- package/templates/skills/cbp-standalone-task-create/SKILL.md +150 -0
- package/templates/skills/cbp-standalone-task-start/SKILL.md +177 -0
- package/templates/skills/cbp-standalone-task-testing/SKILL.md +210 -0
- package/templates/skills/cbp-task-check/SKILL.md +5 -5
- package/templates/skills/cbp-task-complete/SKILL.md +9 -22
- package/templates/skills/cbp-task-create/SKILL.md +11 -31
- package/templates/skills/cbp-task-start/SKILL.md +6 -13
- package/templates/skills/cbp-task-testing/SKILL.md +5 -5
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
scope: repo-only:codebyplan
|
|
3
|
+
name: cbp-standalone-task-testing
|
|
4
|
+
description: Run comprehensive task-level testing after /cbp-standalone-task-check passes
|
|
5
|
+
argument-hint: [task] # e.g. `45` (standalone TASK-45)
|
|
6
|
+
triggers: [cbp-standalone-task-complete]
|
|
7
|
+
effort: xhigh
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Standalone Task Testing Command
|
|
11
|
+
|
|
12
|
+
Comprehensive task-level testing for standalone tasks — runs all automated tests and walks the user through manual testing one-by-one. Tests the entire delivered feature holistically after all rounds are complete. Runs inline — no sub-agent.
|
|
13
|
+
|
|
14
|
+
## When Used
|
|
15
|
+
|
|
16
|
+
- After `/cbp-standalone-task-check` passes with READY verdict
|
|
17
|
+
- Before `/cbp-standalone-task-complete`
|
|
18
|
+
- Never skippable
|
|
19
|
+
|
|
20
|
+
## Scope vs Round-Level Validation
|
|
21
|
+
|
|
22
|
+
Per-wave `testing-qa-agent` runs inside `/cbp-round-execute` Step 5. This skill adds the cross-cutting layer visible only across the full task diff: full-repo lint, workspace tsc, full test suite, `pnpm audit`, and full-diff security scan.
|
|
23
|
+
|
|
24
|
+
## Instructions
|
|
25
|
+
|
|
26
|
+
### Step 1: Parse `$ARGUMENTS`
|
|
27
|
+
|
|
28
|
+
| Shape | Regex | Resolves to |
|
|
29
|
+
|-------|-------|-------------|
|
|
30
|
+
| `{task}` (e.g. `45`) | `^[0-9]+$` | Standalone TASK-{task} |
|
|
31
|
+
| _(empty)_ | — | Use MCP `get_current_standalone_task` to find the active in-progress task |
|
|
32
|
+
|
|
33
|
+
Any multi-segment input is an error:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
standalone-task-testing: argument `{value}` looks like a checkpoint-task pair.
|
|
37
|
+
Use /cbp-task-testing {chk}-{task} for checkpoint-bound tasks.
|
|
38
|
+
Standalone tasks use a bare number, e.g. /cbp-standalone-task-testing 45.
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Error cases: any multi-segment input, `abc`, `108-`, `-1`, anything with whitespace or non-numeric characters.
|
|
42
|
+
|
|
43
|
+
### Step 1.5: Get Current Task
|
|
44
|
+
|
|
45
|
+
| Parse | Resolution path |
|
|
46
|
+
|-------|-----------------|
|
|
47
|
+
| `{task}` | MCP `get_standalone_tasks(repo_id)` → filter `number === {task}`. |
|
|
48
|
+
| _(empty)_ | MCP `get_current_standalone_task(repo_id)` — finds the active in-progress task. |
|
|
49
|
+
|
|
50
|
+
If no in-progress task, show error and stop.
|
|
51
|
+
|
|
52
|
+
### Step 2: Verify All Rounds Complete
|
|
53
|
+
|
|
54
|
+
Use MCP `get_standalone_rounds(standalone_task_id)`. Verify all rounds are `completed`. If any still `in_progress`:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
## Cannot Run Standalone Task Testing
|
|
58
|
+
|
|
59
|
+
Standalone TASK-[N] has an active round (Round [N]). Complete it first:
|
|
60
|
+
- Run `/cbp-round-update` to finish the round
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Stop.
|
|
64
|
+
|
|
65
|
+
### Step 3: Verify `/cbp-standalone-task-check` Passed
|
|
66
|
+
|
|
67
|
+
Check `task.context.check_verdict`: must exist and have `verdict = "READY"`. Otherwise:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
## Cannot Run Standalone Task Testing
|
|
71
|
+
|
|
72
|
+
`/cbp-standalone-task-check` has not passed yet. Run `/cbp-standalone-task-check` first.
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Stop.
|
|
76
|
+
|
|
77
|
+
### Step 4: Aggregate Files Changed
|
|
78
|
+
|
|
79
|
+
Collect all `files_changed` from all rounds via `get_standalone_rounds`. Deduplicate (latest action per path wins). Skip deleted files for file-reading in Step 5.
|
|
80
|
+
|
|
81
|
+
### Step 5: Read ALL Final Changed Files
|
|
82
|
+
|
|
83
|
+
Read every non-deleted file in the aggregated list. Build a mental model of the complete delivered work.
|
|
84
|
+
|
|
85
|
+
### Step 6: Run Comprehensive Automated Testing
|
|
86
|
+
|
|
87
|
+
Capture stdout and stderr for each check.
|
|
88
|
+
|
|
89
|
+
**Hard-fail tests** (block completion):
|
|
90
|
+
|
|
91
|
+
| Category | Command | Condition |
|
|
92
|
+
|----------|---------|-----------|
|
|
93
|
+
| Full-repo lint | `pnpm -w lint` | Always |
|
|
94
|
+
| Full-repo types | `pnpm exec tsc --noEmit` | Source files changed |
|
|
95
|
+
| Full-repo unit tests | `pnpm test --run` | Source files in aggregated_files |
|
|
96
|
+
| Full-repo audit | `pnpm audit` | Always |
|
|
97
|
+
| Per-package E2E | `pnpm --filter <pkg> e2e:test` | UI files in aggregated_files |
|
|
98
|
+
| Full-diff security scan | inline grep or `security-agent` | Always |
|
|
99
|
+
|
|
100
|
+
**Soft tests** (report, don't block):
|
|
101
|
+
|
|
102
|
+
| Category | Method | Condition |
|
|
103
|
+
|----------|--------|-----------|
|
|
104
|
+
| Visual | Screenshot compare via `e2e:visual-check` | UI work + dev server running |
|
|
105
|
+
| API Health | `curl` health endpoint | API routes changed |
|
|
106
|
+
|
|
107
|
+
For each test, record: `category, status (pass|fail|skipped), details, stdout, stderr`.
|
|
108
|
+
|
|
109
|
+
### Step 6.5: Cross-Round Code Review
|
|
110
|
+
|
|
111
|
+
Inline review (no sub-agent) across the aggregated files read in Step 5. Check:
|
|
112
|
+
|
|
113
|
+
| Concern | What to Look For |
|
|
114
|
+
|---------|-----------------|
|
|
115
|
+
| Leftover debug | `console.log`, `debugger`, commented-out blocks, `TODO`/`FIXME` added during this task |
|
|
116
|
+
| Cross-round duplication | Same helper/logic written independently in 2+ rounds |
|
|
117
|
+
| Convention drift | Pattern from one round contradicts a pattern from an earlier round |
|
|
118
|
+
| Incomplete follow-through | A type/field/column added that later rounds never consume |
|
|
119
|
+
| Orphaned additions | Exports or utilities added with no callers after later rounds |
|
|
120
|
+
|
|
121
|
+
For each finding, record: `{category, file, description, severity: 'low'|'medium'|'high', suggested_fix}`.
|
|
122
|
+
|
|
123
|
+
Findings with severity `medium` or `high` feed the Step 9 problem classification.
|
|
124
|
+
|
|
125
|
+
### Step 7: Separate Claude-Testable vs User-Testable
|
|
126
|
+
|
|
127
|
+
**Claude handles automatically** (Step 6): build, types, unit tests, E2E tests, visual, API health.
|
|
128
|
+
|
|
129
|
+
**User must verify**:
|
|
130
|
+
- Visual appearance quality
|
|
131
|
+
- UX flow
|
|
132
|
+
- Business logic correctness
|
|
133
|
+
- Edge cases
|
|
134
|
+
- Cross-browser / real-device behavior
|
|
135
|
+
- Content accuracy
|
|
136
|
+
|
|
137
|
+
### Step 8: User Testing Walkthrough
|
|
138
|
+
|
|
139
|
+
Present all user-testable items as a **single checklist in one `AskUserQuestion` prompt**. Provide description, how-to-test steps, and expected result per item. Record the aggregate response and any per-item notes.
|
|
140
|
+
|
|
141
|
+
### Step 9: Classify Problems
|
|
142
|
+
|
|
143
|
+
Collect failures from automated tests (Step 6), cross-round code review (Step 6.5, medium+), and user tests (Step 8):
|
|
144
|
+
|
|
145
|
+
- **Minor** (round-fixable): styling, small bugs, missing edge cases, localized duplication
|
|
146
|
+
- **Major** (new-task-worthy): architectural issues, missing features, fundamental design problems
|
|
147
|
+
|
|
148
|
+
### Step 10: Save Results
|
|
149
|
+
|
|
150
|
+
```ts
|
|
151
|
+
update_standalone_task(task_id, {
|
|
152
|
+
context: {
|
|
153
|
+
...existing,
|
|
154
|
+
task_testing_output: {
|
|
155
|
+
claude_tests: [...],
|
|
156
|
+
cross_round_code_findings: [...],
|
|
157
|
+
user_tests: [...],
|
|
158
|
+
problems_found: [...],
|
|
159
|
+
all_passed: boolean,
|
|
160
|
+
summary: { total, passed, failed, pending }
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
})
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Step 11: Route Based on Results
|
|
167
|
+
|
|
168
|
+
**ALL PASS:**
|
|
169
|
+
|
|
170
|
+
All tests passed for standalone TASK-[N].
|
|
171
|
+
|
|
172
|
+
Next: /cbp-standalone-task-complete {N}
|
|
173
|
+
|
|
174
|
+
**Minor problems found:**
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
**Next:**
|
|
179
|
+
Run `/cbp-round-input` to address the minor issues found during testing.
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
Waiting for user to run `/cbp-round-input`.
|
|
184
|
+
|
|
185
|
+
**Major problems found:**
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
**Next:**
|
|
190
|
+
Run `/cbp-standalone-task-create` to create a new standalone task for the identified issues.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
Waiting for user to run `/cbp-standalone-task-create`.
|
|
195
|
+
|
|
196
|
+
## Key Rules
|
|
197
|
+
|
|
198
|
+
- **Never skippable** — mandatory before `/cbp-standalone-task-complete`
|
|
199
|
+
- **Must loop until everything passes** — problems must be addressed
|
|
200
|
+
- **No file changes** — testing only, never edit
|
|
201
|
+
- **Batch user tests** — present all user-testable items in a single `AskUserQuestion` checklist
|
|
202
|
+
- **Read actual files** — do not rely on metadata alone
|
|
203
|
+
- **Run actual commands** — capture real stdout/stderr
|
|
204
|
+
|
|
205
|
+
## Integration
|
|
206
|
+
|
|
207
|
+
- **Reads**: MCP `get_current_standalone_task`, `get_standalone_tasks`, `get_standalone_rounds`, all aggregated files
|
|
208
|
+
- **Writes**: MCP `update_standalone_task` (context.task_testing_output)
|
|
209
|
+
- **Triggers**: emits directive `Next: /cbp-standalone-task-complete {N}` when ALL PASS
|
|
210
|
+
- **Triggered by**: user runs `/cbp-standalone-task-testing {task}` per directive from `/cbp-standalone-task-check`
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
scope: org-shared
|
|
3
3
|
name: cbp-task-check
|
|
4
4
|
description: AI production review for the current task
|
|
5
|
-
argument-hint: [chk-task
|
|
5
|
+
argument-hint: [chk-task]
|
|
6
6
|
triggers: [cbp-task-testing, cbp-round-input]
|
|
7
7
|
effort: high
|
|
8
8
|
---
|
|
@@ -40,17 +40,17 @@ Parse the argument using the canonical chk-task-round notation (see `.claude/rul
|
|
|
40
40
|
| Shape | Regex | Resolves to |
|
|
41
41
|
|-------|-------|-------------|
|
|
42
42
|
| `{chk}-{task}` (e.g. `108-1`) | `^[0-9]+-[0-9]+$` | Checkpoint-bound: CHK-{chk} TASK-{task} |
|
|
43
|
-
| `{task}` (e.g. `45`) | `^[0-9]+$` | Standalone: standalone TASK-{task} **only** |
|
|
44
43
|
| _(empty)_ | — | Use MCP `get_current_task` to find the active in-progress task |
|
|
44
|
+
| `{task}` (bare number) | — | **Error**: "Use /cbp-standalone-task-check {N} instead — bare numbers no longer route to standalone tasks." |
|
|
45
45
|
|
|
46
46
|
Anything else is malformed — surface this error and stop:
|
|
47
47
|
|
|
48
48
|
```
|
|
49
49
|
task-check: invalid argument `{value}`. Expected:
|
|
50
50
|
108-1 → CHK-108 TASK-1 (checkpoint-bound)
|
|
51
|
-
45 → standalone TASK-45
|
|
52
51
|
(empty) → active in-progress task
|
|
53
52
|
|
|
53
|
+
For standalone tasks, use `/cbp-standalone-task-check {N}`.
|
|
54
54
|
For a specific round, use `/cbp-round-update 108-1-2`.
|
|
55
55
|
```
|
|
56
56
|
|
|
@@ -59,8 +59,8 @@ Error cases: `108-1-2` (that is round-update's shape), `abc`, `108-`, `-1`, `108
|
|
|
59
59
|
#### Worked examples
|
|
60
60
|
|
|
61
61
|
- `task-check 108-1` → CHK-108 TASK-1
|
|
62
|
-
- `task-check 45` → standalone TASK-45
|
|
63
62
|
- `task-check` (no arg) → active in-progress task via `get_current_task`
|
|
63
|
+
- `task-check 45` → error: "Use /cbp-standalone-task-check 45 instead — bare numbers no longer route to standalone tasks."
|
|
64
64
|
- `task-check 108-1-2` → error: "use `/cbp-round-update 108-1-2`"
|
|
65
65
|
- `task-check abc` → error: malformed
|
|
66
66
|
|
|
@@ -71,7 +71,6 @@ Given the parse from Step 1:
|
|
|
71
71
|
| Parse | Resolution path |
|
|
72
72
|
|-------|-----------------|
|
|
73
73
|
| `{chk}-{task}` | MCP `get_checkpoints(repo_id)` → filter `number === {chk}`. MCP `get_tasks(checkpoint_id)` → filter `number === {task}`. |
|
|
74
|
-
| `{task}` | MCP `get_tasks(repo_id, standalone: true)` → filter `number === {task}`. |
|
|
75
74
|
| _(empty)_ | MCP `get_current_task(repo_id)` — finds the active in-progress task. |
|
|
76
75
|
|
|
77
76
|
If no in-progress task, show error and stop.
|
|
@@ -157,6 +156,7 @@ Suggest: Approve files, then re-run `/cbp-task-check`. **STOP HERE** — wait fo
|
|
|
157
156
|
- **This is AI review + user satisfaction** — not automated testing
|
|
158
157
|
- **Read all changed files** — agent does the heavy lifting
|
|
159
158
|
- **No file changes** — review only, never edit
|
|
159
|
+
- **Checkpoint-bound only** — for standalone tasks use `/cbp-standalone-task-check`
|
|
160
160
|
|
|
161
161
|
## Integration
|
|
162
162
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
scope: org-shared
|
|
3
3
|
name: cbp-task-complete
|
|
4
4
|
description: Complete current task
|
|
5
|
-
argument-hint: [chk-task
|
|
5
|
+
argument-hint: [chk-task]
|
|
6
6
|
effort: xhigh
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -19,17 +19,17 @@ Parse the argument using the canonical chk-task-round notation (see `.claude/rul
|
|
|
19
19
|
| Shape | Regex | Resolves to |
|
|
20
20
|
|-------|-------|-------------|
|
|
21
21
|
| `{chk}-{task}` (e.g. `108-1`) | `^[0-9]+-[0-9]+$` | Checkpoint-bound: CHK-{chk} TASK-{task} |
|
|
22
|
-
| `{task}` (e.g. `45`) | `^[0-9]+$` | Standalone: standalone TASK-{task} **only** |
|
|
23
22
|
| _(empty)_ | — | Use MCP `get_current_task` to find the active in-progress task |
|
|
23
|
+
| `{task}` (bare number) | — | **Error**: "Use /cbp-standalone-task-complete {N} instead — bare numbers no longer route to standalone tasks." |
|
|
24
24
|
|
|
25
25
|
Anything else is malformed — surface this error and stop:
|
|
26
26
|
|
|
27
27
|
```
|
|
28
28
|
task-complete: invalid argument `{value}`. Expected:
|
|
29
29
|
108-1 → CHK-108 TASK-1 (checkpoint-bound)
|
|
30
|
-
45 → standalone TASK-45
|
|
31
30
|
(empty) → active in-progress task
|
|
32
31
|
|
|
32
|
+
For standalone tasks, use `/cbp-standalone-task-complete {N}`.
|
|
33
33
|
For a specific round, use `/cbp-round-update 108-1-2`.
|
|
34
34
|
```
|
|
35
35
|
|
|
@@ -38,8 +38,8 @@ Error cases: `108-1-2` (that is round-update's shape), `abc`, `108-`, `-1`, `108
|
|
|
38
38
|
#### Worked examples
|
|
39
39
|
|
|
40
40
|
- `task-complete 108-1` → CHK-108 TASK-1
|
|
41
|
-
- `task-complete 45` → standalone TASK-45
|
|
42
41
|
- `task-complete` (no arg) → active in-progress task via `get_current_task`
|
|
42
|
+
- `task-complete 45` → error: "Use /cbp-standalone-task-complete 45 instead — bare numbers no longer route to standalone tasks."
|
|
43
43
|
- `task-complete 108-1-2` → error: "use `/cbp-round-update 108-1-2`"
|
|
44
44
|
- `task-complete abc` → error: malformed
|
|
45
45
|
|
|
@@ -50,7 +50,6 @@ Given the parse from Step 1:
|
|
|
50
50
|
| Parse | Resolution path |
|
|
51
51
|
|-------|-----------------|
|
|
52
52
|
| `{chk}-{task}` | MCP `get_checkpoints(repo_id)` → filter `number === {chk}`. MCP `get_tasks(checkpoint_id)` → filter `number === {task}`. |
|
|
53
|
-
| `{task}` | MCP `get_tasks(repo_id, standalone: true)` → filter `number === {task}`. |
|
|
54
53
|
| _(empty)_ | MCP `get_current_task(repo_id)` — finds the active in-progress task. |
|
|
55
54
|
|
|
56
55
|
If no in-progress task, show error and stop.
|
|
@@ -139,19 +138,6 @@ Skip the push only when nothing was committed in Step 5 AND `/cbp-merge-main` re
|
|
|
139
138
|
|
|
140
139
|
Call `complete_task(task_id)`. The server resolves the caller's worktree identity from the JWT/ctx and enforces the mutate-lock (CHK-140 TASK-3 — `caller_worktree_id` input field removed). The server auto-clears `assigned_user_id` + `assigned_worktree_id` on the task; if this was the last sibling task, it also clears the parent checkpoint's assignment. (Per CHK-104 hard-lock.)
|
|
141
140
|
|
|
142
|
-
### Step 7.5: Standalone Task Branch Merge
|
|
143
|
-
|
|
144
|
-
**Standalone tasks only** (no checkpoint). Checkpoint tasks ship via `/cbp-checkpoint-end`.
|
|
145
|
-
|
|
146
|
-
If `checkpoint_id === null` AND current branch is `feat/*`:
|
|
147
|
-
|
|
148
|
-
1. Read `.codebyplan/git.json` `branch_config.production` (default `main`).
|
|
149
|
-
2. Merge: `git checkout {production} && git merge {feat-branch} --no-ff -m "Merge {feat-branch}: {task title}"`
|
|
150
|
-
3. Push: `git push origin {production}`
|
|
151
|
-
4. Delete feat branch (local + remote).
|
|
152
|
-
|
|
153
|
-
If merge has conflicts, stop and ask the user. If current branch is not `feat/*`, skip.
|
|
154
|
-
|
|
155
141
|
### Step 8: Run Cleanup + Migration (inline)
|
|
156
142
|
|
|
157
143
|
Apply the `cleanup` skill inline to remove orphan references to deleted/modified files. Then apply `migration` to propagate renames/moves to consumers. Both run without sub-agent spawns. Skip cleanup if no deletions/modifications; skip migration if cleanup handled everything.
|
|
@@ -175,7 +161,7 @@ Then route. Same-context transitions (next task in this checkpoint) auto-trigger
|
|
|
175
161
|
|
|
176
162
|
```
|
|
177
163
|
checkpoint_id := current_task.checkpoint_id
|
|
178
|
-
if checkpoint_id is null →
|
|
164
|
+
if checkpoint_id is null → error (should never happen — standalone tasks use /cbp-standalone-task-complete)
|
|
179
165
|
else
|
|
180
166
|
siblings := get_tasks(checkpoint_id) minus current_task
|
|
181
167
|
all_done := every sibling has status === 'completed'
|
|
@@ -183,11 +169,11 @@ else
|
|
|
183
169
|
else → MORE-TASKS-IN-CHECKPOINT; go to 9b
|
|
184
170
|
```
|
|
185
171
|
|
|
186
|
-
#### 9b — Next-task routing (more tasks pending
|
|
172
|
+
#### 9b — Next-task routing (more tasks pending)
|
|
187
173
|
|
|
188
|
-
Identify the next pending task: the lowest-numbered pending task in the same checkpoint
|
|
174
|
+
Identify the next pending task: the lowest-numbered pending task in the same checkpoint. Use `{N}` as the chk-task-round identifier form of that task (e.g. `111-5` for CHK-111 TASK-5).
|
|
189
175
|
|
|
190
|
-
Use the Skill tool with `skill: cbp-task-start` and `args: "{NEXT_CHK}-{NEXT_TASK}"`
|
|
176
|
+
Use the Skill tool with `skill: cbp-task-start` and `args: "{NEXT_CHK}-{NEXT_TASK}"` to auto-trigger the next task. Same-context transition; no `/clear` needed.
|
|
191
177
|
|
|
192
178
|
If no next task is found (no pending work anywhere in the repo), emit directive and stop: `Next: Run /clear, then /cbp-session-end.`
|
|
193
179
|
|
|
@@ -210,3 +196,4 @@ Do NOT use AskUserQuestion here — this is a directive, not a menu. The user ru
|
|
|
210
196
|
- **Writes**: MCP `update_task`, `complete_task`
|
|
211
197
|
- **Uses skills (inline, no sub-agent)**: `cleanup` (if deletions), `migration` (if exports renamed)
|
|
212
198
|
- **Triggers**: Same-context transitions auto-trigger via the Skill tool (next task in checkpoint → `/cbp-task-start {N}`). Cross-context transitions emit a directive `Next: /clear, then /cbp-X` for the user to invoke.
|
|
199
|
+
- **Checkpoint-bound only** — for standalone tasks use `/cbp-standalone-task-complete`
|
|
@@ -17,7 +17,16 @@ Create a new task within the active checkpoint. Gathers user context, analyzes e
|
|
|
17
17
|
|
|
18
18
|
## Identifier Notation
|
|
19
19
|
|
|
20
|
-
This skill operates on the **active** checkpoint resolved via MCP `get_current_task` and does not accept a positional identifier argument. The task it creates gets its `number` from the next-available slot within the active checkpoint (checkpoint-bound)
|
|
20
|
+
This skill operates on the **active** checkpoint resolved via MCP `get_current_task` and does not accept a positional identifier argument. The task it creates gets its `number` from the next-available slot within the active checkpoint (checkpoint-bound). Canonical chk-task-round notation — used in prose, error messages, and cross-references — follows `.claude/rules/notation-consistency.md` "CHK / TASK / ROUND Identifier Notation": `108-1` (CHK-108 TASK-1), `108-1-2` (round 2 of CHK-108 TASK-1).
|
|
21
|
+
|
|
22
|
+
**Bare-number argument**: if a bare number (e.g. `42`) is provided with no checkpoint context, this skill cannot resolve it to a checkpoint-bound task:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
task-create: bare number `{N}` is no longer valid here.
|
|
26
|
+
Use /cbp-standalone-task-create instead — bare numbers no longer route to standalone tasks.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Stop and redirect to `/cbp-standalone-task-create`.
|
|
21
30
|
|
|
22
31
|
## Instructions
|
|
23
32
|
|
|
@@ -52,32 +61,6 @@ Use MCP `get_tasks` for the checkpoint. Review:
|
|
|
52
61
|
- Task statuses (completed, in_progress, pending)
|
|
53
62
|
- Dependencies between tasks
|
|
54
63
|
|
|
55
|
-
### Step 3.5: Dedup Against Pending Standalone Tasks (MANDATORY)
|
|
56
|
-
|
|
57
|
-
Per `rules/immediate-issue-capture.md` "Consolidation Before Creation", before creating ANY new task, also check pending standalone tasks for overlap:
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
mcp__codebyplan__get_tasks(repo_id, standalone=true, status="pending")
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Compare the proposed task to each pending standalone task on these match dimensions:
|
|
64
|
-
|
|
65
|
-
| Match dimension | Action if matched |
|
|
66
|
-
|-----------------|-------------------|
|
|
67
|
-
| Same target file(s) | STOP — `update_task` to append, do not create new |
|
|
68
|
-
| Same feature / module | STOP — `update_task` to append, do not create new |
|
|
69
|
-
| Same root cause (e.g. "prettier drift", "router bug") | STOP — `update_task` to append, do not create new |
|
|
70
|
-
| Same dependency / advisory | STOP — `update_task` to append, do not create new |
|
|
71
|
-
|
|
72
|
-
If a match is found, surface it to the user before appending:
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
Found existing pending task TASK-[N]: [title]
|
|
76
|
-
This finding overlaps on [dimension]. Append to TASK-[N] instead of creating new? (yes / no — create separately)
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
Default to append. Only create a separate task if the user explicitly says no, OR if the existing task is in_progress / completed (in which case use `context.related_task_ids[]` on the new task to cross-reference).
|
|
80
|
-
|
|
81
64
|
### Step 4: Analyze Codebase Context
|
|
82
65
|
|
|
83
66
|
Brief inline analysis:
|
|
@@ -113,10 +96,6 @@ Use MCP `create_task` with:
|
|
|
113
96
|
- **requirements**: Numbered requirements list
|
|
114
97
|
- **context**: Include decisions from Q&A, dependencies, source findings
|
|
115
98
|
|
|
116
|
-
**For standalone tasks** (no `checkpoint_id` parameter): resolve worktree_id via `npx codebyplan resolve-worktree 2>/dev/null` and, if non-empty, pass as `assigned_worktree_id`. The `chk_assignment_pair` CHECK constraint permits `assigned_user_id` to be NULL when `assigned_worktree_id` is set — `create_task` does not expose an `assigned_user_id` parameter and none is required. This engages the CHK-104 TASK-2 hard-lock from creation.
|
|
117
|
-
|
|
118
|
-
**If `worktree_id` is empty AND the task is standalone**: warn the user that the task will be unassigned (no hard-lock from creation) and offer to run `npx codebyplan setup` first from the current directory to register the worktree. After setup, re-resolve the worktree_id and proceed. If the user declines, create the task without `assigned_worktree_id`.
|
|
119
|
-
|
|
120
99
|
**For checkpoint-bound tasks**, an empty `worktree_id` is fine — no caller-worktree stamping is needed because the parent checkpoint's `worktree_id` governs.
|
|
121
100
|
|
|
122
101
|
```
|
|
@@ -158,6 +137,7 @@ Waiting for user to decide next step.
|
|
|
158
137
|
- **Consider existing tasks** — avoid duplication
|
|
159
138
|
- **Respect checkpoint goal** — new task must contribute to checkpoint goal
|
|
160
139
|
- **Does NOT auto-trigger** — user decides when to start
|
|
140
|
+
- **Checkpoint-bound only** — for standalone tasks use `/cbp-standalone-task-create`
|
|
161
141
|
|
|
162
142
|
## Integration
|
|
163
143
|
|
|
@@ -3,7 +3,7 @@ scope: org-shared
|
|
|
3
3
|
name: cbp-task-start
|
|
4
4
|
description: Start a task, load context from DB
|
|
5
5
|
triggers: [cbp-round-start]
|
|
6
|
-
argument-hint: [chk-task
|
|
6
|
+
argument-hint: [chk-task] # e.g. `108-1` (CHK-108 TASK-1)
|
|
7
7
|
effort: xhigh
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -20,29 +20,27 @@ Parse the argument using the canonical chk-task-round notation (see `.claude/rul
|
|
|
20
20
|
| Shape | Regex | Resolves to |
|
|
21
21
|
|-------|-------|-------------|
|
|
22
22
|
| `{chk}-{task}` (e.g. `108-1`) | `^[0-9]+-[0-9]+$` | Checkpoint-bound: CHK-{chk} TASK-{task} |
|
|
23
|
-
| `{task}` (e.g. `45`) | `^[0-9]+$` | Standalone: standalone TASK-{task} **only** (bare number = standalone discriminator) |
|
|
24
23
|
| _(empty)_ | — | Use MCP `get_current_task` to find the next pending task |
|
|
24
|
+
| `{task}` (bare number) | — | **Error**: "Use /cbp-standalone-task-start {N} instead — bare numbers no longer route to standalone tasks." |
|
|
25
25
|
|
|
26
26
|
Anything else is malformed — surface this error and stop:
|
|
27
27
|
|
|
28
28
|
```
|
|
29
29
|
task-start: invalid argument `{value}`. Expected:
|
|
30
30
|
108-1 → CHK-108 TASK-1 (checkpoint-bound)
|
|
31
|
-
45 → standalone TASK-45
|
|
32
31
|
(empty) → next pending task
|
|
33
32
|
|
|
33
|
+
For standalone tasks, use `/cbp-standalone-task-start {N}`.
|
|
34
34
|
For a specific round, use `/cbp-round-start 108-1-2`.
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
Error cases: `108-1-2` (that is round-start's shape), `abc`, `108-`, `-1`, `108--1`, anything with whitespace or non-numeric characters.
|
|
38
38
|
|
|
39
|
-
**BREAKING from prior behaviour**: bare-number now resolves to **standalone only**. Previously `task-start 45` would match the first TASK-45 it found anywhere; that heuristic is removed. To target a checkpoint-bound TASK-45, use `{chk}-45`.
|
|
40
|
-
|
|
41
39
|
#### Worked examples
|
|
42
40
|
|
|
43
41
|
- `task-start 108-1` → CHK-108 TASK-1
|
|
44
|
-
- `task-start 45` → standalone TASK-45 (errors if no standalone TASK-45 exists)
|
|
45
42
|
- `task-start` (no arg) → next pending via `get_current_task`
|
|
43
|
+
- `task-start 45` → error: "Use /cbp-standalone-task-start 45 instead — bare numbers no longer route to standalone tasks."
|
|
46
44
|
- `task-start 108-1-2` → error: "use `/cbp-round-start 108-1-2`"
|
|
47
45
|
- `task-start abc` → error: malformed
|
|
48
46
|
- `task-start 108-` → error: malformed
|
|
@@ -54,7 +52,6 @@ Given the parse from Step 1:
|
|
|
54
52
|
| Parse | Resolution path |
|
|
55
53
|
|-------|-----------------|
|
|
56
54
|
| `{chk}-{task}` | MCP `get_checkpoints(repo_id)` → filter `number === {chk}` (must exist). MCP `get_tasks(checkpoint_id)` → filter `number === {task}` (must exist). |
|
|
57
|
-
| `{task}` | MCP `get_tasks(repo_id, standalone: true)` → filter `number === {task}` (must exist). Checkpoint context is null for the rest of the skill. |
|
|
58
55
|
| _(empty)_ | MCP `get_current_task(repo_id)` — output gives both checkpoint (if any) and task. When multiple checkpoints are active and the result is ambiguous, surface the disambiguation prompt and stop. |
|
|
59
56
|
|
|
60
57
|
If any required row is missing, surface this and stop:
|
|
@@ -62,7 +59,6 @@ If any required row is missing, surface this and stop:
|
|
|
62
59
|
```
|
|
63
60
|
task-start: no task found for `{ARG}`.
|
|
64
61
|
- For `108-1`: CHK-108 may not exist, or TASK-1 may not exist within it.
|
|
65
|
-
- For `45`: no standalone TASK-45 exists. If a checkpoint-bound TASK-45 exists, invoke as `{chk}-45`.
|
|
66
62
|
```
|
|
67
63
|
|
|
68
64
|
### Step 2.5: Permission Gate
|
|
@@ -98,7 +94,6 @@ Compute `TARGET`:
|
|
|
98
94
|
|-----------|--------|
|
|
99
95
|
| Checkpoint-bound, `checkpoint.branch_name` set | `checkpoint.branch_name` (e.g. `feat/CHK-095-pricing-page`) |
|
|
100
96
|
| Checkpoint-bound, `branch_name` null (legacy) | `feat/CHK-{NNN}-{kebab-slug-from-checkpoint-title}` |
|
|
101
|
-
| Standalone | `feat/standalone-TASK-{N}-{kebab-slug-from-task-title}` |
|
|
102
97
|
|
|
103
98
|
Slug rules: lowercase, words joined by `-`, drop punctuation, truncate to 40 chars.
|
|
104
99
|
|
|
@@ -140,7 +135,6 @@ After successful switch:
|
|
|
140
135
|
|
|
141
136
|
1. Re-run `git branch --show-current` to confirm `current == TARGET`. If not, fail loudly — something raced.
|
|
142
137
|
2. **Persist for next time**:
|
|
143
|
-
- Standalone task → `update_task(task_id, context: { ...task.context, branch_name: TARGET })`
|
|
144
138
|
- Checkpoint with `branch_name: null` → `update_checkpoint(checkpoint_id, branch_name: TARGET)`
|
|
145
139
|
- Checkpoint with existing `branch_name` → no write (already canonical)
|
|
146
140
|
3. One-line confirmation in output: `Branch: [TARGET] (switched from [previous])`. No prompt, no waiting.
|
|
@@ -182,7 +176,6 @@ Before activating the task, verify the caller's worktree matches the assigned wo
|
|
|
182
176
|
1. Read caller worktree: `CALLER_WT=$(npx codebyplan resolve-worktree 2>/dev/null)`.
|
|
183
177
|
2. Determine target worktree:
|
|
184
178
|
- **Checkpoint-bound tasks**: `TARGET_WT = checkpoint.worktree_id` (read from MCP `get_checkpoints`). Note: checkpoint-bound tasks may have a NULL `task.assigned_worktree_id` because the lock lives on the parent checkpoint — fall through to `checkpoint.worktree_id`.
|
|
185
|
-
- **Standalone tasks**: `TARGET_WT = task.assigned_worktree_id`.
|
|
186
179
|
3. If `TARGET_WT IS NOT NULL AND TARGET_WT != CALLER_WT`, surface this error and abort:
|
|
187
180
|
|
|
188
181
|
```
|
|
@@ -249,11 +242,11 @@ The Step 2.5 permission gate already covered this hand-off (the user approved ru
|
|
|
249
242
|
Starting first round...
|
|
250
243
|
```
|
|
251
244
|
|
|
252
|
-
Trigger `/cbp-round-start` (
|
|
245
|
+
Trigger `/cbp-round-start` with **no argument**. Do NOT pass the task identifier (`{chk}-{task}`) — round-start's 2-segment form is interpreted as standalone TASK-`{chk}` round `{task}`, not CHK-`{chk}` TASK-`{task}`. Passing no argument causes round-start to derive the active task/round from state, which is the correct path here.
|
|
253
246
|
|
|
254
247
|
## Integration
|
|
255
248
|
|
|
256
249
|
- **Gates**: Step 2.5 permission gate — asks the user to confirm before any side effect; **Cancel** aborts cleanly with no writes. Fires on every invocation (manual, auto-trigger, auto-loop).
|
|
257
250
|
- **Reads**: MCP `get_current_task`, `get_tasks`, `get_rounds`
|
|
258
251
|
- **Writes**: MCP `update_task`
|
|
259
|
-
- **Triggers**: `/cbp-round-start` (auto, round 1)
|
|
252
|
+
- **Triggers**: `/cbp-round-start` (auto, round 1, no argument)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
scope: org-shared
|
|
3
3
|
name: cbp-task-testing
|
|
4
4
|
description: Run comprehensive task-level testing after /cbp-task-check passes
|
|
5
|
-
argument-hint: [chk-task
|
|
5
|
+
argument-hint: [chk-task]
|
|
6
6
|
triggers: [cbp-task-complete]
|
|
7
7
|
effort: xhigh
|
|
8
8
|
---
|
|
@@ -30,17 +30,17 @@ Parse the argument using the canonical chk-task-round notation (see `.claude/rul
|
|
|
30
30
|
| Shape | Regex | Resolves to |
|
|
31
31
|
|-------|-------|-------------|
|
|
32
32
|
| `{chk}-{task}` (e.g. `108-1`) | `^[0-9]+-[0-9]+$` | Checkpoint-bound: CHK-{chk} TASK-{task} |
|
|
33
|
-
| `{task}` (e.g. `45`) | `^[0-9]+$` | Standalone: standalone TASK-{task} **only** |
|
|
34
33
|
| _(empty)_ | — | Use MCP `get_current_task` to find the active in-progress task |
|
|
34
|
+
| `{task}` (bare number) | — | **Error**: "Use /cbp-standalone-task-testing {N} instead — bare numbers no longer route to standalone tasks." |
|
|
35
35
|
|
|
36
36
|
Anything else is malformed — surface this error and stop:
|
|
37
37
|
|
|
38
38
|
```
|
|
39
39
|
task-testing: invalid argument `{value}`. Expected:
|
|
40
40
|
108-1 → CHK-108 TASK-1 (checkpoint-bound)
|
|
41
|
-
45 → standalone TASK-45
|
|
42
41
|
(empty) → active in-progress task
|
|
43
42
|
|
|
43
|
+
For standalone tasks, use `/cbp-standalone-task-testing {N}`.
|
|
44
44
|
For a specific round, use `/cbp-round-update 108-1-2`.
|
|
45
45
|
```
|
|
46
46
|
|
|
@@ -49,8 +49,8 @@ Error cases: `108-1-2` (that is round-update's shape), `abc`, `108-`, `-1`, `108
|
|
|
49
49
|
#### Worked examples
|
|
50
50
|
|
|
51
51
|
- `task-testing 108-1` → CHK-108 TASK-1
|
|
52
|
-
- `task-testing 45` → standalone TASK-45
|
|
53
52
|
- `task-testing` (no arg) → active in-progress task via `get_current_task`
|
|
53
|
+
- `task-testing 45` → error: "Use /cbp-standalone-task-testing 45 instead — bare numbers no longer route to standalone tasks."
|
|
54
54
|
- `task-testing 108-1-2` → error: "use `/cbp-round-update 108-1-2`"
|
|
55
55
|
- `task-testing abc` → error: malformed
|
|
56
56
|
|
|
@@ -61,7 +61,6 @@ Given the parse from Step 1:
|
|
|
61
61
|
| Parse | Resolution path |
|
|
62
62
|
|-------|-----------------|
|
|
63
63
|
| `{chk}-{task}` | MCP `get_checkpoints(repo_id)` → filter `number === {chk}`. MCP `get_tasks(checkpoint_id)` → filter `number === {task}`. |
|
|
64
|
-
| `{task}` | MCP `get_tasks(repo_id, standalone: true)` → filter `number === {task}`. |
|
|
65
64
|
| _(empty)_ | MCP `get_current_task(repo_id)` — finds the active in-progress task. |
|
|
66
65
|
|
|
67
66
|
If no in-progress task, show error and stop.
|
|
@@ -268,6 +267,7 @@ Waiting for user to run `/cbp-task-create`.
|
|
|
268
267
|
- **Batch user tests** — present all user-testable items in a single `AskUserQuestion` checklist; never one-per-question
|
|
269
268
|
- **Read actual files** — do not rely on metadata alone
|
|
270
269
|
- **Run actual commands** — capture real stdout/stderr
|
|
270
|
+
- **Checkpoint-bound only** — for standalone tasks use `/cbp-standalone-task-testing`
|
|
271
271
|
|
|
272
272
|
## Integration
|
|
273
273
|
|