@osovv/vv-opencode 2.7.1 → 2.9.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.
Files changed (74) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +27 -49
  3. package/dist/cli.js +1 -3
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/completion.js +6 -32
  6. package/dist/commands/completion.js.map +1 -1
  7. package/dist/commands/preset.d.ts +0 -7
  8. package/dist/commands/preset.js +10 -29
  9. package/dist/commands/preset.js.map +1 -1
  10. package/dist/commands/session.d.ts +0 -3
  11. package/dist/commands/session.js +25 -40
  12. package/dist/commands/session.js.map +1 -1
  13. package/dist/commands/status.js +3 -4
  14. package/dist/commands/status.js.map +1 -1
  15. package/dist/commands/sync.js +25 -3
  16. package/dist/commands/sync.js.map +1 -1
  17. package/dist/lib/managed-agents.js +1 -1
  18. package/dist/lib/managed-agents.js.map +1 -1
  19. package/dist/lib/opencode/inspection.d.ts +0 -4
  20. package/dist/lib/opencode/inspection.js +2 -12
  21. package/dist/lib/opencode/inspection.js.map +1 -1
  22. package/dist/lib/opencode/vvoc-orchestration-migration.d.ts +21 -0
  23. package/dist/lib/opencode/vvoc-orchestration-migration.js +91 -0
  24. package/dist/lib/opencode/vvoc-orchestration-migration.js.map +1 -0
  25. package/dist/lib/orchestration.d.ts +2 -11
  26. package/dist/lib/orchestration.js +21 -44
  27. package/dist/lib/orchestration.js.map +1 -1
  28. package/dist/lib/vvoc-config.d.ts +0 -25
  29. package/dist/lib/vvoc-config.js +4 -22
  30. package/dist/lib/vvoc-config.js.map +1 -1
  31. package/dist/lib/vvoc-preset-registry.d.ts +0 -30
  32. package/dist/lib/vvoc-preset-registry.js +4 -14
  33. package/dist/lib/vvoc-preset-registry.js.map +1 -1
  34. package/dist/plugins/system-context-injection/guidance.d.ts +1 -0
  35. package/dist/plugins/system-context-injection/guidance.js +6 -4
  36. package/dist/plugins/system-context-injection/guidance.js.map +1 -1
  37. package/dist/plugins/system-context-injection/index.js +23 -16
  38. package/dist/plugins/system-context-injection/index.js.map +1 -1
  39. package/dist/plugins/workflow/index.js +4 -2
  40. package/dist/plugins/workflow/index.js.map +1 -1
  41. package/dist/plugins/workflow/results.d.ts +4 -4
  42. package/dist/plugins/workflow/schemas.d.ts +4 -4
  43. package/dist/runtime/context-inspection.js +1 -1
  44. package/dist/runtime/context-inspection.js.map +1 -1
  45. package/dist/runtime/session-settings.d.ts +6 -5
  46. package/dist/runtime/session-settings.js +36 -14
  47. package/dist/runtime/session-settings.js.map +1 -1
  48. package/dist/tui/settings/plugin.d.ts +1 -1
  49. package/dist/tui/settings/plugin.js +3 -3
  50. package/dist/tui/settings/plugin.js.map +1 -1
  51. package/package.json +1 -1
  52. package/schemas/vvoc/v3.json +1 -37
  53. package/templates/agents/vv-controller.md +15 -4
  54. package/templates/skills/vv-execute/SKILL.md +184 -292
  55. package/templates/skills/vv-execute/references/tool-contracts.md +1 -1
  56. package/templates/skills/vv-handoff/SKILL.md +39 -50
  57. package/templates/skills/vv-plan/SKILL.md +97 -155
  58. package/templates/skills/vv-reflect/SKILL.md +91 -111
  59. package/templates/skills/vv-review/SKILL.md +33 -26
  60. package/templates/skills/vv-spec/SKILL.md +51 -93
  61. package/templates/skills/vv-ui-design-principles/SKILL.md +28 -33
  62. package/templates/skills/vv-ui-design-principles/references/slop-tells.md +9 -0
  63. package/templates/skills/vv-verification/SKILL.md +44 -55
  64. package/templates/skills/vv-verification/references/create-your-verification-stack.md +16 -0
  65. package/templates/skills/vv-verification/references/evidence.md +9 -0
  66. package/templates/skills/vv-verification/references/oracles.md +8 -0
  67. package/templates/skills/vv-verification/references/strategy.md +10 -0
  68. package/templates/skills/vv-write-for-agents/SKILL.md +33 -33
  69. package/templates/skills/vv-write-for-humans/SKILL.md +47 -49
  70. package/templates/skills/vvoc-usage-analytics/SKILL.md +45 -43
  71. package/templates/skills/vvoc-usage-analytics/references/opencode-db-queries.md +12 -3
  72. package/dist/commands/orchestration.d.ts +0 -25
  73. package/dist/commands/orchestration.js +0 -185
  74. package/dist/commands/orchestration.js.map +0 -1
@@ -3,77 +3,76 @@ name: vv-reflect
3
3
  description: Use after a heavy development, debugging, bugfix, ops, or investigation session to reflect on it — including its subagent tree — and improve the agent's environment: documents, steering, guardrails, skills, tooling, and delegation, plus durable lessons and runbooks. Dispatches the read-only vv-reflector subagent, then applies only per-entry approved changes.
4
4
  ---
5
5
 
6
- <skill>
7
- <identity>
8
- You are the vv-reflect skill. You dispatch the read-only vv-reflector subagent to analyze the current session and its subagent tree, then present its proposals and apply only what the user approves. You do not analyze the transcript inline: the reflector holds the noisy evidence in its own context and returns a short proposal list; you hold the decision and the writes. You do not write files until the user explicitly approves entries one by one.
9
- </identity>
10
-
11
6
  <scope>
12
- <rule>Use the current visible chat context and repository files as evidence for dispatching and applying changes.</rule>
13
- <rule>Use only the current visible chat context for session history; the reflector reads the recorded session and subagent sessions read-only.</rule>
14
- <rule>Do not use or create .vvoc/reflect.jsonc or any reflect-specific config.</rule>
15
- <rule>Do not add a CLI command, hook behavior, or automatic writer behavior; keep every applied change inside approved repository documents, guardrails, and vvoc-managed skill or agent templates.</rule>
16
- <rule>Prefer the smallest change that removes the friction. Removal and consolidation are valid improvements: a stale, duplicated, or no-op instruction is deleted, not layered over with an exception.</rule>
17
- <rule>For a question spanning more than one session or project, run `session-graph.py --archive`; do not hand-roll SQL and never sum the legacy `part` table with `session_message`.</rule>
7
+ Dispatch the read-only vv-reflector subagent to analyze the current session and its subagent tree, then present its proposals and apply only what the user approves. You do not analyze the transcript inline: the reflector holds the noisy evidence in its own context and returns a short proposal list; you hold the decision and the writes. You do not write files until the user explicitly approves entries one by one.
18
8
  </scope>
19
9
 
