opencodekit 0.14.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/index.js +53 -18
  2. package/dist/template/.opencode/AGENTS.md +38 -3
  3. package/dist/template/.opencode/agent/build.md +44 -1
  4. package/dist/template/.opencode/agent/explore.md +1 -0
  5. package/dist/template/.opencode/agent/planner.md +40 -1
  6. package/dist/template/.opencode/agent/review.md +1 -0
  7. package/dist/template/.opencode/agent/rush.md +35 -0
  8. package/dist/template/.opencode/agent/scout.md +1 -0
  9. package/dist/template/.opencode/command/brainstorm.md +58 -3
  10. package/dist/template/.opencode/command/finish.md +18 -8
  11. package/dist/template/.opencode/command/fix.md +24 -15
  12. package/dist/template/.opencode/command/implement.md +44 -19
  13. package/dist/template/.opencode/command/import-plan.md +30 -8
  14. package/dist/template/.opencode/command/new-feature.md +37 -4
  15. package/dist/template/.opencode/command/plan.md +19 -1
  16. package/dist/template/.opencode/command/pr.md +25 -15
  17. package/dist/template/.opencode/command/revert-feature.md +15 -3
  18. package/dist/template/.opencode/command/skill-optimize.md +71 -7
  19. package/dist/template/.opencode/command/start.md +50 -5
  20. package/dist/template/.opencode/dcp.jsonc +11 -7
  21. package/dist/template/.opencode/memory/observations/2026-01-09-pattern-ampcode-mcp-json-includetools-pattern.md +42 -0
  22. package/dist/template/.opencode/memory/project/gotchas.md +52 -5
  23. package/dist/template/.opencode/memory/vector_db/memories.lance/_transactions/{0-8d00d272-cb80-463b-9774-7120a1c994e7.txn → 0-0d25ba80-ba3b-4209-9046-b45d6093b4da.txn} +0 -0
  24. package/dist/template/.opencode/memory/vector_db/memories.lance/_versions/1.manifest +0 -0
  25. package/dist/template/.opencode/memory/vector_db/memories.lance/data/{001010101000000101110001f998d04b63936ff83f9a34152d.lance → 1111100101010101011010004a9ef34df6b29f36a9a53a2892.lance} +0 -0
  26. package/dist/template/.opencode/opencode.json +525 -587
  27. package/dist/template/.opencode/package.json +1 -1
  28. package/dist/template/.opencode/plugin/memory.ts +77 -1
  29. package/dist/template/.opencode/plugin/package.json +1 -1
  30. package/dist/template/.opencode/plugin/skill-mcp.ts +155 -36
  31. package/dist/template/.opencode/skill/chrome-devtools/SKILL.md +43 -65
  32. package/dist/template/.opencode/skill/chrome-devtools/mcp.json +19 -0
  33. package/dist/template/.opencode/skill/executing-plans/SKILL.md +32 -2
  34. package/dist/template/.opencode/skill/finishing-a-development-branch/SKILL.md +42 -17
  35. package/dist/template/.opencode/skill/playwright/SKILL.md +58 -133
  36. package/dist/template/.opencode/skill/playwright/mcp.json +16 -0
  37. package/dist/template/.opencode/tool/memory-search.ts +2 -2
  38. package/package.json +4 -16
  39. package/dist/template/.opencode/memory/vector_db/memories.lance/_transactions/1-a3bea825-dad3-47dd-a6d6-ff41b76ff7b0.txn +0 -0
  40. package/dist/template/.opencode/memory/vector_db/memories.lance/_versions/2.manifest +0 -0
  41. package/dist/template/.opencode/memory/vector_db/memories.lance/data/010000101010000000010010701b3840d38c2b5f275da99978.lance +0 -0
package/dist/index.js CHANGED
@@ -750,7 +750,7 @@ var cac = (name = "") => new CAC(name);
750
750
  // package.json
