vibe-coding-master 0.0.7 → 0.0.9

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.
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>VibeCodingMaster</title>
7
- <script type="module" crossorigin src="/assets/index-Bp49_End.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-BNASqKEK.css">
7
+ <script type="module" crossorigin src="/assets/index-D59GuHCR.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-CuiNNOzj.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
@@ -68,6 +68,7 @@ Recommended structure:
68
68
  ```text
69
69
  repo/
70
70
  CLAUDE.md
71
+ .gitignore
71
72
 
72
73
  docs/
73
74
  ARCHITECTURE.md
@@ -95,6 +96,7 @@ repo/
95
96
  commands/
96
97
 
97
98
  .ai/
99
+ vcm/ # ignored local VCM control state
98
100
  task-specs/
99
101
  handoffs/
100
102
  <task-slug>/
@@ -957,8 +959,8 @@ Worktree isolation is by task, not by role:
957
959
 
958
960
  ```text
959
961
  one task
960
- -> one branch
961
- -> one worktree
962
+ -> one branch: feature/<task-slug>
963
+ -> one worktree: .ai/vcm/worktrees/<task-slug>
962
964
  -> one handoff directory
963
965
  -> architect -> coder -> reviewer in sequence
964
966
  ```
@@ -1436,8 +1438,8 @@ Default rule:
1436
1438
 
1437
1439
  ```text
1438
1440
  one task
1439
- -> one branch
1440
- -> one worktree
1441
+ -> one branch: feature/<task-slug>
1442
+ -> one worktree: .ai/vcm/worktrees/<task-slug>
1441
1443
  -> one handoff directory
1442
1444
  -> one PR