20
- <dispatch>
21
- <rule>Call the native `subagent` tool with `agent: "vv-reflector"`, a short `description`, and a self-contained `prompt` assignment. Use `subagent`, not the V1 legacy `task`/`subagent_type` names.</rule>
22
- <rule>The assignment carries only what the reflector cannot infer: the target session reference, plus an optional focus area and explicit limits.</rule>
23
- <rule>Prefer a child subagent session id visible from this session's `subagent` results as the target reference — its parent is exactly this session. Otherwise pass an explicit session id. Omit the reference only when neither exists, in which case the extractor defaults to the newest top-level session for the project, which can be a different concurrently active session.</rule>
24
- <rule>Everything stable — method, categories, friction signals, output format, default caps — lives in the vv-reflector agent prompt, not in the assignment.</rule>
25
- <rule>Do not analyze the session yourself before dispatching; the reflector is the analyst.</rule>
26
- <rule>If the reflector reports it could not locate the extractor or the target session, report that to the user and stop; do not fall back to inline analysis.</rule>
27
- </dispatch>
28
-
29
- <approval>
30
- <rule>Present the reflector's proposals to the user, grouped and ordered by severity, one item per proposal.</rule>
31
- <rule>For each entry include: category, severity, finding with concrete evidence, the proposed change, its destination, and why it matters.</rule>
32
- <rule>Wait for explicit per-entry approve, edit, or reject instructions.</rule>
33
- <rule>Treat silence or general agreement without clear approval as not yet approved for writing.</rule>
34
- <rule>Apply only approved entries, preserving local format, keeping writes idempotent, and never silently overwriting an existing entry or user-owned file.</rule>
35
- <rule>Report what was applied, what was proposed but deferred, and what was skipped.</rule>
36
- </approval>
37
-
38
- <classification>
39
- <lesson>A lesson preserves generalized knowledge that future agents should remember: a caveat, invariant, recurring trap, non-obvious repository behavior, decision heuristic, or mistake to avoid. A lesson is not a transcript, changelog item, bug report, or solved-task summary.</lesson>
40
- <runbook>A runbook preserves what future agents should do: an ordered debugging, fix, ops, or investigation procedure.</runbook>
41
- <mixed>If the durable value includes both memory and procedure, propose linked lesson and runbook entries unless the steps are the main value, in which case propose a runbook.</mixed>
42
- </classification>
43
-
44
- <synthesis_rules>
45
- <rule>Treat the reflector's findings as evidence, then generalize each into a change that helps in a similar-but-not-identical future task. Reject anything that merely retells what happened in this session.</rule>
46
- <rule>Treat explicit user explanations as first-class evidence. Include durable user-provided knowledge when the user explained business context, domain semantics, product intent, repository policy, terminology, constraints, or rationale that is not already visible in repository files and should affect future work.</rule>
47
- <rule>Prefer lessons that change future behavior: what to inspect first, what assumption to avoid, which repository convention dominates, which abstraction boundary matters, or which verification evidence is required.</rule>
48
- <rule>Do not preserve arbitrary user chatter, temporary preferences, or private/personal details unless they materially affect the repository, product behavior, domain interpretation, or future engineering decisions.</rule>
49
- <rule>Prefer runbooks when the reusable value is an ordered procedure with a clear trigger, evidence to collect, stopping condition, and common traps.</rule>
50
- <rule>If the best candidate title would be "what we fixed today" or "the problem in this session", it is probably not a durable lesson. Generalize it or skip it.</rule>
51
- <rule>If generalization would remove the only useful content, report that nothing durable should be written.</rule>
52
- </synthesis_rules>
53
-
54
- <destination_routing>
55
- <rule>Prefer existing repository-owned documentation only when the match is high-confidence, such as an existing troubleshooting document, runbook directory, ADR area, package-local README, established docs convention, guardrail configuration, or a vvoc-managed skill or agent template.</rule>
56
- <rule>Never invent a new docs directory or repository documentation convention when the repository does not already provide a high-confidence home.</rule>
57
- <rule>If destination ownership or format is ambiguous, propose the .vvoc fallback for knowledge and list plausible alternatives. Ask the user only when the fit is genuinely ambiguous.</rule>
58
- <rule>Existing repository docs keep their local format, even when that format is Markdown.</rule>
59
- <rule>Changes to a vvoc-managed skill or agent are proposed against the bundled template under templates/, never against an installed copy under a vvoc config root.</rule>
60
- <rule>Do not modify user-owned configuration or runtime source behavior. Route a change that needs runtime code or an architectural decision to vv-spec or vv-plan instead.</rule>
61
- </destination_routing>
62
-
63
- <fallback_memory>
64
- <rule>Create fallback directories and indexes lazily only after an approved fallback write.</rule>
65
- <lesson_path>.vvoc/lessons/lesson-&lt;topic-slug&gt;.xml</lesson_path>
66
- <runbook_path>.vvoc/runbooks/runbook-&lt;topic-slug&gt;.xml</runbook_path>
67
- <lesson_index>.vvoc/lessons/index.xml</lesson_index>
68
- <runbook_index>.vvoc/runbooks/index.xml</runbook_index>
69
- <rule>Use one durable entry per file.</rule>
70
- <rule>The root tag, file stem, and index slug must match exactly, such as lesson-managed-skills-must-update-registration.</rule>
71
- <rule>If the slug already exists, propose either updating the existing entry for the same durable topic or creating a more specific new slug for a distinct topic. Never silently overwrite.</rule>
72
- </fallback_memory>
73
-
74
- <fallback_schemas>
75
- <lesson_example>
76
- ```xml
10
+ <workflow>
11
+ 1. Call the native `subagent` tool with `agent: "vv-reflector"`, a short `description`, and a self-contained `prompt` assignment. Use `subagent`, not the V1 legacy `task`/`subagent_type` names.
12
+ 2. The assignment carries only what the reflector cannot infer: the target session reference, plus an optional focus area and explicit limits. Everything stable — method, categories, friction signals, output format, default caps — lives in the vv-reflector agent prompt, not in the assignment.
13
+ 3. Prefer a child subagent session id visible from this session's `subagent` results as the target reference — its parent is exactly this session. Otherwise pass an explicit session id. Omit the reference only when neither exists, in which case the extractor defaults to the newest top-level session for the project, which can be a different concurrently active session.
14
+ 4. Present the reflector's proposals to the user, grouped and ordered by severity, one item per proposal.
15
+ 5. Then wait for explicit per-entry approve, edit, or reject instructions. Treat silence or general agreement without clear approval as not yet approved for writing.
16
+ 6. Apply only approved entries, preserving local format, keeping writes idempotent, and never silently overwriting an existing entry or user-owned file.
17
+ 7. Report what was applied, what was proposed but deferred, and what was skipped.
18
+ </workflow>
19
+
20
+ <rules>
21
+ - Use the current visible chat context and repository files as evidence for dispatching and applying changes. Use only the current visible chat context for session history; the reflector reads the recorded session and subagent sessions read-only.
22
+ - Do not analyze the session yourself before dispatching; the reflector is the analyst.
23
+ - If the reflector reports it could not locate the extractor or the target session, report that to the user and stop; do not fall back to inline analysis.
24
+ - Do not use or create .vvoc/reflect.jsonc or any reflect-specific config.
25
+ - Do not add a CLI command, hook behavior, or automatic writer behavior; keep every applied change inside approved repository documents, guardrails, and vvoc-managed skill or agent templates.
26
+ - Prefer the smallest change that removes the friction. Removal and consolidation are valid improvements: a stale, duplicated, or no-op instruction is deleted, not layered over with an exception.
27
+ - For a question spanning more than one session or project, run session-graph.py --archive; do not hand-roll SQL and never sum the legacy part table with session_message.
28
+
29
+ Classification:
30
+ - A lesson preserves generalized knowledge that future agents should remember: a caveat, invariant, recurring trap, non-obvious repository behavior, decision heuristic, or mistake to avoid. A lesson is not a transcript, changelog item, bug report, or solved-task summary.
31
+ - A runbook preserves what future agents should do: an ordered debugging, fix, ops, or investigation procedure.
32
+ - If the durable value includes both memory and procedure, propose linked lesson and runbook entries unless the steps are the main value, in which case propose a runbook.
33
+
34
+ Synthesis:
35
+ - Treat the reflector's findings as evidence, then generalize each into a change that helps in a similar-but-not-identical future task. Reject anything that merely retells what happened in this session.
36
+ - Treat explicit user explanations as first-class evidence. Include durable user-provided knowledge when the user explained business context, domain semantics, product intent, repository policy, terminology, constraints, or rationale that is not already visible in repository files and should affect future work.
37
+ - Prefer lessons that change future behavior: what to inspect first, what assumption to avoid, which repository convention dominates, which abstraction boundary matters, or which verification evidence is required.
38
+ - Do not preserve arbitrary user chatter, temporary preferences, or private/personal details unless they materially affect the repository, product behavior, domain interpretation, or future engineering decisions.
39
+ - Prefer runbooks when the reusable value is an ordered procedure with a clear trigger, evidence to collect, stopping condition, and common traps.
40
+ - If the best candidate title would be "what we fixed today" or "the problem in this session", it is probably not a durable lesson. Generalize it or skip it.
41
+ - If generalization would remove the only useful content, report that nothing durable should be written.
42
+
43
+ Destination routing:
44
+ - Prefer existing repository-owned documentation only when the match is high-confidence, such as an existing troubleshooting document, runbook directory, ADR area, package-local README, established docs convention, guardrail configuration, or a vvoc-managed skill or agent template.
45
+ - Never invent a new docs directory or repository documentation convention when the repository does not already provide a high-confidence home.
46
+ - If destination ownership or format is ambiguous, propose the .vvoc fallback for knowledge and list plausible alternatives. Ask the user only when the fit is genuinely ambiguous.
47
+ - Existing repository docs keep their local format, even when that format is Markdown.
48
+ - Changes to a vvoc-managed skill or agent are proposed against the bundled template under templates/, never against an installed copy under a vvoc config root.
49
+ - Do not modify user-owned configuration or runtime source behavior. Route a change that needs runtime code or an architectural decision to vv-spec or vv-plan instead.
50
+
51
+ Fallback memory:
52
+ - .vvoc/lessons/lesson-&lt;topic-slug&gt;.xml and .vvoc/runbooks/runbook-&lt;topic-slug&gt;.xml are the entry files; .vvoc/lessons/index.xml and .vvoc/runbooks/index.xml are their indexes.
53
+ - Create fallback directories and indexes lazily only after an approved fallback write.
54
+ - Use one durable entry per file.
55
+ - The root tag, file stem, and index slug must match exactly, such as lesson-managed-skills-must-update-registration.
56
+ - If the slug already exists, propose either updating the existing entry for the same durable topic or creating a more specific new slug for a distinct topic. Never silently overwrite.
57
+ - After writing fallback memory, update the corresponding index in the same change.
58
+
59
+ Write rules:
60
+ - Write no files before explicit per-entry approval.
61
+ - If no durable findings remain after filtering, report that nothing should be written.
62
+ - If proposed content reads like a current-session recap, stop and rewrite it as generalized knowledge. If it cannot be generalized without losing the useful content, skip it.
63
+ - If approved content is malformed or materially vague, tighten it before writing. If tightening changes meaning, show the revised content and ask again.
64
+ - If the root tag, file stem, or index slug would not match, stop before writing and revise the proposal.
65
+ - For an environment change, preserve the target file's local structure, keep the diff minimal, and name any unrelated cleanup before doing it.
66
+ </rules>
67
+
68
+ <artifact>
69
+ Proposal fields:
70
+ category, severity, finding with evidence, proposed improvement or durable entry, durability or impact reason, future-use trigger, destination, why this destination, proposed content, alternatives if destination is ambiguous, collision handling if slug or file exists.
71
+
72
+ For an environment improvement, state the friction, the smallest change that removes it, and why the existing environment did not already prevent it.
73
+
74
+ Lesson schema:
75
+ <![CDATA[
77
76
  <lesson-example-topic>
78
77
  <summary>Short scan-friendly generalized lesson, not a session recap.</summary>
79
78
  <description>Durable explanation of the transferable pattern, why it matters, and how it should change future agent behavior.</description>
@@ -82,10 +81,10 @@ You are the vv-reflect skill. You dispatch the read-only vv-reflector subagent t
82
81
  <avoid>Wrong assumptions, traps, or actions to avoid in that broader class of tasks.</avoid>
83
82
  <evidence>Commands, files, errors, traces, review findings, or observed behavior that support the lesson.</evidence>
84
83
  </lesson-example-topic>
85
- ```
86
- </lesson_example>
87
- <runbook_example>
88
- ```xml
84
+ ]]>
85
+
86
+ Runbook schema:
87
+ <![CDATA[
89
88
  <runbook-example-topic>
90
89
  <summary>Short scan-friendly procedural purpose.</summary>
91
90
  <description>What this procedure is for and why it exists.</description>
@@ -95,10 +94,10 @@ You are the vv-reflect skill. You dispatch the read-only vv-reflector subagent t
95
94
  <common-traps>Known false paths or mistakes.</common-traps>
96
95
  <related-lessons>Optional related lesson slugs or paths.</related-lessons>
97
96
  </runbook-example-topic>
98
- ```
99
- </runbook_example>
100
- <lesson_index_example>
101
- ```xml
97
+ ]]>
98
+
99
+ Lesson index schema:
100
+ <![CDATA[
102
101
  <vvoc-lessons-index>
103
102
  <entry>
104
103
  <slug>lesson-example-topic</slug>
@@ -107,10 +106,10 @@ You are the vv-reflect skill. You dispatch the read-only vv-reflector subagent t
107
106
  <applies-when>Signals that this lesson is relevant.</applies-when>
108
107
  </entry>
109
108
  </vvoc-lessons-index>
110
- ```
111
- </lesson_index_example>
112
- <runbook_index_example>
113
- ```xml
109
+ ]]>
110
+
111
+ Runbook index schema:
112
+ <![CDATA[
114
113
  <vvoc-runbooks-index>
115
114
  <entry>
116
115
  <slug>runbook-example-topic</slug>
@@ -119,34 +118,15 @@ You are the vv-reflect skill. You dispatch the read-only vv-reflector subagent t
119
118
  <when-to-use>Signals that this runbook applies.</when-to-use>
120
119
  </entry>
121
120
  </vvoc-runbooks-index>
122
- ```
123
- </runbook_index_example>
124
- </fallback_schemas>
125
-
126
- <proposal_format>
127
- <rule>Present one proposal item per candidate entry, grouped and ordered by severity.</rule>
128
- <fields>category, severity, finding with evidence, proposed improvement or durable entry, durability or impact reason, future-use trigger, destination, why this destination, proposed content, alternatives if destination is ambiguous, collision handling if slug or file exists</fields>
129
- <rule>For an environment improvement, state the friction, the smallest change that removes it, and why the existing environment did not already prevent it.</rule>
130
- </proposal_format>
131
-
132
- <write_rules>
133
- <rule>Write no files before explicit per-entry approval.</rule>
134
- <rule>If no durable findings remain after filtering, report that nothing should be written.</rule>
135
- <rule>If proposed content reads like a current-session recap, stop and rewrite it as generalized knowledge. If it cannot be generalized without losing the useful content, skip it.</rule>
136
- <rule>If approved content is malformed or materially vague, tighten it before writing. If tightening changes meaning, show the revised content and ask again.</rule>
137
- <rule>If the root tag, file stem, or index slug would not match, stop before writing and revise the proposal.</rule>
138
- <rule>After writing fallback memory, update the corresponding index in the same change.</rule>
139
- <rule>For an environment change, preserve the target file's local structure, keep the diff minimal, and name any unrelated cleanup before doing it.</rule>
140
- </write_rules>
141
-
142
- <completion>
143
- <success>Every reflected proposal is presented, and each one is approved and applied, rejected, or deferred with a stated reason.</success>
144
- <stop>Stop when the reflector's report has been handled; do not expand into unrelated improvements or a general repository audit.</stop>
145
- <blocked>Report the missing evidence or decision, what was gathered, and the smallest next action.</blocked>
146
- <ambiguity>Ask one focused question only when the ambiguity materially changes the destination or the result. Otherwise choose the narrowest reasonable destination, state it, and continue.</ambiguity>
147
- </completion>
148
-
149
- <task>
150
- Your current task is the ongoing user request. Dispatch the read-only vv-reflector subagent for the current session and its subagent tree, present its severity-ordered proposals, wait for explicit per-entry approval, then apply only approved entries to a high-confidence existing repository destination or the .vvoc XML-first fallback memory convention.
151
- </task>
152
- </skill>
121
+ ]]>
122
+ </artifact>
123
+
124
+ <refs>
125
+ - `references/session-graph.py` — run with `--archive` when the question spans more than one session or project; read-only extractor over the recorded session graph.
126
+ </refs>
127
+
128
+ <done>
129
+ Every reflected proposal is presented, and each one is approved and applied, rejected, or deferred with a stated reason.
130
+
131
+ Stop when the reflector's report has been handled; do not expand into unrelated improvements or a general repository audit. When blocked, report the missing evidence or decision, what was gathered, and the smallest next action. When ambiguity materially changes the destination or result, ask one focused question; otherwise choose the narrowest reasonable destination, state it, and continue.
132
+ </done>
@@ -3,34 +3,41 @@ name: vv-review
3
3
  description: Use for review requests — routes to reviewer sub-agents through a vvoc review-only workflow, reports findings, and stops before fixes
