@bendyline/gilde 0.1.40 → 0.1.41

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 (147) hide show
  1. package/authoring/gstack/overlays/investigate.json +1 -0
  2. package/authoring/gstack/overlays/qa-only.json +1 -0
  3. package/authoring/gstack/wave.json +12 -2
  4. package/authoring/tactical/books/accessibility-retrofit.json +188 -0
  5. package/authoring/tactical/books/apply-review-findings.json +189 -0
  6. package/authoring/tactical/books/bug-fix-tdd.json +237 -0
  7. package/authoring/tactical/books/ci-pipeline.json +168 -0
  8. package/authoring/tactical/books/codemod-sweep.json +182 -0
  9. package/authoring/tactical/books/dependency-upgrade.json +196 -0
  10. package/authoring/tactical/books/flaky-test-fix.json +238 -0
  11. package/authoring/tactical/books/hotfix-flow.json +187 -0
  12. package/authoring/tactical/books/perf-optimization.json +219 -0
  13. package/authoring/tactical/books/refactor-module.json +217 -0
  14. package/authoring/tactical/books/schema-migration.json +192 -0
  15. package/authoring/tactical/books/test-suite-backfill.json +172 -0
  16. package/authoring/tactical/books/type-safety-pass.json +185 -0
  17. package/authoring/tactical/books/ux-update.json +178 -0
  18. package/authoring/tactical/evals/accessibility-retrofit.json +230 -0
  19. package/authoring/tactical/evals/apply-review-findings.json +290 -0
  20. package/authoring/tactical/evals/bug-fix-tdd.json +221 -0
  21. package/authoring/tactical/evals/ci-pipeline.json +227 -0
  22. package/authoring/tactical/evals/codemod-sweep.json +252 -0
  23. package/authoring/tactical/evals/dependency-upgrade.json +235 -0
  24. package/authoring/tactical/evals/flaky-test-fix.json +239 -0
  25. package/authoring/tactical/evals/hotfix-flow.json +220 -0
  26. package/authoring/tactical/evals/perf-optimization.json +235 -0
  27. package/authoring/tactical/evals/refactor-module.json +241 -0
  28. package/authoring/tactical/evals/schema-migration.json +225 -0
  29. package/authoring/tactical/evals/test-suite-backfill.json +197 -0
  30. package/authoring/tactical/evals/type-safety-pass.json +221 -0
  31. package/authoring/tactical/evals/ux-update.json +206 -0
  32. package/authoring/tactical/wave.json +89 -0
  33. package/data/chat-models/de/deepseek-r1-8b-q4/manifest.json +56 -1
  34. package/data/chat-models/gl/glm-5.2-754b-q2/manifest.json +56 -0
  35. package/data/chat-models/gp/gpt-oss-120b-q4/manifest.json +73 -1
  36. package/data/chat-models/gp/gpt-oss-20b-q4/manifest.json +77 -1
  37. package/data/chat-models/index.json +1 -1
  38. package/data/chat-models/ll/llama3.2-3b-q4/manifest.json +3 -1
  39. package/data/chat-models/mi/mistral-7b-q4/manifest.json +54 -3
  40. package/data/chat-models/mi/mistral-medium-3.5-128b-q4/manifest.json +76 -1
  41. package/data/craftbook-templates/ac/accessibility-retrofit/manifest.json +5 -4
  42. package/data/craftbook-templates/ac/accessibility-retrofit/versions/2.0.0/craftbook.json +451 -0
  43. package/data/craftbook-templates/ac/accessibility-retrofit/versions/2.0.0/test.json +231 -0
  44. package/data/craftbook-templates/al/alt-text-pass/manifest.json +5 -1
  45. package/data/craftbook-templates/ap/apply-review-findings/art.json +12 -0
  46. package/data/craftbook-templates/ap/apply-review-findings/logo.webp +0 -0
  47. package/data/craftbook-templates/ap/apply-review-findings/manifest.json +23 -0
  48. package/data/craftbook-templates/ap/apply-review-findings/versions/1.0.0/craftbook.json +436 -0
  49. package/data/craftbook-templates/ap/apply-review-findings/versions/1.0.0/test.json +291 -0
  50. package/data/craftbook-templates/br/browser-qa-audit/manifest.json +5 -1
  51. package/data/craftbook-templates/br/browser-qa-audit/versions/2.0.5/craftbook.json +438 -0
  52. package/data/craftbook-templates/br/browser-qa-audit/versions/2.0.5/test.json +379 -0
  53. package/data/craftbook-templates/bu/bug-fix-tdd/manifest.json +3 -3
  54. package/data/craftbook-templates/bu/bug-fix-tdd/versions/2.0.0/craftbook.json +545 -0
  55. package/data/craftbook-templates/bu/bug-fix-tdd/versions/2.0.0/test.json +222 -0
  56. package/data/craftbook-templates/ch/changelog-cut/manifest.json +5 -1
  57. package/data/craftbook-templates/ch/changelog-writeup/manifest.json +5 -1
  58. package/data/craftbook-templates/ci/ci-pipeline/manifest.json +5 -3
  59. package/data/craftbook-templates/ci/ci-pipeline/versions/2.0.0/craftbook.json +423 -0
  60. package/data/craftbook-templates/ci/ci-pipeline/versions/2.0.0/test.json +228 -0
  61. package/data/craftbook-templates/co/codemod-sweep/art.json +12 -0
  62. package/data/craftbook-templates/co/codemod-sweep/logo.webp +0 -0
  63. package/data/craftbook-templates/co/codemod-sweep/manifest.json +23 -0
  64. package/data/craftbook-templates/co/codemod-sweep/versions/1.0.0/craftbook.json +441 -0
  65. package/data/craftbook-templates/co/codemod-sweep/versions/1.0.0/test.json +253 -0
  66. package/data/craftbook-templates/de/dependency-upgrade/art.json +12 -0
  67. package/data/craftbook-templates/de/dependency-upgrade/logo.webp +0 -0
  68. package/data/craftbook-templates/de/dependency-upgrade/manifest.json +23 -0
  69. package/data/craftbook-templates/de/dependency-upgrade/versions/1.0.0/craftbook.json +459 -0
  70. package/data/craftbook-templates/de/dependency-upgrade/versions/1.0.0/test.json +236 -0
  71. package/data/craftbook-templates/fe/feature-flag-release/manifest.json +5 -1
  72. package/data/craftbook-templates/fe/feature-flag-rollout/manifest.json +4 -1
  73. package/data/craftbook-templates/fe/feature-flag-rollout/versions/1.1.0/craftbook.json +203 -0
  74. package/data/craftbook-templates/fe/feature-flag-rollout/versions/1.1.0/test.json +165 -0
  75. package/data/craftbook-templates/fl/flaky-test-fix/art.json +12 -0
  76. package/data/craftbook-templates/fl/flaky-test-fix/logo.webp +0 -0
  77. package/data/craftbook-templates/fl/flaky-test-fix/manifest.json +24 -0
  78. package/data/craftbook-templates/fl/flaky-test-fix/versions/1.0.0/craftbook.json +534 -0
  79. package/data/craftbook-templates/fl/flaky-test-fix/versions/1.0.0/test.json +240 -0
  80. package/data/craftbook-templates/ho/hotfix-flow/manifest.json +5 -3
  81. package/data/craftbook-templates/ho/hotfix-flow/versions/2.0.0/craftbook.json +442 -0
  82. package/data/craftbook-templates/ho/hotfix-flow/versions/2.0.0/test.json +221 -0
  83. package/data/craftbook-templates/in/investigate/manifest.json +4 -1
  84. package/data/craftbook-templates/in/investigate-root-cause/manifest.json +5 -1
  85. package/data/craftbook-templates/index.json +1 -1
  86. package/data/craftbook-templates/li/live-browser-qa/manifest.json +5 -1
  87. package/data/craftbook-templates/ni/nightly-fix-sweep/art.json +12 -0
  88. package/data/craftbook-templates/ni/nightly-fix-sweep/logo.webp +0 -0
  89. package/data/craftbook-templates/ni/nightly-fix-sweep/manifest.json +23 -0
  90. package/data/craftbook-templates/ni/nightly-fix-sweep/versions/1.0.0/craftbook.json +145 -0
  91. package/data/craftbook-templates/ni/nightly-fix-sweep/versions/1.0.0/test.json +121 -0
  92. package/data/craftbook-templates/pe/perf-audit/versions/1.1.0/craftbook.json +195 -0
  93. package/data/craftbook-templates/pe/perf-audit/versions/1.1.0/test.json +165 -0
  94. package/data/craftbook-templates/pe/perf-optimization/manifest.json +3 -3
  95. package/data/craftbook-templates/pe/perf-optimization/versions/2.0.0/craftbook.json +511 -0
  96. package/data/craftbook-templates/pe/perf-optimization/versions/2.0.0/test.json +236 -0
  97. package/data/craftbook-templates/qa/qa/manifest.json +3 -1
  98. package/data/craftbook-templates/re/refactor-module/manifest.json +2 -2
  99. package/data/craftbook-templates/re/refactor-module/versions/1.0.4/craftbook.json +150 -0
  100. package/data/craftbook-templates/re/refactor-module/versions/1.0.4/test.json +95 -0
  101. package/data/craftbook-templates/re/refactor-module/versions/2.0.0/craftbook.json +509 -0
  102. package/data/craftbook-templates/re/refactor-module/versions/2.0.0/test.json +242 -0
  103. package/data/craftbook-templates/re/release-notes/manifest.json +5 -1
  104. package/data/craftbook-templates/re/release-notes/versions/1.0.3/craftbook.json +220 -0
  105. package/data/craftbook-templates/re/release-notes/versions/1.0.3/test.json +114 -0
  106. package/data/craftbook-templates/re/release-pipeline-ci/manifest.json +5 -1
  107. package/data/craftbook-templates/re/release-readiness-review/versions/1.1.0/craftbook.json +192 -0
  108. package/data/craftbook-templates/re/release-readiness-review/versions/1.1.0/test.json +113 -0
  109. package/data/craftbook-templates/ro/root-cause-investigation/manifest.json +7 -1
  110. package/data/craftbook-templates/ro/root-cause-investigation/versions/2.0.5/craftbook.json +433 -0
  111. package/data/craftbook-templates/ro/root-cause-investigation/versions/2.0.5/test.json +157 -0
  112. package/data/craftbook-templates/sc/schema-migration/manifest.json +4 -4
  113. package/data/craftbook-templates/sc/schema-migration/versions/2.0.0/craftbook.json +459 -0
  114. package/data/craftbook-templates/sc/schema-migration/versions/2.0.0/test.json +226 -0
  115. package/data/craftbook-templates/te/test-coverage-review/versions/1.2.0/craftbook.json +195 -0
  116. package/data/craftbook-templates/te/test-coverage-review/versions/1.2.0/test.json +116 -0
  117. package/data/craftbook-templates/te/test-suite-backfill/manifest.json +1 -2
  118. package/data/craftbook-templates/te/test-suite-backfill/versions/2.0.0/craftbook.json +428 -0
  119. package/data/craftbook-templates/te/test-suite-backfill/versions/2.0.0/test.json +198 -0
  120. package/data/craftbook-templates/ty/type-safety-pass/manifest.json +3 -3
  121. package/data/craftbook-templates/ty/type-safety-pass/versions/2.0.0/craftbook.json +428 -0
  122. package/data/craftbook-templates/ty/type-safety-pass/versions/2.0.0/test.json +222 -0
  123. package/data/craftbook-templates/ux/ux-update/art.json +12 -0
  124. package/data/craftbook-templates/ux/ux-update/logo.webp +0 -0
  125. package/data/craftbook-templates/ux/ux-update/manifest.json +22 -0
  126. package/data/craftbook-templates/ux/ux-update/versions/1.0.0/craftbook.json +439 -0
  127. package/data/craftbook-templates/ux/ux-update/versions/1.0.0/test.json +207 -0
  128. package/data/craftbook-templates/ve/version-bump/versions/1.1.0/craftbook.json +206 -0
  129. package/data/craftbook-templates/ve/version-bump/versions/1.1.0/test.json +95 -0
  130. package/data/gezel-templates/bo/boekwachter/versions/1.1.0/about.md +29 -0
  131. package/data/gezel-templates/bo/boekwachter/versions/1.1.0/manifest.json +16 -0
  132. package/data/gezel-templates/bu/builder/versions/1.5.0/about.md +34 -0
  133. package/data/gezel-templates/bu/builder/versions/1.5.0/manifest.json +16 -0
  134. package/data/gezel-templates/de/developer/versions/1.5.0/about.md +34 -0
  135. package/data/gezel-templates/de/developer/versions/1.5.0/manifest.json +21 -0
  136. package/data/gezel-templates/index.json +1 -1
  137. package/data/gezel-templates/re/reviewer/versions/1.4.0/about.md +49 -0
  138. package/data/gezel-templates/re/reviewer/versions/1.4.0/manifest.json +21 -0
  139. package/data/project-types/index.json +1 -1
  140. package/data/project-types/so/software-project/manifest.json +20 -0
  141. package/data/project-types/so/software-project/versions/1.0.0/about.md +3 -0
  142. package/data/project-types/so/software-project/versions/1.0.0/manifest.json +41 -0
  143. package/data/project-types/so/software-project/versions/1.0.0/mission.md +4 -0
  144. package/package.json +1 -1
  145. package/schemas/craftbook-doc.schema.json +248 -0
  146. package/schemas/craftbook-template-version.schema.json +248 -0
  147. package/schemas/craftbook-test.schema.json +200 -0
