vibe-coding-master 0.4.42 → 0.5.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.
@@ -1,788 +0,0 @@
1
- # VCM 0.5 Custom Workflow Plan
2
-
3
- Last updated: 2026-06-22
4
-
5
- This plan was originally drafted as the VCM 0.4 custom workflow plan. It moved
6
- to VCM 0.5 when VCM 0.4 was narrowed to harness optimization, Harness Engineer,
7
- and Harness Studio.
8
-
9
- This document defines the proposed VCM 0.5 custom workflow architecture.
10
-
11
- VCM 0.5 should turn the current fixed role chain into a configurable workflow
12
- system. Users should be able to compose the task process, edit role definitions,
13
- choose role runtime policies, and decide where gates, checks, and human review
14
- belong. The product should still feel like VCM: local, visible, recoverable, and
15
- oriented around explicit AI role sessions.
16
-
17
- ## 1. Product Goal
18
-
19
- The current VCM workflow is intentionally opinionated:
20
-
21
- ```text
22
- project-manager
23
- -> architect
24
- -> coder
25
- -> reviewer
26
- -> architect
27
- -> project-manager
28
- ```
29
-
30
- That default is useful, but it cannot fit every team, repository, or task type.
31
- Some users need heavier architecture review. Some need a fast bug-fix workflow.
32
- Some need long-lived planning sessions. Some want fresh implementation sessions.
33
- Some want mandatory final gates only for high-risk tasks.
34
-
35
- VCM 0.5 should make these choices explicit and configurable without turning the
36
- app into a fragile scripting environment.
37
-
38
- The target outcome:
39
-
40
- - users can define reusable workflow templates
41
- - users can customize roles and role instructions from the UI
42
- - users can configure session lifecycle per role
43
- - users can add review gates and validation nodes at specific points
44
- - VCM can show exactly where a task is in the workflow
45
- - VCM can pause, retry, skip, or reroute a node without losing task state
46
- - existing VCM workflows keep working through a built-in default template
47
-
48
- ## 2. Core Principle
49
-
50
- Workflow state must be owned by VCM, not inferred from terminals.
51
-
52
- Role sessions are execution resources. They can start, stop, restart, fail, or
53
- survive across several workflow nodes. A workflow run is the source of truth for
54
- what should happen next.
55
-
56
- The key separation:
57
-
58
- ```text
59
- Workflow Definition
60
- declarative template selected by the user
61
-
62
- Workflow Run
63
- one task's execution state for the selected definition
64
-
65
- Node Instance
66
- one concrete execution step inside the run
67
-
68
- Role Session
69
- long-lived or short-lived terminal/runtime used by role nodes
70
- ```
71
-
72
- This separation prevents the main flow from ending only because one terminal
73
- stopped, and it prevents a long-lived role session from falsely keeping a task
74
- running when no workflow node is active.
75
-
76
- ## 3. Non-Goals
77
-
78
- VCM 0.5 should not:
79
-
80
- - become a general BPMN engine
81
- - allow arbitrary untrusted code inside workflow definitions
82
- - require users to understand internal hook details
83
- - force every task to use a visual workflow editor
84
- - make the current default workflow disappear
85
- - mix auxiliary tools into the main engineering workflow
86
- - treat every terminal session as a workflow participant
87
-
88
- ## 4. Workflow Definition Model
89
-
90
- A workflow definition is a versioned, declarative template.
91
-
92
- Recommended top-level shape:
93
-
94
- ```json
95
- {
96
- "schemaVersion": 1,
97
- "id": "standard-feature-workflow",
98
- "version": "1.0.0",
99
- "name": "Standard Feature Workflow",
100
- "description": "Default PM -> Architect -> Coder -> Reviewer flow.",
101
- "roles": {},
102
- "nodes": [],
103
- "edges": [],
104
- "variables": {},
105
- "artifacts": {},
106
- "policies": {}
107
- }
108
- ```
109
-
110
- Definitions should be data, not executable scripts. VCM can validate them,
111
- render them in the UI, diff them, migrate them, and safely run them.
112
-
113
- ### 4.1 Built-In Templates
114
-
115
- VCM should ship with built-in templates:
116
-
117
- - `standard-feature-workflow`: current default multi-role flow
118
- - `small-change-workflow`: PM plus direct implementation and review
119
- - `docs-workflow`: planning, content update, validation, final acceptance
120
- - `review-heavy-workflow`: stricter gates around architecture and final diff
121
- - `hotfix-workflow`: minimal planning, focused fix, mandatory validation
122
-
123
- The built-in templates should be read-only. Users can duplicate one into a
124
- custom template and edit the copy.
125
-
126
- ### 4.2 Storage
127
-
128
- Workflow definitions and runtime state should not be mixed.
129
-
130
- Recommended storage:
131
-
132
- ```text
133
- ~/.vcm/workflows/
134
- user-level workflow templates
135
-
136
- <baseRepoRoot>/.ai/vcm/workflow-runs/<taskSlug>/
137
- runtime state for a task's workflow run
138
-
139
- <baseRepoRoot>/.ai/vcm/handoffs/
140
- existing durable role handoff artifacts
141
- ```
142
-
143
- Project-specific workflow selection can live in the existing VCM settings
144
- system. If a team wants to share templates through Git, VCM should provide
145
- export/import instead of silently writing runtime files into source-controlled
146
- paths.
147
-
148
- ### 4.3 Version Pinning
149
-
150
- Each task must pin the workflow definition version at task creation time.
151
-
152
- If a user edits a workflow template later, existing tasks should continue using
153
- the pinned snapshot. VCM can offer an explicit "migrate task workflow" action,
154
- but it must never silently change the process for an active task.
155
-
156
- ## 5. Role Definition Model
157
-
158
- A role definition describes what the role is, how it runs, and what artifacts it
159
- is expected to produce or consume.
160
-
161
- Recommended shape:
162
-
163
- ```json
164
- {
165
- "id": "architect",
166
- "displayName": "Architect",
167
- "engine": "claude-code",
168
- "instructions": {
169
- "mode": "managed-file",
170
- "path": ".claude/agents/architect.md"
171
- },
172
- "model": {
173
- "default": "inherit",
174
- "allowed": ["inherit", "opus", "sonnet"]
175
- },
176
- "effort": {
177
- "default": "inherit",
178
- "allowed": ["inherit", "low", "medium", "high", "max"]
179
- },
180
- "permissions": {
181
- "default": "inherit"
182
- },
183
- "sessionPolicy": {
184
- "lifecycle": "per-task"
185
- },
186
- "artifacts": {
187
- "reads": [],
188
- "writes": []
189
- }
190
- }
191
- ```
192
-
193
- The UI should let users edit the role name, description, instruction body,
194
- model, effort, permission profile, working directory, session lifecycle, and
195
- artifact contracts.
196
-
197
- ### 5.1 Instruction Sources
198
-
199
- VCM should support several instruction modes:
200
-
201
- - `managed-file`: VCM installs and updates a role file in the repo harness
202
- - `inline`: the workflow template stores the role instruction text
203
- - `external-file`: the workflow references a user-selected local file
204
- - `built-in`: the role uses a bundled VCM role definition
205
-
206
- Managed files should still use protected template blocks where needed, so VCM
207
- can update the stable harness section without deleting user edits.
208
-
209
- ### 5.2 Session Lifecycle Policies
210
-
211
- Session lifecycle should be explicit per role:
212
-
213
- - `per-task`: one session is kept for the whole task
214
- - `per-node`: a fresh session is started for each node execution
215
- - `restart-before-node`: the role is restarted before running this node
216
- - `manual`: VCM prepares the role, but the user starts and drives it manually
217
- - `disabled`: the role exists in the template but is not active for this run
218
-
219
- This is one of the main 0.5 features. Different roles need different memory
220
- and isolation tradeoffs:
221
-
222
- - PM usually benefits from task continuity.
223
- - Architect may benefit from continuity across planning and final assessment.
224
- - Coder may benefit from either continuity or a fresh implementation session.
225
- - Reviewer often benefits from fresh context and independent judgment.
226
- - A gate reviewer often benefits from narrow context and strict artifact input.
227
-
228
- ### 5.3 Runtime Engines
229
-
230
- The role model should not assume every role uses the same CLI.
231
-
232
- Recommended initial engines:
233
-
234
- - `claude-code`
235
- - `manual`
236
- - `command`
237
-
238
- `manual` nodes let the workflow wait for a human decision. `command` nodes run
239
- predefined local checks that VCM can supervise.
240
-
241
- ## 6. Node Types
242
-
243
- The workflow graph is made of typed nodes. Each node type has a small, stable
244
- contract that VCM can validate and display.
245
-
246
- ### 6.1 Role Turn Node
247
-
248
- Runs one prompt through one role session.
249
-
250
- Fields:
251
-
252
- - role id
253
- - prompt template
254
- - input artifacts
255
- - expected output artifacts
256
- - timeout policy
257
- - retry policy
258
- - session lifecycle override
259
-
260
- Example uses:
261
-
262
- - ask architect for a plan
263
- - ask coder to implement a scoped plan
264
- - ask reviewer to validate a diff
265
- - ask PM to summarize final status
266
-
267
- ### 6.2 Review Gate Node
268
-
269
- Runs an independent review against specific artifacts.
270
-
271
- Fields:
272
-
273
- - reviewer role id
274
- - gate name
275
- - required inputs
276
- - report path
277
- - decision schema
278
- - pass condition
279
- - failure handling
280
-
281
- Recommended decision values:
282
-
283
- ```text
284
- approve
285
- request_changes
286
- ```
287
-
288
- The gate should identify issues. Routing after `request_changes` belongs to the
289
- workflow definition and VCM orchestration, not to the gate role.
290
-
291
- ### 6.3 Command Check Node
292
-
293
- Runs a local command with a declared purpose and captures output.
294
-
295
- Fields:
296
-
297
- - command template
298
- - working directory
299
- - environment policy
300
- - success exit codes
301
- - output artifact path
302
- - timeout
303
-
304
- Example uses:
305
-
306
- - unit tests
307
- - format checks
308
- - type checks
309
- - lint checks
310
- - repository-specific validation scripts
311
-
312
- ### 6.4 Artifact Check Node
313
-
314
- Validates that required files exist and match expected shape.
315
-
316
- Fields:
317
-
318
- - file path
319
- - required or optional
320
- - schema type
321
- - maximum size
322
- - validation rules
323
-
324
- This node should catch missing handoff files, empty reports, invalid gate
325
- decisions, and stale artifacts before the next role receives bad input.
326
-
327
- ### 6.5 Human Decision Node
328
-
329
- Pauses the workflow and asks the user to choose.
330
-
331
- Fields:
332
-
333
- - prompt
334
- - choices
335
- - default choice
336
- - required artifact context
337
- - timeout behavior
338
-
339
- Example uses:
340
-
341
- - approve high-risk migration
342
- - choose between two architecture options
343
- - skip a failed gate with recorded override
344
- - retry a failed command
345
-
346
- ### 6.6 Branch Node
347
-
348
- Routes based on workflow state or artifact content.
349
-
350
- Example conditions:
351
-
352
- - gate decision is `approve`
353
- - gate decision is `request_changes`
354
- - command check passed
355
- - user selected retry
356
- - task risk level is high
357
-
358
- Branch logic should use a constrained expression format, not arbitrary code.
359
-
360
- ### 6.7 Fan-Out / Fan-In Node
361
-
362
- Runs several independent checks or reviews, then joins results.
363
-
364
- The first implementation can keep role turns sequential for safety. The data
365
- model should still support future parallelism where it is safe.
366
-
367
- ### 6.8 Finalization Node
368
-
369
- Marks the workflow run complete after required acceptance conditions pass.
370
-
371
- It should collect:
372
-
373
- - final user-facing summary
374
- - changed files
375
- - validation evidence
376
- - unresolved risks
377
- - PR or commit status when applicable
378
-
379
- ## 7. Edges and Routing
380
-
381
- Edges connect nodes and define what happens next.
382
-
383
- Recommended shape:
384
-
385
- ```json
386
- {
387
- "from": "review-plan",
388
- "to": "implement",
389
- "when": "decision == 'approve'"
390
- }
391
- ```
392
-
393
- Routing must be visible in the UI. Users should be able to understand why VCM
394
- picked the next node.
395
-
396
- VCM should support:
397
-
398
- - unconditional next step
399
- - branch by decision
400
- - retry edge
401
- - skip edge with recorded reason
402
- - override edge with recorded user approval
403
- - loop with maximum iteration count
404
-
405
- Every loop must have an explicit maximum iteration count or a human decision
406
- node. This prevents accidental infinite role ping-pong.
407
-
408
- ## 8. Artifact Contracts
409
-
410
- Workflow nodes should communicate through explicit artifacts, not implicit
411
- terminal history.
412
-
413
- Artifact contracts should define:
414
-
415
- - path
416
- - owner node
417
- - reader nodes
418
- - required shape
419
- - freshness rule
420
- - append or replace behavior
421
- - maximum expected size
422
-
423
- Example:
424
-
425
- ```json
426
- {
427
- "id": "architecturePlan",
428
- "path": ".ai/vcm/handoffs/architecture-plan.md",
429
- "owner": "architect-plan",
430
- "readers": ["plan-review-gate", "coder-implementation"],
431
- "required": true,
432
- "writeMode": "replace",
433
- "freshness": "after-node-start"
434
- }
435
- ```
436
-
437
- Artifact contracts solve several current problems:
438
-
439
- - VCM can reject empty or stale reports.
440
- - VCM can show exactly what evidence a node used.
441
- - Gate inputs can stay narrow and repeatable.
442
- - Role prompts can be shorter because the artifact list is explicit.
443
- - Replanning can target the right artifact instead of replaying the whole task.
444
-
445
- ## 9. Prompt Templates
446
-
447
- Each role turn should use a compact prompt template with variables and artifact
448
- references.
449
-
450
- Recommended variable syntax:
451
-
452
- ```text
453
- {{task.name}}
454
- {{task.userRequest}}
455
- {{artifact.architecturePlan.path}}
456
- {{workflow.currentNode.name}}
457
- {{previousNode.summary}}
458
- ```
459
-
460
- Prompt templates should avoid duplicating permanent role rules. Stable role
461
- behavior belongs in role instructions. Node prompts should focus on the current
462
- job, inputs, expected output, and decision contract.
463
-
464
- ## 10. Workflow Run State
465
-
466
- Each task should have one workflow run state file.
467
-
468
- Recommended shape:
469
-
470
- ```json
471
- {
472
- "taskSlug": "example-task",
473
- "workflowId": "standard-feature-workflow",
474
- "workflowVersion": "1.0.0",
475
- "status": "running",
476
- "currentNodeId": "coder-implementation",
477
- "nodeRuns": [],
478
- "roleSessions": {},
479
- "artifacts": {},
480
- "events": []
481
- }
482
- ```
483
-
484
- Workflow run status:
485
-
486
- ```text
487
- created
488
- running
489
- waiting_for_user
490
- waiting_for_role
491
- waiting_for_command
492
- failed
493
- completed
494
- cancelled
495
- ```
496
-
497
- Node run status:
498
-
499
- ```text
500
- pending
501
- running
502
- completed
503
- failed
504
- skipped
505
- overridden
506
- cancelled
507
- ```
508
-
509
- Role session status:
510
-
511
- ```text
512
- not_started
513
- starting
514
- idle
515
- running
516
- stopping
517
- failed
518
- exited
519
- ```
520
-
521
- The workflow run decides whether the task is active. Role sessions only report
522
- execution state into the run.
523
-
524
- ## 11. Hooks and State Updates
525
-
526
- Hooks should report role runtime events into VCM, but they should not decide
527
- workflow completion by themselves.
528
-
529
- Important events:
530
-
531
- - role session started
532
- - prompt submitted
533
- - role output stopped
534
- - command started
535
- - command completed
536
- - artifact written
537
- - artifact validated
538
- - gate decision recorded
539
- - user decision recorded
540
-
541
- VCM should map hook events to the active node run. If no workflow node is
542
- waiting for that role, the event is recorded as session activity but must not
543
- change workflow progress.
544
-
545
- This rule is critical for long-lived sessions.
546
-
547
- ## 12. Permissions and Safety
548
-
549
- Workflow definitions should declare required permissions before execution.
550
-
551
- Permission layers:
552
-
553
- - workflow-level defaults
554
- - role-level defaults
555
- - node-level overrides
556
- - user approval policy
557
-
558
- VCM should show a permission summary before starting a task:
559
-
560
- - repository roots that may be read
561
- - paths that may be written
562
- - commands that may run
563
- - network policy
564
- - sandbox profile
565
- - roles that can edit source files
566
- - roles that are read-only reviewers
567
-
568
- Recommended safety defaults:
569
-
570
- - PM can write VCM metadata and handoff files.
571
- - Architect can write plans, docs, and approved scaffold files.
572
- - Coder can edit implementation files within task scope.
573
- - Reviewer is read-only except for review reports.
574
- - Gate reviewers are read-only except for gate reports.
575
- - Command nodes can write only declared output artifacts unless explicitly
576
- approved.
577
-
578
- ## 13. UI Design
579
-
580
- VCM 0.5 needs two UI layers:
581
-
582
- 1. Running task view
583
- 2. Workflow builder view
584
-
585
- ### 13.1 Running Task View
586
-
587
- The running task view should show:
588
-
589
- - selected workflow template
590
- - current node
591
- - next expected node
592
- - active role session
593
- - node status timeline
594
- - role session status
595
- - required artifacts
596
- - gate decisions
597
- - validation results
598
- - retry / skip / override actions when allowed
599
-
600
- The existing terminal workspace remains important, but the workflow graph should
601
- be the primary explanation for what VCM is doing.
602
-
603
- ### 13.2 Workflow Builder
604
-
605
- The workflow builder should support:
606
-
607
- - duplicate built-in template
608
- - add role
609
- - edit role instructions
610
- - configure model, effort, permissions, and session lifecycle
611
- - add node
612
- - connect nodes
613
- - configure branch conditions
614
- - define artifact contracts
615
- - define gate decision schema
616
- - configure retry and override policies
617
- - preview generated role prompts
618
- - validate workflow definition
619
- - dry-run with mock outputs
620
-
621
- The first UI version can be form-driven with a compact graph preview. A fully
622
- free-form visual canvas is useful later, but the first implementation should
623
- prioritize correctness and validation.
624
-
625
- ### 13.3 Role Editor
626
-
627
- The role editor should include:
628
-
629
- - display name
630
- - engine
631
- - instruction source
632
- - instruction editor
633
- - default model
634
- - default effort
635
- - permission profile
636
- - working directory
637
- - session lifecycle
638
- - owned artifacts
639
- - read artifacts
640
-
641
- VCM should warn when a role instruction conflicts with the workflow contract.
642
- For example, if a node expects a report file but the role instruction says not
643
- to write files, the workflow should fail validation before running.
644
-
645
- ## 14. Validation
646
-
647
- Workflow validation should run before a task starts.
648
-
649
- Checks:
650
-
651
- - unique role ids
652
- - unique node ids
653
- - all edges reference existing nodes
654
- - every non-final node has at least one outgoing edge
655
- - every branch condition references valid fields
656
- - every required artifact has exactly one owner
657
- - every required artifact has a validation rule
658
- - every loop has a max iteration count or human decision node
659
- - every role node references an active role
660
- - every gate has a valid decision schema
661
- - every command node has a timeout
662
- - selected engines are available
663
- - required permission profile is valid
664
-
665
- VCM should block invalid workflows before task creation.
666
-
667
- ## 15. Migration Plan
668
-
669
- The current VCM flow becomes a built-in template:
670
-
671
- ```text
672
- standard-feature-workflow@1
673
- ```
674
-
675
- Migration steps:
676
-
677
- 1. Introduce workflow definition and run state data structures.
678
- 2. Express the current hardcoded flow as a built-in workflow definition.
679
- 3. Route existing orchestration through the workflow engine.
680
- 4. Preserve existing task behavior by default.
681
- 5. Add UI for selecting a built-in workflow at task creation.
682
- 6. Add custom template duplication and editing.
683
- 7. Add richer node types and branch policies.
684
-
685
- Existing tasks should continue with their current runtime state. New tasks can
686
- use workflow definitions once the engine is enabled.
687
-
688
- ## 16. Implementation Phases
689
-
690
- ### Phase 1: Workflow Engine Foundation
691
-
692
- - Define workflow schema.
693
- - Define run state schema.
694
- - Add built-in `standard-feature-workflow`.
695
- - Convert current orchestration to run through workflow nodes.
696
- - Keep current UI mostly unchanged.
697
- - Add workflow event log.
698
-
699
- Success condition: current tasks behave the same, but VCM state knows the active
700
- workflow node instead of inferring flow from role stops.
701
-
702
- ### Phase 2: Role and Session Customization
703
-
704
- - Add role definition editor.
705
- - Add session lifecycle policies.
706
- - Add model, effort, permission, and working directory configuration per role.
707
- - Add role instruction source options.
708
- - Add role session state visualization.
709
-
710
- Success condition: users can customize role behavior without editing harness
711
- files manually.
712
-
713
- ### Phase 3: Workflow Builder MVP
714
-
715
- - Add template selection at task creation.
716
- - Add duplicate built-in template.
717
- - Add form-based node editor.
718
- - Add edge editor.
719
- - Add artifact contract editor.
720
- - Add validation before save.
721
- - Add compact graph preview.
722
-
723
- Success condition: users can create a custom linear or lightly branching
724
- workflow from the UI.
725
-
726
- ### Phase 4: Advanced Gates and Branching
727
-
728
- - Add reusable gate node configuration.
729
- - Add retry / skip / override policies.
730
- - Add loop limits.
731
- - Add human decision nodes.
732
- - Add fan-out / fan-in data model.
733
-
734
- Success condition: review-heavy and hotfix workflows can be modeled without
735
- hardcoded special cases.
736
-
737
- ### Phase 5: Sharing and Auditability
738
-
739
- - Add export/import for workflow templates.
740
- - Add workflow diff view.
741
- - Add task run replay timeline.
742
- - Add workflow run diagnostics.
743
- - Add template migration assistant.
744
-
745
- Success condition: users can share, inspect, and evolve workflows safely.
746
-
747
- ## 17. Open Decisions
748
-
749
- The following details should be decided before implementation:
750
-
751
- - exact workflow JSON schema
752
- - whether custom templates should support YAML in addition to JSON
753
- - how much graph editing belongs in 0.5 versus later versions
754
- - final expression language for branch conditions
755
- - whether command nodes should use allowlisted command templates only
756
- - how workflow templates are imported, exported, and named
757
- - how to present workflow validation errors in the UI
758
- - how task creation should choose between default and custom workflow templates
759
-
760
- ## 18. Recommended 0.5 Scope
761
-
762
- The strongest 0.5 scope is:
763
-
764
- - workflow engine foundation
765
- - built-in default workflow expressed as data
766
- - workflow run state as source of truth
767
- - role definition model
768
- - session lifecycle policies
769
- - template selection
770
- - custom template duplication
771
- - form-based role editor
772
- - form-based node editor for linear workflows
773
- - explicit artifact contracts
774
- - workflow validation
775
-
776
- Advanced graph editing, complex parallel execution, and template marketplace
777
- features should wait until the core state model is stable.
778
-
779
- ## 19. Design Summary
780
-
781
- Custom workflows are a major VCM capability because they move the product from a
782
- single hardcoded process to a configurable local AI workbench.
783
-
784
- The important design choice is not the graph UI. The important design choice is
785
- making workflow runs the source of truth and treating role sessions as managed
786
- execution resources. Once that separation is in place, custom roles, long-lived
787
- sessions, fresh review sessions, reusable gates, artifact validation, and
788
- auditable task progress all become coherent parts of one system.