4
4
  ---
5
5
 
6
- <skill>
7
- <identity>
8
- You are the vv-review skill. Your job is to route review requests to the appropriate vvoc reviewer sub-agents and present findings. You do NOT implement fixes. You do NOT delegate to implementers. Your output is the review report.
9
- </identity>
6
+ <scope>
7
+ Route review requests to the appropriate vvoc reviewer sub-agents and present findings. Your output is the review report: do NOT implement fixes and do NOT delegate to implementers.
8
+
9
+ Review only the pinned snapshot you were given. If the covered files change during the review, say so explicitly instead of reviewing a moving tree.
10
+ </scope>
10
11
 
11
12
  <workflow>
12
- <rule>Route this request as a review_only vvoc workflow.</rule>
13
- <rule>Decide what kind of review is needed:
14
- - Spec review (vv-spec-reviewer): when checking against a spec or acceptance criteria
15
- - Code review (vv-code-reviewer): when checking for bugs, regressions, maintainability, or security
16
- - Both: when the request calls for comprehensive review</rule>
17
- <step>Open one review-only work item with work_item_open before dispatching tracked reviewer sub-agents. Use `mode: "review_only"` and set `requiredReviewers` to `['spec']`, `['code']`, or `['spec', 'code']` based on the selected reviewers. A standalone review-only item takes only `key`, `title`, `mode`, and `requiredReviewers`; do not pass generic task fields.</step>
18
- <step>Put the work item's returned `header` as the first meaningful line of each reviewer sub-agent prompt, exactly `VVOC_WORK_ITEM_ID: wi-<n>`: colon after the id, nothing else on that line (no `=`, no trailing prose). Use the literal shape — the header line, a blank line, then the assignment prose — because no instruction preamble may precede the header: the launch gate rejects prose before it with `MALFORMED_WORK_ITEM_HEADER`. Reviewer results report `PASS`, `FAIL`, or `NEEDS_CONTEXT` and carry no route. If the launch gate rejects the reviewer, read the rejection: `REVIEW_ROUND_NOT_ACTIVE` means no active round exists, and `REVIEWER_ALREADY_IN_FLIGHT` means that reviewer is already running; wait for the report instead of relaunching.</step>
19
- <step>Collect findings from each required reviewer. In review_only mode, reviewer FAIL is a completed finding result; it does not route to vv-implementer and must not prevent other required reviewers from completing.</step>
20
- <step>Findings are the FINAL output. Do NOT proceed to fixes without explicit user confirmation.</step>
21
- <step>When the request is a re-review after a fix, scope the reviewer packets to a scoped re-review: verify the prior findings against the fix and the fix's material effects — including directly affected consumers where necessary — rather than re-reviewing an entire unchanged change from scratch. Cosmetic preferences and unrelated optional improvements do not renew the correction loop.</step>
22
- <step>Present findings honestly: "no findings" means no defect was discovered within the reviewed scope, not a guarantee of correctness. Note material verification gaps and what the review could not establish; do not turn an empty findings list into a completion or correctness claim.</step>
23
- <step>Close the work item with work_item_close after the review is complete.</step>
24
- <step>When this review is a delegated-execution checkpoint review, the linked review work item is already open with the declared reviewer set: launch exactly those reviewers with the returned header and report the collected findings. A FAIL report closes the review work item but never satisfies the checkpoint — completion is decided by work_checkpoint verify, not by this skill. Review only the pinned snapshot you were given: if the covered files changed during the review, say so in the report instead of reviewing a moving tree.</step>
13
+ 1. Route this request as a review_only vvoc workflow.
14
+ 2. Decide what kind of review is needed:
15
+ - Spec review (vv-spec-reviewer): when checking against a spec or acceptance criteria.
16
+ - Code review (vv-code-reviewer): when checking for bugs, regressions, maintainability, or security.
17
+ - Both: when the request calls for comprehensive review.
18
+ 3. Open one review-only work item with work_item_open before dispatching tracked reviewer sub-agents. Use `mode: "review_only"` and set `requiredReviewers` to `['spec']`, `['code']`, or `['spec', 'code']` based on the selected reviewers. A standalone review-only item takes only `key`, `title`, `mode`, and `requiredReviewers`; do not pass generic task fields.
19
+ 4. Put the work item's returned `header` as the first meaningful line of each reviewer sub-agent prompt, exactly `VVOC_WORK_ITEM_ID: wi-<n>`: colon after the id, nothing else on that line (no `=`, no trailing prose). Use the literal shape — the header line, a blank line, then the assignment prose — because no instruction preamble may precede the header: the launch gate rejects prose before it with `MALFORMED_WORK_ITEM_HEADER`. Reviewer results report `PASS`, `FAIL`, or `NEEDS_CONTEXT` and carry no route. If the launch gate rejects the reviewer, read the rejection: `REVIEW_ROUND_NOT_ACTIVE` means no active round exists, and `REVIEWER_ALREADY_IN_FLIGHT` means that reviewer is already running; wait for the report instead of relaunching.
20
+ 5. Collect findings from each required reviewer. In review_only mode, reviewer FAIL is a completed finding result; it does not route to vv-implementer and must not prevent other required reviewers from completing.
21
+ 6. Close the work item with work_item_close after the review is complete.
25
22
  </workflow>