1443
1445
  ```
@@ -1477,9 +1479,19 @@ Branch rules:
1477
1479
 
1478
1480
  - never do AI implementation work directly on the main branch
1479
1481
  - one task branch should map to one task worktree
1482
+ - VCM-managed task branches should use `feature/<task-slug>`
1483
+ - VCM-managed task worktrees should live under `.ai/vcm/worktrees/<task-slug>`
1484
+ - `.gitignore` should contain a VCM managed block that ignores `.ai/vcm/`
1485
+ - a task should not switch to a different branch/worktree after creation; create a new task instead
1480
1486
  - large work should use phase commits on the same task branch unless phases are independently releasable
1481
1487
  - if a task becomes too large, split it into child tasks with explicit branch and PR ownership
1482
1488
 
1489
+ Cleanup rules:
1490
+
1491
+ - after task completion, remove the task worktree only after role sessions are stopped and uncommitted work is handled
1492
+ - remove VCM task/session/message/orchestration metadata with the worktree cleanup
1493
+ - keep the task branch by default until PR merge; delete it only with explicit confirmation
1494
+
1483
1495
  Small commits:
1484
1496
 
1485
1497
  - one commit per phase
@@ -1,8 +1,8 @@
1
1
  # VibeCodingMaster Product Design
2
2
 
3
- Last updated: 2026-05-30
3
+ Last updated: 2026-05-31
4
4
 
5
- This document describes the product that the current code implements. It intentionally removes older CLI-first, tmux, raw-PTY-translation, and main-page artifact-panel designs that are no longer part of V1.
5
+ This document describes the current product direction and implemented V1 behavior for VCM.
6
6
 
7
7
  ## 1. Product Positioning
8
8
 
@@ -24,7 +24,7 @@ VCM is not a hosted SaaS product. It runs locally, connects to a local repositor
24
24
  VCM V1 must make multi-session Claude Code work visible and recoverable:
25
25
 
26
26
  - Connect a local Git repository.
27
- - Create a named task.
27
+ - Create a named task with its own branch and task-level worktree by default.
28
28
  - Start, stop, restart, and resume one Claude Code session per role.
29
29
  - Keep role terminals embedded in one GUI.
30
30
  - Preserve task state, session state, handoff files, message history, and raw terminal logs.
@@ -32,6 +32,7 @@ VCM V1 must make multi-session Claude Code work visible and recoverable:
32
32
  - Let users choose between manual message approval and auto orchestration.
33
33
  - Install or update VCM role rules into `CLAUDE.md` and `.claude/agents/*.md`.
34
34
  - Provide a low-cost translation layer so the user can write Chinese while Claude Code receives English engineering instructions.
35
+ - Clean up completed task worktrees and VCM task metadata when the task is done.
35
36
 
36
37
  ## 3. Non-Goals
37
38
 
@@ -39,6 +40,8 @@ V1 does not include:
39
40
 
40
41
  - tmux.
41
42
  - Worktree isolation per role.
43
+ - Switching a task to a different branch or worktree after task creation.
44
+ - A separate `Create task worktree` action after the task already exists.
42
45
  - Concurrent edits across roles as a product workflow.
43
46
  - Automatic confirmation of Claude Code permission prompts.
44
47
  - A main-page artifact inspector.
@@ -61,6 +64,72 @@ project-manager
61
64
 
62
65
  The workflow is a soft guide in V1. VCM computes readiness from handoff artifact checks and session state, then shows the result in the sidebar. It does not block the user from manually starting a role out of order.
63
66
 
67
+ ### 4.1 Task Worktree Model
68
+
69
+ Task-level worktree management is the current model for multi-task parallelism:
70
+
71
+ ```text
72
+ one task
73
+ -> one branch
74
+ -> one git worktree
75
+ -> one handoff directory
76
+ -> one set of role sessions
77
+ ```
78
+
79
+ VCM must not create worktrees per role. `project-manager`, `architect`, `coder`, and `reviewer` for the same task all run in the same task worktree and hand off sequentially.
80
+
81
+ When the user creates a task, VCM creates the branch and worktree immediately. There is no separate later button named `Create task worktree`, and a task cannot be switched to another worktree after creation.
82
+
83
+ Branch naming:
84
+
85
+ ```text
86
+ feature/<task-name>
87
+ ```
88
+
89
+ Worktree path:
90
+
91
+ ```text
92
+ <base-repo>/.ai/vcm/worktrees/<task-name>
93
+ ```
94
+
95
+ Example:
96
+
97
+ ```text
98
+ base repo: /workspace
99
+ task: docs-cleanup
100
+ branch: feature/docs-cleanup
101
+ worktree: /workspace/.ai/vcm/worktrees/docs-cleanup
102
+ ```
103
+
104
+ The repo's `.gitignore` must ignore `.ai/vcm/`. This is mandatory because the task worktrees live under `.ai/vcm/worktrees/`, and the base repository must not see nested worktree files as untracked source files.
105
+
106
+ Task creation flow:
107
+
108
+ ```text
109
+ New Task submit
110
+ -> validate task name
111
+ -> derive branch feature/<task-name>
112
+ -> derive worktree path .ai/vcm/worktrees/<task-name>
113
+ -> verify .ai/vcm/ is ignored and the base repo is clean
114
+ -> git worktree add -b feature/<task-name> .ai/vcm/worktrees/<task-name> <base-ref>
115
+ -> create task metadata
116
+ -> create handoff structure inside the task worktree
117
+ -> open the task workspace with role session cwd = task worktree
118
+ ```
119
+
120
+ Task cleanup flow:
121
+
122
+ ```text
123
+ task complete
124
+ -> stop running role sessions
125
+ -> verify task worktree is safe to remove
126
+ -> remove git worktree
127
+ -> remove VCM task/session/message/orchestration metadata
128
+ -> keep or delete branch according to guarded branch cleanup policy
129
+ ```
130
+
131
+ Branch deletion should be a separate guarded confirmation, ideally only after the branch is merged or the user explicitly confirms deletion. Worktree cleanup itself removes the local working directory and task metadata.
132
+
64
133
  ## 5. Roles
65
134
 
66
135
  ### Project Manager
@@ -179,20 +248,25 @@ The old `Dirty: yes/no` label is not used. The UI uses `Working tree: clean` or
179
248
 
180
249
  There is no separate `Pause orchestration` or `Resume orchestration` control in the GUI. The current product model is one on/off toggle.
181
250
 
182
- `VCM Harness` shows whether VCM managed blocks are installed/up to date in the project rules files.
251
+ `VCM Harness` shows whether VCM managed blocks are installed/up to date in the project rules files and `.gitignore`.
183
252
 
184
- `New Task` contains one input:
253
+ `New Task` contains:
185
254
 
186
255
  - `task name`
256
+ - a checked, non-optional `Create worktree and branch` indicator
257
+ - generated branch preview: `feature/<task-name>`
258
+ - generated worktree preview: `.ai/vcm/worktrees/<task-name>`
187
259
 
188
260
  There is no optional title input in the current UI.
189
261
 
262
+ The worktree/branch path is the normal VCM task model, not a separate mode users toggle later. The checked indicator is shown so the user understands what will happen; VCM should not require a separate worktree creation action later.
263
+
190
264
  ### Task Workspace
191
265
 
192
266
  The task workspace header is one compact row:
193
267
 
194
268
  ```text
195
- TASK WORKSPACE <task> <branch> [Project Manager] [Architect] [Coder] [Reviewer] [Refresh]
269
+ TASK WORKSPACE <task> <branch> <worktree> [Project Manager] [Architect] [Coder] [Reviewer] [Refresh]
196
270
  ```
197
271
 
198
272
  Role tabs show the session status for each role.
@@ -268,6 +342,7 @@ On repository connect, VCM checks:
268
342
 
269
343
  ```text
270
344
  CLAUDE.md
345
+ .gitignore
271
346
  .claude/agents/project-manager.md
272
347
  .claude/agents/architect.md
273
348
  .claude/agents/coder.md
@@ -284,6 +359,16 @@ If a file already exists, VCM only inserts or replaces the managed block:
284
359
  <!-- VCM:END -->
285
360
  ```
286
361
 
362
+ For `.gitignore`, VCM uses hash comments:
363
+
364
+ ```gitignore
365
+ # VCM:BEGIN version=1
366
+ .ai/vcm/
367
+ # VCM:END
368
+ ```
369
+
370
+ `.ai/vcm/` is the active VCM local control area for task state, session state, orchestration state, and task worktrees.
371
+
287
372
  VCM must preserve all user-authored content outside the managed block.
288
373
 
289
374
  After applying harness changes, the UI tells the user what changed and recommends reviewing and committing those files.
@@ -445,17 +530,26 @@ App-level settings:
445
530
  Repository-level VCM state:
446
531
 
447
532
  ```text
448
- .vcm/config.json
449
- .vcm/tasks/<task>.json
450
- .vcm/sessions/<task>.json
451
- .vcm/messages/<task>.jsonl
452
- .vcm/orchestration/<task>.json
533
+ .ai/vcm/tasks/<task>.json
534
+ .ai/vcm/sessions/<task>.json
535
+ .ai/vcm/messages/<task>.jsonl
536
+ .ai/vcm/orchestration/<task>.json
537
+ .ai/vcm/worktrees/<task>/
453
538
  ```
454
539
 
455
- Repo handoff artifacts:
540
+ Project config:
456
541
 
457
542
  ```text
458
- .ai/handoffs/<task>/
543
+ ~/.vcm/projects/<project-id>/config.json
544
+ ~/.vcm/projects/index.json
545
+ ```
546
+
547
+ The base repository's `.ai/vcm/` directory is the repository-local runtime control area. Long-lived project config is stored under `~/.vcm` so it survives outside Git-ignored repo state. Task source changes and handoff artifacts live inside the task worktree at `.ai/vcm/worktrees/<task>/`.
548
+
549
+ Task worktree local files:
550
+
551
+ ```text
552
+ .ai/vcm/worktrees/<task>/.ai/handoffs/<task>/
459
553
  ```
460
554
 
461
555
  External Claude transcripts:
@@ -489,7 +583,8 @@ This protects against publishing raw TypeScript bin files or missing frontend as
489
583
  VCM V1 is successful when:
490
584
 
491
585
  - A user can connect a repo without global Git safe-directory setup.
492
- - A user can create a task and start all four role sessions.
586
+ - A user can create a task, which creates `feature/<task>` and `.ai/vcm/worktrees/<task>`.
587
+ - A user can start all four role sessions in that task worktree.
493
588
  - Switching roles never loses the embedded terminal.
494
589
  - Restart creates a fresh Claude session; Resume reconnects to the persisted one.
495
590
  - Permission modes are reflected in the Claude command.
@@ -500,3 +595,4 @@ VCM V1 is successful when:
500
595
  - Translation reads Claude transcript JSONL reliably after start, resume, and restart.
501
596
  - Terminal and translation panel have equal, stable reading space.
502
597
  - Harness install/update preserves user content outside VCM managed blocks.
598
+ - Completed tasks can cleanly remove their worktree and VCM task metadata without affecting other tasks.
@@ -1,6 +1,6 @@
1
1
  # V1 Architecture Design
2
2
 
3
- Last updated: 2026-05-30
3
+ Last updated: 2026-05-31
4
4
 
5
5
  This document describes the architecture implemented by the current VCM codebase.
6
6
 
@@ -28,7 +28,7 @@ browser
28
28
  -> claude --agent <role>
29
29
  ```
30
30
 
31
- The app is local-first. It writes repository task state under `.vcm/`, handoff artifacts under `.ai/handoffs/`, app settings under `~/.vcm/settings.json`, and reads Claude transcript files under `~/.claude/projects/`.
31
+ The app is local-first. It writes project control state under `.ai/vcm/`, handoff artifacts under `.ai/handoffs/` inside the active task worktree, app settings under `~/.vcm/settings.json`, and reads Claude transcript files under `~/.claude/projects/`.
32
32
 
33
33
  ## 2. Processes And Ports
34
34
 
@@ -96,7 +96,7 @@ Responsibilities:
96
96
  - Render workflow panel.
97
97
  - Render settings section with Messages, Events, Auto orchestration.
98
98
  - Render harness status/actions.
99
- - Render one-field task creation form.
99
+ - Render task creation form with one task-name field, a checked non-optional worktree/branch indicator, and generated branch/path previews.
100
100
  - Render task list.
101
101
  - Render Messages and Events modals.
102
102
 
@@ -112,7 +112,7 @@ Responsibilities:
112
112
 
113
113
  - Fetch task status, messages, and orchestration state.
114
114
  - Poll those every three seconds.
115
- - Render compact header with task title, branch, role tabs, and Refresh.
115
+ - Render compact header with task title, branch, immutable worktree path, role tabs, and Refresh.
116
116
  - Hold per-role permission mode selection.
117
117
  - Render one `SessionConsole` per role but only show the active role.
118
118
  - Emit workflow/messages/orchestration/events back to `App` so sidebar stays synchronized.
@@ -202,8 +202,8 @@ POST /api/projects/connect
202
202
  -> resolve path
203
203
  -> check path exists
204
204
  -> check .git marker directly
205
- -> create .vcm/config.json
206
- -> ensure .ai/handoffs and .vcm state dirs
205
+ -> create ~/.vcm/projects/<project-id>/config.json
206
+ -> ensure .ai/vcm state dirs
207
207
  -> read branch and dirty state
208
208
  -> record recent repo path in ~/.vcm/settings.json
209
209
  ```
@@ -222,7 +222,124 @@ git -c safe.directory=<repoRoot> -c safe.directory=<realpath(repoRoot)> ...
222
222
 
223
223
  VCM does not require global `safe.directory` configuration.
224
224
 
225
- ## 6. Task And Artifact Model
225
+ ## 6. Task Worktree Architecture
226
+
227
+ Task-level worktree management is the current architecture for multi-task parallelism.
228
+
229
+ Rule:
230
+
231
+ ```text
232
+ one VCM task = one branch + one git worktree + one handoff directory + one role-session set
233
+ ```
234
+
235
+ Branch name:
236
+
237
+ ```text
238
+ feature/<taskSlug>
239
+ ```
240
+
241
+ Worktree path:
242
+
243
+ ```text
244
+ <baseRepoRoot>/.ai/vcm/worktrees/<taskSlug>
245
+ ```
246
+
247
+ VCM does not support switching a task to another branch or worktree after creation. If the user needs a different branch/worktree, they should create a new task.
248
+
249
+ VCM does not create worktrees by role. All four role sessions for a task share the same task worktree:
250
+
251
+ ```text
252
+ .ai/vcm/worktrees/<taskSlug>/
253
+ project-manager session cwd
254
+ architect session cwd
255
+ coder session cwd
256
+ reviewer session cwd
257
+ ```
258
+
259
+ ### 6.1 Base Repo vs Task Worktree
260
+
261
+ VCM distinguishes:
262
+
263
+ - `baseRepoRoot`: repository the user connected.
264
+ - `taskRepoRoot`: git worktree path for a specific task.
265
+ - `branch`: `feature/<taskSlug>`.
266
+ - `worktreePath`: same as `taskRepoRoot`.
267
+
268
+ Project-level VCM control state stays under the base repo:
269
+
270
+ ```text
271
+ <baseRepoRoot>/.ai/vcm/tasks/<task>.json
272
+ <baseRepoRoot>/.ai/vcm/sessions/<task>.json
273
+ <baseRepoRoot>/.ai/vcm/messages/<task>.jsonl
274
+ <baseRepoRoot>/.ai/vcm/orchestration/<task>.json
275
+ <baseRepoRoot>/.ai/vcm/worktrees/<task>/
276
+ ```
277
+
278
+ Project configuration is app-local and stored outside the repository:
279
+
280
+ ```text
281
+ ~/.vcm/projects/<project-id>/config.json
282
+ ~/.vcm/projects/index.json
283
+ ```
284
+
285
+ Task source changes and handoff artifacts live in the task worktree:
286
+
287
+ ```text
288
+ <baseRepoRoot>/.ai/vcm/worktrees/<task>/.ai/handoffs/<task>/
289
+ ```
290
+
291
+ This central base-state model lets VCM list and manage multiple tasks while each task's code changes happen in a separate worktree.
292
+
293
+ ### 6.2 Git Ignore Requirement
294
+
295
+ The base repository must ignore `.ai/vcm/`.
296
+
297
+ Reason:
298
+
299
+ - `.ai/vcm/worktrees/<task>` is a nested git worktree.
300
+ - Without `.ai/vcm/` in `.gitignore`, the base repo sees worktree files as untracked noise.
301
+ - `.ai/vcm` also contains local task/session/message metadata that should not be committed by default.
302
+
303
+ The VCM harness manages a `.gitignore` block that ignores `.ai/vcm/` before task worktree creation.
304
+
305
+ ### 6.3 Task Creation Flow
306
+
307
+ ```text
308
+ POST /api/tasks
309
+ -> validate taskSlug
310
+ -> compute branch feature/<taskSlug>
311
+ -> compute worktreePath <baseRepoRoot>/.ai/vcm/worktrees/<taskSlug>
312
+ -> assert branch does not already exist
313
+ -> assert worktreePath does not already exist
314
+ -> assert .ai/vcm/ is ignored by Git
315
+ -> assert base repo has no uncommitted changes
316
+ -> git worktree add -b feature/<taskSlug> <worktreePath> <baseRef>
317
+ -> create handoff structure in taskRepoRoot
318
+ -> write central task metadata under baseRepoRoot/.ai/vcm/tasks/<task>.json
319
+ ```
320
+
321
+ The default `baseRef` is the connected repo's current `HEAD`.
322
+
323
+ ### 6.4 Task Cleanup Flow
324
+
325
+ ```text
326
+ POST /api/tasks/:taskSlug/cleanup
327
+ -> require no running role sessions
328
+ -> load task metadata
329
+ -> verify worktree path belongs under <baseRepoRoot>/.ai/vcm/worktrees/
330
+ -> check worktree status
331
+ -> refuse cleanup when uncommitted work exists unless force is explicitly requested
332
+ -> git worktree remove <worktreePath>
333
+ -> delete central task/session/message/orchestration metadata
334
+ ```
335
+
336
+ Branch deletion is intentionally separate:
337
+
338
+ - Keep `feature/<taskSlug>` by default.
339
+ - Allow branch deletion only with explicit confirmation.
340
+ - Prefer allowing deletion only when the branch has been merged, or when the user force-confirms.
341
+
342
+ ## 7. Task And Artifact Model
226
343
 
227
344
  File:
228
345
 
@@ -234,7 +351,7 @@ File:
234
351
  Task state:
235
352
 
236
353
  ```text
237
- .vcm/tasks/<task>.json
354
+ <baseRepoRoot>/.ai/vcm/tasks/<task>.json
238
355
  ```
239
356
 
240
357
  Each task stores:
@@ -242,8 +359,10 @@ Each task stores:
242
359
  - `taskSlug`
243
360
  - optional `title`
244
361
  - timestamps
245
- - repo root
246
- - branch at task creation
362
+ - `baseRepoRoot`
363
+ - `worktreePath`
364
+ - `repoRoot` / `taskRepoRoot`
365
+ - branch, always `feature/<taskSlug>` for VCM-created tasks
247
366
  - handoff directory
248
367
  - status
249
368
  - optional spec path
@@ -253,15 +372,16 @@ Task creation:
253
372
  ```text
254
373
  POST /api/tasks
255
374
  -> validate slug
375
+ -> create branch and worktree
256
376
  -> create handoff directories
257
377
  -> create artifact templates
258
- -> write .vcm/tasks/<task>.json
378
+ -> write base .ai/vcm/tasks/<task>.json
259
379
  ```
260
380
 
261
381
  Handoff directory:
262
382
 
263
383
  ```text
264
- .ai/handoffs/<task>/
384
+ <taskRepoRoot>/.ai/handoffs/<task>/
265
385
  role-commands/
266
386
  architect.md
267
387
  coder.md
@@ -287,7 +407,7 @@ Artifact checks are simple V1 checks:
287
407
 
288
408
  They are used for workflow readiness, not content quality judgment.
289
409
 
290
- ## 7. Workflow Computation
410
+ ## 8. Workflow Computation
291
411
 
292
412
  File:
293
413
 
@@ -315,7 +435,7 @@ Step readiness:
315
435
 
316
436
  The report is displayed in the sidebar `Workflow` section.
317
437
 
318
- ## 8. Session Runtime
438
+ ## 9. Session Runtime
319
439
 
320
440
  Files:
321
441
 
@@ -360,7 +480,7 @@ Permission flags:
360
480
  Session persistence:
361
481
 
362
482
  ```text
363
- .vcm/sessions/<task>.json
483
+ <baseRepoRoot>/.ai/vcm/sessions/<task>.json
364
484
  ```
365
485
 
366
486
  The persisted record includes:
@@ -380,7 +500,9 @@ The persisted record includes:
380
500
 
381
501
  If a runtime process is gone but the role has a Claude session id, `getRoleSession` returns a recoverable `resumable` status.
382
502
 
383
- ## 9. Terminal Runtime
503
+ In task-worktree mode, `cwd` must be the immutable task worktree path. Role sessions must not start in the base repo when a task worktree exists.
504
+
505
+ ## 10. Terminal Runtime
384
506
 
385
507
  File:
386
508
 
@@ -391,7 +513,7 @@ The runtime:
391
513
  - spawns `node-pty`
392
514
  - sets `TERM=xterm-256color`
393
515
  - sets color-friendly env vars
394
- - appends raw PTY output to `.ai/handoffs/<task>/logs/<role>.log`
516
+ - appends raw PTY output to `<taskRepoRoot>/.ai/handoffs/<task>/logs/<role>.log`
395
517
  - emits terminal output/input/exit events to WebSocket subscribers
396
518
  - replays the log on terminal WebSocket subscribe
397
519
 
@@ -412,7 +534,7 @@ Server messages:
412
534
  - exit
413
535
  - error
414
536
 
415
- ## 10. Message Bus
537
+ ## 11. Message Bus
416
538
 
417
539
  Files:
418
540
 
@@ -423,8 +545,8 @@ Files:
423
545
  State:
424
546
 
425
547
  ```text
426
- .vcm/messages/<task>.jsonl
427
- .vcm/orchestration/<task>.json
548
+ .ai/vcm/messages/<task>.jsonl
549
+ .ai/vcm/orchestration/<task>.json
428
550
  .ai/handoffs/<task>/messages/<message-id>.md
429
551
  ```
430
552
 
@@ -458,7 +580,9 @@ The backend writes a `[VCM MESSAGE]` envelope to the target terminal and appends
458
580
 
459
581
  The backend still exposes pause/resume orchestration API routes and stores `paused` for compatibility. The current GUI only toggles `mode` between `manual` and `auto`.
460
582
 
461
- ## 11. Role Command Compatibility
583
+ Messages and orchestration snapshots are central project state under `baseRepoRoot/.ai/vcm`. Message body markdown lives in the task worktree handoff directory.
584
+
585
+ ## 12. Role Command Compatibility
462
586
 
463
587
  Files:
464
588
 
@@ -488,7 +612,7 @@ The dispatcher:
488
612
 
489
613
  This is a compatibility path. The preferred V1 coordination path is `vcmctl` message bus.
490
614
 
491
- ## 12. Harness Service
615
+ ## 13. Harness Service
492
616
 
493
617
  File:
494
618
 
@@ -498,6 +622,7 @@ Harness files:
498
622
 
499
623
  ```text
500
624
  CLAUDE.md
625
+ .gitignore
501
626
  .claude/agents/project-manager.md
502
627
  .claude/agents/architect.md
503
628
  .claude/agents/coder.md
@@ -512,6 +637,14 @@ Managed block:
512
637
  <!-- VCM:END -->
513
638
  ```
514
639
 
640
+ `.gitignore` uses the same VCM managed-block concept with hash comments:
641
+
642
+ ```gitignore
643
+ # VCM:BEGIN version=1
644
+ .ai/vcm/
645
+ # VCM:END
646
+ ```
647
+
515
648
  The service:
516
649
 
517
650
  - checks whether files exist
@@ -522,7 +655,7 @@ The service:
522
655
 
523
656
  It must not overwrite user content outside the VCM block.
524
657
 
525
- ## 13. Translation Architecture
658
+ ## 14. Translation Architecture
526
659
 
527
660
  Files:
528
661
 
@@ -554,11 +687,6 @@ Stored data:
554
687
  - translation secrets
555
688
  - recent repository paths, max 5
556
689
 
557
- Legacy migration:
558
-
559
- - `~/.vibe-coding-master/settings.json`
560
- - `~/.vibe-coding-master/translation.json`
561
-
562
690
  ### Provider
563
691
 
564
692
  Provider type:
@@ -626,7 +754,7 @@ POST translation/send -> runtime.write(session.id, englishText + "\r")
626
754
 
627
755
  The backend strips trailing newlines before appending `\r`.
628
756
 
629
- ## 14. API Surface
757
+ ## 15. API Surface
630
758
 
631
759
  Project:
632
760
 
@@ -651,8 +779,11 @@ GET /api/tasks
651
779
  POST /api/tasks
652
780
  GET /api/tasks/:taskSlug
653
781
  GET /api/tasks/:taskSlug/status
782
+ POST /api/tasks/:taskSlug/cleanup
654
783
  ```
655
784
 
785
+ There is no task-level "switch worktree" API. Worktree selection happens only at task creation.
786
+
656
787
  Sessions:
657
788
 
658
789
  ```text
@@ -708,7 +839,7 @@ WebSockets:
708
839
  /ws/translation/:sessionId
709
840
  ```
710
841
 
711
- ## 15. Error Handling
842
+ ## 16. Error Handling
712
843
 
713
844
  File:
714
845
 
@@ -733,7 +864,7 @@ Fastify error handler returns:
733
864
  }
734
865
  ```
735
866
 
736
- ## 16. Packaging Architecture
867
+ ## 17. Packaging Architecture
737
868
 
738
869
  `package.json` publishes built artifacts:
739
870
 
@@ -755,7 +886,7 @@ Important scripts:
755
886
  - `prepack`: build and package verification
756
887
  - `postinstall`: fixes `node-pty` spawn helper when needed
757
888
 
758
- ## 17. Security And Safety Boundaries
889
+ ## 18. Security And Safety Boundaries
759
890
 
760
891
  Current boundaries:
761
892
 
@@ -764,13 +895,16 @@ Current boundaries:
764
895
  - Relaxed Claude permission modes are user-selected per role launch.
765
896
  - Translation API key is local in `~/.vcm/settings.json`.
766
897
  - Translation output is UI/runtime state only unless a user or role copies it into a file.
767
- - Handoff artifacts and `.vcm` state live in the connected repository; users should decide what to commit or ignore.
898
+ - `.ai/vcm` is local project control state and must be ignored by Git.
899
+ - Task handoff artifacts live in the task worktree and users should decide whether those artifacts belong in task commits.
900
+ - Task worktrees are created only during task creation; VCM does not expose branch/worktree switching APIs.
768
901
  - Sandbox isolation should come from a devContainer, Docker container, VM, or other user-controlled environment.
769
902
 
770
- ## 18. Known Implementation Boundaries
903
+ ## 19. Known Implementation Boundaries
771
904
 
772
905
  - No tmux backend.
773
906
  - No per-role worktree manager.
907
+ - No branch switching for an existing task.
774
908
  - No main-page artifact inspector.
775
909
  - No raw PTY output translation.
776
910
  - No hard workflow gate enforcement.