@@ -0,0 +1,237 @@
1
+ {
2
+ "id": "bug-fix-tdd",
3
+ "name": "Reproduce-Then-Fix a Bug",
4
+ "description": "Fix a bug the disciplined way, with proof at every step: a failing test that reproduces it (verified red by a real test run), the smallest change at the real defect site, a green suite afterwards, and an enforced independent review of the fix.",
5
+ "category": "code-quality",
6
+ "role": "maintenance-review",
7
+ "tags": [
8
+ "bug-fix",
9
+ "tdd",
10
+ "regression-test",
11
+ "debugging",
12
+ "tests",
13
+ "quality"
14
+ ],
15
+ "triggers": [
16
+ "fix this bug",
17
+ "reproduce and fix",
18
+ "tdd bug fix",
19
+ "write a regression test",
20
+ "debug and fix"
21
+ ],
22
+ "about": "Fix a bug with the discipline a senior engineer would demand, and with each claim mechanically verified. First REPRODUCE: write a focused failing test in the project's real test layout and run the suite so the failure is recorded — a bug you cannot reproduce you cannot prove fixed, and this book's gates read the actual run receipts, not the author's summary. Then LOCATE the defect site and its causal chain before touching anything. Then make the SMALLEST change at that real site — never a prescribed scratch file — keeping the new test as a permanent regression guard. Then VALIDATE by re-running the original reproduction and the whole suite, which must now be green. Finally an independent reviewer grades the whole chain against fixed criteria and their REVISE verdict routes the work back automatically with concrete findings. Needs a project whose tests run via `npm run test`. Works identically whether the run edits the project directly or drafts a change proposal for the user to apply.",
23
+ "doc": {
24
+ "paramSchema": {
25
+ "type": "object",
26
+ "properties": {
27
+ "scope": {
28
+ "type": "string",
29
+ "title": "Bug to fix",
30
+ "description": "The bug report, failing behavior, or area to focus on. Leave empty when the task description already carries it.",
31
+ "default": ""
32
+ }
33
+ }
34
+ },
35
+ "capabilityFloor": "small",
36
+ "diffpackCapable": true,
37
+ "commands": [
38
+ {
39
+ "scope": "script",
40
+ "name": "test",
41
+ "reason": "Red-then-green proof: the reproduction must actually fail against the current code, and the whole suite must pass after the fix. The gates verify real run receipts."
42
+ }
43
+ ]
44
+ },
45
+ "workflow": {
46
+ "plan": "Reproduce with a failing test (verified red by a real run) -> locate the defect site and causal chain -> smallest fix at the real site -> validate red-to-green with the original reproduction -> enforced independent review.",
47
+ "maxGateAttempts": 4,
48
+ "maxReviewRounds": 3,
49
+ "phases": [
50
+ {
51
+ "id": "reproduce",
52
+ "name": "Reproduce with a failing test",
53
+ "description": "Establish the failure on the real code, as a running test that fails for the right reason.",
54
+ "suggestedRole": "debugging engineer",
55
+ "capabilityFloor": "small",
56
+ "prompt": "The bug to fix: {{scope}}\n\nEstablish the failure on the REAL code before changing anything. Read the bug description and the involved source. Find how this project runs its tests (`list_package_scripts`, then read the existing test layout). Write ONE focused test that captures the exact wrong behavior, in the project's real test layout and style — never a scratch file like `src/bug.test.js`. Then run the suite with `run_package_script` (`test`) and confirm it FAILS because of your new test, for the right reason — quote the failing assertion. If the command needs first-use approval, say so and wait rather than guessing. If you cannot reproduce the bug at all, record every attempt honestly; do not invent a cause.\n\nWrite `{{workPath}}/repro.md` with exactly these sections: `## Symptom` (what the user sees, in their words), `## Repro command` (the exact command you ran), `## Expected`, `## Actual`, `## Red evidence` (the failing test's path and the quoted failing output from the real run). Cite the real files involved with backtick paths.",
57
+ "output": {
58
+ "path": "{{workPath}}/repro.md",
59
+ "minBytes": 500,
60
+ "requiredPatterns": [
61
+ {
62
+ "pattern": "^##\\s+Symptom",
63
+ "label": "Symptom section"
64
+ },
65
+ {
66
+ "pattern": "^##\\s+Repro command",
67
+ "label": "Repro command section"
68
+ },
69
+ {
70
+ "pattern": "^##\\s+Expected",
71
+ "label": "Expected section"
72
+ },
73
+ {
74
+ "pattern": "^##\\s+Actual",
75
+ "label": "Actual section"
76
+ },
77
+ {
78
+ "pattern": "^##\\s+Red evidence",
79
+ "label": "Red evidence section"
80
+ }
81
+ ],
82
+ "additionalChecks": [
83
+ {
84
+ "kind": "citationsResolve",
85
+ "file": "{{workPath}}/repro.md",
86
+ "minCitations": 2,
87
+ "artifact": true
88
+ },
89
+ {
90
+ "kind": "commandEvidence",
91
+ "script": "test",
92
+ "expect": "fail",
93
+ "label": "the suite genuinely fails (red) with the new reproduction test"
94
+ }
95
+ ]
96
+ }
97
+ },
98
+ {
99
+ "id": "locate",
100
+ "name": "Locate the defect",
101
+ "description": "Name the defect site and the causal chain from it to the symptom. No source edits.",
102
+ "suggestedRole": "root-cause analyst",
103
+ "capabilityFloor": "small",
104
+ "prompt": "Read `{{workPath}}/repro.md`, then trace the failure to its source. Name the defect site precisely: file, symbol, and the first place state or logic goes wrong. Explain the causal chain from that site to the observed symptom, step by step. Check sibling cases: does the same defect pattern appear in neighboring code paths that just have no test yet? Do not edit any source in this phase.\n\nWrite `{{workPath}}/diagnosis.md` with exactly these sections: `## Defect site` (the file and symbol, with backtick paths), `## Causal chain`, `## Siblings checked` (which neighboring paths you inspected and what you found). Every path you cite must be real.",
105
+ "output": {
106
+ "path": "{{workPath}}/diagnosis.md",
107
+ "minBytes": 600,
108
+ "requiredPatterns": [
109
+ {
110
+ "pattern": "^##\\s+Defect site",
111
+ "label": "Defect site section"
112
+ },
113
+ {
114
+ "pattern": "^##\\s+Causal chain",
115
+ "label": "Causal chain section"
116
+ },
117
+ {
118
+ "pattern": "^##\\s+Siblings checked",
119
+ "label": "Siblings checked section"
120
+ }
121
+ ],
122
+ "additionalChecks": [
123
+ {
124
+ "kind": "citationsResolve",
125
+ "file": "{{workPath}}/diagnosis.md",
126
+ "minCitations": 2,
127
+ "artifact": true
128
+ }
129
+ ]
130
+ }
131
+ },
132
+ {
133
+ "id": "fix",
134
+ "name": "Make the smallest fix",
135
+ "description": "Change the real defect site, minimally, keeping the new test as a regression guard.",
136
+ "suggestedRole": "software engineer",
137
+ "capabilityFloor": "small",
138
+ "prompt": "Read `{{workPath}}/diagnosis.md` and make the SMALLEST correct change at the defect site it names. There is no prescribed output path for source changes — edit the actual files from the diagnosis with `read_file` plus `write_file`/`replace_in_file`. Never special-case the reproduction's exact input just to silence the test; fix the cause. Cover the sibling cases the diagnosis flagged, and keep (or strengthen) the reproduction test so it becomes the permanent regression guard. Re-run the focused test while you work.\n\nThen write `{{workPath}}/fix-notes.md` with exactly these sections: `## Problem` (one paragraph), `## Change` (what you altered and why it breaks the causal chain), `## Files touched` (backtick path per line), `## Regression coverage` (which test now guards this), `## Risk` (what could still go wrong; be honest about anything unverified), `## How to verify` (the exact commands a person runs to confirm).",
139
+ "output": {
140
+ "path": "{{workPath}}/fix-notes.md",
141
+ "minBytes": 700,
142
+ "requiredPatterns": [
143
+ {
144
+ "pattern": "^##\\s+Problem",
145
+ "label": "Problem section"
146
+ },
147
+ {
148
+ "pattern": "^##\\s+Change",
149
+ "label": "Change section"
150
+ },
151
+ {
152
+ "pattern": "^##\\s+Files touched",
153
+ "label": "Files touched section"
154
+ },
155
+ {
156
+ "pattern": "^##\\s+Regression coverage",
157
+ "label": "Regression coverage section"
158
+ },
159
+ {
160
+ "pattern": "^##\\s+Risk",
161
+ "label": "Risk section"
162
+ },
163
+ {
164
+ "pattern": "^##\\s+How to verify",
165
+ "label": "How to verify section"
166
+ }
167
+ ],
168
+ "additionalChecks": [
169
+ {
170
+ "kind": "citationsResolve",
171
+ "file": "{{workPath}}/fix-notes.md",
172
+ "minCitations": 2,
173
+ "artifact": true
174
+ }
175
+ ]
176
+ }
177
+ },
178
+ {
179
+ "id": "validate",
180
+ "name": "Validate red-to-green",
181
+ "description": "Re-run the original reproduction and the whole suite; record the real results.",
182
+ "suggestedRole": "software engineer",
183
+ "capabilityFloor": "small",
184
+ "prompt": "Prove the fix with fresh eyes. Read `{{workPath}}/repro.md` and re-run the EXACT reproduction command it records with `run_package_script` (the suite runs ONLY through `run_package_script` with script name \"test\"; `run_installed_script` is for named ops scripts and is NOT the test runner) — the previously failing test must now pass, and the whole suite must be green. Anything you could not actually run gets labeled unverified, never claimed. If something regressed, your fix was too broad — go back and narrow it before validating again.\n\nWrite `{{workPath}}/validation.md` with exactly these sections: `## Repro re-run` (the command and what happened to the once-failing test), `## Suite` (the full-suite result), `## Result` (red-to-green confirmed, or what remains unverified and why).",
185
+ "output": {
186
+ "path": "{{workPath}}/validation.md",
187
+ "minBytes": 400,
188
+ "requiredPatterns": [
189
+ {
190
+ "pattern": "^##\\s+Repro re-run",
191
+ "label": "Repro re-run section"
192
+ },
193
+ {
194
+ "pattern": "^##\\s+Suite",
195
+ "label": "Suite section"
196
+ },
197
+ {
198
+ "pattern": "^##\\s+Result",
199
+ "label": "Result section"
200
+ }
201
+ ],
202
+ "additionalChecks": [
203
+ {
204
+ "kind": "commandEvidence",
205
+ "script": "test",
206
+ "expect": "pass",
207
+ "label": "the whole suite is green after the fix (verified run receipt)"
208
+ }
209
+ ]
210
+ }
211
+ }
212
+ ],
213
+ "review": {
214
+ "artifactPath": "{{workPath}}/validation.md",
215
+ "relatedPaths": [
216
+ "{{workPath}}/repro.md",
217
+ "{{workPath}}/diagnosis.md",
218
+ "{{workPath}}/fix-notes.md"
219
+ ],
220
+ "reviewPath": "{{workPath}}/review.md",
221
+ "reviewerRole": "debugging reviewer",
222
+ "repairRole": "software engineer",
223
+ "minReviewBytes": 400,
224
+ "enforce": {
225
+ "fixStepId": "repair"
226
+ },
227
+ "criteria": [
228
+ "The failure was reproduced with recorded red evidence: repro.md quotes a real failing run of a test that lives in the project's actual test layout, or the run stopped honestly at needs-user.",
229
+ "diagnosis.md names a defect site that exists in this codebase and a causal chain that actually explains the symptom.",
230
+ "The change is at that defect site, is minimal, and covers the sibling cases the diagnosis flagged — open the touched files and check; do not grade from fix-notes.md alone.",
231
+ "validation.md re-ran the original reproduction command and the once-failing test now passes with the whole suite green — judged from the recorded runs, not the author's summary.",
232
+ "The reproduction test survives as a permanent regression guard: it exists in the test layout and would fail again if the fix were reverted.",
233
+ "fix-notes.md names every touched file (paths that exist), states residual risk honestly, and gives runnable verification steps."
234
+ ]
235
+ }
236
+ }
237
+ }
@@ -0,0 +1,168 @@
1
+ {
2
+ "id": "ci-pipeline",
3
+ "name": "CI Pipeline from Scratch",
4
+ "description": "Author a CI pipeline grounded in what the repo actually has: inventory the real package scripts, write the workflow at the conventional location with caching and merge-gating on green, and verify every command it invokes against the manifests — honest that CI itself cannot run locally. Adds a publish-on-tag release job only when the repo shows one.",
5
+ "category": "code-release",
6
+ "role": "maintenance-review",
7
+ "tags": [
8
+ "ci",
9
+ "devops",
10
+ "pipeline",
11
+ "automation",
12
+ "github-actions",
13
+ "cd",
14
+ "release",
15
+ "yaml"
16
+ ],
17
+ "triggers": [
18
+ "set up ci",
19
+ "create a ci pipeline",
20
+ "github actions workflow",
21
+ "build a ci/cd pipeline",
22
+ "add automated testing on push",
23
+ "set up a release pipeline",
24
+ "ci/cd for releases",
25
+ "publish on tag workflow",
26
+ "github actions release",
27
+ "automate the release"
28
+ ],
29
+ "about": "Set up continuous integration the way it survives contact with a real repo: every stage grounded in a command that actually exists, and no claim that local reading cannot back. First INVENTORY: read package.json and the repo layout, record the scripts that genuinely exist with their exact lines quoted, and decide the stages — install, lint, typecheck, test, build, whichever subset is real here — plus caching keyed to the lockfile and the triggers the work calls for. The cardinal sin this book exists to prevent is the invented command: a `run:` line calling a script the repo does not have turns the whole pipeline red on its first push, so nothing enters the plan without a quoted manifest line behind it. A release or publish stage is planned only when the repo shows one — publish config, a release script, a tag convention — and when present it is gated behind the green test/build stages and the tag trigger so publishing can never run before the checks pass. Then AUTHOR the real workflow file(s) at the conventional location for the detected host (`.github/workflows/ci.yml` for GitHub Actions by default): minimal, cached, actions pinned to major versions, gating merges on green, with no fabricated secrets or inputs. Then VERIFY by reading the workflow back and matching EVERY command it invokes to the quoted manifest line that provides it — and by being plain that CI cannot be executed locally, so the notes must say what reading verified and what only a live run on the host can prove. Finally an independent reviewer checks the same ground truth — commands exist, stages ordered, triggers match, nothing invented — and a REVISE verdict routes the work back automatically with concrete findings. Works identically whether the run edits the project directly or drafts a change proposal for the user to apply.",
30
+ "doc": {
31
+ "capabilityFloor": "small",
32
+ "diffpackCapable": true
33
+ },
34
+ "workflow": {
35
+ "plan": "Inventory the repo's real commands and decide the stages -> author the workflow at the conventional location, cached and merge-gating -> verify every invoked command against the manifests, honest about what only a live CI run can prove -> enforced independent review.",
36
+ "maxGateAttempts": 4,
37
+ "maxReviewRounds": 3,
38
+ "phases": [
39
+ {
40
+ "id": "inventory",
41
+ "name": "Inventory the repo",
42
+ "description": "Read the real scripts and layout, then plan stages, caching, and triggers — never a command that does not exist.",
43
+ "suggestedRole": "devops engineer",
44
+ "capabilityFloor": "small",
45
+ "prompt": "Learn what this repo actually needs before writing a line of YAML. Read `package.json` (and any workspace manifests) with `read_file` and record the scripts that genuinely exist — their exact names and the exact lines. Read the repo layout with `list_dir`: the lockfile (which package manager), the language, build outputs, and any existing workflow files. NEVER invent a command: a stage enters your plan only when a matching script or standard invocation exists in the repo — install, lint, typecheck, test, build, in whatever subset is real here, and nothing for tools the repo does not use. Decide caching from the lockfile and package manager, and the triggers the task calls for (typically pushes to the default branch and pull requests). Plan a release or publish stage ONLY when the repo shows one — a publish configuration, a release script, an existing tag convention; when nothing shows one, say so and leave it out. Note the CI host the repo points at (existing workflow files, hosting hints); default to GitHub Actions when nothing says otherwise.\n\nWrite `{{workPath}}/ci-plan.md` with exactly these sections: `## Detected commands` (each script name with the exact line quoted from `package.json`), `## Pipeline stages` (the stages in order and why each exists here), `## Caching` (what is cached and what it is keyed on), `## Triggers` (the events and why). Cite the real files with backtick paths.",
46
+ "output": {
47
+ "path": "{{workPath}}/ci-plan.md",
48
+ "minBytes": 500,
49
+ "requiredPatterns": [
50
+ {
51
+ "pattern": "^##\\s+Detected commands",
52
+ "label": "Detected commands section"
53
+ },
54
+ {
55
+ "pattern": "^##\\s+Pipeline stages",
56
+ "label": "Pipeline stages section"
57
+ },
58
+ {
59
+ "pattern": "^##\\s+Caching",
60
+ "label": "Caching section"
61
+ },
62
+ {
63
+ "pattern": "^##\\s+Triggers",
64
+ "label": "Triggers section"
65
+ }
66
+ ],
67
+ "additionalChecks": [
68
+ {
69
+ "kind": "citationsResolve",
70
+ "file": "{{workPath}}/ci-plan.md",
71
+ "minCitations": 2,
72
+ "artifact": true
73
+ }
74
+ ]
75
+ }
76
+ },
77
+ {
78
+ "id": "author",
79
+ "name": "Author the workflow",
80
+ "description": "Write the real workflow file(s) at the conventional location — minimal, cached, pinned, gating merges on green.",
81
+ "suggestedRole": "devops engineer",
82
+ "capabilityFloor": "small",
83
+ "prompt": "Read `{{workPath}}/ci-plan.md` and write the REAL workflow file(s) with `write_file` at the conventional location for the detected host — for GitHub Actions, `.github/workflows/ci.yml` unless the repo already has its own convention. Keep it minimal and fast: the planned stages in order, dependency caching wired to the lockfile, and the workflow triggering on the planned pushes and pull requests so merges gate on green. Pin every action to a major version (for example `actions/checkout@v4`); do not invent action names, inputs, or secrets. Every `run:` line must invoke a command the plan detected — nothing else. Add a release or publish job ONLY if ci-plan.md called for one, and gate it behind the green build/test stages and the tag trigger so a publish can never run before the checks pass; if the plan named no release stage, do not add one.\n\nThen write `{{workPath}}/ci-notes.md` with exactly these sections: `## Files written` (the real path of every workflow file, backtick path per line), `## Stages` (each job and step, and the detected command it runs), `## Choices explained` (caching, triggers, pinning, and anything you deliberately left out — including a release job when the repo showed no evidence for one).",
84
+ "output": {
85
+ "path": "{{workPath}}/ci-notes.md",
86
+ "minBytes": 500,
87
+ "requiredPatterns": [
88
+ {
89
+ "pattern": "^##\\s+Files written",
90
+ "label": "Files written section"
91
+ },
92
+ {
93
+ "pattern": "^##\\s+Stages",
94
+ "label": "Stages section"
95
+ },
96
+ {
97
+ "pattern": "^##\\s+Choices explained",
98
+ "label": "Choices explained section"
99
+ }
100
+ ],
101
+ "additionalChecks": [
102
+ {
103
+ "kind": "citationsResolve",
104
+ "file": "{{workPath}}/ci-notes.md",
105
+ "minCitations": 2,
106
+ "artifact": true
107
+ }
108
+ ]
109
+ }
110
+ },
111
+ {
112
+ "id": "verify",
113
+ "name": "Verify against the manifests",
114
+ "description": "Read the workflow back and match every invoked command to the manifest line that provides it; honest about what only a live run proves.",
115
+ "suggestedRole": "devops engineer",
116
+ "capabilityFloor": "small",
117
+ "prompt": "Verify the workflow the only honest way available without a CI run: read it back and check every claim against the repo. Open each workflow file named in `{{workPath}}/ci-notes.md` with `read_file`, and for EVERY command it invokes, find and quote the `package.json` line (or manifest entry) that provides it — a `run:` line with no matching script is a defect: fix it now at the workflow's real site, not in prose. Confirm the triggers match `{{workPath}}/ci-plan.md`. Confirm every action reference is pinned to a major version, and every secret the workflow references is a standard one (`GITHUB_TOKEN`) or one the user explicitly named — an invented secret is a defect. Be plain about the limit of this verification: CI cannot be executed locally, so state what reading verified and what only a real run on the host can prove — never claim the pipeline ran.\n\nWrite `{{workPath}}/verification.md` with exactly these sections: `## Workflow files` (each file checked, backtick paths), `## Commands verified against package.json` (each workflow command with the quoted manifest line that provides it), `## Result` (what reading verified, what only a live CI run can prove, and any defects found and fixed).",
118
+ "output": {
119
+ "path": "{{workPath}}/verification.md",
120
+ "minBytes": 500,
121
+ "requiredPatterns": [
122
+ {
123
+ "pattern": "^##\\s+Workflow files",
124
+ "label": "Workflow files section"
125
+ },
126
+ {
127
+ "pattern": "^##\\s+Commands verified against package\\.json",
128
+ "label": "Commands verified section"
129
+ },
130
+ {
131
+ "pattern": "^##\\s+Result",
132
+ "label": "Result section"
133
+ }
134
+ ],
135
+ "additionalChecks": [
136
+ {
137
+ "kind": "citationsResolve",
138
+ "file": "{{workPath}}/verification.md",
139
+ "minCitations": 2,
140
+ "artifact": true
141
+ }
142
+ ]
143
+ }
144
+ }
145
+ ],
146
+ "review": {
147
+ "artifactPath": "{{workPath}}/verification.md",
148
+ "relatedPaths": [
149
+ "{{workPath}}/ci-plan.md",
150
+ "{{workPath}}/ci-notes.md"
151
+ ],
152
+ "reviewPath": "{{workPath}}/review.md",
153
+ "reviewerRole": "devops reviewer",
154
+ "repairRole": "devops engineer",
155
+ "minReviewBytes": 400,
156
+ "enforce": {
157
+ "fixStepId": "repair"
158
+ },
159
+ "criteria": [
160
+ "Every command the workflow invokes exists in the repo — open package.json (and any other manifests) and check each run: line yourself; a script the repo does not have fails this criterion.",
161
+ "The stages are ordered sensibly (dependencies installed before lint/test/build) and dependency caching is wired to the real lockfile.",
162
+ "The triggers match ci-plan.md, and a release or publish job exists only where the plan showed repo evidence for one — gated behind the green stages and the tag trigger when present.",
163
+ "Nothing is invented: every action is pinned to a major version, no fabricated action inputs, and no secrets beyond standard ones or those the user explicitly named.",
164
+ "verification.md is honest about the limit of local verification — what reading proved versus what only a live CI run can prove — and the accounts reconcile across ci-plan.md, ci-notes.md, and verification.md."
165
+ ]
166
+ }
167
+ }
168
+ }
@@ -0,0 +1,182 @@
1
+ {
2
+ "id": "codemod-sweep",
3
+ "name": "Codemod Sweep",
4
+ "description": "Make a mechanical change everywhere it applies - a rename, an API-call migration, dead-code removal: enumerate every site first, apply the change under stated invariants, then re-scan to prove zero un-excluded sites remain, with counts that reconcile exactly and a green suite as receipts.",
5
+ "category": "code-quality",
6
+ "role": "general",
7
+ "tags": [
8
+ "codemod",
9
+ "rename",
10
+ "refactor",
11
+ "sweep",
12
+ "mechanical-change",
13
+ "quality"
14
+ ],
15
+ "triggers": [
16
+ "rename across the repo",
17
+ "codemod",
18
+ "migrate every call",
19
+ "remove the dead code"
20
+ ],
21
+ "about": "Run a mechanical, wide change - a rename, an API-call migration, a dead-code removal - the way a careful engineer runs a codemod: completeness IS the product, and each claim is mechanically verified. First ENUMERATE: work out the concrete search pattern for the old form, run real searches over the actual tree, count every site (definitions, re-exports, imports, call sites, and string mentions such as log lines when the change covers them), and list explicit exclusions - files that must keep the old form, such as changelogs - each with a defensible reason. Then APPLY the change at every listed site while holding the stated invariants (no behavior change beyond the declared one), handling the shapes that break naive sweeps - re-exports, aliased imports, strings - and running the suite as you go. Then VERIFY by re-running the exact search: zero un-excluded sites may remain, the found/changed/excluded counts must reconcile exactly, and the whole suite must be green. Finally an independent reviewer grades the chain against fixed criteria, and their REVISE verdict routes the work back automatically with concrete findings. Needs a project whose tests run via `npm run test`. Works identically whether the run edits the project directly or drafts a change proposal for the user to apply.",
22
+ "doc": {
23
+ "paramSchema": {
24
+ "type": "object",
25
+ "properties": {
26
+ "scope": {
27
+ "type": "string",
28
+ "title": "The mechanical change",
29
+ "description": "What to sweep: a rename, an API-call migration, dead-code removal. Name the old and new forms when you can.",
30
+ "default": ""
31
+ }
32
+ }
33
+ },
34
+ "capabilityFloor": "small",
35
+ "diffpackCapable": true,
36
+ "commands": [
37
+ {
38
+ "scope": "script",
39
+ "name": "test",
40
+ "reason": "the sweep must not change behavior - receipts"
41
+ }
42
+ ],
43
+ "runModes": {
44
+ "nightShift": "supported"
45
+ }
46
+ },
47
+ "workflow": {
48
+ "plan": "Enumerate every site with real searches (a count plus the list, and exclusions with reasons) -> apply the mechanical change at every listed site under the stated invariants with the suite run as you go -> re-scan to zero un-excluded sites, reconcile the counts, prove the suite green -> enforced independent review.",
49
+ "maxGateAttempts": 4,
50
+ "maxReviewRounds": 3,
51
+ "phases": [
52
+ {
53
+ "id": "enumerate",
54
+ "name": "Enumerate every site",
55
+ "description": "Find every site with real searches before touching one; count them and list explicit exclusions with reasons. No edits in this phase.",
56
+ "suggestedRole": "codebase analyst",
57
+ "capabilityFloor": "small",
58
+ "prompt": "The mechanical change: {{scope}}\n\nFind EVERY site before touching one - the sweep's completeness is the product. Work out the concrete search pattern (or patterns) that finds the old form: the definition, re-exports, imports, call sites, and string mentions such as log lines when the change covers them. Run real searches over the actual tree with `list_dir` and `read_file`, and record the exact pattern you used. Count the sites and list every one with a backtick path. List explicit exclusions - files that genuinely must keep the old form, such as changelogs or other historical records - each with a reason a reviewer could defend. If the old form cannot be found at all, record that honestly and stop. Do not change anything in this phase.\n\nWrite `{{workPath}}/sites.md` with exactly these sections: `## Pattern` (the exact search pattern or patterns), `## Sites found` (the count on its own line, then the list with a backtick path per site and what is at it), `## Exclusions` (each excluded file with its reason, or 'none').",
59
+ "output": {
60
+ "path": "{{workPath}}/sites.md",
61
+ "minBytes": 500,
62
+ "requiredPatterns": [
63
+ {
64
+ "pattern": "^##\\s+Pattern",
65
+ "label": "Pattern section"
66
+ },
67
+ {
68
+ "pattern": "^##\\s+Sites found",
69
+ "label": "Sites found section"
70
+ },
71
+ {
72
+ "pattern": "^##\\s+Exclusions",
73
+ "label": "Exclusions section"
74
+ }
75
+ ],
76
+ "additionalChecks": [
77
+ {
78
+ "kind": "citationsResolve",
79
+ "file": "{{workPath}}/sites.md",
80
+ "minCitations": 2,
81
+ "artifact": true
82
+ }
83
+ ]
84
+ }
85
+ },
86
+ {
87
+ "id": "apply",
88
+ "name": "Apply the change at every site",
89
+ "description": "Make the mechanical change at every listed site, holding the stated invariants; leave exclusions untouched and run the suite as you go.",
90
+ "suggestedRole": "software engineer",
91
+ "capabilityFloor": "small",
92
+ "prompt": "Read `{{workPath}}/sites.md` and make the mechanical change at every listed site with `read_file` plus `write_file`/`replace_in_file`, holding the stated invariants: no behavior change beyond the declared one, and no listed site skipped. Handle the shapes that break naive sweeps deliberately - re-exports, aliased imports, and string mentions such as log lines when the declared change covers them. Leave every excluded file untouched. Run the suite with `run_package_script` (`test`) as you go and finish green; if the suite was red before you started, record that honestly and stop rather than sweeping on top of it. If the command needs first-use approval, say so and wait rather than guessing. A site that cannot take the change without altering behavior gets recorded with its reason, not forced.\n\nWrite `{{workPath}}/change-notes.md` with exactly these sections: `## Sites changed` (the count on its own line - it must reconcile with sites.md, with any difference explained), `## Files touched` (backtick path per line), `## Invariants held` (the declared change and why nothing else changed).",
93
+ "output": {
94
+ "path": "{{workPath}}/change-notes.md",
95
+ "minBytes": 500,
96
+ "requiredPatterns": [
97
+ {
98
+ "pattern": "^##\\s+Sites changed",
99
+ "label": "Sites changed section"
100
+ },
101
+ {
102
+ "pattern": "^##\\s+Files touched",
103
+ "label": "Files touched section"
104
+ },
105
+ {
106
+ "pattern": "^##\\s+Invariants held",
107
+ "label": "Invariants held section"
108
+ }
109
+ ],
110
+ "additionalChecks": [
111
+ {
112
+ "kind": "citationsResolve",
113
+ "file": "{{workPath}}/change-notes.md",
114
+ "minCitations": 2,
115
+ "artifact": true
116
+ }
117
+ ]
118
+ }
119
+ },
120
+ {
121
+ "id": "verify",
122
+ "name": "Re-scan and reconcile",
123
+ "description": "Re-run the exact search to zero un-excluded sites, reconcile the counts across all three documents, and prove the suite green.",
124
+ "suggestedRole": "software engineer",
125
+ "capabilityFloor": "small",
126
+ "prompt": "Prove completeness with fresh eyes. Re-run the exact search pattern recorded in `{{workPath}}/sites.md` over the real tree - zero un-excluded sites may remain - and quote the re-scan and its result. Reconcile the counts: sites found in `{{workPath}}/sites.md`, sites changed in `{{workPath}}/change-notes.md`, and sites remaining now must add up exactly, with every exclusion accounted for. Open a few changed files with `read_file` and confirm the invariants held - nothing changed beyond the declared change. Re-run the whole suite with `run_package_script` (`test`) - it must be green. If the re-scan finds a missed site, fix it and re-scan again; if it cannot be fixed under the invariants, record it honestly instead of hiding it.\n\nWrite `{{workPath}}/verification.md` with exactly these sections: `## Residual scan` (the exact pattern re-run and what it found), `## Counts reconciled` (found vs changed vs excluded, adding up exactly), `## Suite` (the full-suite result), `## Result` (sweep complete, or what remains and why).",
127
+ "output": {
128
+ "path": "{{workPath}}/verification.md",
129
+ "minBytes": 450,
130
+ "requiredPatterns": [
131
+ {
132
+ "pattern": "^##\\s+Residual scan",
133
+ "label": "Residual scan section"
134
+ },
135
+ {
136
+ "pattern": "^##\\s+Counts reconciled",
137
+ "label": "Counts reconciled section"
138
+ },
139
+ {
140
+ "pattern": "^##\\s+Suite",
141
+ "label": "Suite section"
142
+ },
143
+ {
144
+ "pattern": "^##\\s+Result",
145
+ "label": "Result section"
146
+ }
147
+ ],
148
+ "additionalChecks": [
149
+ {
150
+ "kind": "commandEvidence",
151
+ "script": "test",
152
+ "expect": "pass",
153
+ "label": "the suite is green after the sweep (verified run receipt)"
154
+ }
155
+ ]
156
+ }
157
+ }
158
+ ],
159
+ "review": {
160
+ "artifactPath": "{{workPath}}/verification.md",
161
+ "relatedPaths": [
162
+ "{{workPath}}/sites.md",
163
+ "{{workPath}}/change-notes.md"
164
+ ],
165
+ "reviewPath": "{{workPath}}/review.md",
166
+ "reviewerRole": "sweep reviewer",
167
+ "repairRole": "software engineer",
168
+ "minReviewBytes": 400,
169
+ "enforce": {
170
+ "fixStepId": "repair"
171
+ },
172
+ "criteria": [
173
+ "The re-scan in verification.md is quoted and shows zero un-excluded sites remaining for the exact pattern sites.md declared - re-run it yourself if anything looks off.",
174
+ "The counts reconcile exactly across sites.md, change-notes.md, and verification.md: found, changed, excluded, and remaining add up with no unexplained gap.",
175
+ "The invariants held: open a few changed files and confirm nothing changed beyond the declared mechanical change - do not grade from change-notes.md alone.",
176
+ "Tricky shapes were genuinely handled: re-exports, aliased imports, and covered string mentions were changed, not skipped as too hard.",
177
+ "Every exclusion has a defensible reason, and the excluded files are untouched.",
178
+ "The suite is green after the sweep - judged from the recorded run receipts, not the author's summary."
179
+ ]
180
+ }
181
+ }
182
+ }