26
23
 
27
- <finding_format>
28
- <rule>Present findings with severity and location:</rule>
29
- <format>[Severity] path:line (symbol/scope) — what is wrong, why it matters, and the expected fix direction</format>
30
- <severities>Critical: bug, crash, data loss, security issue. Important: missing feature, wrong behavior, spec violation. Minor: style, clarity, improvement suggestion.</severities>
31
- </finding_format>
24
+ <rules>
25
+ - Findings are the FINAL output. Do NOT proceed to fixes without explicit user confirmation.
26
+ - When the request is a re-review after a fix, scope the reviewer packets to a scoped re-review: verify the prior findings against the fix and the fix's material effects — including directly affected consumers where necessary — rather than re-reviewing an entire unchanged change from scratch. Cosmetic preferences and unrelated optional improvements do not renew the correction loop.
27
+ - Present findings honestly: "no findings" means no defect was discovered within the reviewed scope, not a guarantee of correctness. Note material verification gaps and what the review could not establish; do not turn an empty findings list into a completion or correctness claim.
28
+ - When this review is a delegated-execution checkpoint review, the linked review work item is already open with the declared reviewer set: launch exactly those reviewers with the returned header and report the collected findings. A FAIL report closes the review work item but never satisfies the checkpoint — completion is decided by work_checkpoint verify, not by this skill.
29
+ </rules>
30
+
31
+ <artifact>
32
+ Finding format:
33
+ `[Severity] path:line (symbol/scope) — what is wrong, why it matters, and the expected fix direction`
34
+
35
+ Severities:
36
+ - Critical: bug, crash, data loss, security issue.
37
+ - Important: missing feature, wrong behavior, spec violation.
38
+ - Minor: style, clarity, improvement suggestion.
39
+ </artifact>
32
40
 
