@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
package/README.md CHANGED
@@ -6,7 +6,10 @@ The open catalog that powers [gezel](https://github.com/bendyline/gezel). Browse
6
6
  npm install @bendyline/gilde
7
7
  ```
8
8
 
9
- The package is this repo, verbatim: raw JSON, Markdown and implementations, no tools, no dependencies.
9
+ The package is raw JSON, Markdown, and implementations with no runtime
10
+ dependencies. It includes the released `data/`, exported schemas, and the
11
+ small authoring source trees consumers need to verify generated families
12
+ against their inputs; repository tooling and CI files are not published.
10
13
 
11
14
  ## What's inside
12
15
 
@@ -21,6 +24,7 @@ The package is this repo, verbatim: raw JSON, Markdown and implementations, no t
21
24
  | Video models | data/video-models/ | Video generation model manifests |
22
25
  | Toolsets | data/toolsets/ | Hand-curated first-party toolsets |
23
26
  | Community toolsets | data/community/toolsets/ | Auto-imported from the MCP registry, permissive licenses only — bot-managed |
27
+ | Authoring sources | authoring/ | Reproducible source material for generated catalog families; inert at runtime |
24
28
 
25
29
  Every item follows the same layout:
26
30
 
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Garry Tan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,50 @@
1
+ # gstack-derived craftbook authoring
2
+
3
+ This directory is the reproducible source for the nine craftbooks adapted
4
+ from [garrytan/gstack](https://github.com/garrytan/gstack). The frozen
5
+ snapshots match upstream revision
6
+ `a3259400a366593e0c909dd9ac3e59752efd2488`; its MIT terms and attribution are
7
+ preserved in [LICENSE.gstack](LICENSE.gstack). The released, fully expanded
8
+ catalog payloads remain under `data/craftbook-templates/`.
9
+
10
+ ```
11
+ wave.json release metadata and source-to-craftbook mapping
12
+ snapshots/<source>/SKILL.md frozen upstream inputs
13
+ overlays/<source>.json Gezel-native workflow definitions and patches
14
+ evals/<source>.json source form of each released test.json
15
+ persona-drafts/*.about.md inert review drafts; never indexed as templates
16
+ ```
17
+
18
+ The schema-aware compiler remains in the Gezel repository at
19
+ `packages/catalog/scripts/import-gstack-skills.ts`; it depends on Gezel's
20
+ skill parser, craftbook schemas, and graph validator. It reads this directory
21
+ and writes into the same Gilde checkout, so source and generated output cannot
22
+ silently come from different revisions.
23
+
24
+ From a sibling `gezel` checkout:
25
+
26
+ ```sh
27
+ pnpm --filter @bendyline/gezel-catalog exec tsx scripts/import-gstack-skills.ts --dry-run
28
+ pnpm --filter @bendyline/gezel-catalog exec tsx scripts/import-gstack-skills.ts
29
+ pnpm --filter @bendyline/gezel-catalog run build-index --kind=craftbook-template
30
+ ```
31
+
32
+ Set `GILDE_DIR` when the checkouts are not siblings. Generation is
33
+ append-only: change `version` and `releasedAt` in `wave.json`, add a new
34
+ version, and never rewrite a released `versions/<version>/` directory.
35
+
36
+ The authoring tree is included in `@bendyline/gilde` so Gezel's exact-pinned
37
+ regeneration test can compare these inputs with the generated payload from
38
+ the same package. The product runtime and catalog index never read it.
39
+
40
+ That test resolves the tree from the installed package by default and only
41
+ falls back to a checkout via `GILDE_DIR` or `pnpm link:gilde`, so a release
42
+ without it does not fail Gezel CI — the fidelity suite just stops running.
43
+ `tools/check-package-size.mjs` therefore fails the publish when these sources
44
+ are missing from the tarball, and caps how large the tree may grow.
45
+
46
+ Gilde's dependency-light check validates the authoring sets, release metadata,
47
+ license notice, eval schema, and generated metadata. The Gezel-side fidelity
48
+ test performs the deeper byte-for-byte compiler comparison. Land and publish
49
+ the Gilde change first, then bump Gezel's exact `@bendyline/gilde` pin and
50
+ lockfile.
@@ -0,0 +1,152 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "title": "Security Architecture Review — admin export surface",
4
+ "objective": "Exercise the Security Architecture Review craftbook against a self-contained service slice and require a prioritized, evidence-linked report that includes both confirmed vulnerabilities and working controls.",
5
+ "tags": [
6
+ "workflow",
7
+ "security",
8
+ "architecture-review",
9
+ "typescript"
10
+ ],
11
+ "prompt": "Use the Security Architecture Review craftbook to review the seeded service slice. This is report-only: do not modify source files. Model assets, actors, trust boundaries, and data flows; audit authorization, command/SQL construction, secrets handling, and relevant common vulnerability classes. Produce the scope and findings register, then write `security/security-architecture-review.md`. Every confirmed finding must name severity, confidence, concrete workspace evidence, exploit preconditions, impact, and a specific remediation plus verification. Include working controls and rejected hypotheses. Do not invent CVEs, dependency versions, scans, or tests you did not run, and do not reproduce the example secret value in the report.",
12
+ "setup": {
13
+ "projectName": "Admin export security review",
14
+ "about": "A hermetic source-review fixture. No network or dependency lookup is needed or authorized; conclusions must come from seeded files.",
15
+ "missionObjectives": "Deliver an actionable risk posture that distinguishes confirmed source defects, positive controls, and unverified areas without changing implementation.",
16
+ "files": [
17
+ {
18
+ "path": "docs/architecture.md",
19
+ "content": "# Service slice\n\nAn authenticated HTTP handler receives an export name and email filter from a browser operated by support staff. The handler calls local process and database adapters. `requireUser` is the shared authentication boundary. Only administrators should reach backup export; ordinary authenticated users may search their own customer records. Deployment injects `SESSION_SECRET` from environment configuration.\n"
20
+ },
21
+ {
22
+ "path": "src/auth.ts",
23
+ "content": "export interface User { id: string; role: 'member' | 'admin' }\n\nexport function requireUser(value: User | undefined): User {\n if (!value) throw new Error('unauthorized');\n return value;\n}\n\nexport function requireAdmin(user: User): void {\n if (user.role !== 'admin') throw new Error('forbidden');\n}\n"
24
+ },
25
+ {
26
+ "path": "src/admin-export.ts",
27
+ "content": "import { exec } from 'node:child_process';\nimport type { User } from './auth.js';\nimport { requireAdmin, requireUser } from './auth.js';\n\nexport function exportBackup(currentUser: User | undefined, requestedName: string): void {\n const user = requireUser(currentUser);\n requireAdmin(user);\n exec(`tar -czf backups/${requestedName}.tgz data/`);\n}\n"
28
+ },
29
+ {
30
+ "path": "src/customer-search.ts",
31
+ "content": "export interface Db { query(sql: string): Promise<unknown[]> }\n\nexport function findCustomerByEmail(db: Db, email: string): Promise<unknown[]> {\n return db.query(`SELECT id, email FROM customers WHERE email = '${email}'`);\n}\n"
32
+ },
33
+ {
34
+ "path": "src/safe-audit-log.ts",
35
+ "content": "export interface AuditSink { write(event: { actorId: string; action: string; target: string }): void }\n\nexport function recordExport(sink: AuditSink, actorId: string, target: string): void {\n sink.write({ actorId, action: 'backup.exported', target });\n}\n"
36
+ },
37
+ {
38
+ "path": "config/example.env",
39
+ "content": "# Example only; deployment replaces this value\nSESSION_SECRET=local-dev-only-not-a-real-secret\n"
40
+ }
41
+ ]
42
+ },
43
+ "mocks": [],
44
+ "success": {
45
+ "taskGraph": {
46
+ "requireCraftbookTask": true,
47
+ "requireTerminalStep": true
48
+ },
49
+ "summary": "The named craftbook produces a source-grounded risk posture with prioritized findings, positive controls, remediation, verification, and terminal task evidence.",
50
+ "deliverables": [
51
+ {
52
+ "path": "security/security-architecture-review.md",
53
+ "kind": "security-report",
54
+ "minBytes": 1700,
55
+ "checks": [
56
+ {
57
+ "kind": "contains",
58
+ "file": "security/security-architecture-review.md",
59
+ "pattern": "^#{1,3}\\s+Executive risk posture\\b[\\s\\S]*^#{1,3}\\s+What is working\\b[\\s\\S]*^#{1,3}\\s+Prioritized findings\\b[\\s\\S]*^#{1,3}\\s+Remediation plan\\b[\\s\\S]*^#{1,3}\\s+Verification\\b[\\s\\S]*^#{1,3}\\s+Unverified areas\\b",
60
+ "flags": "im",
61
+ "label": "complete security-review structure"
62
+ },
63
+ {
64
+ "kind": "contains",
65
+ "file": "security/security-architecture-review.md",
66
+ "pattern": "(command injection|shell injection)[\\s\\S]{0,500}src/admin-export\\.ts[\\s\\S]*(severity)[\\s\\S]*(confidence)",
67
+ "flags": "is",
68
+ "label": "command-injection finding with evidence metadata"
69
+ },
70
+ {
71
+ "kind": "contains",
72
+ "file": "security/security-architecture-review.md",
73
+ "pattern": "(SQL injection|parameteri[sz]ed quer)[\\s\\S]{0,500}src/customer-search\\.ts",
74
+ "flags": "is",
75
+ "label": "SQL-injection finding and remediation"
76
+ },
77
+ {
78
+ "kind": "contains",
79
+ "file": "security/security-architecture-review.md",
80
+ "pattern": "(requireUser|requireAdmin)[\\s\\S]{0,300}(working|control|authorization|authentication)[\\s\\S]*(safe-audit-log|audit)",
81
+ "flags": "is",
82
+ "label": "positive auth and audit controls"
83
+ },
84
+ {
85
+ "kind": "citationsResolve",
86
+ "file": "security/security-architecture-review.md",
87
+ "minCitations": 4
88
+ },
89
+ {
90
+ "kind": "notContains",
91
+ "file": "security/security-architecture-review.md",
92
+ "pattern": "CVE-\\d{4}-\\d+",
93
+ "label": "no invented CVEs"
94
+ },
95
+ {
96
+ "kind": "notContains",
97
+ "file": "security/security-architecture-review.md",
98
+ "pattern": "local-dev-only-not-a-real-secret",
99
+ "label": "example secret value is not reproduced"
100
+ }
101
+ ]
102
+ }
103
+ ],
104
+ "taskNotes": {
105
+ "minBytes": 180,
106
+ "requireCraftbookTask": true,
107
+ "checks": [
108
+ {
109
+ "kind": "contains",
110
+ "file": "task-notes.md",
111
+ "pattern": "\\bDONE\\b[\\s\\S]*security/security-architecture-review\\.md[\\s\\S]*(command|SQL)",
112
+ "flags": "i",
113
+ "label": "terminal note records report and principal risks"
114
+ }
115
+ ]
116
+ },
117
+ "unchangedFixtures": [
118
+ "docs/architecture.md",
119
+ "src/auth.ts",
120
+ "src/admin-export.ts",
121
+ "src/customer-search.ts",
122
+ "src/safe-audit-log.ts",
123
+ "config/example.env"
124
+ ]
125
+ },
126
+ "rubric": {
127
+ "artifact": {
128
+ "path": "security/security-architecture-review.md",
129
+ "kind": "markdown"
130
+ },
131
+ "axes": [
132
+ {
133
+ "name": "Threat-model coverage",
134
+ "description": "The report connects assets, actors, trust boundaries, privileges, and data flows to the reviewed attack surface."
135
+ },
136
+ {
137
+ "name": "Finding rigor",
138
+ "description": "Confirmed findings cite exact source evidence, state preconditions and impact, and calibrate severity and confidence without overclaiming."
139
+ },
140
+ {
141
+ "name": "Remediation utility",
142
+ "description": "Recommendations are prioritized, source-specific, verifiable, and preserve or strengthen the controls that already work."
143
+ }
144
+ ],
145
+ "contextNote": "No live dependency or dynamic scan is part of this hermetic source-review scenario; the report should say so."
146
+ },
147
+ "qualityFocus": [
148
+ "Both injection paths are found and tied to exact source",
149
+ "Working authentication, authorization, and audit controls are recognized",
150
+ "Unverified areas and evidence limits are explicit"
151
+ ]
152
+ }
@@ -0,0 +1,201 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "title": "Design System Consultation — Harbor Ops dashboard",
4
+ "objective": "Exercise the Design System Consultation craftbook on a seeded operations dashboard and require a grounded, accessible DESIGN.md plus a complete HTML state preview.",
5
+ "tags": [
6
+ "workflow",
7
+ "design-system",
8
+ "html-page",
9
+ "accessibility"
10
+ ],
11
+ "prompt": "Use the Design System Consultation craftbook for the Harbor Ops dashboard. This is an unattended evaluation: the product and taste decisions in `source/design-brief.md` are authoritative, so proceed without asking questions and label any remaining assumptions. Audit the supplied interface, preserve its useful density, then produce the workflow artifacts, `DESIGN.md`, and `previews/design-system.html`. The preview must be self-contained and show navigation, typography, controls, data cards, table content, empty/loading/error/success states, keyboard focus, disabled controls, and responsive behavior. Use no external assets or live research.",
12
+ "setup": {
13
+ "projectName": "Harbor Ops design system",
14
+ "about": "Harbor Ops is a desktop-first operations dashboard for coordinators monitoring time-sensitive berth assignments. The fixture is complete and must be handled without live research.",
15
+ "missionObjectives": "Run the Design System Consultation craftbook as a real task. Ground every design decision in the seeded brief and current interface, then deliver DESIGN.md and the self-contained preview.",
16
+ "files": [
17
+ {
18
+ "path": "README.md",
19
+ "content": "# Harbor Ops\n\nHarbor Ops helps port coordinators scan berth conflicts, assign an owner, and clear exceptions during a shift. It is dense desktop software used in bright control rooms; the core job is spotting the one item that needs action now.\n"
20
+ },
21
+ {
22
+ "path": "source/design-brief.md",
23
+ "content": "# Locked design brief\n\nAudience: experienced port coordinators working 8-hour shifts on desktop, with occasional tablet use.\n\nMemorable intent: **calm command under pressure**. The interface should feel serious and precise, never playful or luxurious.\n\nPreserve: dense scan-friendly tables, the navy header, status labels, and explicit timestamps.\n\nChange: inconsistent spacing, low-contrast muted text, color-only severity, invisible keyboard focus, and one-off button styles.\n\nBrand constraints: deep navy `#10233f`; signal amber `#d97706`; off-white canvas. Do not use pure black.\n\nAccessibility: WCAG AA text contrast, visible `:focus-visible`, shape/text in addition to status color, 44px primary touch targets on tablet, reduced-motion support.\n\nProduct states that must be designed: normal, loading, empty, permission error, delayed-data warning, success acknowledgement, selected row, disabled action.\n\nTaste: compact Swiss/industrial typography, restrained motion, square-to-soft corners (4-8px), clear dividers. Avoid gradients, glass effects, giant hero type, and decorative illustrations.\n"
24
+ },
25
+ {
26
+ "path": "src/dashboard.html",
27
+ "content": "<!doctype html><html lang=\"en\"><head><meta charset=\"utf-8\"><title>Harbor Ops</title><link rel=\"stylesheet\" href=\"styles.css\"></head><body><header>Harbor Ops <small>Shift A · 07:42 UTC</small></header><main><aside><button>Overview</button><button>Berths</button><button>Exceptions</button></aside><section><h1>Berth exceptions</h1><button class=\"primary\">Assign owner</button><table><tr><th>Vessel</th><th>Berth</th><th>Status</th><th>Updated</th></tr><tr><td>MV Juniper</td><td>B-14</td><td><span class=\"status\">Delayed</span></td><td>07:38 UTC</td></tr></table></section></main></body></html>\n"
28
+ },
29
+ {
30
+ "path": "src/styles.css",
31
+ "content": ":root{--navy:#10233f;--amber:#d97706}body{margin:0;font:14px Arial;background:#f7f5ef;color:#27364a}header{background:var(--navy);color:white;padding:13px 18px}header small{color:#7e8aa0}main{display:flex}aside{width:190px;padding:12px}section{flex:1;padding:19px}button{border:0;padding:7px;margin:3px}.primary{background:var(--amber);color:white}.status{color:#d97706}table{width:100%;border-collapse:collapse}td,th{text-align:left;border-bottom:1px solid #ddd;padding:9px}button:focus{outline:none}\n"
32
+ }
33
+ ]
34
+ },
35
+ "mocks": [],
36
+ "success": {
37
+ "taskGraph": {
38
+ "requireCraftbookTask": true,
39
+ "requireTerminalStep": true
40
+ },
41
+ "summary": "The real craftbook produces a grounded design audit and brief, an accessible token specification, a valid multi-state preview, and terminal review evidence.",
42
+ "deliverables": [
43
+ {
44
+ "path": "design/current-state-audit.md",
45
+ "kind": "markdown-report",
46
+ "minBytes": 750,
47
+ "checks": [
48
+ {
49
+ "kind": "contains",
50
+ "file": "design/current-state-audit.md",
51
+ "pattern": "^#{1,3}\\s+Product and users\\b[\\s\\S]*^#{1,3}\\s+Existing language\\b[\\s\\S]*^#{1,3}\\s+Accessibility\\b",
52
+ "flags": "im",
53
+ "label": "grounded current-state audit"
54
+ },
55
+ {
56
+ "kind": "citationsResolve",
57
+ "file": "design/current-state-audit.md",
58
+ "minCitations": 2
59
+ }
60
+ ]
61
+ },
62
+ {
63
+ "path": "DESIGN.md",
64
+ "kind": "markdown-doc",
65
+ "minBytes": 1800,
66
+ "checks": [
67
+ {
68
+ "kind": "contains",
69
+ "file": "DESIGN.md",
70
+ "pattern": "^#{1,3}\\s+Design intent\\b[\\s\\S]*^#{1,3}\\s+Tokens\\b[\\s\\S]*^#{1,3}\\s+Typography\\b[\\s\\S]*^#{1,3}\\s+Color\\b[\\s\\S]*^#{1,3}\\s+Components and states\\b[\\s\\S]*^#{1,3}\\s+Accessibility\\b[\\s\\S]*^#{1,3}\\s+Adoption\\b",
71
+ "flags": "im",
72
+ "label": "complete design-system specification"
73
+ },
74
+ {
75
+ "kind": "valueGrounding",
76
+ "file": "DESIGN.md",
77
+ "facts": [
78
+ {
79
+ "id": "intent",
80
+ "label": "memorable intent",
81
+ "required": [
82
+ "calm command under pressure"
83
+ ]
84
+ },
85
+ {
86
+ "id": "brand-navy",
87
+ "label": "locked navy",
88
+ "required": [
89
+ "#10233f"
90
+ ]
91
+ },
92
+ {
93
+ "id": "brand-amber",
94
+ "label": "locked signal amber",
95
+ "required": [
96
+ "#d97706"
97
+ ]
98
+ },
99
+ {
100
+ "id": "keyboard-focus",
101
+ "label": "visible keyboard focus",
102
+ "required": [
103
+ "focus-visible"
104
+ ]
105
+ },
106
+ {
107
+ "id": "reduced-motion",
108
+ "label": "reduced-motion behavior",
109
+ "required": [
110
+ "reduced-motion|prefers-reduced-motion"
111
+ ]
112
+ },
113
+ {
114
+ "id": "touch-target",
115
+ "label": "tablet touch target",
116
+ "required": [
117
+ "44\\s*(?:px|pixel)"
118
+ ]
119
+ }
120
+ ]
121
+ }
122
+ ]
123
+ },
124
+ {
125
+ "path": "previews/design-system.html",
126
+ "kind": "html-page",
127
+ "minBytes": 3000,
128
+ "checks": [
129
+ {
130
+ "kind": "htmlLint",
131
+ "file": "previews/design-system.html"
132
+ },
133
+ {
134
+ "kind": "cssMinBytes",
135
+ "file": "previews/design-system.html",
136
+ "bytes": 900
137
+ },
138
+ {
139
+ "kind": "contains",
140
+ "file": "previews/design-system.html",
141
+ "pattern": "loading[\\s\\S]*empty[\\s\\S]*(error|permission)[\\s\\S]*(success|acknowledge)[\\s\\S]*disabled",
142
+ "flags": "i",
143
+ "label": "representative application states"
144
+ },
145
+ {
146
+ "kind": "contains",
147
+ "file": "previews/design-system.html",
148
+ "pattern": "focus-visible|prefers-reduced-motion",
149
+ "flags": "i",
150
+ "label": "keyboard focus and reduced motion"
151
+ }
152
+ ]
153
+ }
154
+ ],
155
+ "taskNotes": {
156
+ "minBytes": 180,
157
+ "requireCraftbookTask": true,
158
+ "checks": [
159
+ {
160
+ "kind": "contains",
161
+ "file": "task-notes.md",
162
+ "pattern": "\\bDONE\\b[\\s\\S]*DESIGN\\.md[\\s\\S]*previews/design-system\\.html",
163
+ "flags": "i",
164
+ "label": "terminal note records both design deliverables"
165
+ }
166
+ ]
167
+ },
168
+ "unchangedFixtures": [
169
+ "README.md",
170
+ "source/design-brief.md",
171
+ "src/dashboard.html",
172
+ "src/styles.css"
173
+ ]
174
+ },
175
+ "rubric": {
176
+ "artifact": {
177
+ "path": "DESIGN.md",
178
+ "kind": "markdown"
179
+ },
180
+ "axes": [
181
+ {
182
+ "name": "Product fit",
183
+ "description": "The system reinforces calm command under pressure and the actual coordinator workflows rather than generic visual taste."
184
+ },
185
+ {
186
+ "name": "System coherence",
187
+ "description": "Tokens, typography, color, density, components, states, and motion form a reusable system with explicit rationale."
188
+ },
189
+ {
190
+ "name": "Accessibility and preview",
191
+ "description": "The specification and preview cover contrast, focus, non-color status, touch size, reduced motion, responsiveness, and real application states."
192
+ }
193
+ ],
194
+ "contextNote": "Judge against the seeded brief and current dashboard; decorative novelty that violates the locked taste is a defect."
195
+ },
196
+ "qualityFocus": [
197
+ "Preserve useful density while correcting current accessibility failures",
198
+ "Use exact reusable tokens with reasons",
199
+ "Preview representative responsive and interaction states without external assets"
200
+ ]
201
+ }
@@ -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
+ "taskGraph": {
34
+ "requireCraftbookTask": true,
35
+ "requireTerminalStep": true
36
+ },
37
+ "summary": "The craftbook produces a complete, grounded five-page Diataxis set with a navigable index and terminal task evidence.",
38
+ "deliverables": [
39
+ {
40
+ "path": "docs/documentation-index.md",
41
+ "kind": "markdown-doc",
42
+ "minBytes": 850,
43
+ "checks": [
44
+ {
45
+ "kind": "contains",
46
+ "file": "docs/documentation-index.md",
47
+ "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",
48
+ "flags": "im",
49
+ "label": "Diataxis map and verification"
50
+ },
51
+ {
52
+ "kind": "contains",
53
+ "file": "docs/documentation-index.md",
54
+ "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",
55
+ "flags": "i",
56
+ "label": "all requested pages linked"
57
+ },
58
+ {
59
+ "kind": "citationsResolve",
60
+ "file": "docs/documentation-index.md",
61
+ "minCitations": 4
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "path": "docs/tutorial-rate-limit.md",
67
+ "kind": "markdown-doc",
68
+ "minBytes": 650,
69
+ "checks": [
70
+ {
71
+ "kind": "contains",
72
+ "file": "docs/tutorial-rate-limit.md",
73
+ "pattern": "createFixedWindowLimiter[\\s\\S]*windowMs[\\s\\S]*max[\\s\\S]*(allowed|remaining|resetAt)",
74
+ "label": "runnable API walkthrough"
75
+ }
76
+ ]
77
+ },
78
+ {
79
+ "path": "docs/how-to-configure-rate-limit.md",
80
+ "kind": "markdown-doc",
81
+ "minBytes": 550,
82
+ "checks": [
83
+ {
84
+ "kind": "contains",
85
+ "file": "docs/how-to-configure-rate-limit.md",
86
+ "pattern": "windowMs[\\s\\S]*max[\\s\\S]*(positive|greater than|at least)[\\s\\S]*(integer|finite)",
87
+ "flags": "i",
88
+ "label": "configuration constraints"
89
+ }
90
+ ]
91
+ },
92
+ {
93
+ "path": "docs/reference-rate-limit.md",
94
+ "kind": "markdown-doc",
95
+ "minBytes": 650,
96
+ "checks": [
97
+ {
98
+ "kind": "contains",
99
+ "file": "docs/reference-rate-limit.md",
100
+ "pattern": "RateLimitOptions[\\s\\S]*RateLimitDecision[\\s\\S]*allowed[\\s\\S]*remaining[\\s\\S]*resetAt",
101
+ "label": "public type reference"
102
+ }
103
+ ]
104
+ },
105
+ {
106
+ "path": "docs/explanation-fixed-window.md",
107
+ "kind": "markdown-doc",
108
+ "minBytes": 600,
109
+ "checks": [
110
+ {
111
+ "kind": "contains",
112
+ "file": "docs/explanation-fixed-window.md",
113
+ "pattern": "fixed[- ]window[\\s\\S]*(boundary|burst|trade[- ]?off)[\\s\\S]*(memory|Map|process)",
114
+ "flags": "i",
115
+ "label": "mechanism and tradeoffs"
116
+ }
117
+ ]
118
+ }
119
+ ],
120
+ "checks": [
121
+ {
122
+ "kind": "fileCount",
123
+ "dir": "docs",
124
+ "ext": [
125
+ ".md"
126
+ ],
127
+ "min": 5
128
+ }
129
+ ],
130
+ "taskNotes": {
131
+ "minBytes": 180,
132
+ "requireCraftbookTask": true,
133
+ "checks": [
134
+ {
135
+ "kind": "contains",
136
+ "file": "task-notes.md",
137
+ "pattern": "\\bDONE\\b[\\s\\S]*docs/documentation-index\\.md[\\s\\S]*(5|five)\\s+(pages|documents)",
138
+ "flags": "i",
139
+ "label": "terminal note records the documentation set"
140
+ }
141
+ ]
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
+ }