@bendyline/gilde 0.1.16 → 0.1.18

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 (95) hide show
  1. package/README.md +5 -1
  2. package/authoring/gstack/LICENSE.gstack +21 -0
  3. package/authoring/gstack/README.md +50 -0
  4. package/authoring/gstack/evals/cso.json +152 -0
  5. package/authoring/gstack/evals/design-consultation.json +201 -0
  6. package/authoring/gstack/evals/document-generate.json +174 -0
  7. package/authoring/gstack/evals/investigate.json +153 -0
  8. package/authoring/gstack/evals/office-hours.json +141 -0
  9. package/authoring/gstack/evals/plan-ceo-review.json +135 -0
  10. package/authoring/gstack/evals/qa-only.json +376 -0
  11. package/authoring/gstack/evals/retro.json +191 -0
  12. package/authoring/gstack/evals/spec.json +162 -0
  13. package/authoring/gstack/overlays/cso.json +132 -0
  14. package/authoring/gstack/overlays/design-consultation.json +153 -0
  15. package/authoring/gstack/overlays/document-generate.json +124 -0
  16. package/authoring/gstack/overlays/investigate.json +128 -0
  17. package/authoring/gstack/overlays/office-hours.json +119 -0
  18. package/authoring/gstack/overlays/plan-ceo-review.json +128 -0
  19. package/authoring/gstack/overlays/qa-only.json +145 -0
  20. package/authoring/gstack/overlays/retro.json +132 -0
  21. package/authoring/gstack/overlays/spec.json +140 -0
  22. package/authoring/gstack/persona-drafts/cso.about.md +9 -0
  23. package/authoring/gstack/persona-drafts/design-consultation.about.md +9 -0
  24. package/authoring/gstack/persona-drafts/office-hours.about.md +9 -0
  25. package/authoring/gstack/persona-drafts/qa-only.about.md +5 -0
  26. package/authoring/gstack/persona-drafts/spec.about.md +26 -0
  27. package/authoring/gstack/snapshots/cso/SKILL.md +1285 -0
  28. package/authoring/gstack/snapshots/design-consultation/SKILL.md +1230 -0
  29. package/authoring/gstack/snapshots/document-generate/SKILL.md +1252 -0
  30. package/authoring/gstack/snapshots/investigate/SKILL.md +1074 -0
  31. package/authoring/gstack/snapshots/office-hours/SKILL.md +1697 -0
  32. package/authoring/gstack/snapshots/plan-ceo-review/SKILL.md +1476 -0
  33. package/authoring/gstack/snapshots/qa-only/SKILL.md +1256 -0
  34. package/authoring/gstack/snapshots/retro/SKILL.md +1812 -0
  35. package/authoring/gstack/snapshots/spec/SKILL.md +2359 -0
  36. package/authoring/gstack/wave.json +103 -0
  37. package/data/connector-types/gi/github-releases/manifest.json +17 -0
  38. package/data/connector-types/gi/github-releases/versions/1.0.0/manifest.json +71 -0
  39. package/data/connector-types/index.json +1 -1
  40. package/data/craftbook-templates/br/branding-website/versions/1.1.0/craftbook.json +190 -0
  41. package/data/craftbook-templates/br/branding-website/versions/1.1.0/test.json +164 -0
  42. package/data/craftbook-templates/br/browser-qa-audit/versions/2.0.0/craftbook.json +358 -0
  43. package/data/craftbook-templates/br/browser-qa-audit/versions/2.0.0/test.json +376 -0
  44. package/data/craftbook-templates/ca/careful-mode/versions/1.1.0/craftbook.json +43 -0
  45. package/data/craftbook-templates/ca/careful-mode/versions/1.1.0/test.json +110 -0
  46. package/data/craftbook-templates/ca/careful-mode/versions/1.2.0/craftbook.json +43 -0
  47. package/data/craftbook-templates/ca/careful-mode/versions/1.2.0/test.json +110 -0
  48. package/data/craftbook-templates/co/content-deck/versions/1.1.0/craftbook.json +185 -0
  49. package/data/craftbook-templates/co/content-deck/versions/1.1.0/test.json +166 -0
  50. package/data/craftbook-templates/co/content-deck/versions/1.2.0/craftbook.json +185 -0
  51. package/data/craftbook-templates/co/content-deck/versions/1.2.0/test.json +169 -0
  52. package/data/craftbook-templates/co/corpus-email-digest/versions/1.1.0/craftbook.json +189 -0
  53. package/data/craftbook-templates/co/corpus-email-digest/versions/1.1.0/test.json +182 -0
  54. package/data/craftbook-templates/co/corpus-email-digest/versions/1.2.0/craftbook.json +189 -0
  55. package/data/craftbook-templates/co/corpus-email-digest/versions/1.2.0/test.json +187 -0
  56. package/data/craftbook-templates/de/design-system-consultation/versions/2.0.0/craftbook.json +385 -0
  57. package/data/craftbook-templates/de/design-system-consultation/versions/2.0.0/test.json +201 -0
  58. package/data/craftbook-templates/en/engineering-retrospective/versions/2.0.0/craftbook.json +353 -0
  59. package/data/craftbook-templates/en/engineering-retrospective/versions/2.0.0/test.json +191 -0
  60. package/data/craftbook-templates/ex/executive-level-review/versions/2.0.0/craftbook.json +347 -0
  61. package/data/craftbook-templates/ex/executive-level-review/versions/2.0.0/test.json +135 -0
  62. package/data/craftbook-templates/fr/freeze-scope/versions/1.2.0/craftbook.json +50 -0
  63. package/data/craftbook-templates/fr/freeze-scope/versions/1.2.0/test.json +131 -0
  64. package/data/craftbook-templates/fr/freeze-scope/versions/1.3.0/craftbook.json +50 -0
  65. package/data/craftbook-templates/fr/freeze-scope/versions/1.3.0/test.json +131 -0
  66. package/data/craftbook-templates/ht/html-arcade-game/versions/1.1.0/craftbook.json +197 -0
  67. package/data/craftbook-templates/ht/html-arcade-game/versions/1.1.0/test.json +173 -0
  68. package/data/craftbook-templates/ht/html-arcade-game/versions/1.2.0/craftbook.json +197 -0
  69. package/data/craftbook-templates/ht/html-arcade-game/versions/1.2.0/test.json +176 -0
  70. package/data/craftbook-templates/id/idea-office-hours/versions/2.0.0/craftbook.json +333 -0
  71. package/data/craftbook-templates/id/idea-office-hours/versions/2.0.0/test.json +141 -0
  72. package/data/craftbook-templates/im/image-set-index/versions/1.1.0/craftbook.json +163 -0
  73. package/data/craftbook-templates/im/image-set-index/versions/1.1.0/test.json +177 -0
  74. package/data/craftbook-templates/im/image-set-index/versions/1.2.0/craftbook.json +163 -0
  75. package/data/craftbook-templates/im/image-set-index/versions/1.2.0/test.json +180 -0
  76. package/data/craftbook-templates/index.json +1 -1
  77. package/data/craftbook-templates/po/powerpoint-deck/versions/1.6.0/craftbook.json +257 -0
  78. package/data/craftbook-templates/po/powerpoint-deck/versions/1.6.0/test.json +225 -0
  79. package/data/craftbook-templates/re/release-artifact-sanity-check/art.json +13 -0
  80. package/data/craftbook-templates/re/release-artifact-sanity-check/logo.webp +0 -0
  81. package/data/craftbook-templates/re/release-artifact-sanity-check/manifest.json +24 -0
  82. package/data/craftbook-templates/re/release-artifact-sanity-check/versions/1.0.0/craftbook.json +202 -0
  83. package/data/craftbook-templates/re/release-artifact-sanity-check/versions/1.0.0/test.json +138 -0
  84. package/data/craftbook-templates/ro/root-cause-investigation/versions/2.0.0/craftbook.json +348 -0
  85. package/data/craftbook-templates/ro/root-cause-investigation/versions/2.0.0/test.json +153 -0
  86. package/data/craftbook-templates/se/security-architecture-review/versions/2.0.0/craftbook.json +353 -0
  87. package/data/craftbook-templates/se/security-architecture-review/versions/2.0.0/test.json +152 -0
  88. package/data/craftbook-templates/sp/spec-authoring/versions/2.0.0/craftbook.json +391 -0
  89. package/data/craftbook-templates/sp/spec-authoring/versions/2.0.0/test.json +162 -0
  90. package/data/craftbook-templates/te/technical-documentation/versions/2.0.0/craftbook.json +343 -0
  91. package/data/craftbook-templates/te/technical-documentation/versions/2.0.0/test.json +174 -0
  92. package/data/craftbook-templates/tr/translate-content/versions/1.1.0/craftbook.json +84 -0
  93. package/data/craftbook-templates/tr/translate-content/versions/1.1.0/test.json +141 -0
  94. package/package.json +8 -4
  95. package/schemas/craftbook-test.schema.json +232 -3