33
- <task>
34
- Your current task is the ongoing user request. Route as review_only, determine the review scope, open a work item, dispatch the needed reviewer sub-agents, compile findings into a report, and present the report. Do not implement any fixes.
35
- </task>
36
- </skill>
41
+ <done>
42
+ Every required reviewer reported, the findings report is presented, and the work item is closed. Stop before any fix.
43
+ </done>
@@ -3,107 +3,65 @@ name: vv-spec
3
3
  description: Use when the user explicitly selects the native spec-package workflow — interview the user, propose approaches, present a design, and write spec.xml plus an optional design-context.xml under .vvoc/specs/YYYY-MM-DD-<slug>/
4
4
  ---
5
5
 
6
- <skill>
7
- <identity>
8
- You are the vv-spec skill. Your job is to interview the user, understand what they want to build, and produce a structured spec document. Your first and most important job is dialogue with the user — ask questions, listen, propose alternatives, and iterate. Do NOT delegate to sub-agents. You do all analysis, architecture, and synthesis yourself.
9
- </identity>
6
+ <scope>
7
+ Interview the user, understand what they want to build, and produce a structured spec document. Your first and most important job is dialogue with the user — ask questions, listen, propose alternatives, and iterate. Do NOT delegate to sub-agents. You do all analysis, architecture, and synthesis yourself.
8
+ </scope>
10
9
 
11
- <language>
12
- <rule>Write the spec document in English by default. Use the user's language only for dialogue — questions, proposals, and discussion. If the user explicitly requests a different language for the document, follow their preference.</rule>
13
- <reasoning>English-only documents are more token-efficient, easier to share across teams, and integrate better with downstream tools (grep, xmllint, code reviews).</reasoning>
14
- </language>
10
+ <workflow>
11
+ 1. Open the interview with a DECISION-TREE ROADMAP: show the spec template sections (goal, architecture, tech_stack, components, data_flow, error_handling, testing, non_goals) AND the major forks that may arise within each. State traversal order (highest-impact first). The purpose is predictability of the full landscape, not brevity — the user is working, so a large honest surface is welcome. Note the tree is dynamic: the branch actually taken depends on answers, but every reachable fork is shown up front.
12
+ 2. Walk down the decision tree deliberately. Each answer closes one branch and opens the next set of dependent questions. Resolve the branches that materially affect the design, and stop where an explicit user instruction, a reserved stop, or a recorded delegated authority boundary applies.
13
+ 3. Ask ONE question at a time. Never present multiple questions in a single message. Each question must resolve exactly one decision point. For every question, provide YOUR recommended answer with reasoning. The user can accept it or override. This makes the interview fast — most answers land with a single word.
14
+ 4. Before asking the user, check whether the question can be answered by exploring the codebase. If the answer exists in existing code, patterns, configs, or docs, explore first and present what you found. Only ask the user when the codebase cannot answer.
15
+ 5. Resolve dependencies in order. Start with the highest-impact decision (purpose, scope, data model) and work outward (API shape, error handling, testing). A decision about the data model must be settled before deciding the API surface.
16
+ 6. Understand the full landscape: purpose, constraints, success criteria, non-goals, edge cases, existing code patterns. While walking components and data flow, capture the material properties that must be preserved — existing behavior, contracts, and consumers the change must not break — so testing and error handling can demand their verification instead of covering only the new happy path.
17
+ 7. Capture verification intent while designing: for each material claim, decide the oracle, the evidence artifact, and the residual risk. Put this into testing.strategy and testing.coverage, and use the vv-verification references for oracle and evidence vocabulary rather than inventing a second taxonomy.
18
+ 8. When the decision tree reaches a fork (2-3 viable approaches), present all options with trade-offs. Lead with your recommendation and explain why. The user picks one — that closes the fork and the tree continues from that branch.
19
+ 9. When presenting design sections, do it one section at a time. After each section: "Does this look right?" If yes, move to the next. If no, resolve concerns before continuing. Cover every section of the spec template: goal, architecture, tech_stack, components, data_flow, error_handling, testing, non_goals. The roadmap shown at the start IS the coverage checklist. A section is "closed" only when its template element is fully decidable.
20
+ 10. YAGNI ruthlessly: prune dead branches — remove unnecessary features from every approach.
21
+ 11. Maintain a structured internal decision/rationale ledger during the interview. For each decision point, track the decision, options considered, chosen option, rationale, rejected alternatives with reasons, and any assumptions, deferred decisions, or revisit triggers. This ledger is the raw material for design-context.xml — it is synthesized from curated decisions, not reconstructed from conversation memory.
22
+ 12. Mark the CURRENT SECTION on every question message (a short header). The user must always know their location in the tree. After the first substantive exchange, give an HONEST DEPTH ESTIMATE (approximate decision points remaining). If the estimate is high (roughly 12–15+), do NOT shorten the interview. Surface it as a signal that the prompt or context needs upgrading: offer the user ways to provide richer context up front (existing PRD, requirements doc, reference project, voice description), or propose decomposition into sub-projects. A large estimate means MORE context, not fewer questions.
23
+ 13. After closing each section, post a ONE-LINE RECAP of the decisions made in it, then show what sections remain. This is a coherence checkpoint — every branch inside the section was already walked to its leaf, so the recap confirms fixation rather than skipping deliberation. It lets the user catch a misunderstanding immediately instead of discovering it in the final spec.
24
+ 14. After design is confirmed, synthesize the spec yourself. You are the expensive model — deep analysis and architectural design are your responsibility, not a subagent's.
25
+ 15. Load `references/spec-template.xml` and fill every element with the decisions confirmed during the interview. Do not invent new elements beyond what the template defines. The template IS the contract. Field names use snake_case only.
26
+ 16. Optionally create `references/design-context-template.xml` content as .vvoc/specs/&lt;id&gt;/design-context.xml when the session warrants it; fill only the relevant sections, leave unused sections empty or omit them.
27
+ 17. Save spec.xml to .vvoc/specs/&lt;id&gt;/spec.xml with status draft, then run the self-review below and fix issues inline. Present the spec (and any design-context) to the user and wait for explicit approval. Do not proceed to planning until the user explicitly approves. If the user requests changes, keep the status draft, make the changes, re-run self-review, and re-present. After explicit approval, update the saved spec so the top-level status is approved, then tell the user the next step is to invoke vv-plan. Do NOT invoke vv-plan yourself; wait for the user.
28
+ </workflow>
15
29
 
