@brainervirus/workit-core 0.8.8 → 0.8.10
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/package.json +1 -1
- package/scripts/sync-release-manifests.ts +72 -0
- package/skills/wk-changelog/SKILL.md +2 -2
- package/skills/wk-commit/SKILL.md +3 -3
- package/skills/wk-docs-refresh/SKILL.md +2 -2
- package/skills/wk-handoff/SKILL.md +5 -3
- package/skills/wk-implement/SKILL.md +13 -11
- package/skills/wk-issue-update/SKILL.md +5 -5
- package/skills/wk-issue-update/references/youtrack-update-style.md +1 -1
- package/skills/wk-meetings/SKILL.md +5 -5
- package/skills/wk-pr/SKILL.md +4 -4
- package/skills/wk-release-notes/SKILL.md +1 -1
- package/skills/wk-verify/SKILL.md +3 -3
- package/src/core/branch.ts +1 -1
- package/src/core/detector.ts +1 -1
- package/src/core/docs-repo.ts +1 -1
- package/src/core/flow-state.ts +443 -77
- package/src/core/menu.ts +3 -1
- package/src/core/reminder.ts +14 -3
- package/src/core/repo-context.ts +1 -1
- package/src/core/sdd.ts +60 -1
- package/src/core/youtrack-tools.ts +4 -4
- package/src/core/youtrack.ts +1 -1
- package/templates/execution-contract.md +20 -18
- package/templates/plan-template.md +1 -1
- package/templates/spec-template.md +2 -2
- package/templates/superpowers-doc-contract.md +13 -10
- package/vendor/superpowers/skills/subagent-driven-development/SKILL.md +4 -4
package/src/core/menu.ts
CHANGED
|
@@ -16,14 +16,16 @@ export const SOURCE_MENU_LABELS = [
|
|
|
16
16
|
"Handoff",
|
|
17
17
|
"Review spec first",
|
|
18
18
|
"Review plan first",
|
|
19
|
+
"Change model first",
|
|
19
20
|
] as const;
|
|
20
21
|
|
|
21
|
-
/** Display labels a marked destination presents — exactly
|
|
22
|
+
/** Display labels a marked destination presents — exactly five, no Handoff (CA-08). */
|
|
22
23
|
export const DESTINATION_MENU_LABELS = [
|
|
23
24
|
"Subagent-driven",
|
|
24
25
|
"Inline",
|
|
25
26
|
"Review spec first",
|
|
26
27
|
"Review plan first",
|
|
28
|
+
"Change model first",
|
|
27
29
|
] as const;
|
|
28
30
|
|
|
29
31
|
/**
|
package/src/core/reminder.ts
CHANGED
|
@@ -15,7 +15,7 @@ export const REMINDER_TEXT = `<workflow-contract-reminder>
|
|
|
15
15
|
- Bounded user choices → call the native \`question\` tool (never A/B/C or 1/2/3 lists in prose).
|
|
16
16
|
- After a plan is approved → native \`question\` menu with exactly: ${SOURCE_MENU_LABELS_DISPLAY.join(", ")}.
|
|
17
17
|
- Tools with \`confirmed\` → call them; never fabricate their result.
|
|
18
|
-
- Before the first \`
|
|
18
|
+
- Before the first \`workit_spec_approve\`/\`workit_plan_approve\` (self-review) run the superpowers writing-plans Self-Review checklist: spec coverage (every spec requirement maps to a task), placeholder scan, type consistency; fix findings inline.
|
|
19
19
|
- Delivering docs → clickable markdown link \`[spec.md](docs/<slug>/spec.md)\` + 3-5 bullet summary.
|
|
20
20
|
</workflow-contract-reminder>`;
|
|
21
21
|
|
|
@@ -29,7 +29,7 @@ export const DESTINATION_REMINDER_TEXT = `<workflow-contract-reminder>
|
|
|
29
29
|
- Bounded user choices → call the native \`question\` tool (never A/B/C or 1/2/3 lists in prose).
|
|
30
30
|
- This session is a handoff destination: present the post-plan menu with exactly: ${DESTINATION_MENU_LABELS.join(", ")}.
|
|
31
31
|
- Tools with \`confirmed\` → call them; never fabricate their result.
|
|
32
|
-
- Before the first \`
|
|
32
|
+
- Before the first \`workit_spec_approve\`/\`workit_plan_approve\` (self-review) run the superpowers writing-plans Self-Review checklist: spec coverage (every spec requirement maps to a task), placeholder scan, type consistency; fix findings inline.
|
|
33
33
|
- Delivering docs → clickable markdown link \`[spec.md](docs/<slug>/spec.md)\` + 3-5 bullet summary.
|
|
34
34
|
${HANDOFF_DESTINATION_MARKER}
|
|
35
35
|
</workflow-contract-reminder>`;
|
|
@@ -51,6 +51,17 @@ export const SDD_REMINDER_TEXT = `<workflow-sdd-reminder>
|
|
|
51
51
|
An approved plan is subagent-driven — execute it via \`wk-implement\` / \`task\` delegation. Never implement the approved plan inline in the main session.
|
|
52
52
|
</workflow-sdd-reminder>`;
|
|
53
53
|
|
|
54
|
+
/**
|
|
55
|
+
* Worker-only context (CA-16): an authorized direct child of the activating
|
|
56
|
+
* coordinator receives ONLY this compact contract — never the coordinator
|
|
57
|
+
* bootstrap or SDD_REMINDER_TEXT. It carries the worker duties (brief, TDD,
|
|
58
|
+
* commit range, report) and no coordination instructions.
|
|
59
|
+
*/
|
|
60
|
+
export const SDD_WORKER_REMINDER_TEXT = `<workflow-sdd-worker>
|
|
61
|
+
You are an authorized delegated worker for an active subagent-driven plan.
|
|
62
|
+
Execute only the supplied task brief: follow TDD (failing test first), land exactly one contiguous non-empty commit range for your task, then report status, commits, and test results to the coordinator. Do not manage coordinator bookkeeping or launch another agent harness.
|
|
63
|
+
</workflow-sdd-worker>`;
|
|
64
|
+
|
|
54
65
|
export const DOC_RENDER_TEXT = `<workflow-doc-render>
|
|
55
66
|
When delivering a spec or plan, by default render the full markdown content of the doc in chat (headings, tables, mermaid fences preserved) — NOT a backtick-wrapped raw block.
|
|
56
67
|
If the doc exceeds the render threshold (more than 150 lines, over 8KB, or more than 3 mermaid diagrams), deliver only the clickable link \`[spec.md](docs/<slug>/spec.md)\` + a 3-5 bullet summary.
|
|
@@ -67,7 +78,7 @@ A tool failed with a config-gap error (\`workflow config missing\`). Never confi
|
|
|
67
78
|
</workflow-config-guard>`;
|
|
68
79
|
|
|
69
80
|
export const VERIFICATION_TEXT = `<workflow-verification-rail>
|
|
70
|
-
Skill: verification-before-completion. NO completion claims without fresh verification evidence — run the check command (e.g. \`bun run check\` / \`
|
|
81
|
+
Skill: verification-before-completion. NO completion claims without fresh verification evidence — run the check command (e.g. \`bun run check\` / \`workit_verify\`) and show its output before claiming done/fixed/passing. If you haven't run the verification command in this message, you cannot claim it passes.
|
|
71
82
|
</workflow-verification-rail>`;
|
|
72
83
|
|
|
73
84
|
export const TDD_TEXT = `<workflow-tdd-rail>
|
package/src/core/repo-context.ts
CHANGED
|
@@ -330,7 +330,7 @@ const CHANGELOG_RULES = `- Use an [Unreleased] section.
|
|
|
330
330
|
- Entries should be human-readable and user-facing.
|
|
331
331
|
- Do not use raw commit messages as changelog bullets.
|
|
332
332
|
- MERGE into existing ### Category under [Unreleased] — never append a second ### Added / ### Fixed block.
|
|
333
|
-
- Apply with the native
|
|
333
|
+
- Apply with the native workit_changelog_apply tool only (not hand-edits under Unreleased).
|
|
334
334
|
- If Unreleased already has duplicate category headings, normalize_only first.`;
|
|
335
335
|
|
|
336
336
|
/** Port of changelog-context.sh — changelog update context. */
|
package/src/core/sdd.ts
CHANGED
|
@@ -183,7 +183,7 @@ export function sddContext({
|
|
|
183
183
|
flow: { spec: flow.spec, plan: flow.plan, menu: flow.menu },
|
|
184
184
|
todowrite_required: true,
|
|
185
185
|
todowrite_hint:
|
|
186
|
-
"REQUIRED: Call OpenCode todowrite with todos from this result so the native task list shows progress. Before each task set status in_progress; after
|
|
186
|
+
"REQUIRED: Call OpenCode todowrite with todos from this result so the native task list shows progress. Before each task set status in_progress; after workit_sdd_append_progress set it completed.",
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
189
|
|
|
@@ -292,3 +292,62 @@ export function sddAppendProgress({
|
|
|
292
292
|
const rel = posix(path.relative(contained.base, path_));
|
|
293
293
|
return { ok: true, line: trimmed, progress_path: rel };
|
|
294
294
|
}
|
|
295
|
+
|
|
296
|
+
export type AdvisoryResult =
|
|
297
|
+
| { ok: true; advisory: string; advisories_path: string }
|
|
298
|
+
| { error: string; code: string };
|
|
299
|
+
|
|
300
|
+
export function sddAppendAdvisory({
|
|
301
|
+
advisories_path,
|
|
302
|
+
task_id,
|
|
303
|
+
text,
|
|
304
|
+
workspace_root,
|
|
305
|
+
}: {
|
|
306
|
+
advisories_path: string;
|
|
307
|
+
task_id: unknown;
|
|
308
|
+
text: unknown;
|
|
309
|
+
workspace_root: string;
|
|
310
|
+
}): AdvisoryResult {
|
|
311
|
+
if (typeof task_id !== "number" || !Number.isSafeInteger(task_id) || task_id <= 0) {
|
|
312
|
+
return { error: "task_id must be a positive safe integer", code: "advisory_task_invalid" };
|
|
313
|
+
}
|
|
314
|
+
if (typeof text !== "string") {
|
|
315
|
+
return {
|
|
316
|
+
error: "advisory text must be a string of 1-1000 characters after normalization",
|
|
317
|
+
code: "advisory_text_invalid",
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
if (text.includes("\r") || text.includes("\n")) {
|
|
321
|
+
return {
|
|
322
|
+
error: "advisory text must be a single line (no CR/LF)",
|
|
323
|
+
code: "advisory_text_invalid",
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
const collapsed = text.trim().replace(/[ \t]+/g, " ");
|
|
327
|
+
if (collapsed.length === 0 || collapsed.length > 1000) {
|
|
328
|
+
return {
|
|
329
|
+
error: "advisory text must be 1-1000 characters after trim and horizontal-space collapse",
|
|
330
|
+
code: "advisory_text_invalid",
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
if (!/^docs\/[^/]+\/sdd\/advisories\.md$/.test(advisories_path)) {
|
|
334
|
+
return {
|
|
335
|
+
error: `advisories_path must be docs/<slug>/sdd/advisories.md: ${advisories_path}`,
|
|
336
|
+
code: "advisory_path_invalid",
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
const contained = resolveDocsPath({ workspace_root, path: advisories_path });
|
|
340
|
+
if (!contained.ok) return { error: contained.error, code: "advisory_path_invalid" };
|
|
341
|
+
const abs = contained.path;
|
|
342
|
+
if (existsSync(abs) && statSync(abs).isDirectory()) {
|
|
343
|
+
return {
|
|
344
|
+
error: `advisory target is a directory: ${advisories_path}`,
|
|
345
|
+
code: "advisory_target_invalid",
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
mkdirSync(path.dirname(abs), { recursive: true });
|
|
349
|
+
const line = `- Task ${task_id}: ${collapsed}\n`;
|
|
350
|
+
appendFileSync(abs, line, "utf8");
|
|
351
|
+
const rel = posix(path.relative(contained.base, abs));
|
|
352
|
+
return { ok: true, advisory: collapsed, advisories_path: rel };
|
|
353
|
+
}
|
|
@@ -102,7 +102,7 @@ type PostData = {
|
|
|
102
102
|
loggedMinutes: number;
|
|
103
103
|
outcome?: "unknown" | "not_applied";
|
|
104
104
|
instructions?: string;
|
|
105
|
-
retry?: "
|
|
105
|
+
retry?: "workit_youtrack_post" | "workit_youtrack_log_time";
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
const notApplied = (value: LegacyValue): value is NotApplied =>
|
|
@@ -129,7 +129,7 @@ export async function postUpdate(
|
|
|
129
129
|
postedComment: false,
|
|
130
130
|
loggedMinutes: 0,
|
|
131
131
|
outcome: "not_applied",
|
|
132
|
-
retry: "
|
|
132
|
+
retry: "workit_youtrack_post",
|
|
133
133
|
});
|
|
134
134
|
unwrap(comment);
|
|
135
135
|
} catch (error) {
|
|
@@ -156,7 +156,7 @@ export async function postUpdate(
|
|
|
156
156
|
postedComment: true,
|
|
157
157
|
loggedMinutes: 0,
|
|
158
158
|
outcome: "not_applied",
|
|
159
|
-
retry: "
|
|
159
|
+
retry: "workit_youtrack_log_time",
|
|
160
160
|
});
|
|
161
161
|
unwrap(time);
|
|
162
162
|
} catch (error) {
|
|
@@ -189,7 +189,7 @@ export async function logTimeUpdate(
|
|
|
189
189
|
issueId: input.issueId,
|
|
190
190
|
loggedMinutes: 0,
|
|
191
191
|
outcome: "not_applied",
|
|
192
|
-
retry: "
|
|
192
|
+
retry: "workit_youtrack_log_time",
|
|
193
193
|
});
|
|
194
194
|
return ok(unwrap(value));
|
|
195
195
|
} catch (error) {
|
package/src/core/youtrack.ts
CHANGED
|
@@ -711,7 +711,7 @@ export async function postUpdate(
|
|
|
711
711
|
postedComment: true,
|
|
712
712
|
loggedMinutes: 0,
|
|
713
713
|
error: time.error,
|
|
714
|
-
retry: "
|
|
714
|
+
retry: "workit_youtrack_log_time",
|
|
715
715
|
};
|
|
716
716
|
}
|
|
717
717
|
return { ok: true, issueId, postedComment: true, loggedMinutes: minutes };
|
|
@@ -7,59 +7,61 @@ Load `using-superpowers`, `subagent-driven-development`, `test-driven-developmen
|
|
|
7
7
|
|
|
8
8
|
## Handoff destination
|
|
9
9
|
|
|
10
|
-
This session is a handoff destination for a continued plan. The originating session already recorded the post-plan menu choice; present exactly these four choices and never re-offer the originating handoff option:
|
|
10
|
+
This session is a handoff destination for a continued plan. The originating session already recorded the post-plan menu choice; present exactly these four choices plus model deferral and never re-offer the originating handoff option:
|
|
11
11
|
|
|
12
12
|
- Subagent-driven
|
|
13
13
|
- Inline
|
|
14
14
|
- Review spec first
|
|
15
15
|
- Review plan first
|
|
16
|
+
- Change model first
|
|
16
17
|
|
|
17
18
|
<workflow-handoff-destination>true</workflow-handoff-destination>
|
|
18
19
|
|
|
19
20
|
## Hard gates
|
|
20
21
|
|
|
21
22
|
- The parent is coordinator-only: it does not edit product code or perform delegated exploration.
|
|
22
|
-
- Never use a worktree. Branch changes are in-place through `
|
|
23
|
-
- Working state, briefs, ledgers, and review diffs live only under gitignored `<SDD_DIR>` in `docs/<slug>/sdd/` and use `
|
|
23
|
+
- Never use a worktree. Branch changes are in-place through `workit_branch_setup` on `feature/*` or `bugfix/*`; never commit on protected branches.
|
|
24
|
+
- Working state, briefs, ledgers, and review diffs live only under gitignored `<SDD_DIR>` in `docs/<slug>/sdd/` and use `workit_sdd_*` tools.
|
|
24
25
|
- Use native `todowrite` for visible task state as well as the gitignored ledger.
|
|
25
26
|
- Use native `question` for branch/stash choices and guarded external mutations; call mutation tools only after approval with `confirmed: true` (grounded in the recorded NativeChoiceEvidence).
|
|
26
|
-
- Flow-tool confirmations are never agent-typed booleans and never caller-supplied evidence objects: on OpenCode the plugin records the user's native-`question` answer as a host-observed one-use receipt (`attested: true`, `callID`, `selectedLabel`, `recordedAt`) consumed by `
|
|
27
|
-
-
|
|
27
|
+
- Flow-tool confirmations are never agent-typed booleans and never caller-supplied evidence objects: on OpenCode the plugin records the user's native-`question` answer as a host-observed one-use receipt (`attested: true`, `callID`, `selectedLabel`, `recordedAt`) consumed by `workit_spec_approve` / `workit_plan_approve` / `workit_plan_menu` — no evidence argument exists, and delegated worker status comes from host session parentage (`parentID`), never a caller `role` field. On Cursor, confirmations are policy-only (`attested: false`) and subagent-driven execution is rejected as unsupported.
|
|
28
|
+
- Delegated authority is direct-child-only: a worker is the session whose host `parentID` exactly equals the activating coordinator's recorded `coordinator_session_id`; missing, mismatched, or multi-owner lineage fails closed with `delegation_lineage_denied`, and nested `opencode` launches are denied during active delegated work. An authorized child receives only the compact worker contract (execute the supplied brief, follow TDD, land one contiguous non-empty commit range, report results) — never coordinator guidance, `wk-implement`, or ledger management; coordinator bookkeeping via `workit_sdd_*` stays with the coordinator session.
|
|
29
|
+
- On Cursor, for every repository-scoped `workit_*` call, pass the active Cursor workspace as `workspace_root`; never rely on the MCP process default.
|
|
28
30
|
- Use native `task` with only the built-in `explore` and `general` agents.
|
|
29
31
|
|
|
30
32
|
## Flow gates (HARD)
|
|
31
33
|
|
|
32
34
|
- `wk-implement` refuses to run unless the plan is `approved` (flow.json) and the post-plan menu was presented.
|
|
33
35
|
- `wk-handoff` refuses to run unless both spec and plan are `approved`.
|
|
34
|
-
- Sequence is enforced by tools: `
|
|
36
|
+
- Sequence is enforced by tools: `workit_spec_approve`, `workit_plan_approve`, `workit_plan_menu` — never skip a step (the spec/plan self-review runs automatically inside the transition; only the final approval asks for your confirmation).
|
|
35
37
|
|
|
36
38
|
## Setup
|
|
37
39
|
|
|
38
|
-
0. Call `
|
|
39
|
-
1. Call `
|
|
40
|
-
2. Call `
|
|
40
|
+
0. Call `workit_docs_validate` with the linked spec/plan paths. Hard-fail on any error before todos or branch setup.
|
|
41
|
+
1. Call `workit_sdd_context` with `<PLAN_PATH>` and initialize `todowrite` from returned tasks.
|
|
42
|
+
2. Call `workit_plan_tasks`; cache each top-level task's `section_text`.
|
|
41
43
|
3. Mark IDs in `completed_task_ids` completed and never redispatch them.
|
|
42
|
-
4. Call `
|
|
44
|
+
4. Call `workit_resolve_branch`, then show the current branch, target branch, and stash behavior before any in-place checkout/setup mutation.
|
|
43
45
|
5. Always use `question`: for a clean tree ask whether to proceed or cancel; for a dirty tree add the stash choice and describe what will be stashed.
|
|
44
|
-
6. Call `
|
|
46
|
+
6. Call `workit_branch_setup` with `confirmed: true` only after approval.
|
|
45
47
|
|
|
46
48
|
## Remaining-task loop
|
|
47
49
|
|
|
48
50
|
For each top-level task absent from `completed_task_ids`:
|
|
49
51
|
|
|
50
52
|
1. Mark it `in_progress` with `todowrite`.
|
|
51
|
-
2. Create a working-state brief with `
|
|
53
|
+
2. Create a working-state brief with `workit_sdd_task_brief` and `confirmed: true`.
|
|
52
54
|
3. Delegate read-only discovery, when needed, to an `explore` agent. Delegate implementation to a fresh `general` agent. Product changes follow TDD.
|
|
53
|
-
4. Create a working-state diff with `
|
|
55
|
+
4. Create a working-state diff with `workit_sdd_review_package` and `confirmed: true`.
|
|
54
56
|
5. Delegate spec-compliance review and code-quality review to separate `general` agents.
|
|
55
|
-
6. **Blocking** findings (Critical, Important, or spec-compliance) may trigger at most **two** fix+re-review rounds per task. **Advisory** findings (Minor, style, YAGNI, taste) never pause the loop — append them
|
|
56
|
-
7. Append the validated ledger entry with `
|
|
57
|
+
6. **Blocking** findings (Critical, Important, or spec-compliance) may trigger at most **two** fix+re-review rounds per task. **Advisory** findings (Minor, style, YAGNI, taste) never pause the loop — append them with `workit_sdd_append_advisory` (`--task <id> --text <text>`, `confirmed: true`) instead of an unrestricted file edit.
|
|
58
|
+
7. Append the validated ledger entry with `workit_sdd_append_progress` and `confirmed: true`; mark the todo completed.
|
|
57
59
|
|
|
58
60
|
## Final gate
|
|
59
61
|
|
|
60
|
-
Run a separate full-branch code review, then `
|
|
62
|
+
Run a separate full-branch code review, then `workit_verify`. Present the full `<SDD_DIR>/advisories.md` roll-up once, then use native `question` so the user can choose which advisory items to fix, discuss, or discard. Report exact check results and never infer success. Use `workit_git_context` for a commit preview and load `wk-commit` through `skill` for an approved commit. If working state contains a stash reference, preview reapplication through `question`, then call `workit_branch_setup` with `confirmed: true` after approval.
|
|
61
63
|
|
|
62
|
-
**Mandatory:** end the run by calling `
|
|
64
|
+
**Mandatory:** end the run by calling `workit_plan_complete` (OpenCode/Cursor) or the CLI `workit flow complete` (CLI host) after the final task once the SDD ledger is complete (all task IDs appended) and `workit_verify` passes — a complete ledger and green verification are the tool's gates. Never finish the run while the plan is still `active`.
|
|
63
65
|
|
|
64
66
|
## Task order
|
|
65
67
|
|
|
@@ -68,4 +70,4 @@ Run a separate full-branch code review, then `workflow_verify`. Present the full
|
|
|
68
70
|
## Quality gate (HARD)
|
|
69
71
|
|
|
70
72
|
- Specs/plans are written from `templates/spec-template.md` / `templates/plan-template.md`.
|
|
71
|
-
- After `
|
|
73
|
+
- After `workit_docs_validate`, surface `quality` findings (spec scan). Hard findings (missing required section, missing CA-XX) block task start unless the user explicitly waives them. Warnings are advisory.
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
## Global Constraints
|
|
11
11
|
|
|
12
12
|
- Each task lands exactly one contiguous non-empty commit range (`base..head`): fix rounds append commits to that range and never rewrite/amend an active review range; each progress line records the task's real base..head shas.
|
|
13
|
-
- The final task ends execution with `
|
|
13
|
+
- The final task ends execution with `workit_plan_complete` (or the CLI `workit flow complete`) once the SDD ledger is complete and repository verification passes — a run never finishes while the plan is still `active`.
|
|
14
14
|
- <project-wide requirements, one line each>
|
|
15
15
|
|
|
16
16
|
---
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
|
|
17
17
|
## Architecture
|
|
18
18
|
|
|
19
|
-
<!-- REQUIRED if this spec has flows or architecture: render a mermaid diagram (
|
|
19
|
+
<!-- REQUIRED if this spec has flows or architecture: render a mermaid diagram (workit_present_flow). -->
|
|
20
20
|
```mermaid
|
|
21
21
|
flowchart TD
|
|
22
22
|
A[Start] --> B[Step]
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
-
<!-- REQUIRED if this spec touches UI: render an ASCII wireframe (
|
|
25
|
+
<!-- REQUIRED if this spec touches UI: render an ASCII wireframe (workit_present_ascii). -->
|
|
26
26
|
```text
|
|
27
27
|
┌──────────────┐
|
|
28
28
|
│ Header │
|
|
@@ -27,31 +27,31 @@ Plans require:
|
|
|
27
27
|
|
|
28
28
|
`bugfix/<slug>` is also valid. Never use `main`, `develop`, `master`, or `prod`. Use plain backtick paths. Top-level headings are exactly `### Task N: Title`; steps use `- [ ] **Step N:** ...`; task headings never appear inside fences.
|
|
29
29
|
|
|
30
|
-
Before writing **Branch:** into a new spec or plan, call `
|
|
30
|
+
Before writing **Branch:** into a new spec or plan, call `workit_docs_branch` and write the returned `branch` verbatim. When `action` is `keep`, use the current feature/bugfix branch. When `action` is `create_from_develop` or `create_from_base`, create the branch only through `workit_branch_setup`; it uses the configured workspace/global target branch.
|
|
31
31
|
|
|
32
32
|
## Execution and handoff
|
|
33
33
|
|
|
34
34
|
- Implementation uses `wk-implement` and subagent-driven development, with native `todowrite` and `task`.
|
|
35
35
|
- Commits use `wk-commit` after its native `question` confirmation.
|
|
36
|
-
- Continuation uses `wk-handoff`, whose `
|
|
37
|
-
- Never use worktrees. Resolve the declared branch with `
|
|
38
|
-
- Flow-tool confirmations are never agent-typed booleans and never caller-supplied evidence objects: on OpenCode the plugin records the user's native-`question` answer as a host-observed one-use receipt (`attested: true`, `callID`, `selectedLabel`, `recordedAt`) consumed by `
|
|
39
|
-
- Keep all SDD state under the gitignored `docs/<slug>/sdd/`; use `
|
|
40
|
-
- After implementation, use `question` before an approved stash reapply through `
|
|
36
|
+
- Continuation uses `wk-handoff`, whose `workit_handoff_session` creates and seeds the OpenCode session automatically.
|
|
37
|
+
- Never use worktrees. Resolve the declared branch with `workit_resolve_branch`, preview dirty-tree stash choices with `question`, and apply an approved in-place checkout through `workit_branch_setup` with `confirmed: true` (grounded in the recorded NativeChoiceEvidence).
|
|
38
|
+
- Flow-tool confirmations are never agent-typed booleans and never caller-supplied evidence objects: on OpenCode the plugin records the user's native-`question` answer as a host-observed one-use receipt (`attested: true`, `callID`, `selectedLabel`, `recordedAt`) consumed by `workit_spec_approve` / `workit_plan_approve` / `workit_plan_menu` — no evidence argument exists, and delegated worker status comes from host session parentage (`parentID`), never a caller `role` field. On Cursor, confirmations are policy-only (`attested: false`) and subagent-driven execution is rejected as unsupported.
|
|
39
|
+
- Keep all SDD state under the gitignored `docs/<slug>/sdd/`; use `workit_sdd_context` and the registered `workit_sdd_*` tools.
|
|
40
|
+
- After implementation, use `question` before an approved stash reapply through `workit_branch_setup` with `confirmed: true`.
|
|
41
41
|
|
|
42
42
|
## YouTrack content
|
|
43
43
|
|
|
44
|
-
Chat follows the user's language. YouTrack task comments are Spanish (`es-CL`) and use `
|
|
44
|
+
Chat follows the user's language. YouTrack task comments are Spanish (`es-CL`) and use `workit_youtrack_draft` followed by reviewed `workit_youtrack_post` with `confirmed: true`. Preserve the user's paragraph voice; do not inject commits, file paths, or robotic bullet reports.
|
|
45
45
|
|
|
46
46
|
## Final self-check
|
|
47
47
|
|
|
48
|
-
Before handoff, call `
|
|
48
|
+
Before handoff, call `workit_docs_validate` on the linked spec/plan pair. Hard-fail on any error; never offer execution when validation fails.
|
|
49
49
|
|
|
50
50
|
Before handoff, verify the saved spec path, plan path, declared branch, top-level task numbering, and workflow-managed SDD directory through the registered read-only workflow tools. Report structured failures; never infer success.
|
|
51
51
|
|
|
52
52
|
## Post-plan execution choice
|
|
53
53
|
|
|
54
|
-
After saving a plan, call `
|
|
54
|
+
After saving a plan, call `workit_docs_validate` on the spec/plan pair. On failure, stop and fix docs — do not offer execution.
|
|
55
55
|
|
|
56
56
|
On success, use native `question` / Cursor `AskQuestion` with exactly these options (no stay, no A/B/C prose duplicate):
|
|
57
57
|
|
|
@@ -60,10 +60,13 @@ On success, use native `question` / Cursor `AskQuestion` with exactly these opti
|
|
|
60
60
|
3. Handoff → load `wk-handoff` (new session only)
|
|
61
61
|
4. Review spec first
|
|
62
62
|
5. Review plan first
|
|
63
|
+
6. Change model first
|
|
64
|
+
|
|
65
|
+
`Change model first` is display-only deferral: it ends the turn without calling `workit_plan_menu` and re-presents the menu on the next turn. Every other choice must call `workit_plan_menu` immediately after the answer and before any skill, branch question, mutation, or handoff.
|
|
63
66
|
|
|
64
67
|
Never emit Superpowers text beginning “Two execution options”.
|
|
65
68
|
|
|
66
|
-
A handoff destination session (the seeded contract carries `<workflow-handoff-destination>true</workflow-handoff-destination>`) presents exactly
|
|
69
|
+
A handoff destination session (the seeded contract carries `<workflow-handoff-destination>true</workflow-handoff-destination>`) presents exactly five choices — Subagent-driven, Inline, Review spec first, Review plan first, Change model first — and never re-offers the originating handoff option.
|
|
67
70
|
|
|
68
71
|
- Specs/plans must follow `templates/spec-template.md` / `templates/plan-template.md` (mandated diagrams, tables, CA-XX).
|
|
69
72
|
|
|
@@ -63,7 +63,7 @@ digraph process {
|
|
|
63
63
|
"Read plan, note context and global constraints, create todos" [shape=box];
|
|
64
64
|
"More tasks remain?" [shape=diamond];
|
|
65
65
|
"Dispatch final code reviewer subagent (../requesting-code-review/code-reviewer.md)" [shape=box];
|
|
66
|
-
"Run verification, then
|
|
66
|
+
"Run verification, then workit_plan_complete once the ledger is complete and verification passes" [shape=box];
|
|
67
67
|
"Use superpowers:finishing-a-development-branch" [shape=box style=filled fillcolor=lightgreen];
|
|
68
68
|
|
|
69
69
|
"Read plan, note context and global constraints, create todos" -> "Dispatch implementer subagent (./implementer-prompt.md)";
|
|
@@ -79,12 +79,12 @@ digraph process {
|
|
|
79
79
|
"Mark task complete in todo list and progress ledger" -> "More tasks remain?";
|
|
80
80
|
"More tasks remain?" -> "Dispatch implementer subagent (./implementer-prompt.md)" [label="yes"];
|
|
81
81
|
"More tasks remain?" -> "Dispatch final code reviewer subagent (../requesting-code-review/code-reviewer.md)" [label="no"];
|
|
82
|
-
"Dispatch final code reviewer subagent (../requesting-code-review/code-reviewer.md)" -> "Run verification, then
|
|
83
|
-
"Run verification, then
|
|
82
|
+
"Dispatch final code reviewer subagent (../requesting-code-review/code-reviewer.md)" -> "Run verification, then workit_plan_complete once the ledger is complete and verification passes";
|
|
83
|
+
"Run verification, then workit_plan_complete once the ledger is complete and verification passes" -> "Use superpowers:finishing-a-development-branch";
|
|
84
84
|
}
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
-
**Mandatory completion:** after the final whole-branch review, run repository verification. Once the SDD ledger is complete and verification passes, end the run by calling `
|
|
87
|
+
**Mandatory completion:** after the final whole-branch review, run repository verification. Once the SDD ledger is complete and verification passes, end the run by calling `workit_plan_complete` (or the CLI `workit flow complete`) — a complete ledger and green verification are the tool's gates. Never finish while the plan is still `active`.
|
|
88
88
|
|
|
89
89
|
## Pre-Flight Plan Review
|
|
90
90
|
|