751
751
  var package_default = {
752
752
  name: "opencodekit",
753
- version: "0.14.0",
753
+ version: "0.14.1",
754
754
  description: "CLI tool for bootstrapping and managing OpenCodeKit projects",
755
755
  type: "module",
756
756
  repository: {
@@ -764,10 +764,7 @@ var package_default = {
764
764
  bin: {
765
765
  ock: "dist/index.js"
766
766
  },
767
- files: [
768
- "dist",
769
- "README.md"
770
- ],
767
+ files: ["dist", "README.md"],
771
768
  scripts: {
772
769
  dev: "bun run src/index.ts",
773
770
  build: "bun run build.ts && mkdir -p dist/template && rsync -av --exclude=node_modules --exclude=dist --exclude=.git --exclude=coverage --exclude=.next --exclude=.turbo --exclude=logs --exclude=package-lock.json .opencode/ dist/template/.opencode/",
@@ -779,14 +776,7 @@ var package_default = {
779
776
  lint: "biome check .",
780
777
  "lint:fix": "biome check --fix ."
781
778
  },
782
- keywords: [
783
- "cli",
784
- "opencodekit",
785
- "template",
786
- "agents",
787
- "mcp",
788
- "opencode"
789
- ],
779
+ keywords: ["cli", "opencodekit", "template", "agents", "mcp", "opencode"],
790
780
  author: "OpenCodeKit",
791
781
  license: "MIT",
792
782
  engines: {
@@ -812,9 +802,7 @@ var package_default = {
812
802
  "@types/node": "^22.10.1",
813
803
  typescript: "^5.7.2"
814
804
  },
815
- trustedDependencies: [
816
- "@beads/bd"
817
- ]
805
+ trustedDependencies: ["@beads/bd"]
818
806
  };
819
807
 
820
808
  // src/commands/agent.ts
@@ -3777,6 +3765,7 @@ import {
3777
3765
  readdirSync as readdirSync3,
3778
3766
  writeFileSync as writeFileSync4
3779
3767
  } from "node:fs";
3768
+ import { homedir, platform } from "node:os";
3780
3769
  import { basename as basename2, dirname, join as join4 } from "node:path";
3781
3770
  import { fileURLToPath } from "node:url";
3782
3771
  var import_picocolors8 = __toESM(require_picocolors(), 1);
@@ -3795,6 +3784,15 @@ var EXCLUDED_FILES = [
3795
3784
  "yarn.lock",
3796
3785
  "pnpm-lock.yaml"
3797
3786
  ];
3787
+ function getGlobalConfigDir() {
3788
+ const os = platform();
3789
+ if (os === "win32") {
3790
+ const appData = process.env.APPDATA || process.env.LOCALAPPDATA || join4(homedir(), "AppData", "Roaming");
3791
+ return join4(appData, "opencode");
3792
+ }
3793
+ const xdgConfig = process.env.XDG_CONFIG_HOME || join4(homedir(), ".config");
3794
+ return join4(xdgConfig, "opencode");
3795
+ }
3798
3796
  function detectMode(targetDir) {
3799
3797
  const opencodeDir = join4(targetDir, ".opencode");
3800
3798
  if (existsSync4(opencodeDir)) {
@@ -3854,9 +3852,46 @@ async function copyOpenCodeOnly(templateRoot, targetDir) {
3854
3852
  async function initCommand(options = {}) {
3855
3853
  if (process.argv.includes("--quiet"))
3856
3854
  return;
3855
+ oe(import_picocolors8.default.bgCyan(import_picocolors8.default.black(" OpenCodeKit ")));
3856
+ if (options.global) {
3857
+ const globalDir = getGlobalConfigDir();
3858
+ const os = platform();
3859
+ const osName = os === "win32" ? "Windows" : os === "darwin" ? "macOS" : "Linux";
3860
+ f2.info(`Installing to global config (${osName})`);
3861
+ f2.info(`Target: ${import_picocolors8.default.cyan(globalDir)}`);
3862
+ const templateRoot2 = getTemplateRoot();
3863
+ if (!templateRoot2) {
3864
+ f2.error("Template not found. Please reinstall opencodekit.");
3865
+ $e(import_picocolors8.default.red("Failed"));
3866
+ process.exit(1);
3867
+ }
3868
+ if (existsSync4(globalDir) && !options.force) {
3869
+ f2.warn(`Global config already exists at ${globalDir}`);
3870
+ f2.info(`Use ${import_picocolors8.default.cyan("--force")} to overwrite`);
3871
+ $e("Nothing to do");
3872
+ return;
3873
+ }
3874
+ const s2 = de();
3875
+ s2.start("Copying to global config");
3876
+ const opencodeSrc = join4(templateRoot2, ".opencode");
3877
+ if (!existsSync4(opencodeSrc)) {
3878
+ s2.stop("Failed");
3879
+ f2.error("Template .opencode/ not found");
3880
+ $e(import_picocolors8.default.red("Failed"));
3881
+ process.exit(1);
3882
+ }
3883
+ await copyDir(opencodeSrc, globalDir);
3884
+ s2.stop("Done");
3885
+ le(`Global config installed at:
3886
+ ${globalDir}
3887
+
3888
+ This provides default agents, skills, and tools
3889
+ for all OpenCode projects on this machine.`, "Global Installation Complete");
3890
+ $e(import_picocolors8.default.green("Ready!"));
3891
+ return;
3892
+ }
3857
3893
  const targetDir = process.cwd();
3858
3894
  const mode = detectMode(targetDir);
3859
- oe(import_picocolors8.default.bgCyan(import_picocolors8.default.black(" OpenCodeKit ")));
3860
3895
  if (mode === "already-initialized" && !options.force) {
3861
3896
  f2.warn("Already initialized (.opencode/ exists)");
3862
3897
  f2.info(`Use ${import_picocolors8.default.cyan("--force")} to reinitialize`);
@@ -6010,7 +6045,7 @@ var cli = cac("ock");
6010
6045
  cli.option("--verbose", "Enable verbose logging");
6011
6046
  cli.option("--quiet", "Suppress all output");
6012
6047
  cli.version(`${packageVersion}`);
6013
- cli.command("init", "Initialize OpenCodeKit in current directory").option("--force", "Reinitialize even if already exists").option("--beads", "Also initialize .beads/ for multi-agent coordination").action(initCommand);
6048
+ cli.command("init", "Initialize OpenCodeKit in current directory").option("--force", "Reinitialize even if already exists").option("--beads", "Also initialize .beads/ for multi-agent coordination").option("--global", "Install to global OpenCode config (~/.config/opencode/)").action(initCommand);
6014
6049
  cli.command("agent [action]", "Manage agents (list, add, view)").action(async (action) => {
6015
6050
  if (!action) {
6016
6051
  console.log(`
@@ -20,6 +20,41 @@ Everything else is guidelines, not laws.
20
20
 
21
21
  If yes → Delegate. If no → Execute directly.
22
22
 
23
+ ## Question Tool
24
+
25
+ **Rule**: Use `question` tool to gather user input when interpretation matters.
26
+
27
+ ### When to Use
28
+
29
+ Use the question tool when ambiguous requests could lead to significantly different implementations—if "add auth" could mean OAuth, JWT, or session-based, ask before building the wrong thing. Use it when multiple valid approaches exist and user preference matters, like choosing between frameworks or patterns. Always ask before destructive operations like deleting branches, resetting hard, or force pushing. When user preferences affect the outcome—naming conventions, file structure, coding style—let them choose. For gathering multiple selections at once, use `multiple: true` to let users pick several options.
30
+
31
+ ### When NOT to Use
32
+
33
+ Skip the question tool for trivial decisions where any reasonable choice works. If you already have enough context from the conversation, just proceed. When you can make a sensible default, mention what you're doing and continue—don't stop for permission on every small choice. Subagents like explore, scout, and review should never ask questions; they report findings back to the leader agent who decides what to do.
34
+
35
+ ### Question Design
36
+
37
+ ```typescript
38
+ question({
39
+ questions: [
40
+ {
41
+ header: "Auth Type", // Max 12 chars
42
+ question: "Which authentication approach?",
43
+ multiple: false, // true for multi-select
44
+ options: [
45
+ { label: "JWT (Recommended)", description: "Stateless, scalable" },
46
+ { label: "Session-based", description: "Traditional, server-side" },
47
+ { label: "OAuth 2.0", description: "Third-party providers" },
48
+ ],
49
+ },
50
+ ],
51
+ });
52
+ ```
53
+
54
+ ** Design Rule**: Use `question` tool to gather user input when interpretation matters.
55
+
56
+ Put your recommended option first with "(Recommended)" in the label. Keep options to 3-5 choices—more than that overwhelms users. Write short, clear descriptions that explain the tradeoff. Users can always select "Other" to provide custom input, so you don't need to cover every edge case.
57
+
23
58
  ## Anti-Hallucination (The Truth)
24
59
 
25
60
  - **Check First**: Run `bd show <id>` before starting major work.
@@ -57,9 +92,9 @@ If yes → Delegate. If no → Execute directly.
57
92
 
58
93
  **Leader Only**: `build` and `rush` agents own the DB. Subagents read-only.
59
94
 
60
- - **Start**: `bd_init()` → `bd_claim()`
61
- - **Work**: `bd_reserve()` (Lock files!) → Edit
62
- - **Finish**: `bd_done()` → **RESTART SESSION**
95
+ - **Start**: `bd ready` → `bd update <id> --status in_progress`
96
+ - **Work**: `bd-reserve({ paths: [...] })` (Lock files!) → Edit
97
+ - **Finish**: `bd close <id> --reason "..."` → `bd sync` → **RESTART SESSION**
63
98
 
64
99
  ## Core Constraints
65
100
 
@@ -62,7 +62,50 @@ Before ANY action on a new request, do two things.
62
62
 
63
63
  **First, check skills.** If the request matches a skill trigger phrase, invoke that skill immediately. Skills are specialized workflows that handle specific tasks better than manual orchestration. Don't proceed until you've checked.
64
64
 
65
- **Second, classify the request.** Trivial requests (single file, known location) get direct tool use. Explicit requests (specific file and line, clear command) get immediate execution. Exploratory requests ("how does X work?") get delegated to @explore. Open-ended requests ("improve this", "add a feature") require codebase assessment first. Ambiguous requests where interpretations differ by 2x or more in effort require clarification—ask ONE question.
65
+ **Second, classify the request.** Trivial requests (single file, known location) get direct tool use. Explicit requests (specific file and line, clear command) get immediate execution. Exploratory requests ("how does X work?") get delegated to @explore. Open-ended requests ("improve this", "add a feature") require codebase assessment first. Ambiguous requests where interpretations differ by 2x or more in effort require clarification—use the `question` tool to ask ONE focused question.
66
+
67
+ ## Using the Question Tool
68
+
69
+ Use `question` when user intent is unclear and wrong interpretation wastes significant effort.
70
+
71
+ **Good triggers:**
72
+
73
+ - "Add auth" → Ask: OAuth vs JWT vs session-based?
74
+ - "Refactor this" → Ask: Performance? Readability? Testability?
75
+ - "Build a dashboard" → Ask: Which metrics? What layout?
76
+
77
+ **Bad triggers (just proceed):**
78
+
79
+ - "Fix this typo" → Just fix it
80
+ - "Run tests" → Just run them
81
+ - User already specified details → Don't re-ask
82
+
83
+ **Question design:**
84
+
85
+ ```typescript
86
+ question({
87
+ questions: [
88
+ {
89
+ header: "Approach", // Max 12 chars
90
+ question: "Which authentication method should I implement?",
91
+ multiple: false,
92
+ options: [
93
+ { label: "JWT (Recommended)", description: "Stateless, good for APIs" },
94
+ {
95
+ label: "Session cookies",
96
+ description: "Traditional, server-side state",
97
+ },
98
+ {
99
+ label: "OAuth 2.0",
100
+ description: "Third-party login (Google, GitHub)",
101
+ },
102
+ ],
103
+ },
104
+ ],
105
+ });
106
+ ```
107
+
108
+ Put recommended option first. Keep to 3-5 options. Users can always pick "Other" for custom input.
66
109
 
67
110
  ## Codebase Assessment
68
111
 
@@ -9,6 +9,7 @@ tools:
9
9
  bash: false
10
10
  todowrite: false
11
11
  memory-update: false
12
+ question: false
12
13
  ---
13
14
 
14
15
  # Explore Agent
@@ -84,7 +84,46 @@ Tool results and user messages may include `<system-reminder>` tags. These conta
84
84
 
85
85
  1. Collect all agent responses
86
86
  2. Note critical files that should be read before implementation
87
- 3. Ask user questions about tradeoffs and preferences
87
+ 3. Use the `question` tool to gather user decisions on tradeoffs:
88
+
89
+ ```typescript
90
+ question({
91
+ questions: [
92
+ {
93
+ header: "Architecture",
94
+ question: "Which approach should we use for the data layer?",
95
+ multiple: false,
96
+ options: [
97
+ {
98
+ label: "Repository pattern (Recommended)",
99
+ description: "Clean separation, testable",
100
+ },
101
+ {
102
+ label: "Direct DB access",
103
+ description: "Simpler, fewer abstractions",
104
+ },
105
+ {
106
+ label: "ORM with models",
107
+ description: "Type-safe, migrations included",
108
+ },
109
+ ],
110
+ },
111
+ ],
112
+ });
113
+ ```
114
+
115
+ **When to use question tool in planning:**
116
+
117
+ - Multiple valid architectures exist
118
+ - Trade-offs affect future work significantly
119
+ - User hasn't specified preferences
120
+ - Need to gather multiple feature selections (use `multiple: true`)
121
+
122
+ **Don't ask when:**
123
+
124
+ - User already specified approach
125
+ - One option is clearly superior
126
+ - Question can be deferred to implementation phase
88
127
 
89
128
  ### Phase 4: Final Plan
90
129
 
@@ -6,6 +6,7 @@ maxSteps: 50
6
6
  tools:
7
7
  edit: false
8
8
  write: false
9
+ question: false
9
10
  permission:
10
11
  bash:
11
12
  "*": allow
@@ -46,8 +46,43 @@ Before acting, answer three questions in your head:
46
46
 
47
47
  **Is this mine to do?** Rush handles well-defined, localized (1-3 files), greenfield tasks. If any of these fail—ambiguous scope, system-wide changes, or legacy code with hidden invariants—delegate immediately. Don't power through complexity; avoid it.
48
48
 
49
+ **Do I need to clarify?** If the request is ambiguous and wrong interpretation wastes significant effort, use the `question` tool to ask ONE focused question. But keep it rare—Rush moves fast. If you're unsure, delegate to @build who handles complexity better.
50
+
49
51
  **Do I need to read first?** If you're about to edit a file you haven't seen, stop. Read it. Never speculate about uninspected code.
50
52
 
53
+ ## Using the Question Tool (Sparingly)
54
+
55
+ Rush uses questions rarely—only when wrong interpretation would waste significant effort AND the task is still small enough for Rush.
56
+
57
+ **Good triggers (still ask fast):**
58
+
59
+ - "Delete this" → Ask: Which files/branches specifically?
60
+ - "Rename X" → Ask: New name preference?
61
+ - Binary choice that user must decide
62
+
63
+ **Bad triggers (delegate instead):**
64
+
65
+ - "Add auth" → Too complex for Rush, delegate to @build
66
+ - Multiple design decisions → Delegate to @planner
67
+ - Research needed → Delegate to @scout
68
+
69
+ **If you need to ask more than ONE question, the task is too complex for Rush. Delegate.**
70
+
71
+ ```typescript
72
+ question({
73
+ questions: [
74
+ {
75
+ header: "Confirm",
76
+ question: "Delete feature/old-auth branch?",
77
+ options: [
78
+ { label: "Yes, delete it", description: "Removes remote and local" },
79
+ { label: "No, keep it", description: "Abort operation" },
80
+ ],
81
+ },
82
+ ],
83
+ });
84
+ ```
85
+
51
86
  ## Bail Triggers
52
87
 
53
88
  Delegate immediately when you hit any of these:
@@ -8,6 +8,7 @@ tools:
8
8
  write: false
9
9
  bash: false
10
10
  memory-update: false
11
+ question: false
11
12
  ---
12
13
 
13
14
  # Scout Agent
@@ -275,7 +275,56 @@ bd create "[Idea name]" -t task -p 2
275
275
 
276
276
  ## Output
277
277
 
278
+ ```markdown
279
+ Brainstorm Complete: $ARGUMENTS
280
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━
281
+
282
+ Duration: [N] minutes
283
+ Ideas generated: [N]
284
+ Ideas evaluated: [N]
285
+
286
+ Top 3:
287
+
288
+ 1. [Idea 1] - Score: [N]
289
+ 2. [Idea 2] - Score: [N]
290
+ 3. [Idea 3] - Score: [N]
291
+
292
+ Recommendation: [Chosen approach]
293
+ Confidence: [High/Medium/Low]
294
+
295
+ Artifacts:
296
+
297
+ - .beads/artifacts/<bead-id>/brainstorm.md (if bead)
298
+ - Observation created ✓
299
+
300
+ Follow-up beads: [N] created
278
301
  ```
302
+
303
+ **Use question tool for next steps:**
304
+
305
+ ```typescript
306
+ question({
307
+ questions: [
308
+ {
309
+ header: "Next Step",
310
+ question: "What should we do next with $ARGUMENTS?",
311
+ options: [
312
+ {
313
+ label: "Research approach (Recommended)",
314
+ description: "Validate with /research",
315
+ },
316
+ { label: "Create implementation plan", description: "Plan with /plan" },
317
+ {
318
+ label: "Explore more",
319
+ description: "Continue brainstorming other aspects",
320
+ },
321
+ { label: "Done for now", description: "Save findings, revisit later" },
322
+ ],
323
+ },
324
+ ],
325
+ });
326
+ ```
327
+
279
328
  Brainstorm Complete: $ARGUMENTS
280
329
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
281
330
 
@@ -284,6 +333,7 @@ Ideas generated: [N]
284
333
  Ideas evaluated: [N]
285
334
 
286
335
  Top 3:
336
+
287
337
  1. [Idea 1] - Score: [N]
288
338
  2. [Idea 2] - Score: [N]
289
339
  3. [Idea 3] - Score: [N]
@@ -292,21 +342,25 @@ Recommendation: [Chosen approach]
292
342
  Confidence: [High/Medium/Low]
293
343
 
294
344
  Artifacts:
345
+
295
346
  - .beads/artifacts/<bead-id>/brainstorm.md (if bead)
296
347
  - Observation created ✓
297
348
 
298
349
  Follow-up beads: [N] created
350
+
299
351
  ```
300
352
 
301
353
  **Next steps:**
302
354
 
303
355
  ```
356
+
304
357
  If ready to proceed:
305
- /research <bead-id> # Validate approach
306
- /plan <bead-id> # Create implementation plan
358
+ /research <bead-id> # Validate approach
359
+ /plan <bead-id> # Create implementation plan
307
360
 
308
361
  If need more exploration:
309
- /brainstorm <new-aspect> # Continue ideation
362
+ /brainstorm <new-aspect> # Continue ideation
363
+
310
364
  ```
311
365
 
312
366
  ## Anti-Patterns
@@ -316,3 +370,4 @@ If need more exploration:
316
370
  - ❌ **Infinite brainstorming** - Time box and decide
317
371
  - ❌ **No decision** - Brainstorming must produce a recommendation
318
372
  - ❌ **No capture** - Undocumented ideas are lost ideas
373
+ ```
@@ -116,17 +116,27 @@ git commit -m "$ARGUMENTS: [what was done]
116
116
  Closes: $ARGUMENTS"
117
117
  ```
118
118
 
119
- ## Close The Task (Ask First)
119
+ ## Close The Task (Use Question Tool)
120
120
 
121
- **Ask the user:**
122
-
123
- ```
124
- Close bead $ARGUMENTS?
125
- - Yes, close it
126
- - No, keep it open for now
121
+ ```typescript
122
+ question({
123
+ questions: [
124
+ {
125
+ header: "Close",
126
+ question: "Should I close bead $ARGUMENTS?",
127
+ options: [
128
+ {
129
+ label: "Yes, close it (Recommended)",
130
+ description: "All gates passed, task complete",
131
+ },
132
+ { label: "No, keep open", description: "Need more work or review" },
133
+ ],
134
+ },
135
+ ],
136
+ });
127
137
  ```
128
138
 
129
- If user confirms:
139
+ If user confirms close:
130
140
 
131
141
  ```bash
132
142
  bd close $ARGUMENTS --reason "Completed: [1-line summary]"
@@ -115,23 +115,32 @@ git status
115
115
  git diff --cached --stat
116
116
  ```
117
117
 
118
- **Present to user:**
118
+ **Use question tool to get commit decision:**
119
119
 
120
+ ```typescript
121
+ question({
122
+ questions: [
123
+ {
124
+ header: "Commit",
125
+ question: "Fix Complete: $ARGUMENTS. What should I do next?",
126
+ options: [
127
+ {
128
+ label: "Commit changes (Recommended)",
129
+ description: "Git commit and bd sync",
130
+ },
131
+ {
132
+ label: "Show diff first",
133
+ description: "Review changes before committing",
134
+ },
135
+ {
136
+ label: "Skip commit",
137
+ description: "I'll review and commit manually",
138
+ },
139
+ ],
140
+ },
141
+ ],
142
+ });
120
143
  ```
121
- Fix Complete: $ARGUMENTS
122
- ━━━━━━━━━━━━━━━━━━━━━━━
123
-
124
- Root cause: [brief]
125
- Changes: [files]
126
- Tests: Pass ✓
127
-
128
- Would you like me to:
129
- 1. Commit these changes
130
- 2. Show full diff first
131
- 3. Skip commit (I'll review manually)
132
- ```
133
-
134
- **Wait for user confirmation before committing.**
135
144
 
136
145
  If user confirms:
137
146
 
@@ -67,7 +67,25 @@ If dirty, ask whether to stash, commit, or continue.
67
67
  Create a branch if not already on one for this task:
68
68
 
69
69
  ```bash
70
- git checkout -b $ARGUMENTS 2>/dev/null || echo "Already on branch"
70
+ # Get current branch (parent branch)
71
+ PARENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
72
+
73
+ # Get task title for readable branch name
74
+ BEAD_INFO=$(bd show $ARGUMENTS --json 2>/dev/null)
75
+ BEAD_TITLE=$(echo "$BEAD_INFO" | jq -r '.title // ""' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/--*/-/g' | cut -c1-40)
76
+ BEAD_TYPE=$(echo "$BEAD_INFO" | jq -r '.type // "task"')
77
+
78
+ # Map bead type to branch prefix
79
+ case "$BEAD_TYPE" in
80
+ "bug") PREFIX="fix" ;;
81
+ "feature"|"epic") PREFIX="feat" ;;
82
+ "refactor") PREFIX="refactor" ;;
83
+ *) PREFIX="feat" ;;
84
+ esac
85
+
86
+ # Create branch: <parent>/<type>/<bead-id>-<description>
87
+ BRANCH_NAME="${PARENT_BRANCH}/${PREFIX}/$ARGUMENTS-${BEAD_TITLE}"
88
+ git checkout -b "$BRANCH_NAME" 2>/dev/null || echo "Already on branch"
71
89
  ```
72
90
 
73
91
  Mark the task in progress (if not already):
@@ -104,7 +122,7 @@ First, get a quick codebase overview:
104
122
 
105
123
  ```typescript
106
124
  // Quick overview of relevant directories
107
- repo-map({ path: "src", format: "compact", maxDepth: 3 });
125
+ repo - map({ path: "src", format: "compact", maxDepth: 3 });
108
126
  ```
109
127
 
110
128
  Then search for relevant patterns and learnings:
@@ -296,25 +314,32 @@ git status
296
314
  git diff --cached --stat
297
315
  ```
298
316
 
299
- **Present to user:**
317
+ **Use question tool to get commit decision:**
300
318
 
319
+ ```typescript
320
+ question({
321
+ questions: [
322
+ {
323
+ header: "Commit",
324
+ question: "Implementation Complete: $ARGUMENTS. What should I do next?",
325
+ options: [
326
+ {
327
+ label: "Commit changes (Recommended)",
328
+ description: "Git commit and bd sync",
329
+ },
330
+ {
331
+ label: "Show diff first",
332
+ description: "Review changes before committing",
333
+ },
334
+ {
335
+ label: "Skip commit",
336
+ description: "I'll review and commit manually",
337
+ },
338
+ ],
339
+ },
340
+ ],
341
+ });
301
342
  ```
302
- Implementation Complete: $ARGUMENTS
303
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
304
-
305
- Type: [epic/task/subtask]
306
- Tests: Pass ✓
307
- Changes: [files modified]
308
-
309
- Subtasks: [N completed / M total] (if applicable)
310
-
311
- Would you like me to:
312
- 1. Commit these changes
313
- 2. Show full diff first
314
- 3. Skip commit (I'll review manually)
315
- ```
316
-
317
- **Wait for user confirmation before committing.**
318
343
 
319
344
  If user confirms:
320
345
 
@@ -46,7 +46,7 @@ Before importing, check for existing beads with similar titles:
46
46
 
47
47
  Compare plan titles against existing beads:
48
48
 
49
- ```
49
+ ````
50
50
  Duplicate Check:
51
51
  ━━━━━━━━━━━━━━━━
52
52
 
@@ -59,8 +59,19 @@ Options:
59
59
  2. Force import (create duplicates)
60
60
  3. Cancel import
61
61
 
62
- Select option (1/2/3):
63
- ```
62
+ ```typescript
63
+ question({
64
+ questions: [{
65
+ header: "Duplicates",
66
+ question: "Potential duplicates found. What should I do?",
67
+ options: [
68
+ { label: "Skip duplicates (Recommended)", description: "Import only new items" },
69
+ { label: "Force import", description: "Create duplicate beads anyway" },
70
+ { label: "Cancel import", description: "Stop and review plan" }
71
+ ]
72
+ }]
73
+ });
74
+ ````
64
75
 
65
76
  If `--force` flag set, skip this check and import everything.
66
77
 
@@ -78,7 +89,7 @@ Parse the plan for:
78
89
 
79
90
  Report:
80
91
 
81
- ```
92
+ ````
82
93
  Plan Analysis: [filename]
83
94
  ━━━━━━━━━━━━━━━━━━━━━━━━
84
95
 
@@ -95,10 +106,21 @@ Structure:
95
106
  │ └── [Issue 1] [L] → depends on [Epic 1/Issue 2]
96
107
  └── ...
97
108
 
98
- Proceed with import? (yes/modify/cancel)
99
- ```
100
-
101
- **STOP and wait for approval** (unless `--dry-run`, then just show preview).
109
+ ```typescript
110
+ question({
111
+ questions: [{
112
+ header: "Import",
113
+ question: "Plan analyzed. Should I proceed with import?",
114
+ options: [
115
+ { label: "Proceed with import (Recommended)", description: "Create epics and issues" },
116
+ { label: "Modify plan", description: "Need changes before importing" },
117
+ { label: "Cancel", description: "Stop and review plan" }
118
+ ]
119
+ }]
120
+ });
121
+ ````
122
+
123
+ **STOP and wait for user approval** (unless `--dry-run`, then just show preview).
102
124
 
103
125
  ---
104
126