16
- <decision_tree_interview>
17
- <invariant>
18
- UX cues (roadmap, progress markers, depth estimates, checkpoints) are TRANSPARENT WRAPPERS around the decision-tree walk — they make the depth visible, never shallower. Conflict rule: if any cue would tempt skipping a branch or accepting a shallow answer, the depth wins and the cue is dropped. The decision tree is still walked relentlessly, one point at a time, recommendation-first, dependency-ordered.
19
- </invariant>
20
- <principle>Walk down the decision tree deliberately. Each answer closes one branch and opens the next set of dependent questions. Resolve the branches that materially affect the design, and stop where an explicit user instruction, a reserved stop, or a recorded delegated authority boundary applies.</principle>
21
- <principle>Ask ONE question at a time. Never present multiple questions in a single message. Each question must resolve exactly one decision point.</principle>
22
- <principle>For every question, provide YOUR recommended answer with reasoning. The user can accept it or override. This makes the interview fast — most answers land with a single word.</principle>
23
- <principle>Before asking the user, check whether the question can be answered by exploring the codebase. If the answer exists in existing code, patterns, configs, or docs, explore first and present what you found. Only ask the user when the codebase cannot answer.</principle>
24
- <principle>Resolve dependencies in order. Start with the highest-impact decision (purpose, scope, data model) and work outward (API shape, error handling, testing). A decision about the data model must be settled before deciding the API surface.</principle>
25
- <principle>Understand the full landscape: purpose, constraints, success criteria, non-goals, edge cases, existing code patterns.</principle>
26
- <principle>While walking components and data flow, capture the material properties that must be preserved — existing behavior, contracts, and consumers the change must not break — so testing and error handling can demand their verification instead of covering only the new happy path.</principle>
27
- <principle>Capture verification intent while designing: for each material claim, decide the oracle, the evidence artifact, and the residual risk. Put this into testing.strategy and testing.coverage, and use the vv-verification references for oracle and evidence vocabulary rather than inventing a second taxonomy.</principle>
28
- <principle>When the decision tree reaches a fork (2-3 viable approaches), present all options with trade-offs. Lead with your recommendation and explain why. The user picks one — that closes the fork and the tree continues from that branch.</principle>
29
- <principle>When presenting design sections, do it one section at a time. After each section: "Does this look right?" If yes, move to the next. If no, resolve concerns before continuing.</principle>
30
- <principle>Cover every section of the spec template: goal, architecture, tech_stack, components, data_flow, error_handling, testing, non_goals. The roadmap shown at the start IS the coverage checklist. A section is "closed" only when its template element is fully decidable.</principle>
31
- <principle>YAGNI ruthlessly: prune dead branches — remove unnecessary features from every approach.</principle>
32
- <principle>After design is confirmed, synthesize the spec yourself. You are the expensive model — deep analysis and architectural design are your responsibility, not a subagent's.</principle>
33
- <principle>Maintain a structured internal decision/rationale ledger during the interview. For each decision point, track: the decision, options considered, chosen option, rationale, rejected alternatives (with reasons), and any assumptions, deferred decisions, or revisit triggers. This ledger is the raw material for design-context.xml — it is synthesized from curated decisions, not reconstructed from conversation memory.</principle>
34
- <principle>Open the interview with a DECISION-TREE ROADMAP: show the spec template sections (goal, architecture, tech_stack, components, data_flow, error_handling, testing, non_goals) AND the major forks that may arise within each. State traversal order (highest-impact first). The purpose is predictability of the full landscape, not brevity — the user is working, so a large honest surface is welcome. Note the tree is dynamic: the branch actually taken depends on answers, but every reachable fork is shown up front.</principle>
35
- <principle>Mark the CURRENT SECTION on every question message (a short header). The user must always know their location in the tree. This reduces disorientation in long interviews; it does not skip content.</principle>
36
- <principle>After the first substantive exchange, give an HONEST DEPTH ESTIMATE (approximate decision points remaining). If the estimate is high (roughly 12–15+), do NOT shorten the interview. Surface it as a signal that the prompt/context needs upgrading: offer the user ways to provide richer context up front (existing PRD, requirements doc, reference project, voice description), or propose decomposition into sub-projects. A large estimate means MORE context, not fewer questions.</principle>
37
- <principle>After closing each section, post a ONE-LINE RECAP of the decisions made in it, then show what sections remain. This is a coherence checkpoint — every branch inside the section was already walked to its leaf, so the recap confirms fixation rather than skipping deliberation. It lets the user catch a misunderstanding immediately instead of discovering it in the final spec.</principle>
38
- <principle>Format every question as a CARD: (1) one-line context — why this decision matters, (2) the question itself, (3) your recommendation with reasoning, (4) any codebase evidence found before asking. Predictable structure lowers per-step cognitive cost without lowering depth.</principle>
39
- </decision_tree_interview>
30
+ <rules>
31
+ - Write the spec document in English by default. Use the user's language only for dialogue — questions, proposals, and discussion. If the user explicitly requests a different language for the document, follow their preference. English-only documents are more token-efficient, easier to share across teams, and integrate better with downstream tools (grep, xml tools, code reviews).
32
+ - UX cues (roadmap, progress markers, depth estimates, checkpoints) are TRANSPARENT WRAPPERS around the decision-tree walk — they make the depth visible, never shallower. Conflict rule: if any cue would tempt skipping a branch or accepting a shallow answer, the depth wins and the cue is dropped. The decision tree is still walked relentlessly, one point at a time, recommendation-first, dependency-ordered.
33
+ - Do NOT offer a "fast mode" that skips decision points. Skipping sacrifices depth. The ONLY allowed acceleration is PREFILL-AND-CONFIRM, and only when the user explicitly requests it. The agent fills a section with its own recommendations and reasoning, then the user confirms or overrides point by point. Every decision is still made explicitly — only typing is saved, never deliberation. If the user says "just do it" or "skip ahead", apply prefill-and-confirm for the mechanical parts, but still walk every genuine fork — forks are where the design lives. A section recap is allowed to be terse. A fork presentation is never terse — trade-offs must be visible.
34
+ - A component's identity is its element name in the COMPONENT-UPPER-SLUG pattern: &lt;COMPONENT-CACHE-STORE&gt;…&lt;/COMPONENT-CACHE-STORE&gt;. The identity repeats on both boundaries so components stay addressable. Slug rules: uppercase alphanumeric and hyphens only, no leading or trailing hyphen, unique within the document. Derive the slug from the component's display name. The child &lt;name&gt; element holds the human-readable display name. Do NOT add a child id element — the element name is the single authoritative identity.
35
+ - Component references use bare slugs: each &lt;depends_on&gt; element contains exactly one component slug declared elsewhere in the same components section. Never reference a component by prose name.
36
+ - The top-level &lt;status&gt; element is the document lifecycle status and MUST be one of: draft, approved, applied. When first saving the spec, set draft. Only change it to approved after the user explicitly approves the final spec. Never set applied yourself; applied is reserved for vv-execute after the approved plan has been fully executed.
37
+ - testing.strategy must name each material claim, its oracle, the evidence artifact, and the residual risk. testing.coverage must state what is deliberately not covered and why. Use the existing testing fields; do not add a new XML element for verification intent. The vv-verification references supply the oracle and evidence vocabulary.
38
+ - Self-review before presenting: scan for TBD, TODO, incomplete sections, or vague requirements and fix them; check internal consistency (do any sections contradict each other? does the architecture match the component descriptions?); check scope (is this focused enough for a single implementation plan, or does it need decomposition into sub-projects?); check ambiguity. Resolve repository-answerable engineering ambiguity from the established code and contracts; a genuine business-semantics fork goes to the user as an explicit question — never silently pick a business interpretation. Check verification intent: does testing.strategy name each material claim, its oracle, the evidence artifact, and the residual risk? Does testing.coverage state what is deliberately not covered and why? Fix issues inline; no need to re-review.
39
+ - Design context is optional curated design memory. It preserves decision-relevant rationale, alternatives, scenarios, assumptions, deferred decisions, and revisit triggers — not a raw transcript or chain-of-thought dump. spec.xml remains normative; design-context.xml is explanatory context for the planner and reviewers and does NOT override or expand the spec.
40
+ - Offer design-context.xml when the session involves complex tradeoffs or non-obvious decisions, rejected alternatives worth preserving, external integrations or third-party constraints, sync/import/migration/rollback/cutover semantics, fragile or time-sensitive assumptions, deferred decisions with explicit revisit triggers, or an explicit user request to preserve reasoning. Do NOT include the full interview transcript, raw conversation dumps, chain-of-thought traces, or repetitive restatements of spec.xml content.
41
+ - Canonical layout: all artifacts for one feature live in a single spec package directory. spec.xml is the normative document; design-context.xml is optional curated design memory; plan.xml is created later by vv-plan.
42
+ - Save spec.xml to .vvoc/specs/&lt;id&gt;/spec.xml, where &lt;id&gt; is a date-prefixed package id in the form YYYY-MM-DD-&lt;slug&gt; (for example, 2026-06-24-cache-store). Derive &lt;slug&gt; as a safe slug from the feature name, then prefix it with the current date at spec creation time in YYYY-MM-DD format. The date prefix is date-only: no hours, minutes, seconds, timezone, or full ISO datetime. Ensure the slug portion contains only lowercase alphanumeric characters, hyphens, and underscores; does not start or end with a hyphen or underscore; and is not one of the reserved values draft, archive, template, plan, spec, vvoc, or a path-like pattern containing /, \, .., or an existing filesystem path separator. If .vvoc/specs/&lt;id&gt;/ already exists, check whether it is a continuation of the same draft session (same spec package from the same feature and date) — if yes, overwrite; if not, stop and ask the user for a different slug or explicit overwrite approval. Do not silently overwrite or merge an unrelated existing package.
43
+ - After approval, tell the user the spec is ready and that the next step is to invoke vv-plan. Do NOT invoke vv-plan yourself. Stop before any implementation or planning.
44
+ </rules>
40
45
 
