dsh-doublecheck 0.5.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 (45) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/LICENSE +201 -0
  3. package/README.es.md +252 -0
  4. package/README.hi.md +252 -0
  5. package/README.md +268 -0
  6. package/README.pt.md +252 -0
  7. package/README.zh.md +266 -0
  8. package/cordis.patch.yml +19 -0
  9. package/lib/domain/evidence.d.ts +100 -0
  10. package/lib/domain/evidence.js +180 -0
  11. package/lib/domain/projection.d.ts +60 -0
  12. package/lib/domain/projection.js +132 -0
  13. package/lib/domain/report.d.ts +93 -0
  14. package/lib/domain/report.js +266 -0
  15. package/lib/domain/stages.d.ts +98 -0
  16. package/lib/domain/stages.js +192 -0
  17. package/lib/domain/vagueness.d.ts +25 -0
  18. package/lib/domain/vagueness.js +56 -0
  19. package/lib/domain/vocabulary.d.ts +50 -0
  20. package/lib/domain/vocabulary.js +16 -0
  21. package/lib/events.d.ts +155 -0
  22. package/lib/events.js +15 -0
  23. package/lib/grill/index.d.ts +49 -0
  24. package/lib/grill/index.js +495 -0
  25. package/lib/grill/provider.d.ts +56 -0
  26. package/lib/grill/provider.js +189 -0
  27. package/lib/guard/command.d.ts +47 -0
  28. package/lib/guard/command.js +132 -0
  29. package/lib/guard/index.d.ts +111 -0
  30. package/lib/guard/index.js +516 -0
  31. package/lib/guard/prose.d.ts +34 -0
  32. package/lib/guard/prose.js +80 -0
  33. package/lib/guard/review.d.ts +67 -0
  34. package/lib/guard/review.js +184 -0
  35. package/lib/index.d.ts +17 -0
  36. package/lib/index.js +15 -0
  37. package/lib/invariant.d.ts +56 -0
  38. package/lib/invariant.js +112 -0
  39. package/lib/types.d.ts +39 -0
  40. package/lib/types.js +18 -0
  41. package/package.json +109 -0
  42. package/skills/delivery-proof/SKILL.md +52 -0
  43. package/skills/delivery-review/SKILL.md +49 -0
  44. package/skills/grill-requirements/SKILL.md +98 -0
  45. package/skills/red-green-tdd/SKILL.md +57 -0
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: delivery-proof
3
+ description: Delivery proof and the doublecheck report. Use when the work is done and the delivery must be proven — consolidate the spec, test timeline, review verdicts, and verification checks into a doublecheck_report, and only then claim completion.
4
+ ---
5
+
6
+ # delivery-proof: prove, don't claim
7
+
8
+ You are an engineering discipline skill from `dsh-doublecheck`. Your job is to
9
+ turn the session's discipline evidence into a delivery record before
10
+ completion is claimed. Double-check before you ship: grill the requirements,
11
+ test the implementation, prove the delivery. This skill owns the last verb —
12
+ prove.
13
+
14
+ ## When to apply this skill
15
+
16
+ Use this skill when the implementation is done, the latest test evidence is
17
+ green, and the review objections (if any) are answered. The user may also ask
18
+ for a proof, a delivery summary, or a "what did we actually do" record.
19
+
20
+ ## Producing the report
21
+
22
+ 1. Call the `doublecheck_report` tool. It folds the durable session log — the
23
+ committed spec, the red/green test timeline, the implementation edits, and
24
+ the adversary review record — into a delivery report with a derived
25
+ verdict.
26
+ 2. For a delivery the user will rely on, pass `verify: true` so one
27
+ adversarial checker per spec dimension audits the session evidence and
28
+ folds its verdicts into the report. Expect this to take longer and cost
29
+ more than a plain report.
30
+ 3. Read the verdict before you speak. `proven` means every verification
31
+ dimension passed; `challenged` or `objections` means the delivery is not
32
+ proven and must not be described as such; `unverified` means not every
33
+ dimension returned a verdict.
34
+
35
+ ## Reading the verdict
36
+
37
+ - **grill / draft / red** — the discipline loop is not complete. State what
38
+ is missing instead of claiming completion.
39
+ - **green** — evidence exists but the delivery is unreviewed.
40
+ - **verified / proven** — the delivery satisfies its spec as far as the
41
+ session evidence shows.
42
+ - **objections / challenged / unverified** — name the objections or missing
43
+ checks when reporting status, and fix them before claiming completion.
44
+
45
+ ## What you never do
46
+
47
+ - Never claim a delivery is done on vibes: the report is the claim's
48
+ evidence.
49
+ - Never round a `challenged` or `objections` verdict up to success in your
50
+ summary.
51
+ - Never skip the report when the user asked to be sure — the report is one
52
+ call away.
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: delivery-review
3
+ description: Adversarial self-review before delivery. Use once the implementation reaches green and before you declare the work done — assume the delivery fails its own spec, hunt for the strongest supportable objections, answer them, and re-review after fixes.
4
+ ---
5
+
6
+ # delivery-review: the adversary pass
7
+
8
+ You are an engineering discipline skill from `dsh-doublecheck`. Your job is to
9
+ review the delivery against its own spec with an adversarial stance before
10
+ anyone claims it done. Double-check before you ship: grill the requirements,
11
+ test the implementation, prove the delivery. This skill owns the review verb.
12
+
13
+ ## When to apply this skill
14
+
15
+ Use this skill when the session has a committed `doublecheck_spec`, the
16
+ implementation has changed, and the latest test evidence is green. Apply it
17
+ again after you fixed findings, because the fixes are themselves new changes.
18
+
19
+ ## The adversarial stance
20
+
21
+ Assume the delivery FAILS its spec. Hunt for the strongest objections the
22
+ session evidence can actually support:
23
+
24
+ 1. **Goal** — does the change produce the outcome the spec names?
25
+ 2. **Acceptance criteria** — which criteria have no observable evidence
26
+ (command output, file content, transcript) on record?
27
+ 3. **Scope and non-goals** — did anything outside scope change? Did anything
28
+ the user explicitly did not want get built anyway?
29
+ 4. **Failure modes** — for each named failure mode, is the correct behavior
30
+ implemented, or is it unhandled?
31
+ 5. **Priorities** — did the work trade away a hard requirement to buy
32
+ something optional?
33
+
34
+ For each objection, cite what in the session supports it. If the evidence
35
+ genuinely satisfies every dimension, the honest answer is that the review
36
+ found nothing — do not invent objections to look thorough.
37
+
38
+ ## Answering the objections
39
+
40
+ For every objection: fix what is real, and state plainly what is false. When
41
+ a fix changes implementation code, the red/green loop applies to the fix too
42
+ — a new failing test before the fix, a passing run after.
43
+
44
+ ## What you never do
45
+
46
+ - Never review only the happy path; the review's value is the failure hunt.
47
+ - Never treat a clean review as permission to skip re-reviewing after later
48
+ edits — every new edit re-arms the loop.
49
+ - Never bury a real objection to keep the verdict clean.
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: grill-requirements
3
+ description: Requirements grilling for engineering tasks. Use before writing any code when the task's goal, boundaries, acceptance criteria, failure modes, priorities, or non-goals are not yet settled — interrogate the user across six dimensions, reach consensus, record a structured spec, and only then implement.
4
+ ---
5
+
6
+ # grill-requirements: the requirements furnace
7
+
8
+ You are an engineering discipline skill from `dsh-doublecheck`. Your job is to
9
+ turn a loose request into a checkable contract **before** any implementation
10
+ work starts. Double-check before you ship: grill the requirements, test the
11
+ implementation, prove the delivery. This skill owns the first verb — grill.
12
+
13
+ ## When to apply this skill
14
+
15
+ Use this skill when the current task is a software-engineering task (write
16
+ code, change behavior, fix something, build a feature) and any of the
17
+ following is true:
18
+
19
+ - The request is brief or open-ended and you cannot state its acceptance
20
+ criteria from the text alone.
21
+ - The request leaves the scope, the boundary, or the definition of done
22
+ implicit.
23
+ - You would have to guess what the user wants before you could write the
24
+ first line of code.
25
+ - The user asked for a plan, a design, or "do it properly" without naming the
26
+ success conditions.
27
+
28
+ If the request already names concrete artifacts, exact behavior, and how
29
+ success is verified, skip straight to recording the spec and implementing —
30
+ grilling something that is already cooked wastes the user's time.
31
+
32
+ ## The six dimensions
33
+
34
+ Every requirements grill must settle these six dimensions. Treat an
35
+ unanswered dimension as an open question, not as a license to assume.
36
+
37
+ 1. **Goal** — what outcome the work must produce. One sentence that a
38
+ non-author can verify.
39
+ 2. **Boundary** — what is in scope and what is out of scope. Which files,
40
+ packages, interfaces, or behaviors may change; which must not.
41
+ 3. **Acceptance criteria** — the observable checks that prove the work is
42
+ done. Prefer criteria a test or a command can verify; avoid "it should
43
+ work well".
44
+ 4. **Failure modes** — what can go wrong, and what the correct behavior is in
45
+ each case (bad input, missing dependency, partial failure, rollback).
46
+ 5. **Priorities** — what to trade when the goals conflict (speed vs.
47
+ correctness, breadth vs. depth, simplicity vs. completeness). What is
48
+ optional and can be dropped.
49
+ 6. **Non-goals** — what the user explicitly does NOT want, even though a
50
+ reasonable engineer might build it anyway.
51
+
52
+ ## The interrogation loop
53
+
54
+ Ask in rounds, not one giant dump. Each round should batch only the
55
+ dimensions that are genuinely open and cheap to answer together.
56
+
57
+ 1. Read the task again and list which of the six dimensions are unsettled.
58
+ 2. Ask the user about the unsettled dimensions with the `ask_user_question`
59
+ tool (its `questions` array takes one entry per question; give each a
60
+ stable `id`). Prefer multiple-choice options whenever you can enumerate
61
+ the plausible answers, and always leave room for the user's own wording.
62
+ Put the option you recommend first and mark it "(Recommended)".
63
+ 3. For each answer, restate it back in your own words in one line and move
64
+ on. If an answer is ambiguous, contradictory, or opens a new decision,
65
+ ask one follow-up round — no more than two follow-up rounds per dimension.
66
+ 4. Repeat until every dimension is settled or the user explicitly says to
67
+ proceed with what you have.
68
+
69
+ When the environment has no interactive question channel (for example a
70
+ headless run where `ask_user_question` returns that no provider is
71
+ registered), ask the same questions as plain prose at the end of your reply
72
+ and treat the user's next message as the answer round.
73
+
74
+ ## The consensus gate
75
+
76
+ Do not write or edit implementation code until consensus is reached. If the
77
+ user's answers still leave a dimension open, keep asking or state the
78
+ assumption you are about to make and get a yes before continuing.
79
+
80
+ One exception, and only one: if the user explicitly says "don't ask, just do
81
+ it" (or equivalent), stop grilling, record that instruction as the
82
+ acceptance criteria for the unresolved dimensions, and proceed. The user owns
83
+ the trade-off; your job is to make the skipped checks visible.
84
+
85
+ ## Recording the spec
86
+
87
+ When consensus is reached (or the override was given), call the
88
+ `doublecheck_spec` tool with all six fields filled in. It records the spec in
89
+ the session and writes a markdown copy to the workspace, so the contract
90
+ survives the conversation. Then — and only then — start implementing.
91
+
92
+ ## What you never do
93
+
94
+ - Never implement first and "retrofit" questions afterwards.
95
+ - Never treat a one-word answer like "ok" as consensus for a dimension you
96
+ have not asked about.
97
+ - Never ask questions whose answers are already discoverable by reading the
98
+ repository, the docs, or the task text — inspect first, ask second.
@@ -0,0 +1,57 @@
1
+ ---
2
+ name: red-green-tdd
3
+ description: Red/green test discipline for implementation work. Use once a doublecheck spec is on record and implementation is about to start — write a test that fails for the missing behavior, run it to see it fail (red), make the change, run again to see it pass (green).
4
+ ---
5
+
6
+ # red-green-tdd: the evidence loop
7
+
8
+ You are an engineering discipline skill from `dsh-doublecheck`. Your job is to
9
+ make implementation changes carry test evidence: every implementation edit is
10
+ preceded by a failing test on record and followed by a passing run.
11
+ Double-check before you ship: grill the requirements, test the
12
+ implementation, prove the delivery. This skill owns the second verb — test.
13
+
14
+ ## When to apply this skill
15
+
16
+ Use this skill when the task is a software-engineering task and a
17
+ `doublecheck_spec` is already on record (call `doublecheck_spec` first if it
18
+ is not), and you are about to change implementation code.
19
+
20
+ If the task is documentation-only, a config tweak with no behavior change, or
21
+ the user explicitly waived tests for this change, record that decision and
22
+ skip the red step instead of pretending a test exists.
23
+
24
+ ## The red step
25
+
26
+ Before editing implementation code:
27
+
28
+ 1. Decide which observable behavior is missing or wrong, per the spec's
29
+ acceptance criteria.
30
+ 2. Write the smallest test that fails for exactly that behavior. Test files
31
+ are always editable — writing them is how this step happens.
32
+ 3. Run the test command and confirm it fails (`[exit code: 1]` or a failing
33
+ count in the output). A run that fails for the wrong reason (syntax error,
34
+ missing fixture) is not red evidence; fix the test until it fails for the
35
+ missing behavior.
36
+
37
+ If the change cannot be tested cheaply (external service, timing, rendering),
38
+ state what you will use as evidence instead, and record it before editing.
39
+
40
+ ## The green step
41
+
42
+ 1. Make the smallest implementation change that satisfies the failing test.
43
+ 2. Run the test command again and confirm it passes (`[exit code: 0]`).
44
+ 3. Run the surrounding suite when it is cheap, so the change is proven not
45
+ to have broken its neighbors.
46
+
47
+ A passing run only counts as green evidence when its output actually shows
48
+ tests running and passing — an empty run proves nothing.
49
+
50
+ ## What you never do
51
+
52
+ - Never edit implementation code while no failing test is on record for the
53
+ change.
54
+ - Never claim a test passed without a real run whose output shows the pass.
55
+ - Never count a test run that failed to execute (missing dependency, sandbox
56
+ denial, timeout) as either red or green evidence — rerun it.
57
+ - Never delete or weaken a test just to get a green run.