@osovv/vv-opencode 2.7.0 → 2.8.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 (39) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/README.md +6 -3
  3. package/dist/lib/managed-skills.d.ts +1 -1
  4. package/dist/lib/managed-skills.js +5 -2
  5. package/dist/lib/managed-skills.js.map +1 -1
  6. package/package.json +1 -1
  7. package/schemas/vvoc/v3.json +1 -1
  8. package/templates/skills/vv-execute/SKILL.md +183 -291
  9. package/templates/skills/vv-execute/references/tool-contracts.md +1 -1
  10. package/templates/skills/vv-handoff/SKILL.md +39 -50
  11. package/templates/skills/vv-plan/SKILL.md +97 -153
  12. package/templates/skills/vv-plan/references/plan-template.xml +5 -0
  13. package/templates/skills/vv-reflect/SKILL.md +91 -111
  14. package/templates/skills/vv-review/SKILL.md +33 -26
  15. package/templates/skills/vv-spec/SKILL.md +51 -90
  16. package/templates/skills/vv-spec/references/spec-template.xml +6 -0
  17. package/templates/skills/vv-ui-design-principles/SKILL.md +46 -0
  18. package/templates/skills/{vv-design-principles → vv-ui-design-principles}/references/slop-tells.md +9 -0
  19. package/templates/skills/vv-verification/SKILL.md +67 -0
  20. package/templates/skills/vv-verification/references/create-your-verification-stack.md +201 -0
  21. package/templates/skills/vv-verification/references/evidence.md +110 -0
  22. package/templates/skills/vv-verification/references/formal.md +86 -0
  23. package/templates/skills/vv-verification/references/maintenance.md +88 -0
  24. package/templates/skills/vv-verification/references/oracles.md +110 -0
  25. package/templates/skills/vv-verification/references/strategy.md +126 -0
  26. package/templates/skills/vv-write-for-agents/SKILL.md +45 -0
  27. package/templates/skills/vv-write-for-agents/references/compilation.md +66 -0
  28. package/templates/skills/vv-write-for-agents/references/session.md +44 -0
  29. package/templates/skills/vv-write-for-agents/references/structure.md +35 -0
  30. package/templates/skills/vv-write-for-agents/references/validation.md +42 -0
  31. package/templates/skills/vv-write-for-humans/SKILL.md +56 -0
  32. package/templates/skills/vv-write-for-humans/references/fidelity.md +41 -0
  33. package/templates/skills/vv-write-for-humans/references/genres.md +38 -0
  34. package/templates/skills/vv-write-for-humans/references/patterns.md +39 -0
  35. package/templates/skills/vvoc-usage-analytics/SKILL.md +45 -43
  36. package/templates/skills/vvoc-usage-analytics/references/opencode-db-queries.md +12 -3
  37. package/templates/skills/vv-design-principles/SKILL.md +0 -51
  38. /package/templates/skills/{vv-design-principles → vv-ui-design-principles}/references/design-md.md +0 -0
  39. /package/templates/skills/{vv-design-principles → vv-ui-design-principles}/references/quality-floor.md +0 -0
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: vv-ui-design-principles
3
+ description: Use when UI work needs verifiable design quality — auditing an existing page, component, or design system for AI-slop tells and accessibility-floor violations, or building new UI with a token plan, a measurable quality floor, and a project DESIGN.md design-system anchor. Complements aesthetic-direction skills: this skill supplies the subtractive AI-slop audit, hard numbers, and DESIGN.md checks.
4
+ ---
5
+
6
+ <scope>
7
+ Bring a design process to UI work: plan tokens before code, build against a measurable quality floor, then audit your own output by removing machine-recognizable tells. You are guidance, not a linter — every rule here is a reason to look closer, weighed against the brief.
8
+
9
+ AI slop is density, not a banned list. Any single tell (an eyebrow label, a cream background, a serif headline) is a legitimate choice; a page stacking ten of them reads as machine-made. Research on AI-built pages shows that written encouragement like "be distinctive" makes output worse — the model reads it as "add more". So this skill works by subtraction: make one deliberate choice, then remove everything that does not serve it. Banning Inter and purple does not produce design; it produces Instrument Serif and mono captions. The list of tells steers attention; the brief decides.
10
+ </scope>
11
+
12
+ <workflow>
13
+ 1. Identify the subject before styling: what the product is, who it is for, and the one job of this page or screen. Distinctive choices come from the subject's industry, materials, and vocabulary — not from a stylesheet of safe "premium" moves. If the brief does not name a subject, propose one and confirm.
14
+ 2. Look for a project DESIGN.md before choosing any token. Load references/design-md.md when you need the discovery procedure and file contract. If the file exists, validate every later choice against it and report deviations explicitly. If it is missing, plan tokens first and propose creating DESIGN.md from your plan — ask before writing it.
15
+ 3. Plan tokens before code: 4–8 named hex colors with roles, one or two brand typefaces with roles plus a mono or data face where the product needs one, a layout concept (alignment, density, one sentence per section), and one signature element the page will be remembered by. Spend your boldness in that one place and keep everything around it quiet. Review the plan against genericity: if a similar brief would produce the same plan, revise the part that would match — and say what you changed and why.
16
+ 4. Build against the quality floor. Load references/quality-floor.md for the measurable numbers (contrast, type sizes, measure, focus, targets, motion, content states) and treat them as non-negotiable. Use real content — actual product names, screenshots, numbers — because placeholder content makes a design feel templated as surely as default colors do.
17
+ 5. Run the subtractive audit before declaring the work done. Load references/slop-tells.md, walk the catalog by category, and count tells per section. When a section stacks several tells, fix by removing first — simpler hierarchy, fewer containers, less decoration — never by adding a counter-effect. Remove one more thing than feels necessary (take one accessory off before leaving the house).
18
+ 6. Report honestly: list the tells you removed, the tells you kept deliberately (with the brief-based reason), and the quality-floor violations you fixed with numbers. A deliberate keep is legitimate; an unexamined default is not.
19
+ </workflow>
20
+
21
+ <rules>
22
+ - A tell may remain only when the brief or subject genuinely calls for it and you can state that reason in one sentence. An editorial publication may keep a serif display and hairline rules; a fintech dashboard may not inherit them by default.
23
+ - Fix by removal before addition: merge containers, delete badges, drop entrances, shorten headlines. If a fix requires adding a new decoration, it is probably not a fix.
24
+ - Density ladder for the audit: one tell is a choice; more than 2 in one section is a pattern to break by removal; more than 5 on a page is a redesign of those areas.
25
+ - Do not fix slop by inverting it into the next default (cream to neon, serif to mono). Re-derive the choice from the subject.
26
+ - The quality floor is a requirement, not a style preference: it ranks above the brief, DESIGN.md, and this skill's other rules. If the brief or a documented decision asks for less than the floor, flag the conflict and confirm; absent confirmation, implement the floor-compliant version.
27
+ - Motion is judgment, not compliance: keep at most one purposeful reveal and the feedback that answers user actions, gate all of it behind reduced-motion, and never strip motion entirely just to pass an audit.
28
+ </rules>
29
+
30
+ <artifact>
31
+ Report format:
32
+ - Removed: tell → what replaced it (per section)
33
+ - Kept deliberately: tell → one-sentence brief-based reason
34
+ - Quality floor: violation → measured fix (numbers where applicable)
35
+ - DESIGN.md: found and followed | found with deviations listed | missing → proposal attached
36
+ </artifact>
37
+
38
+ <refs>
39
+ - `references/slop-tells.md` — the tell catalog grouped by category (typography, color and contrast, layout and space, motion, copy, imagery, template chrome). Load when auditing or when a choice feels familiar.
40
+ - `references/quality-floor.md` — the measurable non-negotiables for any build. Load before writing UI code.
41
+ - `references/design-md.md` — the DESIGN.md contract: discovery, validation, and the create-or-fill proposal. Load at plan time and whenever a token choice is contested.
42
+ </refs>
43
+
44
+ <done>
45
+ The requested build or audit is complete, the report lists removed tells, deliberate keeps with reasons, and measured quality-floor fixes, and DESIGN.md was followed or its absence was proposed. Do not modify files the request does not cover, and never write DESIGN.md without asking first.
46
+ </done>
@@ -1,5 +1,14 @@
1
1
  # AI slop tells