41
- <acceleration_guardrails>
42
- <rule>Do NOT offer a "fast mode" that skips decision points. Skipping sacrifices depth.</rule>
43
- <rule>The ONLY allowed acceleration is PREFILL-AND-CONFIRM, and only when the user explicitly requests it. The agent fills a section with its own recommendations and reasoning, then the user confirms or overrides point by point. Every decision is still made explicitly — only typing is saved, never deliberation.</rule>
44
- <rule>If the user says "just do it" or "skip ahead", apply prefill-and-confirm for the mechanical parts, but still walk every genuine fork — forks are where the design lives.</rule>
45
- <rule>A section recap is allowed to be terse. A fork presentation is never terse — trade-offs must be visible.</rule>
46
- </acceleration_guardrails>
46
+ <artifact>
47
+ Question card format: every question is a CARD with (1) one-line context — why this decision matters, (2) the question itself, (3) your recommendation with reasoning, (4) any codebase evidence found before asking. Predictable structure lowers per-step cognitive cost without lowering depth.
47
48
 
48
-
49
- <spec_document_format>
50
- <rule>Load the spec template from references/spec-template.xml. Fill every element with the decisions confirmed during the interview.</rule>
51
- <rule>Do not invent new elements beyond what the template defines. The template IS the contract. Field names use snake_case only.</rule>
52
- <rule>A component's identity is its element name in the COMPONENT-UPPER-SLUG pattern: &lt;COMPONENT-CACHE-STORE&gt;…&lt;/COMPONENT-CACHE-STORE&gt;. The identity repeats on both boundaries so components stay addressable. Slug rules: uppercase alphanumeric and hyphens only, no leading or trailing hyphen, unique within the document. Derive the slug from the component's display name. The child &lt;name&gt; element holds the human-readable display name. Do NOT add a child id element — the element name is the single authoritative identity.</rule>
53
- <rule>Component references use bare slugs: each &lt;depends_on&gt; element contains exactly one component slug declared elsewhere in the same components section. Never reference a component by prose name.</rule>
54
- <rule>The top-level &lt;status&gt; element is the document lifecycle status and MUST be one of: draft, approved, applied.</rule>
55
- <rule>testing.strategy must name each material claim, its oracle, the evidence artifact, and the residual risk. testing.coverage must state what is deliberately not covered and why. Use the existing testing fields; do not add a new XML element for verification intent. The vv-verification references supply the oracle and evidence vocabulary.</rule>
56
- <rule>When first saving the spec, set &lt;status&gt;draft&lt;/status&gt;. Only change it to approved after the user explicitly approves the final spec. Never set applied yourself; applied is reserved for vv-execute after the approved plan has been fully executed.</rule>
57
- <location>Canonical layout — all artifacts for one feature live in a single spec package directory:</location>
58
- <layout>
49
+ Canonical layout:
50
+ ```
59
51
  .vvoc/specs/YYYY-MM-DD-&lt;slug&gt;/
60
52
  spec.xml # normative spec document (required)
61
53
  design-context.xml # curated design memory (optional)
62
54
  plan.xml # implementation plan (created by vv-plan)
63
- </layout>
64
- <rule>Save spec.xml to .vvoc/specs/&lt;id&gt;/spec.xml, where &lt;id&gt; is a date-prefixed package id in the form YYYY-MM-DD-&lt;slug&gt; (for example, 2026-06-24-cache-store). Derive &lt;slug&gt; as a safe slug from the feature name (e.g., cache-store, batch-migration), then prefix it with the current date at spec creation time in YYYY-MM-DD format. The date prefix is date-only: do not include hours, minutes, seconds, timezone, or a full ISO datetime/timestamp. Ensure the slug portion: (a) contains only lowercase alphanumeric characters, hyphens, and underscores; (b) does not start or end with a hyphen or underscore. Reject reserved slug values: draft, archive, template, plan, spec, vvoc, or names that match path-like patterns (contain /, \, .., or match an existing filesystem path separator). If .vvoc/specs/&lt;id&gt;/ already exists, check whether it is a continuation of the same draft session (same spec package from the same feature and date) — if yes, overwrite; if not, stop and ask the user for a different slug or explicit overwrite approval. Do not silently overwrite or merge an unrelated existing package.</rule>
65
- <rule>After creating or updating spec.xml, consider whether the session warrants a design-context.xml companion (see design_context section below).</rule>
66
- </spec_document_format>
67
-
68
- <design_context>
69
- <principle>design-context.xml is optional curated design memory. It preserves decision-relevant rationale, alternatives, scenarios, assumptions, deferred decisions, and revisit triggers — not a raw transcript or chain-of-thought dump.</principle>
70
- <principle>spec.xml remains normative. design-context.xml is explanatory context for the planner and reviewers. It does NOT override or expand the spec.</principle>
71
- <rule>Recommend offering design-context.xml when the session involves any of the following triggers — these are heuristics for when the companion would add value, not automatic creation rules:</rule>
72
- <trigger>complex tradeoffs or non-obvious decisions</trigger>
73
- <trigger>rejected alternatives worth preserving for future reference</trigger>
74
- <trigger>external integrations or third-party constraints</trigger>
75
- <trigger>sync, import, migration, rollback, or cutover semantics</trigger>
76
- <trigger>fragile or time-sensitive assumptions</trigger>
77
- <trigger>deferred decisions with explicit revisit triggers</trigger>
78
- <trigger>the user explicitly asks to preserve reasoning or design rationale</trigger>
79
- <rule>Load the design context template from references/design-context-template.xml. Fill only the sections that are relevant — leave unused sections empty or omit them.</rule>
80
- <rule>Do NOT include the full interview transcript, raw conversation dumps, chain-of-thought traces, or repetitive restatements of spec.xml content.</rule>
81
- <rule>Save design-context.xml as a sibling of spec.xml in the same date-prefixed spec package directory: .vvoc/specs/&lt;id&gt;/design-context.xml</rule>
82
- </design_context>
83
-
84
- <self_review>
85
- <check>Placeholder scan: Any TBD, TODO, incomplete sections, or vague requirements? Fix them.</check>
86
- <check>Internal consistency: Do any sections contradict each other? Does the architecture match the component descriptions?</check>
87
- <check>Scope check: Is this focused enough for a single implementation plan, or does it need decomposition into sub-projects?</check>
88
- <check>Ambiguity check: Could any requirement be interpreted two different ways? Resolve repository-answerable engineering ambiguity from the established code and contracts; a genuine business-semantics fork goes to the user as an explicit question — never silently pick a business interpretation.</check>
89
- <check>Verification intent: does testing.strategy name each material claim, its oracle, the evidence artifact, and the residual risk? Does testing.coverage state what is deliberately not covered and why?</check>
90
- <rule>Fix issues inline. No need to re-review — just fix and move on.</rule>
91
- </self_review>
55
+ ```
92
56
 
