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,528 +0,0 @@
1
- # VCM Claude Code Best Practices
2
-
3
- Last updated: 2026-06-21
4
-
5
- This is the current VCM-specific Claude Code / AI coding best-practices guide.
6
- It is based on the latest `example/rust-layered` harness baseline.
7
-
8
- Do not install this document into target repositories. Target repositories should
9
- receive a concise root `CLAUDE.md` VCM block, role agents, repo-local VCM
10
- skills, harness tools, Translator harness files, and project-owned
11
- durable docs.
12
-
13
- `docs/cc-best-practices.md` is archived as the old generic baseline. Current VCM
14
- implementation should use this document and `docs/full-harness-baseline.md`.
15
-
16
- ## 1. Core Principle
17
-
18
- VCM separates three concerns:
19
-
20
- - Harness-managed files: VCM owns, upgrades, repairs, audits, and can uninstall
21
- these through deterministic installer definitions and managed markers.
22
- - Project-owned durable docs: VCM bootstrap may create or initialize these, but
23
- they become project truth and are not VCM-owned harness.
24
- - Runtime state: VCM writes these during task execution and cleans them up after
25
- durable facts are promoted.
26
-
27
- Temporary documents should be deleted. Durable documents should be updated.
28
- Completed routine plans, task-local handoffs, logs, and job state should not pile
29
- up as permanent repository history.
30
-
31
- ## 2. Current Repo Harness Baseline
32
-
33
- The current baseline is represented by `example/rust-layered`.
34
-
35
- Fixed installer files:
36
-
37
- ```text
38
- CLAUDE.md
39
- .gitignore
40
- .claude/settings.json
41
- .claude/agents/project-manager.md
42
- .claude/agents/architect.md
43
- .claude/agents/coder.md
44
- .claude/agents/reviewer.md
45
- .claude/agents/gate-reviewer.md
46
- .claude/skills/vcm-route-message/SKILL.md
47
- .claude/skills/vcm-final-acceptance/SKILL.md
48
- .claude/skills/vcm-long-running-validation/SKILL.md
49
- .claude/skills/vcm-harness-bootstrap/SKILL.md
50
- .claude/skills/vcm-gate-review/SKILL.md
51
- .claude/agents/translator.md
52
- .ai/tools/generate-module-index
53
- .ai/tools/generate-public-surface
54
- .ai/tools/request-gate-review
55
- .ai/tools/run-long-check
56
- .ai/tools/watch-job
57
- .ai/tools/vcm-bash-guard
58
- .github/pull_request_template.md
59
- ```
60
-
61
- Derived bootstrap artifacts:
62
-
63
- ```text
64
- .ai/generated/module-index.json
65
- .ai/generated/public-surface.json
66
- ```
67
-
68
- The generated artifacts are produced by generator tools during bootstrap or
69
- later maintenance work. They are not hand-authored fixed templates.
70
-
71
- Runtime roots:
72
-
73
- ```text
74
- .ai/vcm/
75
- .claude/worktrees/
76
- ```
77
-
78
- Not part of the current baseline:
79
-
80
- ```text
81
- .claude/commands/
82
- .claude/agents/optional/
83
- .ai/task-specs/
84
- .ai/vcm/tasks/
85
- .ai/vcm/handoffs/role-commands/
86
- .ai/vcm-harness-manifest.json
87
- docs/plans/active/
88
- docs/plans/completed/
89
- docs/MODULE_MAP.md
90
- docs/SECURITY.md
91
- docs/DEPENDENCY_RULES.md
92
- docs/AI_WORKFLOW.md
93
- .ai/generated/test-map.json
94
- .ai/tools/check-fast
95
- .ai/tools/check-changed
96
- .ai/tools/check-module
97
- .ai/tools/check-boundaries
98
- .ai/tools/check-agent-rules
99
- .ai/tools/check-docs-freshness
100
- .ai/tools/find-owner
101
- .ai/tools/find-callers
102
- .ai/tools/find-tests
103
- ```
104
-
105
- Do not reintroduce these unless there is a current VCM requirement.
106
-
107
- ## 3. Harness Ownership
108
-
109
- VCM harness ownership is defined by the installer code and by managed markers.
110
- The current implementation does not use `.ai/vcm-harness-manifest.json`.
111
-
112
- VCM-owned managed blocks use markers such as:
113
-
114
- ```md
115
- <!-- VCM:BEGIN version=1 -->
116
- ...
117
- <!-- VCM:END -->
118
- ```
119
-
120
- For `.gitignore`, VCM uses:
121
-
122
- ```gitignore
123
- # VCM:BEGIN version=1
124
- ...
125
- # VCM:END
126
- ```
127
-
128
- Whole-file and raw-file harness files are owned by VCM only when their paths are
129
- listed by the fixed installer. VCM uninstall should remove only VCM-owned
130
- managed blocks or unchanged VCM-owned whole files. User-authored project docs
131
- must not be deleted by harness uninstall.
132
-
133
- ## 4. Project-Owned Durable Docs
134
-
135
- The current Rust layered example uses:
136
-
137
- ```text
138
- docs/ARCHITECTURE.md
139
- <module>/ARCHITECTURE.md
140
- docs/TESTING.md
141
- docs/known-issues.md
142
- docs/plans/
143
- ```
144
-
145
- Ownership:
146
-
147
- - Architect owns `docs/ARCHITECTURE.md`, module-level `ARCHITECTURE.md`, and
148
- promotion of unresolved durable issues to `docs/known-issues.md`.
149
- - Reviewer owns `docs/TESTING.md`, validation strategy, test adequacy, and final
150
- validation confidence.
151
- - `docs/plans/` is for durable plans only when a large task needs one.
152
- Completed routine plans should be deleted after durable facts are promoted.
153
-
154
- Project-owned durable docs are not VCM harness entries. VCM bootstrap may draft
155
- or initialize them, but after creation they belong to the project.
156
-
157
- ## 5. Runtime State
158
-
159
- Task runtime state lives under `.ai/vcm/` in the task worktree or connected repo.
160
- It is task-local and temporary.
161
-
162
- Current runtime files and directories:
163
-
164
- ```text
165
- .ai/vcm/handoffs/
166
- .ai/vcm/handoffs/messages/
167
- .ai/vcm/handoffs/architecture-plan.md
168
- .ai/vcm/handoffs/review-report.md
169
- .ai/vcm/handoffs/docs-sync-report.md
170
- .ai/vcm/handoffs/final-acceptance.md
171
- .ai/vcm/handoffs/known-issues.md
172
- .ai/vcm/gate-reviews/
173
- .ai/vcm/jobs/<job-id>/
174
- .ai/vcm/harness-engineer/session.json
175
- .ai/vcm/bootstrap/session.json
176
- ```
177
-
178
- App-local VCM task records live outside the connected repository:
179
-
180
- ```text
181
- <vcmDataDir>/projects/<project-id>/tasks/<task-slug>.json
182
- ```
183
-
184
- Runtime state is deleted during task cleanup after useful facts are promoted to
185
- code, tests, durable docs, PR text, or commit history.
186
-
187
- ## 6. Role Model
188
-
189
- VCM uses four core roles:
190
-
191
- - `project-manager`: user-facing flow manager. It routes work, tracks gates,
192
- asks the user for product or approval decisions, and performs final evidence
193
- acceptance. It does not perform technical analysis.
194
- - `architect`: technical planner and docs-sync owner. It defines module/file
195
- responsibilities, cross-file callable surfaces, public contracts, phase
196
- boundaries, risks, and durable docs updates. Before coder work starts,
197
- architect writes the plan with a Scaffold Manifest whose rows have stable
198
- IDs, and materializes only the minimum necessary code scaffolding with
199
- durable contract comments and `VCM:CODE <ID>` placeholders.
200
- - `coder`: implementation owner. It changes production code and baseline unit
201
- tests within the approved plan. It follows the architect-defined scaffold,
202
- implements and removes `VCM:CODE` placeholders, reports Scaffold Completion
203
- by ID in handoff, follows general coding standards, and does not change
204
- architecture or durable docs.
205
- - `reviewer`: independent validation owner. It reads code as needed, writes or
206
- updates tests, owns `docs/TESTING.md`, and decides validation sufficiency.
207
- `docs/TESTING.md` must be current validation strategy, not a task log, and
208
- must include reviewable integration/E2E case lists. Production fixes go back
209
- to coder; design conflicts go back to architect.
210
-
211
- Roles work sequentially in one task worktree. If `git status` shows uncommitted
212
- changes, commit them before handing off to another role.
213
-
214
- ## 7. Task Flow
215
-
216
- Default code-change route:
217
-
218
- ```text
219
- project-manager
220
- -> architect
221
- -> coder
222
- -> reviewer
223
- -> architect docs sync
224
- -> project-manager final acceptance
225
- ```
226
-
227
- Shorter routes:
228
-
229
- - Docs-only work: `project-manager -> architect -> project-manager final acceptance`
230
- - Test-only or validation-only work:
231
- `project-manager -> reviewer -> project-manager final acceptance`
232
-
233
- If a docs/test/validation-only task reveals required code, architecture, public
234
- contract, dependency, durable-doc, or validation-strategy changes, route back
235
- through the full code-change flow.
236
-
237
- Complex tasks may be split by architect into phases. PM dispatches one
238
- architect-defined phase at a time and must not split, merge, reorder, or redefine
239
- phases. A role may return partial completed work and ask PM for continuation, but
240
- workload or context size is not a valid reason to change the architect plan.
241
-
242
- ## 7.1 Architecture Plan And Code Scaffolding
243
-
244
- For code changes, the architect plan is not only a markdown handoff. It is a
245
- plan document plus a Scaffold Manifest and the minimum necessary code
246
- scaffolding.
247
-
248
- The plan document defines affected modules, changed or created files, file
249
- responsibilities, why each file is in scope, user-visible behavior changes,
250
- non-private cross-file callable surfaces, docs impact, risks, and Replan
251
- triggers.
252
-
253
- The Scaffold Manifest carries task-specific file context for the current handoff:
254
- stable row ID, why a file is in scope, what coder should implement, allowed
255
- implementation freedom, expected `VCM:CODE` placeholders, durable code comment
256
- needs, proof points, and Replan triggers. Task context, phase notes, handoff
257
- instructions, temporary rationale, and coder guidance belong in the Scaffold
258
- Manifest, not in source-code comments.
259
-
260
- Code scaffolding materializes that plan in the repository before coder work
261
- starts:
262
-
263
- - new modules or files are created when needed
264
- - durable behavior, contracts, invariants, error boundaries, or non-obvious
265
- logic are documented in code only when they should remain useful after the
266
- task is complete
267
- - new or changed non-private callable surfaces are defined directly in code with
268
- signature shape and contract comments
269
- - incomplete implementation bodies are marked with `VCM:CODE <Scaffold Manifest ID>`
270
-
271
- Coder implements the marked placeholders and may add private helpers, but cannot
272
- change file responsibilities, callable-surface signatures, or contract intent
273
- without architect replan. Coder handoff reports Scaffold Completion by manifest
274
- ID, including completed markers, remaining markers if any, private helpers
275
- added, manifest deviations, and whether Replan is needed.
276
-
277
- Architect may also enter Debug Mode when PM routes bugs, failing tests,
278
- build/runtime failures, or unclear defects. Debug Mode allows architect to read
279
- source/tests, edit code, add temporary diagnostics, write focused verification,
280
- and run tests until the root cause is known. Architect may directly finish only
281
- localized fixes that add no new module, add no new public or cross-file callable
282
- surface, and stay under 500 changed production-code lines. Architect-run
283
- validation is diagnostic evidence, not final acceptance; reviewer still performs
284
- independent final validation.
285
-
286
- ## 8. Route Messages
287
-
288
- Use the `vcm-route-message` skill whenever a VCM role hands off work, asks a
289
- question, reports a result, reports a blocker, or raises a finding.
290
-
291
- Current route file path:
292
-
293
- ```text
294
- .ai/vcm/handoffs/messages/<from-role>-<to-role>.md
295
- ```
296
-
297
- The skill is a route-file writing protocol. It should not encode the full role
298
- policy; role permissions belong in root and role `CLAUDE.md` files.
299
-
300
- The route file name is authoritative for source and target. Do not duplicate
301
- `from` or `to` in frontmatter.
302
-
303
- After writing or updating a route file, end the current Claude Code turn. Do not
304
- poll route files, loop, wait for another role, paste directly into another role
305
- terminal, or use Claude Code Task/Subagent to replace VCM role routing.
306
-
307
- ## 9. Validation
308
-
309
- Validation is role-owned, not wrapper-owned.
310
-
311
- VCM defines validation levels in root `CLAUDE.md`:
312
-
313
- - L0: fast format/lint/typecheck/boundary/dependency/project checks
314
- - L1: coder unit checks for changed behavior and direct regressions
315
- - L2: module or integration checks
316
- - L3: smoke E2E checks
317
- - L4: release/full regression checks
318
-
319
- The current Rust example does not use fixed `check-fast`, `check-changed`, or
320
- `check-module` wrappers. Coder and reviewer use native Rust commands such as
321
- `cargo test`, `cargo test -p <crate>`, `cargo check`, or project-specific
322
- commands documented in `docs/TESTING.md`.
323
-
324
- Reviewer owns `docs/TESTING.md` as the current validation strategy, not as a
325
- task log or diagnostic history. It must explain what is tested, why it matters,
326
- how to run it, when to run it, and known gaps. Integration and E2E tests should
327
- be documented as reviewable case lists with ID, scenario, entry point, what the
328
- case proves, key assertions, when to run, and current limitations when relevant.
329
- Superseded failures, temporary diagnostics, and per-task validation logs belong
330
- in review reports, PR text, or durable known issues when they must persist.
331
-
332
- Long-running commands use `vcm-long-running-validation`, backed by:
333
-
334
- ```text
335
- .ai/tools/run-long-check
336
- .ai/tools/watch-job
337
- ```
338
-
339
- This skill is role-independent. It only handles long-running command execution,
340
- bounded waiting, file-backed status, timeout, and log summaries. The caller
341
- decides where to record command evidence.
342
-
343
- VCM roles must not run background Bash; a `PreToolUse` hook
344
- (`.ai/tools/vcm-bash-guard`) denies `run_in_background`, `nohup`, `setsid`,
345
- `disown`, and trailing `&`. The only sanctioned long-running mechanism is
346
- `.ai/tools/run-long-check` plus `.ai/tools/watch-job` through
347
- `vcm-long-running-validation`. The job worker enforces a hard 60 minute
348
- ceiling and a supervision lease that kills unwatched jobs; `watch-job` watches
349
- in foreground windows of up to 8 minutes (exit `125` means watch again now),
350
- and the VCM backend blocks turn-end while a validation job is running. Split
351
- larger validation/build work or ask the user before suggesting anything longer
352
- than 60 minutes.
353
-
354
- ## 10. Generated Context
355
-
356
- The current example has two generated artifacts:
357
-
358
- ```text
359
- .ai/generated/module-index.json
360
- .ai/generated/public-surface.json
361
- ```
362
-
363
- `module-index.json` helps agents find layers, modules, manifests, module docs,
364
- source files, test files, and workspace dependencies.
365
-
366
- `public-surface.json` indexes project public APIs, routes, and externally
367
- consumed surfaces. It is a machine index, not an architecture document.
368
-
369
- Current generated-context support covers Rust/Cargo projects and npm workspace
370
- TypeScript/JavaScript projects. Other repository shapes must use
371
- project-specific generators before `.ai/generated/*` is considered reliable.
372
-
373
- There is no `test-map.json`. Rust unit tests live with source where appropriate;
374
- integration tests use Cargo's normal test layout. Test files are discoverable
375
- through `module-index.json`.
376
-
377
- Generated artifacts are derived context. They must be regenerated by tools after
378
- relevant source, manifest, module, or public API changes. They should not be
379
- hand-edited as durable truth.
380
-
381
- ## 11. Harness Bootstrap
382
-
383
- `vcm-harness-bootstrap` is the AI-assisted project understanding and refresh
384
- procedure. It is not the deterministic installer.
385
-
386
- It may read the repository and create or refresh project-specific content such
387
- as:
388
-
389
- - `CLAUDE.md` project context outside the VCM managed block
390
- - `docs/ARCHITECTURE.md`
391
- - module-level `ARCHITECTURE.md`
392
- - `docs/TESTING.md`
393
- - `docs/known-issues.md`
394
- - `.ai/generated/module-index.json`
395
- - `.ai/generated/public-surface.json`
396
-
397
- It must not edit product source, product tests, package manifests, lockfiles,
398
- deployment config, or secrets. It must not create new validation wrapper tools
399
- during bootstrap.
400
-
401
- Important claims should be marked as verified, inferred, unknown, or needing
402
- human confirmation.
403
-
404
- VCM should run bootstrap through the project-scoped `harness-engineer` session,
405
- not through a separate temporary terminal or invisible background task:
406
-
407
- - run the deterministic fixed installer first
408
- - start or resume the project-scoped `harness-engineer` role with execution cwd set to the active task worktree
409
- - send a prompt that explicitly requires using `vcm-harness-bootstrap` and creating the bootstrap commit
410
- - persist the bootstrap run marker under `.ai/vcm/bootstrap/session.json`
411
- - mark the bootstrap run complete when the `harness-engineer` Stop hook arrives
412
- - do not create the bootstrap commit in VCM; Harness Engineer owns that commit
413
-
414
- The UI should expose both stages: fixed install status and bootstrap completion
415
- status. A failed or disconnected Harness Engineer session should be restartable
416
- without treating project-owned durable docs as VCM-owned harness files.
417
-
418
- ## 12. Final Acceptance
419
-
420
- `vcm-final-acceptance` is PM's final evidence audit. PM must not use it for
421
- technical design review, implementation review, source-code analysis, or test
422
- adequacy analysis.
423
-
424
- It checks whether required evidence exists and has clear decisions:
425
-
426
- - architect plan or docs-sync decision when needed
427
- - reviewer decision and validation evidence when needed
428
- - known-issues disposition
429
- - explicit user approval for high-risk exceptions
430
- - file-scope explanation at changed-file-list level
431
-
432
- Do not accept when required role evidence is missing, reviewer findings are
433
- unresolved, docs sync is missing for durable changes, known-issues disposition is
434
- missing, or unexplained high-risk files remain.
435
-
436
- ## 13. Documentation Lifecycle
437
-
438
- Temporary files should be deleted after the task:
439
-
440
- - route messages
441
- - handoff artifacts
442
- - job logs and status files
443
- - app-local task records
444
- - routine completed plans
445
-
446
- Durable facts should be moved into:
447
-
448
- - code
449
- - tests
450
- - `docs/ARCHITECTURE.md`
451
- - module-level `ARCHITECTURE.md`
452
- - `docs/TESTING.md`
453
- - `docs/known-issues.md`
454
- - PR text
455
- - commit history
456
-
457
- Do not keep completed task notes as a permanent docs archive unless they remain
458
- valuable durable planning knowledge.
459
-
460
- ## 14. Embedded Terminal
461
-
462
- The embedded terminal should run through backend-managed PTY/session services,
463
- not as front-end-only command execution. Frontend code displays and controls
464
- session streams; process ownership, logs, task routing, and terminal safety belong
465
- to backend services.
466
-
467
- High-risk terminal work includes process lifecycle, cross-device control,
468
- gateway-submitted prompts, and command authorization.
469
-
470
- ## 15. Mobile Gateway
471
-
472
- VCM 0.2 gateway should expose a conservative mobile command surface through
473
- Tencent iLink Bot API / Weixin DM.
474
-
475
- Gateway product rules:
476
-
477
- - support Weixin DM only, not group chat
478
- - bind one mobile Weixin DM identity to one desktop VCM instance
479
- - do not bind gateway to a single project or task
480
- - let the bound phone select among the projects and tasks available to that VCM
481
- instance
482
- - send ordinary mobile text only to the current task's `project-manager`
483
- - do not send gateway messages directly to architect, coder, or reviewer
484
- - when translation is enabled, send only translated English to PM and translated
485
- Chinese back to Weixin
486
- - do not include the original Chinese text in PM prompts
487
- - use one bound DM identity; do not maintain a multi-user allowlist
488
-
489
- Gateway settings and secrets live in app-local state:
490
-
491
- ```text
492
- <vcmDataDir>/gateway/settings.json
493
- ```
494
-
495
- Gateway audit logs live outside connected repositories:
496
-
497
- ```text
498
- <vcmDataDir>/gateway/audit.jsonl
499
- ```
500
-
501
- Rules:
502
-
503
- - do not expose the full embedded terminal over Weixin
504
- - do not store gateway credentials in connected repositories
505
- - reject or ignore messages outside the bound DM identity
506
- - keep the MVP PM-only and avoid approve/reject/start/stop workflow commands
507
- - audit gateway state changes and message handling with secrets redacted
508
- - treat gateway authorization and command parsing as high-risk code
509
-
510
- ## 16. Minimum VCM Rules
511
-
512
- 1. Manifest records harness ownership only.
513
- 2. Project durable docs are project-owned.
514
- 3. Runtime state under `.ai/vcm/**` is temporary.
515
- 4. No `.claude/commands/` by default.
516
- 5. No optional agents by default.
517
- 6. No role-command files.
518
- 7. No `.ai/vcm/tasks/` in connected repos.
519
- 8. No `docs/plans/active` or `docs/plans/completed`.
520
- 9. No `test-map.json` by default.
521
- 10. No fixed `check-*` wrappers by default.
522
- 11. Use native project commands for validation.
523
- 12. Use generated context only when it has a real generator.
524
- 13. Coder owns implementation, baseline unit checks, scaffold completion, and general coding standards.
525
- 14. Reviewer owns independent validation and `docs/TESTING.md` as current testing strategy with integration/E2E case lists.
526
- 15. Architect owns architecture planning, code scaffolding, Debug Mode, and durable architecture docs.
527
- 16. PM owns routing and final evidence acceptance, not technical analysis.
528
- 17. Temporary documents are deleted; durable documents are updated.