@@ -0,0 +1,343 @@
1
+ {
2
+ "id": "technical-documentation",
3
+ "name": "Technical Documentation",
4
+ "description": "Generate a coherent documentation set from a codebase, organized by the Diataxis model (tutorials, how-to guides, reference, explanation), with cross-links and a coverage pass.",
5
+ "basedOn": {
6
+ "name": "gstack",
7
+ "url": "https://github.com/garrytan/gstack"
8
+ },
9
+ "plan": "Treat documentation as a tested product surface. Research implementation, tests, configuration, and existing prose before writing. Separate learning-oriented tutorials, task-oriented how-to guides, factual reference, and explanatory rationale. Every public claim must trace to a workspace source, every example must be verified when the environment permits, and every produced page must be reachable from the documentation index.",
10
+ "entryStepId": "inventory",
11
+ "triggers": [
12
+ "write docs for this",
13
+ "generate documentation",
14
+ "document this feature",
15
+ "create a tutorial",
16
+ "write a how-to",
17
+ "explain this module",
18
+ "docs for this project"
19
+ ],
20
+ "command": "technical-documentation",
21
+ "steps": [
22
+ {
23
+ "id": "inventory",
24
+ "name": "Inventory the documentation surface",
25
+ "description": "Map readers, public interfaces, source evidence, existing coverage, and gaps.",
26
+ "prompt": "Confirm the requested scope from the task and project context. Inspect the project guide, package or build metadata, entry points, public interfaces, configuration, examples, tests, and current docs with workspace tools. Build an exact inventory of the entities in scope, their source paths, intended readers, existing documentation, missing coverage, and risky claims that need verification. Do not start polished prose yet.\n\nObservable handoff: write the completed result to `notes/documentation-inventory.md` in the workspace. Do not merely describe what the file would contain. Re-read it before finishing this phase and repair any incomplete sections.",
27
+ "suggestedRole": "technical researcher",
28
+ "advanceWhen": {
29
+ "file": "notes/documentation-inventory.md",
30
+ "minBytes": 900,
31
+ "sniff": "nonempty",
32
+ "requireChange": true,
33
+ "goto": "plan-docs"
34
+ },
35
+ "gate": {
36
+ "at": "completion",
37
+ "checks": [
38
+ {
39
+ "kind": "minBytes",
40
+ "file": "notes/documentation-inventory.md",
41
+ "bytes": 900
42
+ },
43
+ {
44
+ "kind": "sniff",
45
+ "file": "notes/documentation-inventory.md",
46
+ "sniff": "nonempty"
47
+ },
48
+ {
49
+ "kind": "contains",
50
+ "file": "notes/documentation-inventory.md",
51
+ "pattern": "^##\\s+Scope",
52
+ "flags": "im",
53
+ "label": "Scope section"
54
+ },
55
+ {
56
+ "kind": "contains",
57
+ "file": "notes/documentation-inventory.md",
58
+ "pattern": "^##\\s+Readers",
59
+ "flags": "im",
60
+ "label": "Readers section"
61
+ },
62
+ {
63
+ "kind": "contains",
64
+ "file": "notes/documentation-inventory.md",
65
+ "pattern": "^##\\s+Public surface",
66
+ "flags": "im",
67
+ "label": "Public surface section"
68
+ },
69
+ {
70
+ "kind": "contains",
71
+ "file": "notes/documentation-inventory.md",
72
+ "pattern": "^##\\s+Source map",
73
+ "flags": "im",
74
+ "label": "Source map section"
75
+ },
76
+ {
77
+ "kind": "contains",
78
+ "file": "notes/documentation-inventory.md",
79
+ "pattern": "^##\\s+Coverage gaps",
80
+ "flags": "im",
81
+ "label": "Coverage gaps section"
82
+ }
83
+ ],
84
+ "onReject": "inventory",
85
+ "maxAttempts": 3
86
+ },
87
+ "next": "plan-docs"
88
+ },
89
+ {
90
+ "id": "plan-docs",
91
+ "name": "Design the documentation set",
92
+ "description": "Choose the right document type for each reader need and lock verification criteria.",
93
+ "prompt": "Turn `notes/documentation-inventory.md` into a document plan. For each proposed page, state its reader, job, quadrant, destination path, evidence sources, prerequisites, cross-links, and pass/fail checks. Reuse existing conventions and update existing pages when that is clearer than duplication. Keep the set proportional to the scope, but cover every public item in the inventory or explicitly defer it with a reason.\n\nObservable handoff: write the completed result to `notes/documentation-plan.md` in the workspace. Do not merely describe what the file would contain. Re-read it before finishing this phase and repair any incomplete sections.",
94
+ "suggestedRole": "documentation architect",
95
+ "advanceWhen": {
96
+ "file": "notes/documentation-plan.md",
97
+ "minBytes": 900,
98
+ "sniff": "nonempty",
99
+ "requireChange": true,
100
+ "goto": "author-and-verify"
101
+ },
102
+ "gate": {
103
+ "at": "completion",
104
+ "checks": [
105
+ {
106
+ "kind": "minBytes",
107
+ "file": "notes/documentation-plan.md",
108
+ "bytes": 900
109
+ },
110
+ {
111
+ "kind": "sniff",
112
+ "file": "notes/documentation-plan.md",
113
+ "sniff": "nonempty"
114
+ },
115
+ {
116
+ "kind": "contains",
117
+ "file": "notes/documentation-plan.md",
118
+ "pattern": "^##\\s+Document matrix",
119
+ "flags": "im",
120
+ "label": "Document matrix section"
121
+ },
122
+ {
123
+ "kind": "contains",
124
+ "file": "notes/documentation-plan.md",
125
+ "pattern": "^##\\s+Information architecture",
126
+ "flags": "im",
127
+ "label": "Information architecture section"
128
+ },
129
+ {
130
+ "kind": "contains",
131
+ "file": "notes/documentation-plan.md",
132
+ "pattern": "^##\\s+Verification plan",
133
+ "flags": "im",
134
+ "label": "Verification plan section"
135
+ },
136
+ {
137
+ "kind": "contains",
138
+ "file": "notes/documentation-plan.md",
139
+ "pattern": "^##\\s+Deferred coverage",
140
+ "flags": "im",
141
+ "label": "Deferred coverage section"
142
+ }
143
+ ],
144
+ "onReject": "plan-docs",
145
+ "maxAttempts": 3
146
+ },
147
+ "next": "author-and-verify"
148
+ },
149
+ {
150
+ "id": "author-and-verify",
151
+ "name": "Author, link, and verify the docs",
152
+ "description": "Write the planned pages, validate examples and links, and expose the complete set through one index.",
153
+ "prompt": "Implement the approved document plan in the workspace. Keep reference factual, how-to steps actionable, tutorials quick to first result, and explanations explicit about trade-offs. Verify commands, code examples, option names, defaults, and constraints against implementation and tests; run safe examples where possible and label anything not executed. Add troubleshooting based on real failure paths. Cross-link related pages and write an index that lists every created or updated document, its reader job, quadrant, source evidence, and verification status.\n\nObservable handoff: write the completed result to `docs/documentation-index.md` in the workspace. Do not merely describe what the file would contain. Re-read it before finishing this phase and repair any incomplete sections.",
154
+ "suggestedRole": "technical writer",
155
+ "advanceWhen": {
156
+ "file": "docs/documentation-index.md",
157
+ "minBytes": 1200,
158
+ "sniff": "nonempty",
159
+ "requireChange": true,
160
+ "goto": "evaluate"
161
+ },
162
+ "gate": {
163
+ "at": "completion",
164
+ "checks": [
165
+ {
166
+ "kind": "minBytes",
167
+ "file": "docs/documentation-index.md",
168
+ "bytes": 1200
169
+ },
170
+ {
171
+ "kind": "sniff",
172
+ "file": "docs/documentation-index.md",
173
+ "sniff": "nonempty"
174
+ },
175
+ {
176
+ "kind": "contains",
177
+ "file": "docs/documentation-index.md",
178
+ "pattern": "^##\\s+Documentation map",
179
+ "flags": "im",
180
+ "label": "Documentation map section"
181
+ },
182
+ {
183
+ "kind": "contains",
184
+ "file": "docs/documentation-index.md",
185
+ "pattern": "^##\\s+Tutorials",
186
+ "flags": "im",
187
+ "label": "Tutorials section"
188
+ },
189
+ {
190
+ "kind": "contains",
191
+ "file": "docs/documentation-index.md",
192
+ "pattern": "^##\\s+How-to guides",
193
+ "flags": "im",
194
+ "label": "How-to guides section"
195
+ },
196
+ {
197
+ "kind": "contains",
198
+ "file": "docs/documentation-index.md",
199
+ "pattern": "^##\\s+Reference",
200
+ "flags": "im",
201
+ "label": "Reference section"
202
+ },
203
+ {
204
+ "kind": "contains",
205
+ "file": "docs/documentation-index.md",
206
+ "pattern": "^##\\s+Explanation",
207
+ "flags": "im",
208
+ "label": "Explanation section"
209
+ },
210
+ {
211
+ "kind": "contains",
212
+ "file": "docs/documentation-index.md",
213
+ "pattern": "^##\\s+Verification",
214
+ "flags": "im",
215
+ "label": "Verification section"
216
+ }
217
+ ],
218
+ "onReject": "author-and-verify",
219
+ "maxAttempts": 3
220
+ },
221
+ "next": "evaluate"
222
+ },
223
+ {
224
+ "id": "evaluate",
225
+ "name": "Evaluate the deliverable",
226
+ "description": "Independently grade the observable deliverable and route it to finish, repair, or user escalation.",
227
+ "prompt": "Review `docs/documentation-index.md`, `notes/documentation-inventory.md`, `notes/documentation-plan.md` against every criterion below. Inspect the underlying evidence files named by the workflow; do not grade from the author's summary alone.\n\n1. Every in-scope public item is documented or explicitly deferred with a reason.\n2. Claims, types, defaults, constraints, and examples agree with the cited implementation or tests.\n3. Tutorial, how-to, reference, and explanation content serve distinct reader jobs without needless duplication.\n4. Commands and examples have credible verification results or are clearly marked unexecuted.\n5. Every produced page is linked from the index and all internal links resolve.\n6. The prose is concrete, readable, and includes real troubleshooting and trade-offs where relevant.\n\nWrite an evidence-backed review to `reviews/technical-documentation-review.md`. Give each criterion a PASS or FAIL with a concrete path, excerpt, measurement, or observed behavior. End with exactly `Verdict: PASS` or `Verdict: REVISE`. Then use `advance_task_step` for the active task: PASS routes to `finish`; REVISE routes to `repair` for review rounds 1 through 2, and the 3th REVISE routes to `needs-user`. Never route to finish while a criterion is unmet.",
228
+ "suggestedRole": "technical editor",
229
+ "gate": {
230
+ "at": "completion",
231
+ "checks": [
232
+ {
233
+ "kind": "minBytes",
234
+ "file": "reviews/technical-documentation-review.md",
235
+ "bytes": 400
236
+ },
237
+ {
238
+ "kind": "contains",
239
+ "file": "reviews/technical-documentation-review.md",
240
+ "pattern": "Verdict:\\s*(?:PASS|REVISE)",
241
+ "flags": "i",
242
+ "label": "explicit PASS or REVISE verdict"
243
+ }
244
+ ],
245
+ "onReject": "evaluate",
246
+ "maxAttempts": 3
247
+ },
248
+ "next": "repair"
249
+ },
250
+ {
251
+ "id": "repair",
252
+ "name": "Repair the deliverable",
253
+ "description": "Fix only the concrete gaps from the latest independent review.",
254
+ "prompt": "Read `reviews/technical-documentation-review.md` and repair every failed criterion in `docs/documentation-index.md`, `notes/documentation-inventory.md`, `notes/documentation-plan.md`. Make the changes in the actual workspace files, not just in task notes or a reply. Preserve evidence that already passed. Re-run or re-check anything the reviewer found unproven. Ensure `docs/documentation-index.md` is genuinely updated this turn so the repair is observable, then hand it back for independent evaluation.",
255
+ "suggestedRole": "technical writer",
256
+ "advanceWhen": {
257
+ "file": "docs/documentation-index.md",
258
+ "minBytes": 1200,
259
+ "sniff": "nonempty",
260
+ "requireChange": true,
261
+ "goto": "evaluate"
262
+ },
263
+ "gate": {
264
+ "at": "completion",
265
+ "checks": [
266
+ {
267
+ "kind": "minBytes",
268
+ "file": "docs/documentation-index.md",
269
+ "bytes": 1200
270
+ },
271
+ {
272
+ "kind": "sniff",
273
+ "file": "docs/documentation-index.md",
274
+ "sniff": "nonempty"
275
+ },
276
+ {
277
+ "kind": "contains",
278
+ "file": "docs/documentation-index.md",
279
+ "pattern": "^##\\s+Documentation map",
280
+ "flags": "im",
281
+ "label": "Documentation map section"
282
+ },
283
+ {
284
+ "kind": "contains",
285
+ "file": "docs/documentation-index.md",
286
+ "pattern": "^##\\s+Tutorials",
287
+ "flags": "im",
288
+ "label": "Tutorials section"
289
+ },
290
+ {
291
+ "kind": "contains",
292
+ "file": "docs/documentation-index.md",
293
+ "pattern": "^##\\s+How-to guides",
294
+ "flags": "im",
295
+ "label": "How-to guides section"
296
+ },
297
+ {
298
+ "kind": "contains",
299
+ "file": "docs/documentation-index.md",
300
+ "pattern": "^##\\s+Reference",
301
+ "flags": "im",
302
+ "label": "Reference section"
303
+ },
304
+ {
305
+ "kind": "contains",
306
+ "file": "docs/documentation-index.md",
307
+ "pattern": "^##\\s+Explanation",
308
+ "flags": "im",
309
+ "label": "Explanation section"
310
+ },
311
+ {
312
+ "kind": "contains",
313
+ "file": "docs/documentation-index.md",
314
+ "pattern": "^##\\s+Verification",
315
+ "flags": "im",
316
+ "label": "Verification section"
317
+ }
318
+ ],
319
+ "onReject": "repair",
320
+ "maxAttempts": 3
321
+ },
322
+ "next": "evaluate"
323
+ },
324
+ {
325
+ "id": "finish",
326
+ "name": "Finish",
327
+ "description": "All deterministic and reviewer criteria passed.",
328
+ "prompt": "The independent review passed. Read `reviews/technical-documentation-review.md`, then use `write_task_note` to record a concise DONE summary with the final deliverable paths (`docs/documentation-index.md`, `notes/documentation-inventory.md`, `notes/documentation-plan.md`) and the evidence that each acceptance criterion passed. Report DONE without starting new work.",
329
+ "suggestedRole": "project lead",
330
+ "terminal": true
331
+ },
332
+ {
333
+ "id": "needs-user",
334
+ "name": "Escalate unresolved concerns",
335
+ "description": "The bounded repair loop ended without a defensible pass.",
336
+ "prompt": "The deliverable did not pass after 3 review rounds. Do not claim success. Read `reviews/technical-documentation-review.md`, then use `write_task_note` to record DONE_WITH_CONCERNS: the unmet criteria, what was attempted, the affected paths, and the smallest user decision or missing input needed to continue.",
337
+ "suggestedRole": "project lead",
338
+ "terminal": true
339
+ }
340
+ ],
341
+ "version": "2.0.0",
342
+ "releasedAt": "2026-08-09T00:00:00Z"
343
+ }
@@ -0,0 +1,174 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "title": "Technical Documentation — rate limiter Diataxis set",
4
+ "objective": "Exercise the Technical Documentation craftbook on a small real code surface and require a coherent, cross-linked Diataxis documentation set grounded in source behavior.",
5
+ "tags": [
6
+ "workflow",
7
+ "documentation",
8
+ "diataxis",
9
+ "typescript"
10
+ ],
11
+ "prompt": "Use the Technical Documentation craftbook to document the dependency-free rate limiter in this workspace. Inspect the source and test rather than guessing. Produce the craftbook inventory and plan plus a coherent set under `docs/`: `documentation-index.md`, `tutorial-rate-limit.md`, `how-to-configure-rate-limit.md`, `reference-rate-limit.md`, and `explanation-fixed-window.md`. The index must clearly organize tutorials, how-to, reference, and explanation, link to every page, cite the implementation/test where claims come from, and state how the documented examples were verified.",
12
+ "setup": {
13
+ "projectName": "Rate limiter documentation",
14
+ "about": "A hermetic TypeScript library documentation exercise. There are no external APIs or package dependencies.",
15
+ "missionObjectives": "Create accurate, navigable documentation that helps a first-time adopter use `createFixedWindowLimiter` and understand its tradeoffs without reading all source code.",
16
+ "files": [
17
+ {
18
+ "path": "README.md",
19
+ "content": "# tiny-limit\n\nA dependency-free fixed-window request limiter. Public behavior is defined by `src/rate-limit.ts` and its test. Documentation is intentionally incomplete.\n"
20
+ },
21
+ {
22
+ "path": "src/rate-limit.ts",
23
+ "content": "export interface RateLimitOptions {\n windowMs: number;\n max: number;\n}\n\nexport interface RateLimitDecision {\n allowed: boolean;\n remaining: number;\n resetAt: number;\n}\n\nexport function createFixedWindowLimiter(options: RateLimitOptions) {\n if (!Number.isInteger(options.max) || options.max < 1) throw new RangeError('max must be a positive integer');\n if (!Number.isFinite(options.windowMs) || options.windowMs <= 0) throw new RangeError('windowMs must be positive');\n const buckets = new Map<string, { count: number; resetAt: number }>();\n\n return function check(key: string, now = Date.now()): RateLimitDecision {\n const current = buckets.get(key);\n const bucket = !current || now >= current.resetAt\n ? { count: 0, resetAt: now + options.windowMs }\n : current;\n bucket.count += 1;\n buckets.set(key, bucket);\n return {\n allowed: bucket.count <= options.max,\n remaining: Math.max(0, options.max - bucket.count),\n resetAt: bucket.resetAt,\n };\n };\n}\n"
24
+ },
25
+ {
26
+ "path": "test/rate-limit.test.ts",
27
+ "content": "import { strict as assert } from 'node:assert';\nimport { createFixedWindowLimiter } from '../src/rate-limit.js';\n\nconst check = createFixedWindowLimiter({ windowMs: 1000, max: 2 });\nassert.deepEqual(check('ada', 100), { allowed: true, remaining: 1, resetAt: 1100 });\nassert.deepEqual(check('ada', 200), { allowed: true, remaining: 0, resetAt: 1100 });\nassert.deepEqual(check('ada', 300), { allowed: false, remaining: 0, resetAt: 1100 });\nassert.deepEqual(check('ada', 1100), { allowed: true, remaining: 1, resetAt: 2100 });\n"
28
+ }
29
+ ]
30
+ },
31
+ "mocks": [],
32
+ "success": {
33
+ "summary": "The craftbook produces a complete, grounded five-page Diataxis set with a navigable index and terminal task evidence.",
34
+ "deliverables": [
35
+ {
36
+ "path": "docs/documentation-index.md",
37
+ "kind": "markdown-doc",
38
+ "minBytes": 850,
39
+ "checks": [
40
+ {
41
+ "kind": "contains",
42
+ "file": "docs/documentation-index.md",
43
+ "pattern": "^#{1,3}\\s+Tutorials?\\b[\\s\\S]*^#{1,3}\\s+How-to guides?\\b[\\s\\S]*^#{1,3}\\s+Reference\\b[\\s\\S]*^#{1,3}\\s+Explanation\\b[\\s\\S]*^#{1,3}\\s+Verification\\b",
44
+ "flags": "im",
45
+ "label": "Diataxis map and verification"
46
+ },
47
+ {
48
+ "kind": "contains",
49
+ "file": "docs/documentation-index.md",
50
+ "pattern": "tutorial-rate-limit\\.md[\\s\\S]*how-to-configure-rate-limit\\.md[\\s\\S]*reference-rate-limit\\.md[\\s\\S]*explanation-fixed-window\\.md",
51
+ "flags": "i",
52
+ "label": "all requested pages linked"
53
+ },
54
+ {
55
+ "kind": "citationsResolve",
56
+ "file": "docs/documentation-index.md",
57
+ "minCitations": 4
58
+ }
59
+ ]
60
+ },
61
+ {
62
+ "path": "docs/tutorial-rate-limit.md",
63
+ "kind": "markdown-doc",
64
+ "minBytes": 650,
65
+ "checks": [
66
+ {
67
+ "kind": "contains",
68
+ "file": "docs/tutorial-rate-limit.md",
69
+ "pattern": "createFixedWindowLimiter[\\s\\S]*windowMs[\\s\\S]*max[\\s\\S]*(allowed|remaining|resetAt)",
70
+ "label": "runnable API walkthrough"
71
+ }
72
+ ]
73
+ },
74
+ {
75
+ "path": "docs/how-to-configure-rate-limit.md",
76
+ "kind": "markdown-doc",
77
+ "minBytes": 550,
78
+ "checks": [
79
+ {
80
+ "kind": "contains",
81
+ "file": "docs/how-to-configure-rate-limit.md",
82
+ "pattern": "windowMs[\\s\\S]*max[\\s\\S]*(positive|greater than|at least)[\\s\\S]*(integer|finite)",
83
+ "flags": "i",
84
+ "label": "configuration constraints"
85
+ }
86
+ ]
87
+ },
88
+ {
89
+ "path": "docs/reference-rate-limit.md",
90
+ "kind": "markdown-doc",
91
+ "minBytes": 650,
92
+ "checks": [
93
+ {
94
+ "kind": "contains",
95
+ "file": "docs/reference-rate-limit.md",
96
+ "pattern": "RateLimitOptions[\\s\\S]*RateLimitDecision[\\s\\S]*allowed[\\s\\S]*remaining[\\s\\S]*resetAt",
97
+ "label": "public type reference"
98
+ }
99
+ ]
100
+ },
101
+ {
102
+ "path": "docs/explanation-fixed-window.md",
103
+ "kind": "markdown-doc",
104
+ "minBytes": 600,
105
+ "checks": [
106
+ {
107
+ "kind": "contains",
108
+ "file": "docs/explanation-fixed-window.md",
109
+ "pattern": "fixed[- ]window[\\s\\S]*(boundary|burst|trade[- ]?off)[\\s\\S]*(memory|Map|process)",
110
+ "flags": "i",
111
+ "label": "mechanism and tradeoffs"
112
+ }
113
+ ]
114
+ }
115
+ ],
116
+ "checks": [
117
+ {
118
+ "kind": "fileCount",
119
+ "ext": [
120
+ ".md"
121
+ ],
122
+ "min": 5,
123
+ "dir": "docs"
124
+ }
125
+ ],
126
+ "taskNotes": {
127
+ "minBytes": 180,
128
+ "checks": [
129
+ {
130
+ "kind": "contains",
131
+ "file": "task-notes.md",
132
+ "pattern": "\\bDONE\\b[\\s\\S]*docs/documentation-index\\.md[\\s\\S]*(5|five)\\s+(pages|documents)",
133
+ "flags": "i",
134
+ "label": "terminal note records the documentation set"
135
+ }
136
+ ],
137
+ "requireCraftbookTask": true
138
+ },
139
+ "taskGraph": {
140
+ "requireCraftbookTask": true,
141
+ "requireTerminalStep": true
142
+ },
143
+ "unchangedFixtures": [
144
+ "README.md",
145
+ "src/rate-limit.ts",
146
+ "test/rate-limit.test.ts"
147
+ ]
148
+ },
149
+ "rubric": {
150
+ "artifact": {
151
+ "path": "docs/documentation-index.md",
152
+ "kind": "markdown"
153
+ },
154
+ "axes": [
155
+ {
156
+ "name": "Source fidelity",
157
+ "description": "Claims, examples, inputs, outputs, and edge cases agree with the supplied implementation and test."
158
+ },
159
+ {
160
+ "name": "Diataxis separation",
161
+ "description": "Tutorial, how-to, reference, and explanation pages each serve their distinct reader need without becoming duplicate summaries."
162
+ },
163
+ {
164
+ "name": "Navigation and verification",
165
+ "description": "The set is cross-linked, easy to scan, and transparent about how examples and factual claims were checked."
166
+ }
167
+ ]
168
+ },
169
+ "qualityFocus": [
170
+ "Every public option and result field matches the source",
171
+ "Each Diataxis page has a distinct job",
172
+ "The index links the complete set and explains verification"
173
+ ]
174
+ }
@@ -0,0 +1,84 @@
1
+ {
2
+ "id": "translate-content",
3
+ "name": "Translate Content",
4
+ "description": "Translate the project's new and changed content into the designated language as sidecar files under translations/<language>/, mirroring the source structure and never modifying originals.",
5
+ "entryStepId": "translate",
6
+ "triggers": [
7
+ "translate the content",
8
+ "translate everything",
9
+ "update the translations"
10
+ ],
11
+ "command": "translate-content",
12
+ "paramSchema": {
13
+ "type": "object",
14
+ "properties": {
15
+ "language": {
16
+ "type": "string",
17
+ "description": "Target language — a language name or BCP-47 tag (e.g. Nederlands, de, pt-BR).",
18
+ "projectProperty": "content.language"
19
+ }
20
+ },
21
+ "required": [
22
+ "language"
23
+ ]
24
+ },
25
+ "runModes": {
26
+ "nightShift": "recommended",
27
+ "scheduled": "supported"
28
+ },
29
+ "steps": [
30
+ {
31
+ "id": "translate",
32
+ "name": "Translate changed content",
33
+ "suggestedRole": "Translator",
34
+ "prompt": "You are running the incremental translation pass into **{{language}}**.\n\n1. List the project's content files (markdown, text, and documents converted to markdown). Skip code, lockfiles, binaries, and anything under `translations/`.\n2. For each content file, check whether a sidecar already exists at `translations/{{language}}/<same relative path>` and whether the source changed since it was written (compare content, not timestamps — if the existing translation still matches the source's current content, skip it).\n3. Translate each new or changed file into {{language}} and write the result to `translations/{{language}}/<same relative path>` with `write_file`. Preserve meaning, tone, register, markdown structure, links, and code blocks. Never translate product names, code identifiers, or content inside code fences. NEVER modify a source file.\n4. After every translation sidecar is written, finish by calling `write_artifact` for `translations/run-note.md`: list which files you translated this pass, which you skipped as unchanged, and anything you could not translate (with the reason).\n\nIf no content has changed since the last pass, still write the run-note artifact saying so. Keep the note factual and short. Write the run note last: it triggers completion, and the completion gate requires at least one sidecar under `translations/{{language}}/` plus a substantive run note.",
35
+ "advanceWhen": {
36
+ "file": "translations/run-note.md",
37
+ "artifact": true,
38
+ "minBytes": 80,
39
+ "requireChange": true
40
+ },
41
+ "gate": {
42
+ "at": "completion",
43
+ "checks": [
44
+ {
45
+ "kind": "fileCount",
46
+ "ext": [
47
+ "md",
48
+ "markdown",
49
+ "txt"
50
+ ],
51
+ "min": 1,
52
+ "dir": "translations/{{language}}"
53
+ },
54
+ {
55
+ "kind": "minBytes",
56
+ "file": "translations/run-note.md",
57
+ "bytes": 80,
58
+ "artifact": true
59
+ },
60
+ {
61
+ "kind": "contains",
62
+ "file": "translations/run-note.md",
63
+ "pattern": "translated|skipped|unchanged|could not translate",
64
+ "flags": "i",
65
+ "label": "run note reports the pass outcome",
66
+ "artifact": true
67
+ }
68
+ ],
69
+ "onReject": "translate",
70
+ "maxAttempts": 4
71
+ },
72
+ "next": "done"
73
+ },
74
+ {
75
+ "id": "done",
76
+ "name": "Done",
77
+ "suggestedRole": "Translator",
78
+ "prompt": "The translation sidecars and run-note artifact cleared the completion gate. Call `write_task_note` with the target language, translated and skipped counts, the sidecar root, and confirmation that source files stayed untouched. Then finish the task.",
79
+ "terminal": true
80
+ }
81
+ ],
82
+ "version": "1.1.0",
83
+ "releasedAt": "2026-08-09T00:00:00Z"
84
+ }