vibe-coding-master 0.0.17 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -28
- package/dist/backend/api/artifact-routes.js +5 -5
- package/dist/backend/api/harness-routes.js +8 -0
- package/dist/backend/server.js +8 -2
- package/dist/backend/services/artifact-service.js +12 -12
- package/dist/backend/services/harness-service.js +579 -5
- package/dist/backend/services/project-service.js +4 -1
- package/dist/backend/services/session-service.js +1 -3
- package/dist/backend/services/task-service.js +16 -17
- package/dist/backend/templates/handoff.js +64 -26
- package/dist/backend/templates/harness/architect-agent.js +42 -12
- package/dist/backend/templates/harness/claude-root.js +42 -18
- package/dist/backend/templates/harness/coder-agent.js +15 -11
- package/dist/backend/templates/harness/known-issues-doc.js +22 -0
- package/dist/backend/templates/harness/project-manager-agent.js +66 -16
- package/dist/backend/templates/harness/pull-request-template.js +29 -0
- package/dist/backend/templates/harness/reviewer-agent.js +40 -12
- package/dist/backend/templates/harness/vcm-final-acceptance-skill.js +105 -0
- package/dist/backend/templates/harness/vcm-harness-bootstrap-skill.js +78 -0
- package/dist/backend/templates/harness/vcm-long-running-validation-skill.js +50 -0
- package/dist/backend/templates/harness/vcm-route-message-skill.js +86 -0
- package/dist/backend/templates/message-envelope.js +1 -0
- package/dist/backend/templates/role-command.js +7 -1
- package/dist/shared/validation/artifact-check.js +14 -9
- package/dist-frontend/assets/index-CrY5Ryps.js +90 -0
- package/dist-frontend/assets/index-CvvtrrCN.css +32 -0
- package/dist-frontend/index.html +2 -2
- package/docs/cc-best-practices.md +433 -192
- package/docs/full-harness-baseline.md +254 -0
- package/docs/product-design.md +9 -9
- package/docs/v0.2-implementation-plan.md +379 -0
- package/docs/vcm-cc-best-practices.md +449 -0
- package/package.json +3 -1
- package/scripts/harness-tools/generate-module-index +298 -0
- package/scripts/harness-tools/generate-public-surface +692 -0
- package/scripts/install-vcm-harness.mjs +1607 -0
- package/scripts/uninstall-vcm-harness.mjs +490 -0
- package/scripts/verify-package.mjs +4 -0
- package/dist-frontend/assets/index-D40qaonx.css +0 -32
- package/dist-frontend/assets/index-DK2F4LFT.js +0 -90
- package/docs/v1-architecture-design.md +0 -1014
- package/docs/v1-implementation-plan.md +0 -1379
|
@@ -41,6 +41,7 @@ export function createSessionService(deps) {
|
|
|
41
41
|
cwd: taskRepoRoot,
|
|
42
42
|
env: {
|
|
43
43
|
VCM_API_URL: deps.apiUrl,
|
|
44
|
+
VCM_TASK_REPO_ROOT: taskRepoRoot,
|
|
44
45
|
VCM_TASK_SLUG: taskSlug,
|
|
45
46
|
VCM_ROLE: role,
|
|
46
47
|
VCM_SESSION_ID: claudeSessionId
|
|
@@ -224,9 +225,6 @@ function getHandoffArtifactPath(paths, role) {
|
|
|
224
225
|
if (role === "architect") {
|
|
225
226
|
return paths.architecturePlanPath;
|
|
226
227
|
}
|
|
227
|
-
if (role === "coder") {
|
|
228
|
-
return paths.implementationLogPath;
|
|
229
|
-
}
|
|
230
228
|
if (role === "reviewer") {
|
|
231
229
|
return paths.reviewReportPath;
|
|
232
230
|
}
|
|
@@ -7,7 +7,8 @@ export function createTaskService(deps) {
|
|
|
7
7
|
async createTask(repoRoot, input) {
|
|
8
8
|
assertValidTaskSlug(input.taskSlug);
|
|
9
9
|
const config = await deps.projectService.loadConfig(repoRoot);
|
|
10
|
-
const
|
|
10
|
+
const taskStoreRoot = deps.projectService.getProjectDataRoot(repoRoot);
|
|
11
|
+
const taskPath = getTaskPath(taskStoreRoot, input.taskSlug);
|
|
11
12
|
const shouldCreateWorktree = input.createWorktree !== false;
|
|
12
13
|
const taskBranch = shouldCreateWorktree
|
|
13
14
|
? `feature/${input.taskSlug}`
|
|
@@ -22,7 +23,7 @@ export function createTaskService(deps) {
|
|
|
22
23
|
statusCode: 409
|
|
23
24
|
});
|
|
24
25
|
}
|
|
25
|
-
if (!(await deps.git.isIgnored(repoRoot, `${config.stateRoot}
|
|
26
|
+
if (!(await deps.git.isIgnored(repoRoot, `${config.stateRoot}/.probe`))) {
|
|
26
27
|
throw new VcmError({
|
|
27
28
|
code: "VCM_STATE_NOT_IGNORED",
|
|
28
29
|
message: `${config.stateRoot}/ is not ignored by Git.`,
|
|
@@ -39,7 +40,7 @@ export function createTaskService(deps) {
|
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
42
|
if (!shouldCreateWorktree) {
|
|
42
|
-
const activeInlineTask = await findActiveInlineTask(deps.fs,
|
|
43
|
+
const activeInlineTask = await findActiveInlineTask(deps.fs, taskStoreRoot);
|
|
43
44
|
if (activeInlineTask) {
|
|
44
45
|
throw new VcmError({
|
|
45
46
|
code: "INLINE_TASK_EXISTS",
|
|
@@ -108,14 +109,14 @@ export function createTaskService(deps) {
|
|
|
108
109
|
await deps.artifactService.createArtifactTemplates({
|
|
109
110
|
repoRoot: taskRepoRoot,
|
|
110
111
|
taskSlug: input.taskSlug,
|
|
111
|
-
handoffDir: task.handoffDir
|
|
112
|
+
handoffDir: task.handoffDir,
|
|
113
|
+
branch: task.branch
|
|
112
114
|
});
|
|
113
115
|
await this.saveTask(repoRoot, task);
|
|
114
116
|
return task;
|
|
115
117
|
},
|
|
116
118
|
async listTasks(repoRoot) {
|
|
117
|
-
const
|
|
118
|
-
const tasksDir = path.join(repoRoot, config.stateRoot, "tasks");
|
|
119
|
+
const tasksDir = path.join(deps.projectService.getProjectDataRoot(repoRoot), "tasks");
|
|
119
120
|
if (!(await deps.fs.pathExists(tasksDir))) {
|
|
120
121
|
return [];
|
|
121
122
|
}
|
|
@@ -128,8 +129,7 @@ export function createTaskService(deps) {
|
|
|
128
129
|
},
|
|
129
130
|
async loadTask(repoRoot, taskSlug) {
|
|
130
131
|
assertValidTaskSlug(taskSlug);
|
|
131
|
-
const
|
|
132
|
-
const taskPath = getTaskPath(repoRoot, config.stateRoot, taskSlug);
|
|
132
|
+
const taskPath = getTaskPath(deps.projectService.getProjectDataRoot(repoRoot), taskSlug);
|
|
133
133
|
if (!(await deps.fs.pathExists(taskPath))) {
|
|
134
134
|
throw new VcmError({
|
|
135
135
|
code: "TASK_MISSING",
|
|
@@ -140,8 +140,7 @@ export function createTaskService(deps) {
|
|
|
140
140
|
return deps.fs.readJson(taskPath);
|
|
141
141
|
},
|
|
142
142
|
async saveTask(repoRoot, task) {
|
|
143
|
-
|
|
144
|
-
await deps.fs.writeJsonAtomic(getTaskPath(repoRoot, config.stateRoot, task.taskSlug), task);
|
|
143
|
+
await deps.fs.writeJsonAtomic(getTaskPath(deps.projectService.getProjectDataRoot(repoRoot), task.taskSlug), task);
|
|
145
144
|
},
|
|
146
145
|
async updateTaskStatus(repoRoot, taskSlug, status) {
|
|
147
146
|
const task = await this.loadTask(repoRoot, taskSlug);
|
|
@@ -165,7 +164,7 @@ export function createTaskService(deps) {
|
|
|
165
164
|
const config = await deps.projectService.loadConfig(repoRoot);
|
|
166
165
|
const task = await this.loadTask(repoRoot, taskSlug);
|
|
167
166
|
const taskRepoRoot = getTaskRuntimeRepoRoot(task);
|
|
168
|
-
const statePaths = getTaskStatePaths(repoRoot, taskRepoRoot, config.stateRoot, config.handoffRoot, taskSlug);
|
|
167
|
+
const statePaths = getTaskStatePaths(deps.projectService.getProjectDataRoot(repoRoot), taskRepoRoot, config.stateRoot, config.handoffRoot, taskSlug);
|
|
169
168
|
const removedStatePaths = [];
|
|
170
169
|
const cleanedAt = now();
|
|
171
170
|
if (task.worktreePath) {
|
|
@@ -194,8 +193,8 @@ export function createTaskService(deps) {
|
|
|
194
193
|
export function getTaskRuntimeRepoRoot(task) {
|
|
195
194
|
return task.worktreePath ?? task.repoRoot;
|
|
196
195
|
}
|
|
197
|
-
function getTaskPath(
|
|
198
|
-
return path.join(
|
|
196
|
+
function getTaskPath(taskStoreRoot, taskSlug) {
|
|
197
|
+
return path.join(taskStoreRoot, "tasks", `${taskSlug}.json`);
|
|
199
198
|
}
|
|
200
199
|
function getTaskWorktreePath(repoRoot, taskSlug) {
|
|
201
200
|
return path.join(repoRoot, ".claude", "worktrees", taskSlug);
|
|
@@ -206,8 +205,8 @@ async function ensureTaskRuntimeStateDirs(fs, taskRepoRoot, stateRoot) {
|
|
|
206
205
|
await fs.ensureDir(path.join(taskRepoRoot, stateRoot, "orchestration"));
|
|
207
206
|
await fs.ensureDir(path.join(taskRepoRoot, stateRoot, "translation"));
|
|
208
207
|
}
|
|
209
|
-
async function findActiveInlineTask(fs,
|
|
210
|
-
const tasksDir = path.join(
|
|
208
|
+
async function findActiveInlineTask(fs, taskStoreRoot) {
|
|
209
|
+
const tasksDir = path.join(taskStoreRoot, "tasks");
|
|
211
210
|
if (!(await fs.pathExists(tasksDir))) {
|
|
212
211
|
return undefined;
|
|
213
212
|
}
|
|
@@ -220,9 +219,9 @@ async function findActiveInlineTask(fs, repoRoot, stateRoot) {
|
|
|
220
219
|
}
|
|
221
220
|
return undefined;
|
|
222
221
|
}
|
|
223
|
-
function getTaskStatePaths(
|
|
222
|
+
function getTaskStatePaths(taskStoreRoot, taskRepoRoot, stateRoot, handoffRoot, taskSlug) {
|
|
224
223
|
return [
|
|
225
|
-
|
|
224
|
+
getTaskPath(taskStoreRoot, taskSlug),
|
|
226
225
|
path.join(taskRepoRoot, stateRoot, "sessions", `${taskSlug}.json`),
|
|
227
226
|
path.join(taskRepoRoot, stateRoot, "messages", `${taskSlug}.jsonl`),
|
|
228
227
|
path.join(taskRepoRoot, stateRoot, "orchestration", `${taskSlug}.json`),
|
|
@@ -22,36 +22,16 @@ TBD
|
|
|
22
22
|
TBD
|
|
23
23
|
`;
|
|
24
24
|
}
|
|
25
|
-
export function
|
|
26
|
-
return `#
|
|
25
|
+
export function renderKnownIssuesTemplate(taskSlug) {
|
|
26
|
+
return `# Known Issues: ${taskSlug}
|
|
27
27
|
|
|
28
|
-
##
|
|
29
|
-
|
|
30
|
-
TBD
|
|
31
|
-
|
|
32
|
-
## Files Changed
|
|
33
|
-
|
|
34
|
-
TBD
|
|
35
|
-
|
|
36
|
-
## Validation
|
|
28
|
+
## Task Issues
|
|
37
29
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
## Deviations From Architecture Plan
|
|
41
|
-
|
|
42
|
-
TBD
|
|
30
|
+
No unresolved task issues recorded yet.
|
|
43
31
|
|
|
44
|
-
##
|
|
32
|
+
## Escalation To Docs
|
|
45
33
|
|
|
46
|
-
|
|
47
|
-
`;
|
|
48
|
-
}
|
|
49
|
-
export function renderValidationLogTemplate(taskSlug) {
|
|
50
|
-
return `# Validation Log: ${taskSlug}
|
|
51
|
-
|
|
52
|
-
## Validation
|
|
53
|
-
|
|
54
|
-
Not run yet.
|
|
34
|
+
At task close, promote still-relevant confirmed issues to \`docs/known-issues.md\`; delete this task-local file with the rest of \`.ai/vcm/\` runtime state.
|
|
55
35
|
`;
|
|
56
36
|
}
|
|
57
37
|
export function renderReviewReportTemplate(taskSlug) {
|
|
@@ -101,8 +81,66 @@ TBD
|
|
|
101
81
|
|
|
102
82
|
TBD
|
|
103
83
|
|
|
84
|
+
## Known Issues Disposition
|
|
85
|
+
|
|
86
|
+
TBD
|
|
87
|
+
|
|
104
88
|
## Decision
|
|
105
89
|
|
|
90
|
+
TBD
|
|
91
|
+
`;
|
|
92
|
+
}
|
|
93
|
+
export function renderFinalAcceptanceTemplate(taskSlug) {
|
|
94
|
+
return `# Final Acceptance: ${taskSlug}
|
|
95
|
+
|
|
96
|
+
## Decision
|
|
97
|
+
|
|
98
|
+
TBD
|
|
99
|
+
|
|
100
|
+
## Evidence Reviewed
|
|
101
|
+
|
|
102
|
+
TBD
|
|
103
|
+
|
|
104
|
+
## Scope Traceability
|
|
105
|
+
|
|
106
|
+
### Expected Changes
|
|
107
|
+
|
|
108
|
+
TBD
|
|
109
|
+
|
|
110
|
+
### Supporting Changes
|
|
111
|
+
|
|
112
|
+
TBD
|
|
113
|
+
|
|
114
|
+
### Approved Deviations
|
|
115
|
+
|
|
116
|
+
TBD
|
|
117
|
+
|
|
118
|
+
### Unexplained Changes
|
|
119
|
+
|
|
120
|
+
TBD
|
|
121
|
+
|
|
122
|
+
### High-Risk Unexpected Changes
|
|
123
|
+
|
|
124
|
+
TBD
|
|
125
|
+
|
|
126
|
+
## Validation Summary
|
|
127
|
+
|
|
128
|
+
TBD
|
|
129
|
+
|
|
130
|
+
## Review And Docs Sync
|
|
131
|
+
|
|
132
|
+
TBD
|
|
133
|
+
|
|
134
|
+
## Known Issues Disposition
|
|
135
|
+
|
|
136
|
+
TBD
|
|
137
|
+
|
|
138
|
+
## Cleanup Readiness
|
|
139
|
+
|
|
140
|
+
TBD
|
|
141
|
+
|
|
142
|
+
## Final User Summary
|
|
143
|
+
|
|
106
144
|
TBD
|
|
107
145
|
`;
|
|
108
146
|
}
|
|
@@ -1,18 +1,48 @@
|
|
|
1
1
|
export function renderArchitectHarnessRules() {
|
|
2
2
|
return `## VCM Architect Rules
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
### Role Scope
|
|
5
|
+
|
|
6
|
+
- Own technical analysis, architecture planning, module boundaries, file responsibilities, public contracts, verifiable behavior, phase boundaries, behavior/contract proof points, risks, and Replan triggers.
|
|
6
7
|
- Do not implement production code.
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
|
|
8
|
+
- Do not design complete test cases, coverage matrices, or final validation strategy; reviewer owns independent test design, test adequacy, and validation confidence.
|
|
9
|
+
- Do not make product priority or approval decisions; route those questions back to project-manager.
|
|
10
|
+
- Reply to project-manager with the \`vcm-route-message\` skill.
|
|
11
|
+
|
|
12
|
+
### Planning Inputs
|
|
13
|
+
|
|
14
|
+
- Read \`CLAUDE.md\`, the role command, durable plans when present, relevant handoff artifacts, and affected project docs before planning.
|
|
15
|
+
- Use \`docs/ARCHITECTURE.md\`, \`docs/MODULE_MAP.md\`, \`docs/SECURITY.md\`, and \`docs/DEPENDENCY_RULES.md\` as durable project truth when relevant.
|
|
16
|
+
- If durable docs conflict with the requested plan or code reality, report the conflict to project-manager and identify whether user approval is required.
|
|
17
|
+
|
|
18
|
+
### Architecture Plan
|
|
19
|
+
|
|
20
|
+
- Write \`.ai/vcm/handoffs/architecture-plan.md\` before coder work starts.
|
|
21
|
+
- The plan must cover changed files, file responsibilities, public interfaces or user-visible behavior, required behavior or contract proof points, docs impact, risks, and Replan triggers.
|
|
22
|
+
- Keep implementation work scoped to what can be safely described, validated, reviewed, and handed off.
|
|
23
|
+
|
|
24
|
+
### Phase Planning
|
|
25
|
+
|
|
26
|
+
- Do not create phases for small, single-scope changes; use phases only when the task spans multiple modules, public contracts, migrations, high-risk integrations, or more work than one reliable coder handoff should carry.
|
|
27
|
+
- Split phased work into verifiable engineering slices with clear handoff and proof boundaries.
|
|
28
|
+
- Prefer behavior slices, but use module, interface, migration, or risk-isolation slices when they are clearer.
|
|
29
|
+
- Each phase must state goal, non-goals, affected scope, required behavior or contract proof points, completion criteria, dependencies, risks, and Replan triggers.
|
|
30
|
+
- Do not split by individual files unless independently verifiable; do not combine unrelated behavior, public-contract changes, migrations, or high-risk areas.
|
|
31
|
+
|
|
32
|
+
### Replan And Drift
|
|
33
|
+
|
|
34
|
+
- Replan only when project-manager routes a technical mismatch back to architect.
|
|
35
|
+
- Change the plan only for code reality conflict, invalid phase boundary, public contract change, dependency change, durable docs impact, or missing behavior/contract proof point.
|
|
36
|
+
- Do not treat workload, session length, or context size as a reason to change the plan.
|
|
37
|
+
- When reviewing drift, tell project-manager whether to keep the plan and send work back to coder, update the plan, or ask the user for approval.
|
|
38
|
+
|
|
39
|
+
### Docs Sync
|
|
40
|
+
|
|
41
|
+
- Perform docs sync only when project-manager requests it after reviewer completes.
|
|
42
|
+
- Check whether final code changed durable project truth: architecture, module map, public contracts, security constraints, dependency rules, or durable plans.
|
|
43
|
+
- Update affected durable docs when project truth changed; otherwise state which docs were checked and why they remain current.
|
|
44
|
+
- Treat reviewer-reported docs gaps as inputs; resolve technical docs drift or report conflicts back to project-manager.
|
|
45
|
+
- Read \`.ai/vcm/handoffs/known-issues.md\` and promote confirmed unresolved issues to \`docs/known-issues.md\`.
|
|
46
|
+
- Write \`.ai/vcm/handoffs/docs-sync-report.md\` with decision, evidence reviewed, architecture drift check, docs updated, docs left unchanged, remaining documentation risks, and handoff notes.
|
|
17
47
|
`;
|
|
18
48
|
}
|
|
@@ -1,21 +1,45 @@
|
|
|
1
1
|
export function renderRootClaudeHarnessRules() {
|
|
2
|
-
return `## VCM
|
|
3
|
-
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
2
|
+
return `## VCM Start Here
|
|
3
|
+
|
|
4
|
+
- Use the durable project docs below as role-relevant project truth.
|
|
5
|
+
- Read module-local \`CLAUDE.md\` before editing a subdirectory if one exists.
|
|
6
|
+
|
|
7
|
+
## VCM Durable Project Docs
|
|
8
|
+
|
|
9
|
+
- \`docs/ARCHITECTURE.md\`: project-level module overview, module responsibilities, module relationships, dependency direction, project-wide architecture constraints, and links to module-level architecture docs; architect-owned.
|
|
10
|
+
- \`<module>/ARCHITECTURE.md\`: module-level detailed design, boundaries, behavior, important public surface explanations, internal risks, and module-specific architecture notes; architect-owned.
|
|
11
|
+
- \`docs/TESTING.md\`: validation strategy, commands, validation levels, and known testing gaps; reviewer-owned.
|
|
12
|
+
- \`docs/known-issues.md\`: durable known issues and accepted limitations; architect-owned.
|
|
13
|
+
- \`.ai/generated/module-index.json\`: generated module index; use it to find layers, modules, manifests, module docs, source files, test files, and workspace dependencies.
|
|
14
|
+
- \`.ai/generated/public-surface.json\`: generated crate-external public API index; use it to inspect module-to-module public interfaces and source evidence.
|
|
15
|
+
|
|
16
|
+
## VCM Task Flow
|
|
17
|
+
|
|
18
|
+
- Code changes use the full route: \`project-manager -> architect -> coder -> reviewer -> architect docs sync -> project-manager final acceptance\`.
|
|
19
|
+
- Before code changes, architect must write a plan that covers changed files, file responsibilities, public interfaces or user-visible behavior, validation requirements, and Replan triggers.
|
|
20
|
+
- Docs-only changes may use: \`project-manager -> architect -> project-manager final acceptance\`.
|
|
21
|
+
- Test-only or validation-only work may use: \`project-manager -> reviewer -> project-manager final acceptance\`.
|
|
22
|
+
- If a docs/test/validation-only task reveals required code, architecture, public contract, dependency, durable-doc, or test-strategy changes, route back through the full code-change flow.
|
|
23
|
+
- Keep role outputs under \`.ai/vcm/handoffs/\`.
|
|
24
|
+
- Runtime task records and handoffs under \`.ai/vcm/\` are temporary. Durable facts must move into code, tests, PR text, commit history, or long-term docs.
|
|
25
|
+
- Record current-task unresolved findings in \`.ai/vcm/handoffs/known-issues.md\`.
|
|
26
|
+
- Use the \`vcm-route-message\` skill when writing or updating VCM role messages.
|
|
27
|
+
- Use the \`vcm-final-acceptance\` skill before declaring a VCM-managed task complete.
|
|
28
|
+
|
|
29
|
+
## VCM Validation Levels
|
|
30
|
+
|
|
31
|
+
- L0 fast checks: format, lint, typecheck, boundary, dependency, or other cheap project checks.
|
|
32
|
+
- L1 focused unit / contract checks: changed behavior, public function contracts, and direct regressions.
|
|
33
|
+
- L2 module / integration checks: module-level behavior, API contracts, service integration, persistence, or cross-file wiring.
|
|
34
|
+
- L3 smoke E2E checks: core user journeys or critical browser/API flows.
|
|
35
|
+
- L4 full regression / release checks are release-only unless explicitly requested.
|
|
36
|
+
- Coder normally runs baseline unit-level checks plus \`check-fast\`; reviewer decides final validation sufficiency and whether L2/L3 is required.
|
|
37
|
+
|
|
38
|
+
## VCM Worktree Policy
|
|
39
|
+
|
|
40
|
+
- Use one branch, one worktree, one handoff directory, and one PR or final patch per VCM-managed task.
|
|
41
|
+
- Roles work sequentially in the same task worktree.
|
|
42
|
+
- If \`git status\` shows uncommitted changes, commit them before handing off to another role.
|
|
43
|
+
|
|
20
44
|
`;
|
|
21
45
|
}
|
|
@@ -2,16 +2,20 @@ export function renderCoderHarnessRules() {
|
|
|
2
2
|
return `## VCM Coder Rules
|
|
3
3
|
|
|
4
4
|
- Implement only the approved task scope and architecture plan.
|
|
5
|
-
- Read the
|
|
6
|
-
- Add or update direct
|
|
7
|
-
-
|
|
8
|
-
- Do not
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
5
|
+
- Read \`CLAUDE.md\`, the route message or durable plan, architecture plan, relevant project docs, and cited handoff artifacts before editing.
|
|
6
|
+
- Add or update direct validation for changed behavior when practical.
|
|
7
|
+
- Record confirmed out-of-scope implementation issues in \`.ai/vcm/handoffs/known-issues.md\`; do not update \`docs/known-issues.md\` directly.
|
|
8
|
+
- Do not update durable docs unless architect explicitly assigns a mechanical edit.
|
|
9
|
+
- Do not change module boundaries, public contracts, dependency direction, durable docs, or test strategy without project-manager/architect Replan.
|
|
10
|
+
- Do not weaken, delete, or skip tests to make validation pass.
|
|
11
|
+
- Run \`.ai/tools/check-fast\` before handoff.
|
|
12
|
+
- Run focused validation from \`CLAUDE.md\`, the role command, and project docs when changed behavior requires it; record skipped checks with reasons.
|
|
13
|
+
- Stop and reply to project-manager when the approved plan conflicts with code reality.
|
|
14
|
+
- Stop before editing when the required architecture plan, route message, approved scope, public contract, or validation expectation is missing or unclear.
|
|
15
|
+
- If implementation requires architecture, public contract, dependency, durable docs, or test strategy changes, stop and request Replan instead of continuing.
|
|
16
|
+
- Reply through \`.ai/vcm/handoffs/messages/coder-project-manager.md\`.
|
|
17
|
+
- Use the \`vcm-route-message\` skill when writing or updating a role message.
|
|
18
|
+
- After writing a route file, end the current turn immediately; do not poll, loop, or wait for another role's answer.
|
|
19
|
+
- For slow validation, use the \`vcm-long-running-validation\` skill instead of ending the turn to wait for a shell callback.
|
|
16
20
|
`;
|
|
17
21
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function renderKnownIssuesDocHarnessRules() {
|
|
2
|
+
return `## VCM Known Issues Policy
|
|
3
|
+
|
|
4
|
+
- Use this file only for confirmed unresolved issues that must survive across tasks.
|
|
5
|
+
- Do not record current-task scratch notes, guesses, resolved issues, or ordinary TODOs here.
|
|
6
|
+
- During a task, record unresolved findings in \`.ai/vcm/handoffs/known-issues.md\` first.
|
|
7
|
+
- At task close, promote only still-relevant confirmed issues from the task-local file into this document.
|
|
8
|
+
- Remove entries when they are fixed, rejected, obsolete, or moved into a concrete plan.
|
|
9
|
+
|
|
10
|
+
## Entry Format
|
|
11
|
+
|
|
12
|
+
\`\`\`md
|
|
13
|
+
## YYYY-MM-DD <short issue title>
|
|
14
|
+
|
|
15
|
+
- discovered in: <task or PR>
|
|
16
|
+
- type: bug | limitation | technical-debt | validation-gap | docs-gap | decision-needed
|
|
17
|
+
- impact: low | medium | high
|
|
18
|
+
- status: open | planned | accepted
|
|
19
|
+
- proposed action: <next useful step>
|
|
20
|
+
\`\`\`
|
|
21
|
+
`;
|
|
22
|
+
}
|
|
@@ -1,22 +1,72 @@
|
|
|
1
1
|
export function renderProjectManagerHarnessRules() {
|
|
2
2
|
return `## VCM Project Manager Rules
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
- Before sending another task, question, revise, or review-request to the same role, wait for that role's reply file to be delivered back by VCM.
|
|
11
|
-
- In one Claude Code turn, send at most one VCM message to any single target role.
|
|
12
|
-
- After writing a route file, end the turn immediately. Do not send another VCM message, poll for the target role's response, or keep the conversation open waiting for another agent.
|
|
13
|
-
- Continue orchestration only in a later turn after VCM delivers that role's result, blocked, question, or finding message.
|
|
14
|
-
- Do not use Claude Code Task/Subagent for VCM role delegation; VCM manages the four role sessions.
|
|
15
|
-
- Use cancel only for urgent supersession; include what is superseded.
|
|
16
|
-
- Track the workflow gates: architecture plan, implementation/validation, review, docs sync, final acceptance.
|
|
17
|
-
- Request architect post-review docs sync after reviewer completes.
|
|
18
|
-
- Prepare final acceptance, commit, and PR only after reviewer and docs-sync gates pass or an explicit exception is approved.
|
|
4
|
+
### Role Scope
|
|
5
|
+
|
|
6
|
+
- You are the user-facing orchestration hub for this VCM-managed repository.
|
|
7
|
+
- Clarify the user's request, manage task flow, and choose the next role route.
|
|
8
|
+
- Route based on the user request, current VCM task state, and existing handoff status.
|
|
9
|
+
- Do not perform technical analysis; route technical, architectural, scope, contract, dependency, docs, and validation questions to architect.
|
|
19
10
|
- Do not implement non-trivial production code directly.
|
|
20
|
-
|
|
11
|
+
|
|
12
|
+
### Routing
|
|
13
|
+
|
|
14
|
+
- Use the routes defined in \`CLAUDE.md\`.
|
|
15
|
+
- Keep only one active role handoff at a time.
|
|
16
|
+
- Ask the user when user intent, priority, or approval is unclear.
|
|
17
|
+
- Ask the user when architect or reviewer reports a conflict with durable docs that requires user approval.
|
|
18
|
+
|
|
19
|
+
### Worktree
|
|
20
|
+
|
|
21
|
+
- Before dispatching work, confirm the current task repo root and branch.
|
|
22
|
+
- If the current directory does not match \`VCM_TASK_REPO_ROOT\`, stop and report the mismatch.
|
|
23
|
+
- Include the confirmed task repo root and branch in each role command \`## Worktree\` section.
|
|
24
|
+
|
|
25
|
+
### Dispatch Artifacts
|
|
26
|
+
|
|
27
|
+
- Before dispatching a role, update that role's command under \`.ai/vcm/handoffs/role-commands/\`.
|
|
28
|
+
- Role commands contain PM-owned routing context only: target role, user request summary, known user constraints, source of truth, required next gate, skipped gates when applicable, required handoff inputs, expected artifact, stop conditions, and confirmed worktree information.
|
|
29
|
+
- Do not write technical design into role commands; ask architect to determine architecture, file scope, public contracts, validation requirements, and Replan triggers.
|
|
30
|
+
- For coder or reviewer commands, reference existing handoff artifacts instead of making new technical judgments.
|
|
31
|
+
- Dispatch the handoff with the \`vcm-route-message\` skill and follow its write-then-stop rule.
|
|
32
|
+
|
|
33
|
+
### Phased Tasks
|
|
34
|
+
|
|
35
|
+
- When architect provides a phased plan, dispatch only one phase at a time.
|
|
36
|
+
- Do not split, merge, reorder, or redefine phases yourself; route phase-plan changes back to architect.
|
|
37
|
+
- Each coder phase must complete its assigned implementation, phase validation, and handoff artifacts before PM dispatches the next phase.
|
|
38
|
+
- Phase validation normally runs through L2; reserve full L3 validation for final task acceptance unless architect requires phase-level L3.
|
|
39
|
+
- Route back to architect only when coder or reviewer reports a technical mismatch with the approved plan.
|
|
40
|
+
|
|
41
|
+
### Flow Gates
|
|
42
|
+
|
|
43
|
+
- Track required handoff artifacts: architecture plan, task known issues, review report, docs-sync report, and final acceptance report.
|
|
44
|
+
- Advance to the next gate only when the current role reports complete or explicitly requests the next action.
|
|
45
|
+
- If a required artifact is missing, stale, blocked, or asks for a decision, route the issue to the responsible role or user.
|
|
46
|
+
- Request architect post-review docs sync after reviewer completes.
|
|
47
|
+
|
|
48
|
+
### Partial Role Results
|
|
49
|
+
|
|
50
|
+
- Treat partial, blocked, or continuation-needed role results as incomplete gates.
|
|
51
|
+
- If a role completes a coherent slice and the remaining work still matches the current role command, update the same role command and dispatch the same role again.
|
|
52
|
+
- Do not accept workload, session length, or context size as a reason to change the architect plan.
|
|
53
|
+
- Route back to architect only for technical mismatch with the approved plan, not for workload or session-size reasons.
|
|
54
|
+
- Do not advance to the next gate until the current gate is explicitly complete or an approved exception is recorded.
|
|
55
|
+
|
|
56
|
+
### Final Acceptance
|
|
57
|
+
|
|
58
|
+
- Use the \`vcm-final-acceptance\` skill before declaring the task complete.
|
|
59
|
+
- Start final acceptance only after reviewer and docs-sync gates pass or an explicit exception is approved.
|
|
60
|
+
- Confirm required evidence exists: validation result, review decision, docs-sync decision, unresolved risks, known-issues disposition, and cleanup status.
|
|
61
|
+
- If final acceptance finds missing evidence, unresolved risk, or required user approval, route it to the responsible role or user before closing the task.
|
|
62
|
+
|
|
63
|
+
### PR Preparation
|
|
64
|
+
|
|
65
|
+
- Prepare or update a GitHub PR only after final acceptance passes.
|
|
66
|
+
- Confirm \`git status\` has no uncommitted changes before creating or updating the PR.
|
|
67
|
+
- Use \`.github/pull_request_template.md\` when present.
|
|
68
|
+
- Fill the PR body from final acceptance, review report, docs-sync report, known-issues disposition, and commits.
|
|
69
|
+
- Do not perform technical review or validation during PR preparation; route missing evidence to the responsible role.
|
|
70
|
+
- Create a draft PR by default unless the user requests a ready PR.
|
|
21
71
|
`;
|
|
22
72
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export function renderPullRequestTemplateHarnessRules() {
|
|
2
|
+
return `## Summary
|
|
3
|
+
|
|
4
|
+
## Validation
|
|
5
|
+
|
|
6
|
+
- Commands run or checked:
|
|
7
|
+
- Result:
|
|
8
|
+
|
|
9
|
+
## Review
|
|
10
|
+
|
|
11
|
+
- Reviewer decision:
|
|
12
|
+
- Final acceptance:
|
|
13
|
+
|
|
14
|
+
## Docs
|
|
15
|
+
|
|
16
|
+
- Durable docs updated or confirmed unchanged:
|
|
17
|
+
- Known issues disposition:
|
|
18
|
+
|
|
19
|
+
## Risks
|
|
20
|
+
|
|
21
|
+
## Checklist
|
|
22
|
+
|
|
23
|
+
- [ ] Final acceptance completed.
|
|
24
|
+
- [ ] Reviewer validation completed.
|
|
25
|
+
- [ ] Durable docs updated or confirmed unchanged.
|
|
26
|
+
- [ ] Known issues resolved or recorded.
|
|
27
|
+
- [ ] No uncommitted changes remain.
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
@@ -1,19 +1,47 @@
|
|
|
1
1
|
export function renderReviewerHarnessRules() {
|
|
2
2
|
return `## VCM Reviewer Rules
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
4
|
+
### Role Scope
|
|
5
|
+
|
|
6
|
+
- Own the independent review gate, test adequacy, reviewer-owned validation design, and final validation confidence.
|
|
7
|
+
- Do not take over broad, architectural, risky, or multi-file implementation work, and do not weaken tests to pass validation.
|
|
8
|
+
- Reply to project-manager with the \`vcm-route-message\` skill.
|
|
9
|
+
|
|
10
|
+
### Inputs
|
|
11
|
+
|
|
12
|
+
- Read \`CLAUDE.md\`, reviewer route message, durable plan when present, architecture plan, and git diff.
|
|
13
|
+
- For code-change reviews, read coder route message; if it is missing, note the missing evidence in \`.ai/vcm/handoffs/review-report.md\`.
|
|
14
|
+
- Read affected code, tests, and project docs only as needed to verify behavior, public contracts, validation, risk, and docs impact.
|
|
15
|
+
|
|
16
|
+
### Review Scope
|
|
17
|
+
|
|
18
|
+
- Verify scope, role compliance, single-writer compliance, architecture compliance, public contract compliance, docs gaps, cleanup, risk, and whether validation evidence is sufficient.
|
|
9
19
|
- Escalate larger implementation issues to project-manager for coder follow-up.
|
|
10
20
|
- Escalate architecture, public contract, design, or documentation drift issues to project-manager for architect follow-up.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- Do not
|
|
21
|
+
|
|
22
|
+
### Test Adequacy And Validation
|
|
23
|
+
|
|
24
|
+
- Independently design the test coverage needed to prove the implemented behavior, including missing cases beyond coder's baseline tests.
|
|
25
|
+
- Decide whether stronger L1/L2/L3 validation is needed for final confidence.
|
|
26
|
+
- Add or modify tests needed for test adequacy.
|
|
27
|
+
- Do not skip smoke, integration, or E2E checks only because coder did not run them.
|
|
28
|
+
|
|
29
|
+
### Review-Scoped Fixes
|
|
30
|
+
|
|
31
|
+
- Production-code fixes must be small, local, low-risk, and traceable to review findings.
|
|
32
|
+
- Escalate broad, risky, architectural, or multi-file production fixes instead of implementing them directly.
|
|
33
|
+
|
|
34
|
+
### Phase Validation
|
|
35
|
+
|
|
36
|
+
- Each phase must run the strongest practical validation up to L2: fast, changed-file, focused unit, contract, or module validation.
|
|
37
|
+
- Full L3 E2E / browser / integration validation is normally reserved for the final phase or whole-task acceptance.
|
|
38
|
+
- Run a narrow L3 smoke during a phase only when that phase directly changes a critical E2E path or high-risk integration boundary.
|
|
39
|
+
- Treat architect-flagged public contracts, migrations, auth, data flow, routing, or dependency changes as risk inputs for reviewer-owned validation design.
|
|
40
|
+
- Record skipped L3 checks in \`.ai/vcm/handoffs/review-report.md\` with the reason and the planned final validation point.
|
|
41
|
+
|
|
42
|
+
### Outputs
|
|
43
|
+
|
|
44
|
+
- Write \`.ai/vcm/handoffs/review-report.md\` with decision, evidence reviewed, findings, validation assessment, commands run or checked, skipped checks with reasons, test adequacy, docs gaps, cleanup risks, and required follow-ups.
|
|
45
|
+
- Record confirmed unresolved findings that should survive task cleanup in \`.ai/vcm/handoffs/known-issues.md\` for docs sync/final acceptance triage.
|
|
18
46
|
`;
|
|
19
47
|
}
|