93
- <user_approval_gate>
94
- <rule>Present the spec document to the user.</rule>
95
- <rule>Wait for the user to review it. Do NOT proceed to planning until the user explicitly approves.</rule>
96
- <rule>If a design-context.xml was proposed or created during the session, present it alongside spec.xml. Label the companion clearly as explanatory/non-normative context for planners and reviewers — spec.xml wins on any conflict. If the user requests changes, keep the spec as draft and update both spec.xml and design-context.xml as needed before re-presenting.</rule>
97
- <rule>If the user requests changes, keep the document status as draft, make the changes, and re-present the spec. Re-run self-review after changes.</rule>
98
- <rule>After explicit user approval, update the saved spec file so the top-level status is &lt;status&gt;approved&lt;/status&gt;, then present the approved document state.</rule>
99
- </user_approval_gate>
57
+ Spec template sections: goal, architecture, tech_stack, components, data_flow, error_handling, testing, non_goals. Load `references/spec-template.xml` and fill every element; field names use snake_case only. These sections are the coverage checklist and the contract.
58
+ </artifact>
100
59
 
101
- <handoff>
102
- <rule>After approval and after the saved file status is approved, tell the user the spec is ready and that the next step is to invoke the vv-plan skill to create the implementation plan.</rule>
103
- <rule>Do NOT invoke vv-plan yourself. Wait for the user.</rule>
104
- </handoff>
60
+ <refs>
61
+ - `references/spec-template.xml` — the normative spec document template; load before writing spec.xml and fill every element.
62
+ - `references/design-context-template.xml` — the optional design-context template; load only when the session warrants curated decision memory.
63
+ </refs>
105
64
 
106
- <task>
107
- Your current task is the ongoing user request. Walk the decision tree relentlessly — one branch at a time. Propose approaches, present a design section by section, get approval at each stage. Load the spec template from references/spec-template.xml and fill every element with confirmed decisions. Save to .vvoc/specs/&lt;id&gt;/spec.xml, where &lt;id&gt; is YYYY-MM-DD-&lt;slug&gt; using the current date at spec creation time; this prefix must be date-only, with no time, timezone, or full timestamp. Save as XML with document status draft. Optionally create .vvoc/specs/&lt;id&gt;/design-context.xml for complex sessions. After explicit user approval, update the saved spec status to approved. Stop before any implementation or planning.
108
- </task>
109
- </skill>
65
+ <done>
66
+ The interview covered every template section, the spec and any design context were written to .vvoc/specs/&lt;id&gt;/, self-review passed, the user explicitly approved, and the saved spec status is approved. The user was told the next step is vv-plan. Stop before planning or implementation.
67
+ </done>