2
2
 
3
+ ## Contents
4
+ - Typography
5
+ - Color and contrast
6
+ - Layout and space
7
+ - Motion
8
+ - Copy
9
+ - Imagery
10
+ - Template chrome (composites)
11
+
3
12
  A catalog for the subtractive audit. Read it as a set of familiar defaults to notice, not a ban list.
4
13
 
5
14
  **How to use it**
@@ -0,0 +1,67 @@
1
+ ---
2
+ name: vv-verification
3
+ description: Use when you need to prove a change works — choose test levels and oracles, design reproduction and target tests, gather evidence, apply evidence-based testing or formal verification, and keep the verification stack maintainable
4
+ ---
5
+
6
+ <scope>
7
+ Turn a correctness claim into sufficient evidence, not into a maximum number of tests. Decide what must be proven, which oracle can prove it, which test level reaches the risk, what artifact records the result, and what remains unproven. Work in any language and any stack; the repository's own commands are the source of truth.
8
+
9
+ Use this skill when a change needs a correctness claim, when a bug needs reproduction, when a test suite is slow, weak, or full of stale cases, when a state or concurrency flow needs stronger proof, or when a repository has no explicit verification map. Do not use it to design a full AI eval program; use an eval only as one oracle.
10
+ </scope>
11
+
12
+ <workflow>
13
+ 1. State the claim. Write one sentence: what must be true after the change? Name the property, the boundary, and the failure mode. Distinguish a new behavior, a preserved behavior, a regression, and an absence claim. If the property depends on business semantics, ask; do not test an implementation-shaped guess.
14
+ 2. Classify the risk. Classify the blast radius: pure logic, module contract, integration, persisted data, money, permissions, security, concurrency, migration, user-facing flow, or operational behavior. The risk decides the oracle and the level, not the size of the diff.
15
+ 3. Choose the oracle. Load references/oracles.md. Pick the cheapest oracle that can actually distinguish correct from incorrect for this claim. Prefer an oracle that carries information the implementation did not produce: a human-authored expectation, an external fixture, a property, an invariant, a model, a real environment, or a runtime observation.
16
+ 4. Choose the level. Load references/strategy.md. Choose the level where the risk arises: unit for pure logic, contract for a module boundary, integration for real collaboration, browser or end-to-end for a user path, smoke for deployment and environment, property or model for a quantified claim. Do not present a green general check as evidence for a risk it cannot reach.
17
+ 5. Reproduce before fixing. For a defect, write a failing reproduction or target test first. Confirm that it fails for the reported reason, then fix, then confirm that it passes for the right reason. Do not edit the reproduction to make the fix pass.
18
+ 6. Consider formal methods. For state machines, concurrency, protocols, permissions, money, or distributed flows, load references/formal.md. Model the flow, state the invariant, run a model checker or proof, map any counterexample back to code, and add a deterministic regression test. If the tooling is unavailable or the cost exceeds the risk, record the residual risk instead of claiming proof.
19
+ 7. Design the evidence. Load references/evidence.md. For every material claim fill the evidence ledger: claim, property, oracle, exact command, artifact, observed result, residual risk, and owner. The artifact must be reproducible from the command, not reconstructed from prose.
20
+ 8. Execute and capture. Run the command in the real environment. Capture exact output, exit code, screenshots, traces, logs, counterexamples, or proof output. Keep the artifact with the change. If the run is flaky, record the flakiness rather than averaging it away.
21
+ 9. Verify independently when material. Self-verification is the author's feedback loop. Independent verification runs in a fresh context and does not inherit the implementation's assumptions. Use it for high-risk, cross-module, security, data, or release claims; do not confuse a review of intent with a verification of behavior.
22
+ 10. Record residual risk. State what the evidence does not prove, which consumers were not exercised, which environments were not reproduced, and what would change the conclusion. No artifact means no completion claim; partial evidence means a named residual risk.
23
+ 11. Maintain the stack. Load references/maintenance.md. Delete or update stale tests, quarantine flaky tests, and use mutation or kill-matrix audits only where their cost is justified. Coverage is a weak signal; a test that cannot fail for the claimed reason is maintenance debt.
24
+ 12. Bootstrap when missing. If the repository has no explicit verification map, load references/create-your-verification-stack.md. Discover the project's own commands and generate the full stack: a project-local VERIFICATION.md mapping claims to oracles, commands, evidence, gaps, and owners; a thin verification CLI in the repository's own runner; and two project-local skills — verify and maintain-verification — at the repository's skill convention (default .agents/skills/), registered only with the user's explicit approval. Never impose a framework the repository does not use.
25
+ </workflow>
26
+
27
+ <rules>
28
+ - Write skill artifacts, plans, evidence ledgers, and reports in English by default. Use the user's language only for dialogue; if the user explicitly requests a different document language, follow that request.
29
+ - A green test is not proof. It proves that the test ran and passed, not that the specification is satisfied.
30
+ - The oracle must carry external information. A test generated from the same context as the code tends to mirror the code.
31
+ - Separate the oracle from the implementer. When the implementer can see the exact tests, it can optimize for the tests instead of the specification.
32
+ - Tests never outrank the current specification. If a test contradicts the specification, surface the conflict before deciding which side is wrong.
33
+ - Stale tests are dangerous. They silently override current intent and are rarely reviewed. Prefer deleting or updating a stale test over preserving a false contract.
34
+ - Prefer deterministic checks over inferential ones. Use lint, types, contracts, properties, and reproducible commands before LLM judges or manual review.
35
+ - Evidence over prose. A completion claim names the command, the artifact, and the observed result.
36
+ - Formal methods are not a silver bullet. They can miss the formalization gap, tool bugs, and model drift.
37
+ - Keep tests worth their maintenance cost. A test that cannot fail for the claimed reason, or that duplicates another test, is a candidate for deletion.
38
+ - Stay language-agnostic. Use the repository's existing runner, fixtures, and CI. Do not introduce a framework or a script just because this skill mentions one.
39
+ - Stop when the claimed property is ambiguous or depends on business semantics. Ask for the property; do not invent a test-shaped interpretation.
40
+ - Stop when a test contradicts the current specification. Surface the conflict and the stale-test risk before changing either side.
41
+ - Stop when the available evidence cannot reach the changed behavior. Report the verification gap; do not claim completion.
42
+ - Stop when formal tooling is unavailable or its cost exceeds the risk. Fall back to the cheapest discriminating oracle and record the residual risk.
43
+ - Stop when the target is an AI pipeline and the request is a full eval design. Use an eval run as one oracle only; route the eval program to a separate workflow.
44
+ </rules>
45
+
46
+ <artifact>
47
+ Use this shape in the change description, plan, review, or project VERIFICATION.md:
48
+
49
+ | Claim | Property | Oracle | Command | Artifact | Result | Residual risk | Owner |
50
+ |---|---|---|---|---|---|---|---|
51
+ | Checkout rejects an expired card | No charge is created for an expired card | Contract test plus recorded provider request | `bun test test/checkout/expired-card.test.ts` | Test output and recorded request body | Pass; no charge request observed | Provider sandbox differs from production | Payments team |
52
+
53
+ A ledger row is complete only when the command is reproducible and the artifact can be inspected without asking the author.
54
+ </artifact>
55
+
56
+ <refs>
57
+ - `references/strategy.md` — risk classification, test levels, cost and confidence, CI split, and coverage limits.
58
+ - `references/oracles.md` — the oracle problem, oracle catalog, selection matrix, fixtures, and anti-patterns.
59
+ - `references/evidence.md` — standards traceability, specification to invariant to proof to log check, evidence ledger, independent verification, and confidence tiers.
60
+ - `references/formal.md` — statecharts, TLA+, Lean, property-based tests, counterexample mapping, tooling, and limits.
61
+ - `references/maintenance.md` — stale tests, mutation and kill-matrix audits, flaky tests, coverage versus value, and incident-to-regression practice.
62
+ - `references/create-your-verification-stack.md` — a language-agnostic bootstrap that discovers a repository's verification surface and generates the stack: VERIFICATION.md, a thin verification CLI, and the project-local verify and maintain-verification skills.
63
+ </refs>
64
+
65
+ <done>
66
+ Every material claim carries an inspectable artifact: claim, property, oracle, exact command, result, and residual risk are recorded. Load only the references the current claim needs. Never claim completion without an inspectable artifact.
67
+ </done>
@@ -0,0 +1,201 @@
1
+ # Create Your Verification Stack
2
+
3
+ ## Contents
4
+ - When to use
5
+ - Discover the repository
6
+ - Write VERIFICATION.md
7
+ - Commands
8
+ - Claim map
9
+ - Environments and fixtures
10
+ - Known gaps
11
+ - Maintenance
12
+ - Create the verification CLI
13
+ - Generate the project skills
14
+ - Register the skills
15
+ - The smallest useful stack
16
+ - Never impose a framework
17
+ - Keep it current
18
+
19
+ Most repositories have tests but no explicit map from claims to evidence. This reference builds that map from the repository's own tooling, then turns it into invocable behavior: a verification CLI and two project-local skills. It is language-agnostic by design: discover what the project already uses, then record and wrap it.
20
+
21
+ What the stack consists of:
22
+
23
+ - `VERIFICATION.md` — the data: claim → oracle → command → evidence → gap → owner.
24
+ - A verification CLI — thin commands in the repository's own runner.
25
+ - A `verify` skill — routes "verify this change" to those commands.
26
+ - A `maintain-verification` skill — keeps the map, the CLI, and the skills truthful over time.
27
+
28
+ Only this bootstrap procedure ships with the tooling. The CLI and the two skills are generated in the target project and belong to it.
29
+
30
+ ## When to use
31
+
32
+ Use this reference when:
33
+
34
+ - The repository has no documented verification map.
35
+ - A new contributor or agent cannot tell which command proves which behavior.
36
+ - The suite is large, slow, or unclear, and nobody knows which tests are load-bearing.
37
+ - A change needs a verification plan for a language or stack the host skill has not seen.
38
+
39
+ Do not use it to impose a test framework. Use it to make the existing surface legible and runnable.
40
+
41
+ ## Discover the repository
42
+
43
+ Read the repository before writing anything. Record what exists, not what you wish existed.
44
+
45
+ - **Languages and runtimes:** the languages, versions, and runtime managers actually declared by the project.
46
+ - **Package manager and task runner:** the lockfile, workspace layout, and the commands the project already uses.
47
+ - **Test runners:** unit, contract, integration, end-to-end, browser, property-based, model-checking, and eval tools. Note the exact command and the config file.
48
+ - **CI:** which jobs run on a change, which run nightly, which run on release, and which are required to merge.
49
+ - **Environments:** local, container, staging, production, sandboxes, and the credentials or fixtures needed to run each.
50
+ - **Observability:** logs, metrics, traces, screenshots, videos, and where they are stored.
51
+ - **Deployment:** build, migration, rollout, rollback, and smoke procedure.
52
+ - **Existing tests:** the directories, naming conventions, fixtures, and the tests that are known to be flaky or stale.
53
+ - **Skill loading convention:** how this repository loads agent skills — an explicit skills array in the agent config, an `.agents/skills` directory, or another tool-specific location. The generated skills must live where this repository expects them.
54
+ - **Known gaps:** what the project cannot verify today and why.
55
+
56
+ Ask the user only for information the repository cannot answer, such as a business property or an environment you cannot inspect.
57
+
58
+ ## Write VERIFICATION.md
59
+
60
+ Create `VERIFICATION.md` at the repository root unless the project already has a documented verification location. Keep it short enough to read and specific enough to run.
61
+
62
+ ```markdown
63
+ # Verification
64
+
65
+ ## Commands
66
+
67
+ | Purpose | Command | Runtime | Required to merge |
68
+ |---|---|---|---|
69
+ | Unit and contract tests | `<the CLI command>` | `<seconds>` | yes |
70
+ | Integration tests | `<the CLI command>` | `<seconds>` | yes |
71
+ | Browser or end-to-end | `<the CLI command>` | `<seconds>` | nightly |
72
+ | Smoke against staging | `<the CLI command>` | `<seconds>` | release |
73
+ | Lint and types | `<the CLI command>` | `<seconds>` | yes |
74
+
75
+ ## Claim map
76
+
77
+ | Claim | Oracle | Command | Evidence | Residual gap | Owner |
78
+ |---|---|---|---|---|---|
79
+ | A user can complete the checkout flow | Browser test plus screenshot | `<command>` | Screenshot and trace | Payment sandbox differs from production | Payments |
80
+ | An expired card creates no charge | Contract test plus recorded provider request | `<command>` | Test output and request body | Provider sandbox only | Payments |
81
+ | A migration preserves existing rows | Migration test plus rehearsal on a copy | `<command>` | Row counts and checksum | Production data volume not reproduced | Data |
82
+
83
+ ## Environments and fixtures
84
+
85
+ - Local:
86
+ - CI:
87
+ - Staging:
88
+ - Sandbox providers:
89
+ - Secrets or variables:
90
+
91
+ ## Known gaps
92
+
93
+ - `<gap>` — why it exists, what would close it, and who owns it.
94
+
95
+ ## Maintenance
96
+
97
+ - Stale-test review: `<cadence or trigger>`
98
+ - Flaky-test quarantine: `<location>`
99
+ - Mutation or kill-matrix audit: `<scope and cadence>`
100
+ - Incident-to-regression rule: `<where the test is added>`
101
+
102
+ Last reviewed: `<date>`
103
+ ```
104
+
105
+ Adapt the sections; do not invent commands. If a command does not exist, write `missing` and record the gap.
106
+
107
+ ## Create the verification CLI
108
+
109
+ Prefer thin CLI entry points over long prose. A command that produces evidence is testable, reusable, and cheaper for an agent than a wall of instructions.
110
+
111
+ - Use the repository's own runner: package scripts, a Makefile or justfile, a scripts directory, or the language's standard task runner.
112
+ - Expose one command per level you actually use — for example unit, contract, integration, e2e, smoke — or a single command with a level argument.
113
+ - Each command must exit nonzero on failure and print where the evidence artifact landed (report path, screenshot directory, trace) when one exists.
114
+ - Do not add a new framework or dependency to satisfy this; wrap what already runs.
115
+ - Record the commands in `VERIFICATION.md`. The generated skills call these commands and never inline long shell chains.
116
+
117
+ ## Generate the project skills
118
+
119
+ Create two project-local skills beside the verification map. Default location is `.agents/skills/` (a cross-tool convention); if the repository already loads skills from another path, use that path instead. The default maintenance name is `maintain-verification`; rename it if the project has a stronger convention.
120
+
121
+ Before writing, check whether a skill with the default name already exists at the target location. If it does, read it first and integrate with it or rename the generated skill instead of overwriting user-owned content.
122
+
123
+ ### verify
124
+
125
+ `.agents/skills/verify/SKILL.md` routes "verify this change" to the project's commands. Keep it thin: data lives in `VERIFICATION.md`, method in the host's verification skill.
126
+
127
+ ```markdown
128
+ ---
129
+ name: verify
130
+ description: Use when a change in this repository needs proof — run the right verification level, capture the evidence, and report residual risk
131
+ ---
132
+
133
+ 1. Read VERIFICATION.md for the claim map and the CLI commands.
134
+ 2. Classify the change's risk and pick the level that reaches it.
135
+ 3. Run the matching CLI command; keep the exit code and the artifact path.
136
+ 4. Record an evidence ledger row: claim, property, oracle, command, artifact, result, residual risk.
137
+ 5. For oracle choice, evidence design, or formal methods, follow the host's verification skill if available.
138
+ 6. Never weaken a check to make it pass. If the map is wrong, say so and propose an update.
139
+ ```
140
+
141
+ ### maintain-verification
142
+
143
+ `.agents/skills/maintain-verification/SKILL.md` keeps the stack truthful. Run it after an incident, after a spec or plan change, after a runner, CI, or dependency change, when a test goes flaky, on a release cadence, or whenever `VERIFICATION.md` and reality drift.
144
+
145
+ ```markdown
146
+ ---
147
+ name: maintain-verification
148
+ description: Use to keep this repository's verification stack current — reconcile the claim map, CLI commands, and skills after incidents, spec changes, or tooling changes
149
+ ---
150
+
151
+ 1. Diff the claim map against the current tests: claims without evidence, evidence without claims.
152
+ 2. Add a regression entry for every incident since the last pass; keep it in the permanent set.
153
+ 3. Prune stale, duplicate, and non-discriminating entries; quarantine flaky tests with an owner.
154
+ 4. Re-check the CLI commands against the current runners; keep exit codes and artifact paths meaningful.
155
+ 5. Update VERIFICATION.md, the CLI, and both skills together — they must not diverge.
156
+ 6. Refresh Last reviewed and record remaining gaps with owners.
157
+ ```
158
+
159
+ Both generated skills stay thin. A generated skill that duplicates the map will drift; a generated skill that inlines commands will rot when the runner changes.
160
+
161
+ ## Register the skills
162
+
163
+ - Discover how the repository loads skills. If a config file lists skill paths explicitly, propose adding the two new paths and show the exact snippet; apply it only after the user approves. Never edit user-owned configuration silently.
164
+ - If the repository's convention is directory auto-discovery, no config change is needed — create the files and report where they are.
165
+ - Tell the user how to invoke the skills afterwards, including a host restart if the host caches the skill list.
166
+
167
+ ## The smallest useful stack
168
+
169
+ Start with the smallest set that covers the real risks:
170
+
171
+ 1. One deterministic CLI command that runs the unit and contract tests.
172
+ 2. One integration command for the collaborators you own.
173
+ 3. One browser or end-to-end path for the critical user journey.
174
+ 4. One smoke command for the target environment.
175
+ 5. One lint and type command.
176
+ 6. One regression entry per known incident.
177
+ 7. `VERIFICATION.md`, the `verify` skill, and the `maintain-verification` skill that keep them usable.
178
+
179
+ Add a property or model check when a quantified or stateful claim appears. Add an eval when the target is probabilistic. Do not add a layer just because a pyramid diagram has it.
180
+
181
+ ## Never impose a framework
182
+
183
+ - Use the project's existing runner, fixtures, and conventions.
184
+ - Do not add a dependency to satisfy this reference.
185
+ - Do not rewrite a working suite into a preferred style.
186
+ - Do not introduce a browser, a database, or a container the project does not already use.
187
+ - The generated CLI and the generated skills follow the same rule: they wrap what exists, they do not replace it.
188
+ - If the project has no runner, propose the smallest one that fits the stack and ask before adding it.
189
+
190
+ The skill travels across stacks; the repository's own commands are the source of truth.
191
+
192
+ ## Keep it current
193
+
194
+ A verification map that nobody updates is worse than no map: it gives false confidence. The generated `maintain-verification` skill exists to prevent that.
195
+
196
+ - Run the maintain pass after every incident and before every release.
197
+ - Update the claim map when a requirement, interface, or environment changes.
198
+ - Remove claims that no longer matter; do not let the map become a museum.
199
+ - Re-run the CLI commands after a tool or runtime upgrade.
200
+ - Record the evidence location, not just "tests pass".
201
+ - Treat the map, the CLI, and the two skills as code: reviewed, owned, and versioned with the repository.
@@ -0,0 +1,110 @@
1
+ # Evidence-Based Testing
2
+
3
+ ## Contents
4
+ - High-assurance traceability
5
+ - Specification to invariant to proof to log check
6
+ - Evidence ledger
7
+ - Self-verification versus independent verification
8
+ - Acceptance and review language
9
+ - Confidence tiers
10
+ - What this does not prove
11
+
12
+ Evidence-based testing starts from the practice used for life-critical systems: code must demonstrate that a stated requirement is satisfied, not merely pass a green test. The practical question is not "do the tests pass?" but "what evidence proves this claim, and where is it recorded?"
13
+
14
+ ## High-assurance traceability
15
+
16
+ Life-critical practice converges on the same shape:
17
+
18
+ - Requirements are explicit and traceable.
19
+ - Tests are derived from requirements and from identified failure modes, not only from the implementation.
20
+ - Independence and coverage are part of the evidence, not an afterthought.
21
+ - An auditor looks for a trace from requirement to design to code to test result, not for a green status.
22
+
23
+ The common shape is:
24
+
25
+ ```text
26
+ requirement -> design -> code -> evidence -> test result
27
+ ```
28
+
29
+ Every material requirement should be traceable to the code that implements it and to the evidence that demonstrates it. The trace is the audit object; the green status is not.
30
+
31
+ ## Specification to invariant to proof to log check
32
+
33
+ A compact engineering variant that works with agents:
34
+
35
+ 1. The architect reads the requirement, classifies it, and formulates an **invariant**: a statement that must hold if the requirement is satisfied.
36
+ 2. The coding agent receives the **burden of proof**: it must make the implementation produce evidence that the invariant holds.
37
+ 3. A test exercises the implementation to populate its logs or trace with that evidence.
38
+ 4. The test checks the **evidence** in the log, not only the business return value.
39
+ 5. The verification code merges with the implementation; the invariant and proof can often be very small.
40
+
41
+ This is stronger than an example test because the oracle is the invariant, and the evidence is produced by the implementation rather than copied from it. It also gives the agent a concrete obligation: prove this claim, not "make the tests green".
42
+
43
+ A generic shape:
44
+
45
+ ```text
46
+ invariant I(requirement)
47
+ implementation produces evidence E when I holds
48
+ test asserts E is present and well-formed
49
+ test also asserts the observable behavior
50
+ ```
51
+
52
+ The evidence must be specific enough that a wrong implementation cannot produce it accidentally. A log line that says "ok" without the relevant values is not evidence.
53
+
54
+ ## Evidence ledger
55
+
56
+ Use a ledger for every material claim. It can live in the change description, the plan, the review, or a project `VERIFICATION.md`.
57
+
58
+ | Field | Meaning |
59
+ |---|---|
60
+ | Claim | The one-sentence statement under test |
61
+ | Property | The invariant or behavior that must hold |
62
+ | Oracle | The independent source of truth |
63
+ | Command | The exact reproducible command |
64
+ | Artifact | The output, screenshot, trace, log, proof, or counterexample |
65
+ | Result | Observed pass, fail, or inconclusive, with the relevant values |
66
+ | Residual risk | What the evidence does not prove |
67
+ | Owner | Who can reproduce or update it |
68
+
69
+ A row is complete only when another person can run the command and inspect the artifact without asking the author. "Tests pass" is not a row.
70
+
71
+ ## Self-verification versus independent verification
72
+
73
+ Self-verification is the author's feedback loop: run the tests, build, screenshots, and traces while implementing. It is necessary and cheap.
74
+
75
+ Independent verification runs in a fresh context and does not inherit the assumptions that produced the code. It is appropriate for high-risk, cross-module, security, data, or release claims. A common long-running-agent practice distinguishes the two and runs the verifier in a fresh context so the verdict is not colored by the implementation's assumptions. Code review is not verification: review checks intent, risk, and specification fit; verification checks behavior.
76
+
77
+ ## Acceptance and review language
78
+
79
+ Separate these statements:
80
+
81
+ - "No defect was discovered in the reviewed scope."
82
+ - "The material claims are supported by evidence that exercises the changed behavior."
83
+ - "The change is proven correct."
84
+
85
+ Only the second is a reasonable completion claim for ordinary work. The third is reserved for a proof or an exhaustive verification, and even then only within the model or the stated assumptions.
86
+
87
+ A reviewer finding should name the property, its relevance, the evidence limitation, and the smallest useful check. A material verification gap is a finding, not a stylistic preference.
88
+
89
+ ## Confidence tiers
90
+
91
+ Use explicit tiers when a claim is contested or when sources disagree:
92
+
93
+ 1. **Executed observation in this repository:** a command you ran, an artifact you inspected, a test that failed before and passed after.
94
+ 2. **Authoritative contract:** the current specification, schema, public interface, or standard that governs the behavior.
95
+ 3. **Reproducible primary source:** a paper, official documentation, or a reproducible external experiment.
96
+ 4. **Practitioner report or secondary retelling:** a blog, talk, thread, or a summary of a paper. Useful for direction; not proof.
97
+ 5. **Model self-report or prose:** the agent's description of what it did. Never sufficient for a correctness claim.
98
+
99
+ Treat a `medium` or `low` confidence claim as a hypothesis to test, not as a settled fact. This includes claims about TDD, formal methods, and agent behavior.
100
+
101
+ ## What this does not prove
102
+
103
+ - A green test does not prove the absence of defects.
104
+ - A proof does not prove that the formalization matches the intended requirement.
105
+ - A model check does not prove that the model matches the code.
106
+ - A screenshot does not prove that every branch is correct.
107
+ - An eval does not prove that the product is correct outside the eval distribution.
108
+ - A reviewer's approval does not prove that the evidence is sufficient.
109
+
110
+ State the residual risk explicitly. A named gap is honest; an unnamed gap is a false completion claim.
@@ -0,0 +1,86 @@
1
+ # Formal Verification
2
+
3
+ Formal verification is the strongest oracle in this skill, and the easiest to misuse. Use it when the claim is about all reachable states, not just the examples you remembered.
4
+
5
+ ## When it is justified
6
+
7
+ Reach for formal methods when at least one of these is true:
8
+
9
+ - The behavior is a state machine, protocol, permission model, payment flow, notification fan-out, or distributed interaction.
10
+ - The failure mode is a race, a lost update, a duplicate, a deadlock, a reordering, or an unreachable-state violation.
11
+ - The cost of a production failure is high enough to justify modeling effort.
12
+ - A property must hold for all interleavings, not just the happy path.
13
+ - The implementation is hard to test exhaustively but easy to model.
14
+
15
+ Do not reach for formal methods when a contract test, property test, or integration test already discriminates the risk. Formal methods are not a substitute for ordinary tests; they cover a different class of claim.
16
+
17
+ ## Statecharts and TLA+
18
+
19
+ A statechart is a readable model of states, transitions, guards, and parallel regions. It is often the bridge between code and a formal model.
20
+
21
+ A practical agent workflow:
22
+
23
+ 1. Ask the agent to draw the statechart for the flow, from the code and the user-facing requirement.
24
+ 2. Review the statechart: are the states real, are the transitions complete, are the guards meaningful?
25
+ 3. Translate the statechart into TLA+ (or another model checker).
26
+ 4. State the invariants: no charge without an order, no duplicate notification, no state reachable after cancellation, no permission escalation.
27
+ 5. Run the model checker. If it finds a counterexample, map the trace back to code and write a deterministic regression test.
28
+ 6. Keep the model and the invariant with the code; update them when the flow changes.
29
+
30
+ TLA+ is good at interleavings, invariants, and protocol-level properties. It is not a code verifier; it verifies the model. The model-to-code gap is your responsibility.
31
+
32
+ ## Lean and property-based tests
33
+
34
+ Lean is a dependent type theory proof assistant. It is appropriate when the claim is a mathematical property of an algorithm and the specification is stable enough to formalize.
35
+
36
+ Property-based testing is the cheaper bridge. Instead of a proof, assert a property over generated inputs. It finds counterexamples without a full formalization, and it is usually the right first step before investing in a proof.
37
+
38
+ Use Lean when:
39
+
40
+ - The algorithm is stable and the property is mathematical.
41
+ - The cost of a wrong result is high.
42
+ - You can afford to maintain the proof and the formalization.
43
+
44
+ Use property-based testing when:
45
+
46
+ - The property is clear but the implementation is still moving.
47
+ - You want counterexamples quickly.
48
+ - A full proof would be disproportionate to the risk.
49
+
50
+ ## Counterexample to regression test
51
+
52
+ A model checker's counterexample is a trace: a sequence of states and actions that violates the invariant. Do not stop at "the model is wrong". Map the trace to the code path, reproduce it with a deterministic test if possible, fix the code or the model, and add the regression test.
53
+
54
+ If the counterexample is not reproducible in code, record why: the model is more abstract, the code has an additional guard, or the trace requires an environment you cannot create. That gap is residual risk, not a pass.
55
+
56
+ ## Tooling notes
57
+
58
+ - **TLA+ model checkers:** the standard approach is TLA+ plus a model checker. Some implementations require a JVM; others aim for compatibility without that friction. Verify that the tool supports the TLA+ features you use.
59
+ - **Lean and its standard library:** a proof assistant and its mathematics library. Proofs are checked by a small kernel; the kernel itself can have bugs, and a proof can be about the wrong formalization.
60
+ - **Property-based libraries:** every ecosystem has one; use the repository's existing library rather than adding a new dependency.
61
+
62
+ Tooling is not the point. The point is the model, the invariant, and the mapping back to code.
63
+
64
+ ## Limits
65
+
66
+ - **Formalization gap:** the proof can be correct and still not match the intended requirement. A proof is only as good as the specification it formalizes.
67
+ - **Kernel and tool bugs:** a small trusted kernel is not infallible. Do not treat "the proof checked" as absolute truth without understanding the toolchain.
68
+ - **Cost:** modeling, proof engineering, and maintenance are expensive. Use formal methods where the risk justifies them.
69
+ - **Model drift:** the model and the code can diverge. Keep the model in the repository, review changes to both, and regenerate or re-check when the flow changes.
70
+ - **Coverage of the model:** a model checker explores the model you wrote, not the code you wrote. A missing transition or an omitted environment assumption can hide the bug.
71
+ - **Not a silver bullet:** formal verification is very promising and can find real bugs, but it is not a substitute for judgment.
72
+
73
+ ## A minimal workflow
74
+
75
+ ```text
76
+ 1. State the property in plain language.
77
+ 2. Draw the statechart from the code and the requirement.
78
+ 3. Review the statechart with a human or a fresh-context reviewer.
79
+ 4. Encode the model and the invariant.
80
+ 5. Run the model checker.
81
+ 6. If a counterexample appears: map it to code, fix, add a regression test.
82
+ 7. If no counterexample appears: record the model, the invariant, the tool version, and the residual gap.
83
+ 8. Keep the model and the regression test with the code.
84
+ ```
85
+
86
+ The output of formal verification is not "proven correct"; it is "no counterexample was found in this model under these assumptions". That is a strong and honest claim.
@@ -0,0 +1,88 @@
1
+ # Test Maintenance
2
+
3
+ A verification stack decays. Tests become stale, duplicate, flaky, or slower than the value they provide. Maintenance is part of verification, not an afterthought.
4
+
5
+ ## Stale tests
6
+
7
+ A stale test encodes an old contract. It can silently override the current specification because a failing implementation is "wrong" by the test's definition. This is a real specification-drift risk: tests can take priority over the specification, especially test suites nobody remembers or reviews.
8
+
9
+ Policy:
10
+
11
+ 1. Every test should name the property or requirement it protects.
12
+ 2. When a requirement changes, update or delete the test in the same change.
13
+ 3. A test that cannot fail for the claimed reason is not protecting anything; delete it.
14
+ 4. A test that duplicates another test adds maintenance cost without adding discrimination; keep the stronger one.
15
+ 5. A test written for a one-off investigation is not a permanent regression test unless it is promoted deliberately.
16
+
17
+ A useful pruning instruction is a bounded, reviewable goal: instead of "clean up the tests", ask for "remove the least useful tests while keeping the critical claims covered". The principle is a measurable outcome, not a vague tidy-up.
18
+
19
+ ## Mutation testing and kill matrix
20
+
21
+ Mutation testing changes the implementation in small ways and checks whether a test fails. A test that survives a relevant mutation is not discriminating. A kill matrix records which test kills which mutation and exposes duplicates.
22
+
23
+ Use mutation testing as a targeted audit:
24
+
25
+ - On a critical module where the test suite is large and its value is unclear.
26
+ - Before deleting tests, to see which ones are load-bearing.
27
+ - After a defect escapes, to check whether the existing tests would have caught the class of defect.
28
+
29
+ Do not run full mutation testing on every change. Aggressive mutation testing can be extremely expensive, with a poor return on tokens and time. A kill matrix is a scalpel, not a default gate.
30
+
31
+ A practical kill-matrix rule: keep a test only if it catches something no other test catches. A test that catches nothing unique is a candidate for deletion.
32
+
33
+ ## Flaky tests
34
+
35
+ A flaky test is worse than a missing test because it trains everyone to ignore failures.
36
+
37
+ - Quarantine it: move it out of the blocking suite, keep it visible, and assign an owner.
38
+ - Fix the cause: time, ordering, shared state, network, randomness, or an unstated environment assumption.
39
+ - If it cannot be made deterministic, replace it with a deterministic oracle at a lower level and keep the flaky scenario as a manual or scheduled check.
40
+ - Never average a flaky test into "mostly passing".
41
+
42
+ ## Coverage versus value
43
+
44
+ Coverage is a map of executed lines, not a measure of verified behavior. Use it to find unexercised code, then ask what claim that code needs. Do not use a coverage target as evidence for correctness, and do not preserve a low-value test just because it raises a number.
45
+
46
+ A useful review question: "If this test were deleted, which defect would escape?" If the answer is "none that another test would not catch", the test is a candidate for deletion.
47
+
48
+ ## Incident to regression test
49
+
50
+ Every production incident should produce a regression test or eval that fails before the fix and passes after it. The test should reproduce the class of failure, not only the exact symptom. Keep it in the permanent set. If the incident cannot be reproduced deterministically, record the environment and the evidence, and add the closest deterministic check.
51
+
52
+ The incident becomes a new requirement or eval, and the loop returns to the specification. The test is the memory of the failure.
53
+
54
+ ## Test-code quality
55
+
56
+ Test code is code. Apply the same standards:
57
+
58
+ - Arrange, act, assert in a readable order.
59
+ - One reason to fail per test where practical.
60
+ - No hidden sleeps, real network calls, or shared mutable state in the deterministic suite.
61
+ - Assert on structured values, not long unstable prose.
62
+ - Make the failure message name the property and the observed value.
63
+ - Keep fixtures small and owned; a fixture that nobody understands is a liability.
64
+ - Prefer the public boundary over private helpers, unless the helper is the unit under test.
65
+
66
+ ## Pruning policy
67
+
68
+ When the suite is large, prune deliberately:
69
+
70
+ 1. List tests by the claim they protect.
71
+ 2. Mark duplicates and tests that cannot fail for the claimed reason.
72
+ 3. Run a targeted mutation audit on the critical modules.
73
+ 4. Delete or merge the weakest tests.
74
+ 5. Re-run the suite and confirm the critical claims still have evidence.
75
+ 6. Record the pruning decision and the residual risk.
76
+
77
+ Do not prune by coverage alone. Do not keep a test because it is old, green, or expensive to understand. Keep it because it protects a claim.
78
+
79
+ ## Anti-patterns
80
+
81
+ - Keeping a stale test because "it passes".
82
+ - Adding a test for every line of implementation.
83
+ - Treating a coverage percentage as a correctness claim.
84
+ - Running mutation testing on every change and calling the cost "quality".
85
+ - Ignoring a flaky test until it blocks a release.
86
+ - Fixing an incident without a regression test.
87
+ - A test that fails for an unrelated reason and is retried until green.
88
+ - A test suite nobody can run locally.