@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,172 @@
1
+ {
2
+ "id": "test-suite-backfill",
3
+ "name": "Test Suite Backfill",
4
+ "description": "Add tests that actually bite to untested code: rank the untested behavior by breakage cost, write tests in the project's real layout that a wrong implementation would fail, and prove the suite green with real run receipts — under an enforced independent review.",
5
+ "category": "code-quality",
6
+ "role": "maintenance-review",
7
+ "tags": [
8
+ "tests",
9
+ "coverage",
10
+ "testing",
11
+ "quality",
12
+ "regression"
13
+ ],
14
+ "triggers": [
15
+ "add tests to this code",
16
+ "backfill tests",
17
+ "increase test coverage",
18
+ "write tests for an untested module",
19
+ "test this function"
20
+ ],
21
+ "about": "Backfill a test suite that would actually catch a regression, not one that inflates a coverage number. First map the RISK: read the target modules and rank their untested behavior by breakage cost — what would hurt most if it went silently wrong — then choose concrete targets, because a suite built without that ranking pins the easy paths and misses the expensive ones. Then WRITE the tests in the project's real test layout and style, with one discipline above all others: every test must be able to FAIL. Assert actual values, actual errors, actual edge cases — never tautologies like expecting true, asserting a mock returns what it was told, or restating the implementation back at itself. The module under test does not change: if a test exposes what looks like a genuine bug, pin the current behavior or flag it honestly for the user instead of silently editing the source to match an expectation. Then VERIFY with the whole suite green — judged from real run receipts, not the author's summary — and a per-test statement of the regression each one guards. Finally an independent reviewer opens the tests themselves and grades the assertions against fixed criteria; a REVISE verdict routes the work back automatically with concrete findings. Needs a project whose tests run via `npm run test`. Suited to unattended night-shift runs. Works identically whether the run edits the project directly or drafts a change proposal for the user to apply.",
22
+ "doc": {
23
+ "capabilityFloor": "small",
24
+ "diffpackCapable": true,
25
+ "commands": [
26
+ {
27
+ "scope": "script",
28
+ "name": "test",
29
+ "reason": "The new tests must run green in the real suite — the verify gate checks real run receipts, not claims."
30
+ }
31
+ ],
32
+ "runModes": {
33
+ "nightShift": "supported"
34
+ }
35
+ },
36
+ "workflow": {
37
+ "plan": "Map untested behavior by breakage cost and choose targets -> write tests in the real layout that a wrong implementation would fail -> verify the whole suite green with run receipts -> enforced independent review of the assertions.",
38
+ "maxGateAttempts": 4,
39
+ "maxReviewRounds": 3,
40
+ "phases": [
41
+ {
42
+ "id": "risk-map",
43
+ "name": "Map the risk",
44
+ "description": "Read the target modules and rank untested behavior by breakage cost; choose concrete targets. No test writing yet.",
45
+ "suggestedRole": "quality engineer",
46
+ "capabilityFloor": "small",
47
+ "prompt": "Before writing any test, learn what is worth testing. Read the target module(s) named by the task with `read_file` — the whole file, not the signatures — and read the existing test layout (`list_dir` on the test folder, then the test files) to learn where tests live and how this project writes them. Rank the UNTESTED behavior by breakage cost: what would hurt users or downstream code most if it went silently wrong — boundary semantics, error contracts, arithmetic, state transitions — not what is easiest to cover. Then choose concrete targets: the specific functions and the specific behaviors of each you will pin, including the edge and error cases. Be honest about what you are deliberately leaving untested and why.\n\nWrite `{{workPath}}/risk-map.md` with exactly these sections: `## Modules` (each target module and what it does, with backtick paths), `## Risks ranked` (the untested behaviors ordered by breakage cost, with the cost stated), `## Chosen targets` (the tests you will write, each naming the behavior it pins). Every path you cite must be real.",
48
+ "output": {
49
+ "path": "{{workPath}}/risk-map.md",
50
+ "minBytes": 500,
51
+ "requiredPatterns": [
52
+ {
53
+ "pattern": "^##\\s+Modules",
54
+ "label": "Modules section"
55
+ },
56
+ {
57
+ "pattern": "^##\\s+Risks ranked",
58
+ "label": "Risks ranked section"
59
+ },
60
+ {
61
+ "pattern": "^##\\s+Chosen targets",
62
+ "label": "Chosen targets section"
63
+ }
64
+ ],
65
+ "additionalChecks": [
66
+ {
67
+ "kind": "citationsResolve",
68
+ "file": "{{workPath}}/risk-map.md",
69
+ "minCitations": 2,
70
+ "artifact": true
71
+ }
72
+ ]
73
+ }
74
+ },
75
+ {
76
+ "id": "write-tests",
77
+ "name": "Write tests that can fail",
78
+ "description": "Add the tests in the project's real layout and style, asserting actual behavior — never tautologies.",
79
+ "suggestedRole": "software engineer",
80
+ "capabilityFloor": "small",
81
+ "prompt": "Read `{{workPath}}/risk-map.md` and write the chosen tests in the project's REAL test layout and style — the same folder, naming convention, and assertion idioms the existing tests use, added with `write_file`. There is no prescribed output path for the tests themselves; they live where this project's tests live. Every test must be able to FAIL: assert actual values, actual thrown errors, actual edge-case results. Never write tautologies — expecting true, asserting a mock returns what it was told, or asserting whatever the implementation currently returns without knowing why it is right. Backfill means tests, not source changes: do not modify the module under test. If a test exposes what you believe is a genuine bug, pin the current behavior with a characterization test or flag it honestly in your notes for the user — never silently edit the source to match your expectation. Run the suite with `run_package_script` (`test`) as you go and make each test pass for the right reason; if the command needs first-use approval, say so and wait rather than guessing.\n\nThen write `{{workPath}}/test-notes.md` with exactly these sections: `## Tests added` (the real path of every new test file, backtick path per line), `## Behaviors pinned` (each test and the exact behavior it asserts), `## How each test would catch a realistic break` (for each test, the plausible wrong implementation it would fail on).",
82
+ "output": {
83
+ "path": "{{workPath}}/test-notes.md",
84
+ "minBytes": 600,
85
+ "requiredPatterns": [
86
+ {
87
+ "pattern": "^##\\s+Tests added",
88
+ "label": "Tests added section"
89
+ },
90
+ {
91
+ "pattern": "^##\\s+Behaviors pinned",
92
+ "label": "Behaviors pinned section"
93
+ },
94
+ {
95
+ "pattern": "^##\\s+How each test would catch a realistic break",
96
+ "label": "realistic-break section"
97
+ }
98
+ ],
99
+ "additionalChecks": [
100
+ {
101
+ "kind": "citationsResolve",
102
+ "file": "{{workPath}}/test-notes.md",
103
+ "minCitations": 2,
104
+ "artifact": true
105
+ }
106
+ ]
107
+ }
108
+ },
109
+ {
110
+ "id": "verify",
111
+ "name": "Verify the suite green",
112
+ "description": "Run the whole suite and record the real result, with a per-test statement of the regression it guards.",
113
+ "suggestedRole": "software engineer",
114
+ "capabilityFloor": "small",
115
+ "prompt": "Prove the backfill with a full, fresh run. Execute the whole suite with `run_package_script` (`test`) — every test, old and new, must pass. If anything fails, fix the TEST (or honestly report the module bug it exposed); do not touch the module under test to force green. Then account for the coverage: for each new test, one line stating the regression it now guards — what break it would catch that yesterday's suite would have missed. Compare against `{{workPath}}/risk-map.md`: any chosen target you did not cover gets an honest deferral with the reason, never silence.\n\nWrite `{{workPath}}/verification.md` with exactly these sections: `## Suite` (the exact command and the real full-suite result), `## Coverage summary` (per-test: the regression it guards; plus honest deferrals), `## Result` (green confirmed, or what remains open and why).",
116
+ "output": {
117
+ "path": "{{workPath}}/verification.md",
118
+ "minBytes": 400,
119
+ "requiredPatterns": [
120
+ {
121
+ "pattern": "^##\\s+Suite",
122
+ "label": "Suite section"
123
+ },
124
+ {
125
+ "pattern": "^##\\s+Coverage summary",
126
+ "label": "Coverage summary section"
127
+ },
128
+ {
129
+ "pattern": "^##\\s+Result",
130
+ "label": "Result section"
131
+ }
132
+ ],
133
+ "additionalChecks": [
134
+ {
135
+ "kind": "citationsResolve",
136
+ "file": "{{workPath}}/verification.md",
137
+ "minCitations": 2,
138
+ "artifact": true
139
+ },
140
+ {
141
+ "kind": "commandEvidence",
142
+ "script": "test",
143
+ "expect": "pass",
144
+ "label": "the whole suite is green with the new tests (verified run receipt)"
145
+ }
146
+ ]
147
+ }
148
+ }
149
+ ],
150
+ "review": {
151
+ "artifactPath": "{{workPath}}/verification.md",
152
+ "relatedPaths": [
153
+ "{{workPath}}/risk-map.md",
154
+ "{{workPath}}/test-notes.md"
155
+ ],
156
+ "reviewPath": "{{workPath}}/review.md",
157
+ "reviewerRole": "test reviewer",
158
+ "repairRole": "software engineer",
159
+ "minReviewBytes": 400,
160
+ "enforce": {
161
+ "fixStepId": "repair"
162
+ },
163
+ "criteria": [
164
+ "The new tests live in the project's real test layout and follow its existing naming and assertion style — open the test files and check.",
165
+ "Each test pins observable behavior a wrong implementation would fail: open the assertions — expecting true, asserting a mock returns what it was told, or restating the implementation back at itself does not pass.",
166
+ "The edge and error cases the risk map ranked are covered, or honestly deferred with a stated reason — reconcile risk-map.md's chosen targets against test-notes.md and verification.md.",
167
+ "The whole suite is green by real run receipt, judged from the recorded runs rather than the author's summary.",
168
+ "The module under test was not modified to make tests pass — the only changes are new or updated test files and the working notes."
169
+ ]
170
+ }
171
+ }
172
+ }
@@ -0,0 +1,185 @@
1
+ {
2
+ "id": "type-safety-pass",
3
+ "name": "Type-Safety Pass",
4
+ "description": "Tighten a module against unsafe patterns — loose equality, implicit coercions, swallowed catches, untyped boundaries, any-casts — with counted evidence: an audit that inventories the patterns by a stated method, fixes that never silence a check to move a count, a same-method re-count, and an enforced independent review.",
5
+ "category": "code-quality",
6
+ "role": "maintenance-review",
7
+ "tags": [
8
+ "types",
9
+ "typescript",
10
+ "javascript",
11
+ "type-safety",
12
+ "strict",
13
+ "quality"
14
+ ],
15
+ "triggers": [
16
+ "tighten the types",
17
+ "kill any types",
18
+ "add type annotations",
19
+ "make this type-safe",
20
+ "fix type errors"
21
+ ],
22
+ "about": "Tighten code against the unsafe patterns that turn into 3am bugs, with the improvement proven by counting rather than claiming. First AUDIT: inventory the patterns in scope WITH COUNTS gathered by a stated, repeatable method (a grep per pattern, expressions quoted) — loose equality against null or undefined, implicit string/number coercions, swallowed catches that hide real errors, untyped or unvalidated boundaries, and in TypeScript projects any-casts and ignore-comments. The audit picks the concrete targets, names which behavioral consequences of these patterns are bugs this pass is expected to fix, records the guardrail, and captures the suite green before any change. Then CHANGE: fix pattern by pattern at the real sites — and never buy a lower count by weakening the code: no deleted assertions, no silenced error paths, no bare casts, no ignore-comments; a count that falls that way is a regression wearing a metric. Then VERIFY: re-count with exactly the audit's method, quote before and after per pattern, and show the suite green. Finally an independent reviewer grades the chain — counts genuinely fell by the same method, no suppression, behavior preserved except the declared consequence fixes — and a REVISE verdict routes the work back automatically with concrete findings. Small enough to run as night-shift work. 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": "Where to tighten",
30
+ "description": "The module, folder, or area to audit for unsafe patterns. Leave empty when the task description already carries it.",
31
+ "default": ""
32
+ }
33
+ }
34
+ },
35
+ "capabilityFloor": "small",
36
+ "diffpackCapable": true,
37
+ "runModes": {
38
+ "nightShift": "supported"
39
+ },
40
+ "commands": [
41
+ {
42
+ "scope": "script",
43
+ "name": "test",
44
+ "reason": "The suite is the guardrail: it must be green before the pass starts and green at the end, so tightened checks provably did not break pinned behavior. The gates verify the green-before/green-after receipts from real runs, not the author's claims."
45
+ }
46
+ ]
47
+ },
48
+ "workflow": {
49
+ "plan": "Audit the unsafe patterns with counts and a stated method, pick targets, record the guardrail and a green suite -> fix pattern by pattern at the real sites without silencing anything -> re-count with the same method, quote before/after, suite green -> enforced independent review.",
50
+ "maxGateAttempts": 4,
51
+ "maxReviewRounds": 3,
52
+ "phases": [
53
+ {
54
+ "id": "audit",
55
+ "name": "Audit with counts",
56
+ "description": "Inventory the unsafe patterns in scope with counts by a stated method, pick concrete targets, record the guardrail, and capture the suite green.",
57
+ "suggestedRole": "code auditor",
58
+ "capabilityFloor": "small",
59
+ "prompt": "The area to tighten: {{scope}}\n\nInventory the unsafe patterns before fixing any of them — the improvement will be proven by re-counting later, so the counts and the exact method are the deliverable here. Read the involved source, then count each pattern class in scope with a stated, repeatable method (a grep per pattern works; quote the exact expressions you used): loose equality against null or undefined (`==`/`!=` where a strict check belongs), implicit string/number coercions (arithmetic or concatenation on values that may arrive as strings), swallowed catches (a catch that hides the error and carries on as if nothing failed), untyped or unvalidated boundaries (inputs used without a shape check), and in TypeScript projects `any`-casts and ignore-comments. Record the count per pattern and where each hit lives.\n\nPick the concrete targets for this pass and state the guardrail: which behavior is pinned by tests and must not change, and which behavioral CONSEQUENCES of these patterns are bugs this pass is expected to fix — name each one. Then find how the project runs its tests (`list_package_scripts`), run the suite with `run_package_script` (`test`), and record it green before any change; if it is already red, stop and report that honestly. If the command needs first-use approval, say so and wait rather than guessing.\n\nWrite `{{workPath}}/audit.md` with exactly these sections: `## Inventory` (counts by pattern with the exact method and grep expressions used), `## Targets` (the hits this pass will fix, with backtick paths), `## Guardrail` (what must not change, and the declared consequence fixes that may). Cite the real files with backtick paths.",
60
+ "output": {
61
+ "path": "{{workPath}}/audit.md",
62
+ "minBytes": 600,
63
+ "requiredPatterns": [
64
+ {
65
+ "pattern": "^##\\s+Inventory[\\s\\S]*\\d",
66
+ "label": "Inventory section with counts"
67
+ },
68
+ {
69
+ "pattern": "^##\\s+Targets",
70
+ "label": "Targets section"
71
+ },
72
+ {
73
+ "pattern": "^##\\s+Guardrail",
74
+ "label": "Guardrail section"
75
+ }
76
+ ],
77
+ "additionalChecks": [
78
+ {
79
+ "kind": "citationsResolve",
80
+ "file": "{{workPath}}/audit.md",
81
+ "minCitations": 2,
82
+ "artifact": true
83
+ },
84
+ {
85
+ "kind": "commandEvidence",
86
+ "script": "test",
87
+ "expect": "pass",
88
+ "label": "green before the work starts"
89
+ }
90
+ ]
91
+ }
92
+ },
93
+ {
94
+ "id": "change",
95
+ "name": "Fix pattern by pattern",
96
+ "description": "Fix the targeted patterns at the real sites, never silencing a check or weakening an assertion to move a count.",
97
+ "suggestedRole": "software engineer",
98
+ "capabilityFloor": "small",
99
+ "prompt": "Read `{{workPath}}/audit.md` and fix the targeted patterns at the REAL sites with `read_file` plus `write_file`/`replace_in_file`, pattern by pattern. Replace loose equality with strict checks that state what they mean; normalize or validate values at the boundary they cross instead of coercing mid-calculation; make swallowed catches surface the error — rethrow, or report it the way the audit's guardrail declares — rather than carrying on as if nothing failed. Never buy a lower count by weakening the code: no deleting an assertion, no silencing an error path, no bare casts, and in TypeScript no `any` or ignore-comment to make a diagnostic disappear — a count that falls that way is a regression wearing a metric. Behavior changes only where the audit declared a consequence fix, and each one gets named in your notes. Run the suite with `run_package_script` (`test`) as you go and keep it green; a change that goes red gets narrowed, not stacked on. If a targeted hit turns out to be correct as written, record why and leave it — honesty beats a moved count.\n\nWrite `{{workPath}}/change-notes.md` with exactly these sections: `## Patterns addressed` (each pattern class, what the fix was, and any declared consequence fix it delivered), `## Files touched` (backtick path per line), `## Deviations` (targets handled differently than the audit planned, or `none`, honestly).",
100
+ "output": {
101
+ "path": "{{workPath}}/change-notes.md",
102
+ "minBytes": 600,
103
+ "requiredPatterns": [
104
+ {
105
+ "pattern": "^##\\s+Patterns addressed",
106
+ "label": "Patterns addressed section"
107
+ },
108
+ {
109
+ "pattern": "^##\\s+Files touched",
110
+ "label": "Files touched section"
111
+ },
112
+ {
113
+ "pattern": "^##\\s+Deviations",
114
+ "label": "Deviations section"
115
+ }
116
+ ],
117
+ "additionalChecks": [
118
+ {
119
+ "kind": "citationsResolve",
120
+ "file": "{{workPath}}/change-notes.md",
121
+ "minCitations": 2,
122
+ "artifact": true
123
+ }
124
+ ]
125
+ }
126
+ },
127
+ {
128
+ "id": "verify",
129
+ "name": "Re-count and verify",
130
+ "description": "Re-count every pattern with exactly the audit's method, quote before/after counts, and record the suite green.",
131
+ "suggestedRole": "software engineer",
132
+ "capabilityFloor": "small",
133
+ "prompt": "Prove the pass with fresh eyes. Read `{{workPath}}/audit.md` and RE-COUNT every pattern with EXACTLY the method and grep expressions it records — same expressions, same scope; a changed method voids the comparison, and if the recorded method cannot be reproduced that is a finding to report, not a license to substitute one. Quote the audit's count and the new count for each pattern side by side. Run the whole suite with `run_package_script` (`test`) and record the green result. Spot-check the fixed sites: the checks got stronger, not deleted, and no cast or ignore-comment crept in. Anything you could not actually re-run gets labeled unverified, never claimed.\n\nWrite `{{workPath}}/verification.md` with exactly these sections: `## Before / after counts` (per pattern, the audit count next to the re-count, same greps), `## Suite` (the full-suite result from the real run), `## Result` (which declared consequences are now fixed, and anything unverified).",
134
+ "output": {
135
+ "path": "{{workPath}}/verification.md",
136
+ "minBytes": 400,
137
+ "requiredPatterns": [
138
+ {
139
+ "pattern": "^##\\s+Before\\s*/\\s*after counts[\\s\\S]*\\d",
140
+ "label": "Before / after counts with figures"
141
+ },
142
+ {
143
+ "pattern": "^##\\s+Suite",
144
+ "label": "Suite section"
145
+ },
146
+ {
147
+ "pattern": "^##\\s+Result",
148
+ "label": "Result section"
149
+ }
150
+ ],
151
+ "additionalChecks": [
152
+ {
153
+ "kind": "commandEvidence",
154
+ "script": "test",
155
+ "expect": "pass",
156
+ "label": "green after the pass (verified run receipt)"
157
+ }
158
+ ]
159
+ }
160
+ }
161
+ ],
162
+ "review": {
163
+ "artifactPath": "{{workPath}}/verification.md",
164
+ "relatedPaths": [
165
+ "{{workPath}}/audit.md",
166
+ "{{workPath}}/change-notes.md"
167
+ ],
168
+ "reviewPath": "{{workPath}}/review.md",
169
+ "reviewerRole": "code-quality reviewer",
170
+ "repairRole": "software engineer",
171
+ "minReviewBytes": 400,
172
+ "enforce": {
173
+ "fixStepId": "repair"
174
+ },
175
+ "criteria": [
176
+ "audit.md counts real patterns in real files with the exact method recorded (grep expressions quoted), and a green suite receipt exists from before the work started.",
177
+ "Counts genuinely fell and the re-count method matches the audit's exactly: verification.md quotes before and after per pattern — the measured target moved against the recorded baseline using the same method.",
178
+ "No suppression bought the improvement: open the touched files and confirm no assertion was weakened, no check deleted, no error path silenced, and no cast or ignore-comment introduced to move a count.",
179
+ "Observable behavior unchanged (or changed only as the audit declared): each consequence fix the audit named happened and is recorded in change-notes.md, and nothing else moved.",
180
+ "No stage left the suite red (receipts, not claims): green before the pass and green after it, from real runs.",
181
+ "change-notes.md names every touched file (paths that exist) and records its deviations honestly, including targets left alone because they were correct as written."
182
+ ]
183
+ }
184
+ }
185
+ }
@@ -0,0 +1,178 @@
1
+ {
2
+ "id": "ux-update",
3
+ "name": "Implement a UX Change",
4
+ "description": "Deliver a described UX change the disciplined way: capture the before state from the real markup, make the smallest coherent change at the real sites in the product's own conventions, and prove the after state with the existing behaviors still working — under an enforced independent review.",
5
+ "category": "code-build",
6
+ "role": "general",
7
+ "tags": [
8
+ "ux",
9
+ "ui",
10
+ "frontend",
11
+ "user-experience",
12
+ "polish"
13
+ ],
14
+ "triggers": [
15
+ "make this ux change",
16
+ "move the button",
17
+ "improve this flow",
18
+ "update the ui"
19
+ ],
20
+ "about": "Implement a UX change the way a careful product engineer would — grounded in the real code at every step, not in a redescription of it. First UNDERSTAND: restate the requested change as the user would experience it, find the involved surfaces in the actual pages, components, styles, and scripts, and capture the BEFORE state by quoting the real markup and wiring — including every behavior attached to those surfaces (handlers, keyboard shortcuts, ids, state), because each must still work afterwards. Then IMPLEMENT the smallest coherent change at those real sites, matching the surrounding product's conventions — its spacing, naming, and markup patterns — rather than inventing a new style, and moving existing behaviors with the elements rather than dropping them. Then VALIDATE by walking the changed flow and building a concrete before/after comparison grounded in the files, honest about what was inspected versus actually exercised. Finally an independent reviewer grades the delivered change as a user would judge it — request delivered, conventions respected, nothing that worked before broken — and a REVISE verdict routes the work back automatically with concrete findings. This is the fix-applying sibling of the report-only codebase UX review: that book tells you what is wrong, this one delivers the change. Works identically whether the run edits the project directly or drafts a change proposal for the user to apply.",
21
+ "doc": {
22
+ "paramSchema": {
23
+ "type": "object",
24
+ "properties": {
25
+ "scope": {
26
+ "type": "string",
27
+ "title": "The UX change",
28
+ "description": "What should change for the user, in plain words. Leave empty when the task description carries it.",
29
+ "default": ""
30
+ }
31
+ }
32
+ },
33
+ "capabilityFloor": "small",
34
+ "diffpackCapable": true
35
+ },
36
+ "workflow": {
37
+ "plan": "Understand the request and capture the before state from the real code -> implement the smallest coherent change at the real sites in the product's own conventions -> validate the flow with a concrete before/after -> enforced independent review.",
38
+ "maxGateAttempts": 4,
39
+ "maxReviewRounds": 3,
40
+ "phases": [
41
+ {
42
+ "id": "understand",
43
+ "name": "Understand and capture the before state",
44
+ "description": "Restate the change as the user experiences it, find the real surfaces, and quote the current markup and wiring.",
45
+ "suggestedRole": "product engineer",
46
+ "capabilityFloor": "small",
47
+ "prompt": "The UX change to deliver: {{scope}}\n\nUnderstand before touching anything. Restate the requested change as the USER would experience it — what they see and do today, what they should see and do afterwards. Then find the involved surfaces in the REAL code: read the actual pages, components, styles, and scripts with `read_file` until you can point at the exact markup and wiring behind the current experience. Capture the BEFORE state from those files — quote the relevant snippets (the current markup, the handler, the shortcut wiring) so the change can later be judged against reality rather than memory. Catalogue every behavior attached to the surfaces you will touch — handlers, keyboard shortcuts, element ids other code references, state — because each of them must still work afterwards. If the request is ambiguous, record the reading you chose and why; if the described surface cannot be located in this codebase at all, say so honestly and stop rather than inventing one.\n\nWrite `{{workPath}}/before.md` with exactly these sections: `## Request` (the change in the user's terms), `## Current behavior` (what happens today, with the quoted snippets), `## Surfaces involved` (each file and the part it plays, with backtick paths). Every path you cite must be real.",
48
+ "output": {
49
+ "path": "{{workPath}}/before.md",
50
+ "minBytes": 500,
51
+ "requiredPatterns": [
52
+ {
53
+ "pattern": "^##\\s+Request",
54
+ "label": "Request section"
55
+ },
56
+ {
57
+ "pattern": "^##\\s+Current behavior",
58
+ "label": "Current behavior section"
59
+ },
60
+ {
61
+ "pattern": "^##\\s+Surfaces involved",
62
+ "label": "Surfaces involved section"
63
+ }
64
+ ],
65
+ "additionalChecks": [
66
+ {
67
+ "kind": "citationsResolve",
68
+ "file": "{{workPath}}/before.md",
69
+ "minCitations": 2,
70
+ "artifact": true
71
+ }
72
+ ]
73
+ }
74
+ },
75
+ {
76
+ "id": "implement",
77
+ "name": "Implement the smallest coherent change",
78
+ "description": "Deliver the request at the real sites, in the product's own conventions, keeping existing behaviors wired.",
79
+ "suggestedRole": "frontend engineer",
80
+ "capabilityFloor": "small",
81
+ "prompt": "Read `{{workPath}}/before.md` and deliver the SMALLEST coherent change at the real sites it names — edit the actual files with `read_file` plus `write_file`/`replace_in_file`; there is no prescribed output path for the change itself. Match the surrounding product's conventions: reuse its spacing, naming, class patterns, and markup style rather than inventing a new one — open neighboring code to see how this product already does the same kind of thing. Keep every existing behavior working: the handlers, keyboard shortcuts, element ids, and state catalogued in before.md must still be wired when you are done — move them with the element rather than dropping or duplicating them. Do not smuggle in unrequested changes; polish beyond the request is scope creep, not generosity.\n\nThen write `{{workPath}}/fix-notes.md` with exactly these sections: `## Problem` (the request, one paragraph), `## Change` (what you altered and how it delivers the request), `## Files touched` (backtick path per line), `## Consistency notes` (which existing conventions you followed and where you saw them), `## Risk` (what could break; be honest about anything unverified), `## How to verify` (the exact steps a person follows to see the new experience).",
82
+ "output": {
83
+ "path": "{{workPath}}/fix-notes.md",
84
+ "minBytes": 700,
85
+ "requiredPatterns": [
86
+ {
87
+ "pattern": "^##\\s+Problem",
88
+ "label": "Problem section"
89
+ },
90
+ {
91
+ "pattern": "^##\\s+Change",
92
+ "label": "Change section"
93
+ },
94
+ {
95
+ "pattern": "^##\\s+Files touched",
96
+ "label": "Files touched section"
97
+ },
98
+ {
99
+ "pattern": "^##\\s+Consistency notes",
100
+ "label": "Consistency notes section"
101
+ },
102
+ {
103
+ "pattern": "^##\\s+Risk",
104
+ "label": "Risk section"
105
+ },
106
+ {
107
+ "pattern": "^##\\s+How to verify",
108
+ "label": "How to verify section"
109
+ }
110
+ ],
111
+ "additionalChecks": [
112
+ {
113
+ "kind": "citationsResolve",
114
+ "file": "{{workPath}}/fix-notes.md",
115
+ "minCitations": 2,
116
+ "artifact": true
117
+ }
118
+ ]
119
+ }
120
+ },
121
+ {
122
+ "id": "validate",
123
+ "name": "Validate the changed flow",
124
+ "description": "Walk the new experience and build a concrete before/after grounded in the real files.",
125
+ "suggestedRole": "product engineer",
126
+ "capabilityFloor": "small",
127
+ "prompt": "Prove the change as the user would experience it. Read `{{workPath}}/before.md` and `{{workPath}}/fix-notes.md`, then re-open the changed files with `read_file` and walk the flow: where the element lives now, what happens on each interaction, where focus goes, what each shortcut does. Build a concrete before/after comparison grounded in the real files — quote the after state next to the before state that before.md recorded. Re-check every behavior from before.md's catalogue: each handler, shortcut, and id must be verifiably still wired in the current code. Say plainly which parts you INSPECTED (read the code) versus EXERCISED (actually ran or interacted with) — anything that is neither is unverified and must be named, never claimed.\n\nWrite `{{workPath}}/validation.md` with exactly these sections: `## Before / after` (the concrete comparison, quoting both states), `## What was exercised` (inspected versus exercised, honestly), `## Result` (delivered as requested, or what remains open and why).",
128
+ "output": {
129
+ "path": "{{workPath}}/validation.md",
130
+ "minBytes": 500,
131
+ "requiredPatterns": [
132
+ {
133
+ "pattern": "^##\\s+Before\\s*/\\s*after",
134
+ "label": "Before / after section"
135
+ },
136
+ {
137
+ "pattern": "^##\\s+What was exercised",
138
+ "label": "What was exercised section"
139
+ },
140
+ {
141
+ "pattern": "^##\\s+Result",
142
+ "label": "Result section"
143
+ }
144
+ ],
145
+ "additionalChecks": [
146
+ {
147
+ "kind": "citationsResolve",
148
+ "file": "{{workPath}}/validation.md",
149
+ "minCitations": 2,
150
+ "artifact": true
151
+ }
152
+ ]
153
+ }
154
+ }
155
+ ],
156
+ "review": {
157
+ "artifactPath": "{{workPath}}/validation.md",
158
+ "relatedPaths": [
159
+ "{{workPath}}/before.md",
160
+ "{{workPath}}/fix-notes.md"
161
+ ],
162
+ "reviewPath": "{{workPath}}/review.md",
163
+ "reviewerRole": "ux reviewer",
164
+ "repairRole": "frontend engineer",
165
+ "minReviewBytes": 400,
166
+ "enforce": {
167
+ "fixStepId": "repair"
168
+ },
169
+ "criteria": [
170
+ "The delivered change matches the request as a user would judge it — open the changed files and walk the flow; do not grade from fix-notes.md alone.",
171
+ "The change respects the surrounding product's conventions — open neighboring code and compare naming, spacing, and markup patterns; a one-off new style where an existing pattern served does not pass.",
172
+ "Nothing that worked before broke: every handler, keyboard shortcut, and id catalogued in before.md is still wired in the current code — check the wiring, not the claim.",
173
+ "before.md quotes the real prior state and validation.md's before/after is grounded in the current files, not reconstructed from memory.",
174
+ "The change is minimal: no unrequested alterations rode along with it."
175
+ ]
176
+ }
177
+ }
178
+ }