kitfly 0.1.2

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 (62) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/LICENSE +21 -0
  3. package/README.md +136 -0
  4. package/VERSION +1 -0
  5. package/package.json +63 -0
  6. package/schemas/README.md +32 -0
  7. package/schemas/site.schema.json +5 -0
  8. package/schemas/theme.schema.json +5 -0
  9. package/schemas/v0/site.schema.json +172 -0
  10. package/schemas/v0/theme.schema.json +210 -0
  11. package/scripts/build-all.ts +121 -0
  12. package/scripts/build.ts +601 -0
  13. package/scripts/bundle.ts +781 -0
  14. package/scripts/dev.ts +777 -0
  15. package/scripts/generate-checksums.sh +78 -0
  16. package/scripts/release/export-release-key.sh +28 -0
  17. package/scripts/release/release-guard-tag-version.sh +79 -0
  18. package/scripts/release/sign-release-assets.sh +123 -0
  19. package/scripts/release/upload-release-assets.sh +76 -0
  20. package/scripts/release/upload-release-provenance.sh +52 -0
  21. package/scripts/release/verify-public-key.sh +48 -0
  22. package/scripts/release/verify-signatures.sh +117 -0
  23. package/scripts/version-sync.ts +82 -0
  24. package/src/__tests__/build.test.ts +240 -0
  25. package/src/__tests__/bundle.test.ts +786 -0
  26. package/src/__tests__/cli.test.ts +706 -0
  27. package/src/__tests__/crucible.test.ts +1043 -0
  28. package/src/__tests__/engine.test.ts +157 -0
  29. package/src/__tests__/init.test.ts +450 -0
  30. package/src/__tests__/pipeline.test.ts +1087 -0
  31. package/src/__tests__/productbook.test.ts +1206 -0
  32. package/src/__tests__/runbook.test.ts +974 -0
  33. package/src/__tests__/server-registry.test.ts +1251 -0
  34. package/src/__tests__/servicebook.test.ts +1248 -0
  35. package/src/__tests__/shared.test.ts +2005 -0
  36. package/src/__tests__/styles.test.ts +14 -0
  37. package/src/__tests__/theme-schema.test.ts +47 -0
  38. package/src/__tests__/theme.test.ts +554 -0
  39. package/src/cli.ts +582 -0
  40. package/src/commands/init.ts +92 -0
  41. package/src/commands/update.ts +444 -0
  42. package/src/engine.ts +20 -0
  43. package/src/logger.ts +15 -0
  44. package/src/migrations/0000_schema_versioning.ts +67 -0
  45. package/src/migrations/0001_server_port.ts +52 -0
  46. package/src/migrations/0002_brand_logo.ts +49 -0
  47. package/src/migrations/index.ts +26 -0
  48. package/src/migrations/schema.ts +24 -0
  49. package/src/server-registry.ts +405 -0
  50. package/src/shared.ts +1239 -0
  51. package/src/site/styles.css +931 -0
  52. package/src/site/template.html +193 -0
  53. package/src/templates/crucible.ts +1163 -0
  54. package/src/templates/driver.ts +876 -0
  55. package/src/templates/handbook.ts +339 -0
  56. package/src/templates/minimal.ts +139 -0
  57. package/src/templates/pipeline.ts +966 -0
  58. package/src/templates/productbook.ts +1032 -0
  59. package/src/templates/runbook.ts +829 -0
  60. package/src/templates/schema.ts +119 -0
  61. package/src/templates/servicebook.ts +1242 -0
  62. package/src/theme.ts +245 -0
@@ -0,0 +1,1032 @@
1
+ /**
2
+ * Productbook Template
3
+ *
4
+ * Extends minimal with structured sections for product and domain documentation.
5
+ * Designed for greenfield client engagements with complex business processes.
6
+ * Sections: Product, Domain, Planning, Operations, Guides, Reference
7
+ */
8
+
9
+ import type { TemplateContext, TemplateDef } from "./schema.ts";
10
+
11
+ export const productbook: TemplateDef = {
12
+ id: "productbook",
13
+ name: "Productbook",
14
+ description: "Product and domain documentation for complex greenfield engagements",
15
+ version: 1,
16
+ extends: "minimal",
17
+ sections: [
18
+ {
19
+ name: "Product",
20
+ path: "content/product",
21
+ description: "Product overview, features, user guides, release notes",
22
+ },
23
+ {
24
+ name: "Domain",
25
+ path: "content/domain",
26
+ description: "Business processes, terminology, industry context, data dictionary",
27
+ },
28
+ {
29
+ name: "Planning",
30
+ path: "content/planning",
31
+ description: "Roadmap, specifications, decisions (ADRs), research",
32
+ },
33
+ {
34
+ name: "Operations",
35
+ path: "content/operations",
36
+ description: "Deployment, environments, configuration",
37
+ },
38
+ {
39
+ name: "Guides",
40
+ path: "content/guides",
41
+ description: "Onboarding, how-tos, tutorials (user-facing)",
42
+ },
43
+ {
44
+ name: "Reference",
45
+ path: "content/reference",
46
+ description: "Architecture, integrations, data models, contacts, metrics",
47
+ },
48
+ ],
49
+ files: [
50
+ {
51
+ path: "site.yaml",
52
+ content: (ctx: TemplateContext) => `# ${ctx.branding.siteName} - Site Configuration
53
+ # Documentation: https://github.com/3leaps/kitfly
54
+
55
+ title: "${ctx.branding.siteName}"
56
+
57
+ # ← CUSTOMIZE: Your brand settings
58
+ brand:
59
+ name: "${ctx.branding.brandName}"
60
+ url: "${ctx.branding.brandUrl}"
61
+ # external: false # Set true if brand URL is external
62
+
63
+ # Content sections
64
+ sections:
65
+ - name: "Product"
66
+ path: "content/product"
67
+ - name: "Domain"
68
+ path: "content/domain"
69
+ - name: "Planning"
70
+ path: "content/planning"
71
+ - name: "Operations"
72
+ path: "content/operations"
73
+ - name: "Guides"
74
+ path: "content/guides"
75
+ - name: "Reference"
76
+ path: "content/reference"
77
+
78
+ # Home page
79
+ home: "index.md"
80
+ `,
81
+ },
82
+ {
83
+ path: "index.md",
84
+ content: (ctx: TemplateContext) => `---
85
+ title: Home
86
+ description: ${ctx.branding.siteName} - Product & Domain Documentation
87
+ ---
88
+
89
+ # ${ctx.branding.siteName}
90
+
91
+ Product and domain documentation for ${ctx.branding.brandName}.
92
+
93
+ ## Product
94
+
95
+ | Area | Description | Status |
96
+ |------|-------------|--------|
97
+ | Core Platform | <!-- primary product capability --> | Planning |
98
+ | Integrations | <!-- external system connections --> | Discovery |
99
+ | User Experience | <!-- end-user workflows --> | Discovery |
100
+
101
+ ## Quick Links
102
+
103
+ ### [Product Overview](/content/product/overview)
104
+ Vision, target users, key capabilities, and success metrics.
105
+
106
+ ### [Domain Model](/content/domain/overview)
107
+ Business context, key concepts, and domain complexity.
108
+
109
+ ### [Roadmap](/content/planning/roadmap)
110
+ Current priorities, phases, and decision rationale.
111
+
112
+ ### [Getting Started](/content/guides/getting-started)
113
+ Onboarding for new team members and AI agents.
114
+
115
+ ---
116
+
117
+ *Last updated: ${new Date().toISOString().split("T")[0]}*
118
+ `,
119
+ },
120
+ // ---------------------------------------------------------------
121
+ // Product section
122
+ // ---------------------------------------------------------------
123
+ {
124
+ path: "content/product/overview.md",
125
+ content: (ctx: TemplateContext) => `---
126
+ title: Product Overview
127
+ description: Vision, users, and capabilities for ${ctx.branding.brandName}
128
+ ---
129
+
130
+ # Product Overview
131
+
132
+ <!-- ← CUSTOMIZE: Replace with your product details -->
133
+
134
+ ## Vision
135
+
136
+ <!-- What is this product and why does it exist? -->
137
+
138
+ ## Target Users
139
+
140
+ | User | Role | Primary Need |
141
+ |------|------|-------------|
142
+ | <!-- user type --> | <!-- role --> | <!-- what they need --> |
143
+
144
+ ## Key Capabilities
145
+
146
+ ### 1. <!-- Capability Name -->
147
+
148
+ <!-- Description, value proposition -->
149
+
150
+ ### 2. <!-- Capability Name -->
151
+
152
+ <!-- Description, value proposition -->
153
+
154
+ ## Success Metrics
155
+
156
+ | Metric | Target | How Measured |
157
+ |--------|--------|-------------|
158
+ | <!-- metric --> | <!-- target --> | <!-- measurement approach --> |
159
+
160
+ ## Related
161
+
162
+ - [Domain Overview](/content/domain/overview) — business context
163
+ - [Roadmap](/content/planning/roadmap) — what we're building and when
164
+ `,
165
+ },
166
+ {
167
+ path: "content/product/features/index.md",
168
+ content: (ctx: TemplateContext) => `---
169
+ title: Features
170
+ description: Feature catalog for ${ctx.branding.brandName}
171
+ ---
172
+
173
+ # Features
174
+
175
+ <!-- ← CUSTOMIZE: Add features as they are defined -->
176
+
177
+ | Feature | Status | Description | Spec |
178
+ |---------|--------|-------------|------|
179
+ | <!-- feature name --> | Planning / In Progress / Shipped | <!-- brief description --> | [Link](./feature-name) |
180
+
181
+ ## Adding a Feature
182
+
183
+ 1. Create a file in \`content/product/features/\`
184
+ 2. Include: problem statement, user stories, acceptance criteria, success metrics
185
+ 3. Update this index table
186
+ 4. Link to the relevant spec in [Planning](/content/planning/specs/)
187
+ `,
188
+ },
189
+ {
190
+ path: "content/product/releases/index.md",
191
+ content: (ctx: TemplateContext) => `---
192
+ title: Releases
193
+ description: Release history for ${ctx.branding.brandName}
194
+ ---
195
+
196
+ # Releases
197
+
198
+ <!-- ← CUSTOMIZE: Add releases as they ship -->
199
+
200
+ | Version | Date | Highlights |
201
+ |---------|------|------------|
202
+ | <!-- v0.1.0 --> | <!-- YYYY-MM-DD --> | <!-- key changes --> |
203
+
204
+ ## Release Process
205
+
206
+ 1. Feature complete and acceptance criteria met
207
+ 2. Release notes drafted
208
+ 3. Deployment per [Operations](/content/operations/deployment)
209
+ 4. Update this log
210
+ `,
211
+ },
212
+ // ---------------------------------------------------------------
213
+ // Domain section
214
+ // ---------------------------------------------------------------
215
+ {
216
+ path: "content/domain/overview.md",
217
+ content: (ctx: TemplateContext) => `---
218
+ title: Domain Overview
219
+ description: Business domain context for ${ctx.branding.brandName}
220
+ ---
221
+
222
+ # Domain Overview
223
+
224
+ <!-- ← CUSTOMIZE: This is the most important section for complex engagements.
225
+ Capture the business reality that shapes every product decision. -->
226
+
227
+ ## What Is This Domain?
228
+
229
+ <!-- What business domain does this product operate in?
230
+ Why is it complex? What makes it non-obvious? -->
231
+
232
+ ## Key Concepts
233
+
234
+ | Concept | Definition | Why It Matters |
235
+ |---------|-----------|----------------|
236
+ | <!-- term --> | <!-- definition --> | <!-- product impact --> |
237
+
238
+ ## Domain Boundaries
239
+
240
+ <!-- What's in scope? What's adjacent but out of scope?
241
+ Where does this domain interact with other systems/processes? -->
242
+
243
+ ## Complexity Drivers
244
+
245
+ <!-- What makes this domain hard? Regulations? Legacy systems?
246
+ Multiple stakeholders? Ambiguous terminology? -->
247
+
248
+ ## Related
249
+
250
+ - [Business Processes](/content/domain/processes/) — how work flows in this domain
251
+ - [Data Dictionary](/content/domain/data-dictionary) — canonical term definitions
252
+ - [Industry Notes](/content/domain/industry-notes) — regulations, standards, market context
253
+ `,
254
+ },
255
+ {
256
+ path: "content/domain/processes/index.md",
257
+ content: (ctx: TemplateContext) => `---
258
+ title: Business Processes
259
+ description: Business process catalog for ${ctx.branding.brandName}
260
+ ---
261
+
262
+ # Business Processes
263
+
264
+ <!-- ← CUSTOMIZE: Document each key business process.
265
+ This is often the most valuable artifact for complex engagements. -->
266
+
267
+ | Process | Trigger | Key Systems | Documentation |
268
+ |---------|---------|-------------|---------------|
269
+ | <!-- process name --> | <!-- what starts it --> | <!-- systems involved --> | [Details](./process-name) |
270
+
271
+ ## Documenting a Process
272
+
273
+ Each process should capture:
274
+
275
+ 1. **Trigger** — what initiates the process
276
+ 2. **Actors** — who/what is involved (people, systems, roles)
277
+ 3. **Steps** — the happy path, numbered
278
+ 4. **Variations** — edge cases, exception paths
279
+ 5. **Systems** — which systems participate at each step
280
+ 6. **Data** — what data flows between steps
281
+ 7. **Business Rules** — constraints, validations, policies
282
+
283
+ ## Process Template
284
+
285
+ \`\`\`markdown
286
+ # Process: [Name]
287
+
288
+ ## Trigger
289
+ <!-- What starts this process -->
290
+
291
+ ## Actors
292
+ | Actor | Role | System |
293
+ |-------|------|--------|
294
+
295
+ ## Steps
296
+ 1. [Step] — [Actor] does [action] in [system]
297
+ 2. ...
298
+
299
+ ## Variations
300
+ ### [Variation Name]
301
+ - When: [condition]
302
+ - Then: [different path]
303
+
304
+ ## Business Rules
305
+ - [Rule 1]
306
+ - [Rule 2]
307
+ \`\`\`
308
+ `,
309
+ },
310
+ {
311
+ path: "content/domain/data-dictionary.md",
312
+ content: (ctx: TemplateContext) => `---
313
+ title: Data Dictionary
314
+ description: Canonical term definitions for ${ctx.branding.brandName}
315
+ ---
316
+
317
+ # Data Dictionary
318
+
319
+ <!-- ← CUSTOMIZE: Add terms as the domain model evolves.
320
+ This is the single source of truth for "what does X mean?" -->
321
+
322
+ ## Core Terms
323
+
324
+ | Term | Definition | Also Known As | Used In |
325
+ |------|-----------|---------------|---------|
326
+ | <!-- term --> | <!-- precise definition --> | <!-- aliases --> | <!-- where it appears --> |
327
+
328
+ ## Data Entities
329
+
330
+ ### <!-- Entity Name -->
331
+
332
+ | Field | Type | Description | Example |
333
+ |-------|------|-------------|---------|
334
+ | <!-- field --> | <!-- string/number/date/etc --> | <!-- what it represents --> | <!-- sample value --> |
335
+
336
+ ## Relationships
337
+
338
+ <!-- How do entities relate to each other?
339
+ Consider a diagram (Mermaid) for complex relationships. -->
340
+
341
+ ## Naming Conventions
342
+
343
+ <!-- Are there naming rules? Field prefixes? Status value enumerations?
344
+ Document anything that a developer or analyst needs to know. -->
345
+ `,
346
+ },
347
+ {
348
+ path: "content/domain/industry-notes.md",
349
+ content: (ctx: TemplateContext) => `---
350
+ title: Industry Notes
351
+ description: Industry context for ${ctx.branding.brandName}
352
+ ---
353
+
354
+ # Industry Notes
355
+
356
+ <!-- ← CUSTOMIZE: Capture the external context that constrains product decisions -->
357
+
358
+ ## Regulatory Environment
359
+
360
+ <!-- What regulations apply? Compliance requirements?
361
+ Certification standards? Reporting obligations? -->
362
+
363
+ | Regulation | Scope | Impact on Product |
364
+ |-----------|-------|-------------------|
365
+ | <!-- regulation --> | <!-- what it covers --> | <!-- how it affects us --> |
366
+
367
+ ## Industry Standards
368
+
369
+ <!-- Technical standards, data formats, protocols,
370
+ interoperability requirements -->
371
+
372
+ ## Competitive Landscape
373
+
374
+ <!-- Who else operates in this space?
375
+ What are common industry patterns?
376
+ What do users expect based on other products? -->
377
+
378
+ ## Market Dynamics
379
+
380
+ <!-- Trends, shifts, upcoming changes that affect product direction -->
381
+ `,
382
+ },
383
+ // ---------------------------------------------------------------
384
+ // Planning section
385
+ // ---------------------------------------------------------------
386
+ {
387
+ path: "content/planning/roadmap.md",
388
+ content: (ctx: TemplateContext) => `---
389
+ title: Roadmap
390
+ description: Product roadmap for ${ctx.branding.brandName}
391
+ ---
392
+
393
+ # Roadmap
394
+
395
+ <!-- ← CUSTOMIZE: Define phases and priorities -->
396
+
397
+ ## Current Phase
398
+
399
+ **Phase**: <!-- name -->
400
+ **Timeline**: <!-- date range -->
401
+ **Focus**: <!-- primary goal -->
402
+
403
+ ## Priorities
404
+
405
+ | Priority | Initiative | Rationale | Status |
406
+ |----------|-----------|-----------|--------|
407
+ | 1 | <!-- initiative --> | <!-- why now --> | Planning |
408
+ | 2 | <!-- initiative --> | <!-- why now --> | Discovery |
409
+ | 3 | <!-- initiative --> | <!-- why now --> | Backlog |
410
+
411
+ ## What We're NOT Doing (and Why)
412
+
413
+ <!-- Equally important as what we are doing.
414
+ Document deferred items and rationale. -->
415
+
416
+ | Deferred Item | Reason | Revisit When |
417
+ |--------------|--------|-------------|
418
+ | <!-- item --> | <!-- rationale --> | <!-- trigger --> |
419
+
420
+ ## Phase History
421
+
422
+ | Phase | Dates | Outcome |
423
+ |-------|-------|---------|
424
+ | <!-- phase --> | <!-- dates --> | <!-- what was achieved --> |
425
+
426
+ ## Related
427
+
428
+ - [Specs](/content/planning/specs/) — detailed specifications
429
+ - [Decisions](/content/planning/decisions/) — key decision records
430
+ - [Research](/content/planning/research/) — supporting analysis
431
+ `,
432
+ },
433
+ {
434
+ path: "content/planning/decisions/index.md",
435
+ content: (_ctx: TemplateContext) => `---
436
+ title: Decisions
437
+ description: Architecture and product decision records
438
+ ---
439
+
440
+ # Decision Log
441
+
442
+ <!-- ← CUSTOMIZE: Record significant decisions as they are made -->
443
+
444
+ | ID | Decision | Date | Status |
445
+ |----|----------|------|--------|
446
+ | ADR-001 | <!-- decision title --> | <!-- date --> | Proposed / Accepted / Superseded |
447
+
448
+ ## Recording a Decision
449
+
450
+ Use the [ADR Template](./adr-template) for each significant decision.
451
+
452
+ A decision is worth recording when:
453
+ - It affects architecture or technology choice
454
+ - It's hard to reverse
455
+ - Multiple valid options were considered
456
+ - Future team members will ask "why did we do it this way?"
457
+ `,
458
+ },
459
+ {
460
+ path: "content/planning/decisions/adr-template.md",
461
+ content: (_ctx: TemplateContext) => `---
462
+ title: "ADR-000: Decision Template"
463
+ description: Template for architecture/product decision records
464
+ ---
465
+
466
+ # ADR-000: [Decision Title]
467
+
468
+ ## Status
469
+
470
+ Proposed | Accepted | Deprecated | Superseded by [ADR-XXX]
471
+
472
+ ## Context
473
+
474
+ <!-- What is the issue? What forces are at play?
475
+ Include technical, business, and organizational context. -->
476
+
477
+ ## Options Considered
478
+
479
+ ### Option A: [Name]
480
+
481
+ - **Pros**: ...
482
+ - **Cons**: ...
483
+
484
+ ### Option B: [Name]
485
+
486
+ - **Pros**: ...
487
+ - **Cons**: ...
488
+
489
+ ## Decision
490
+
491
+ <!-- What was decided and why. Be specific. -->
492
+
493
+ ## Consequences
494
+
495
+ ### Positive
496
+
497
+ - <!-- benefit -->
498
+
499
+ ### Negative
500
+
501
+ - <!-- trade-off -->
502
+
503
+ ### Risks
504
+
505
+ - <!-- risk and mitigation -->
506
+ `,
507
+ },
508
+ {
509
+ path: "content/planning/specs/index.md",
510
+ content: (ctx: TemplateContext) => `---
511
+ title: Specifications
512
+ description: Product specifications for ${ctx.branding.brandName}
513
+ ---
514
+
515
+ # Specifications
516
+
517
+ <!-- ← CUSTOMIZE: Add specs as features are scoped -->
518
+
519
+ | Spec | Feature | Status | Owner |
520
+ |------|---------|--------|-------|
521
+ | <!-- spec title --> | <!-- feature link --> | Draft / Review / Approved | <!-- who --> |
522
+
523
+ ## Writing a Spec
524
+
525
+ Each spec should include:
526
+
527
+ 1. **Problem Statement** — what user problem this solves
528
+ 2. **Proposed Solution** — how we solve it
529
+ 3. **Acceptance Criteria** — how we know it's done
530
+ 4. **Out of Scope** — what this spec does NOT cover
531
+ 5. **Dependencies** — what else needs to exist
532
+ `,
533
+ },
534
+ {
535
+ path: "content/planning/research/index.md",
536
+ content: (ctx: TemplateContext) => `---
537
+ title: Research
538
+ description: Research and analysis for ${ctx.branding.brandName}
539
+ ---
540
+
541
+ # Research
542
+
543
+ <!-- ← CUSTOMIZE: Add research as analysis is completed -->
544
+
545
+ | Topic | Type | Date | Key Finding |
546
+ |-------|------|------|-------------|
547
+ | <!-- topic --> | Market / User / Technology / Competitive | <!-- date --> | <!-- one-line summary --> |
548
+
549
+ ## Research Types
550
+
551
+ - **Market research** — industry trends, market size, opportunity assessment
552
+ - **User research** — interviews, surveys, usage patterns, pain points
553
+ - **Technology assessment** — vendor evaluation, build vs buy, feasibility
554
+ - **Competitive analysis** — alternatives, positioning, differentiation
555
+ `,
556
+ },
557
+ // ---------------------------------------------------------------
558
+ // Operations section
559
+ // ---------------------------------------------------------------
560
+ {
561
+ path: "content/operations/environments.md",
562
+ content: (ctx: TemplateContext) => `---
563
+ title: Environments
564
+ description: Environment catalog for ${ctx.branding.brandName}
565
+ ---
566
+
567
+ # Environments
568
+
569
+ <!-- ← CUSTOMIZE: Document your environments -->
570
+
571
+ | Environment | URL | Purpose | Access |
572
+ |-------------|-----|---------|--------|
573
+ | Development | <!-- URL --> | Active development | Team |
574
+ | Staging | <!-- URL --> | Pre-production testing | Team + stakeholders |
575
+ | Production | <!-- URL --> | Live system | End users |
576
+
577
+ ## Configuration
578
+
579
+ <!-- How do environments differ? Feature flags? API keys?
580
+ What needs to change between environments? -->
581
+
582
+ ## Access
583
+
584
+ <!-- How to get access to each environment.
585
+ Credentials, VPN, service accounts. -->
586
+ `,
587
+ },
588
+ {
589
+ path: "content/operations/deployment.md",
590
+ content: (ctx: TemplateContext) => `---
591
+ title: Deployment
592
+ description: Deployment procedure for ${ctx.branding.brandName}
593
+ ---
594
+
595
+ # Deployment
596
+
597
+ <!-- ← CUSTOMIZE: Replace with your deployment process -->
598
+
599
+ ## Prerequisites
600
+
601
+ - [ ] Code reviewed and approved
602
+ - [ ] Tests passing
603
+ - [ ] Staging verified
604
+ - [ ] Stakeholders notified
605
+
606
+ ## Procedure
607
+
608
+ ### 1. Pre-deployment
609
+
610
+ \`\`\`bash
611
+ # ← CUSTOMIZE: your verification commands
612
+ \`\`\`
613
+
614
+ ### 2. Deploy
615
+
616
+ \`\`\`bash
617
+ # ← CUSTOMIZE: your deployment commands
618
+ \`\`\`
619
+
620
+ ### 3. Verify
621
+
622
+ - [ ] Application healthy
623
+ - [ ] Key flows working
624
+ - [ ] No error spikes
625
+
626
+ ## Rollback
627
+
628
+ \`\`\`bash
629
+ # ← CUSTOMIZE: your rollback commands
630
+ \`\`\`
631
+ `,
632
+ },
633
+ // ---------------------------------------------------------------
634
+ // Guides section
635
+ // ---------------------------------------------------------------
636
+ {
637
+ path: "content/guides/getting-started.md",
638
+ content: (ctx: TemplateContext) => `---
639
+ title: Getting Started
640
+ description: Onboarding guide for ${ctx.branding.brandName}
641
+ ---
642
+
643
+ # Getting Started
644
+
645
+ <!-- ← CUSTOMIZE: Adapt for your team and project -->
646
+
647
+ ## For New Team Members
648
+
649
+ ### 1. Read the Domain
650
+
651
+ Start with [Domain Overview](/content/domain/overview) — understand the business context before the code.
652
+
653
+ ### 2. Understand the Product
654
+
655
+ Read [Product Overview](/content/product/overview) — what we're building and why.
656
+
657
+ ### 3. Review Current Plan
658
+
659
+ Check the [Roadmap](/content/planning/roadmap) — what phase are we in, what are the priorities.
660
+
661
+ ### 4. Set Up
662
+
663
+ Follow the environment setup in [Operations](/content/operations/environments).
664
+
665
+ ## For AI Agents
666
+
667
+ 1. Read \`AGENTS.md\` and \`CUSTOMIZING.md\` at the project root
668
+ 2. Read [Domain Overview](/content/domain/overview) for business context
669
+ 3. Check \`.kitfly/manifest.json\` for template metadata
670
+ 4. Follow existing content patterns in each section
671
+ `,
672
+ },
673
+ {
674
+ path: "content/guides/user-guide.md",
675
+ content: (ctx: TemplateContext) => `---
676
+ title: User Guide
677
+ description: End-user documentation for ${ctx.branding.brandName}
678
+ ---
679
+
680
+ # User Guide
681
+
682
+ <!-- ← CUSTOMIZE: Write for end users, not developers -->
683
+
684
+ ## Overview
685
+
686
+ <!-- What can users do with this product? -->
687
+
688
+ ## Getting Started
689
+
690
+ ### Step 1: <!-- first thing a user does -->
691
+
692
+ ### Step 2: <!-- next step -->
693
+
694
+ ## Common Tasks
695
+
696
+ ### <!-- Task Name -->
697
+
698
+ 1. <!-- step -->
699
+ 2. <!-- step -->
700
+
701
+ ## FAQ
702
+
703
+ ### <!-- Common question? -->
704
+
705
+ <!-- Answer -->
706
+
707
+ ## Support
708
+
709
+ <!-- How to get help -->
710
+ `,
711
+ },
712
+ // ---------------------------------------------------------------
713
+ // Reference section
714
+ // ---------------------------------------------------------------
715
+ {
716
+ path: "content/reference/architecture/overview.md",
717
+ content: (ctx: TemplateContext) => `---
718
+ title: Architecture Overview
719
+ description: System architecture for ${ctx.branding.brandName}
720
+ ---
721
+
722
+ # Architecture Overview
723
+
724
+ <!-- ← CUSTOMIZE: Document your system architecture -->
725
+
726
+ ## System Diagram
727
+
728
+ <!-- Consider a Mermaid diagram for architecture visualization -->
729
+
730
+ ## Components
731
+
732
+ | Component | Purpose | Technology | Owner |
733
+ |-----------|---------|-----------|-------|
734
+ | <!-- component --> | <!-- what it does --> | <!-- tech stack --> | <!-- team/person --> |
735
+
736
+ ## Data Flow
737
+
738
+ <!-- How does data move through the system?
739
+ Source → Processing → Storage → Presentation -->
740
+
741
+ ## Key Design Decisions
742
+
743
+ See [Decision Log](/content/planning/decisions/) for architectural decisions and rationale.
744
+ `,
745
+ },
746
+ {
747
+ path: "content/reference/integrations/index.md",
748
+ content: (ctx: TemplateContext) => `---
749
+ title: Integrations
750
+ description: External system integrations for ${ctx.branding.brandName}
751
+ ---
752
+
753
+ # Integrations
754
+
755
+ <!-- ← CUSTOMIZE: Document each external system integration -->
756
+
757
+ | System | Type | Purpose | Documentation |
758
+ |--------|------|---------|---------------|
759
+ | <!-- system --> | REST API / File / Database | <!-- why we integrate --> | [Details](./system-name) |
760
+
761
+ ## Adding an Integration
762
+
763
+ 1. Create a file in \`content/reference/integrations/\`
764
+ 2. Document: connection details, auth, endpoints, data format, error handling
765
+ 3. Update this index table
766
+ 4. Add relevant entries to [Data Dictionary](/content/domain/data-dictionary)
767
+ `,
768
+ },
769
+ {
770
+ path: "content/reference/data-models/index.md",
771
+ content: (ctx: TemplateContext) => `---
772
+ title: Data Models
773
+ description: Database and API schemas for ${ctx.branding.brandName}
774
+ ---
775
+
776
+ # Data Models
777
+
778
+ <!-- ← CUSTOMIZE: Document your data structures -->
779
+
780
+ ## Database Schema
781
+
782
+ <!-- Tables, relationships, key constraints -->
783
+
784
+ ## API Schema
785
+
786
+ <!-- Request/response formats, versioning -->
787
+
788
+ ## Related
789
+
790
+ - [Data Dictionary](/content/domain/data-dictionary) — business term definitions
791
+ - [Integrations](/content/reference/integrations/) — external system data formats
792
+ `,
793
+ },
794
+ {
795
+ path: "content/reference/contacts/directory.md",
796
+ content: (ctx: TemplateContext) => `---
797
+ title: Contact Directory
798
+ description: Team and vendor contacts for ${ctx.branding.brandName}
799
+ ---
800
+
801
+ # Contact Directory
802
+
803
+ <!-- ← CUSTOMIZE: Add your team and vendor contacts -->
804
+
805
+ ## Project Team
806
+
807
+ | Role | Contact | Responsibility |
808
+ |------|---------|----------------|
809
+ | Product Lead | <!-- name/email --> | Product direction, priorities |
810
+ | Technical Lead | <!-- name/email --> | Architecture, implementation |
811
+ | Domain Expert | <!-- name/email --> | Business context, process knowledge |
812
+
813
+ ## Vendor Contacts
814
+
815
+ | Vendor | Type | Contact |
816
+ |--------|------|---------|
817
+ | <!-- vendor --> | <!-- what they provide --> | <!-- portal/email --> |
818
+
819
+ ## Stakeholders
820
+
821
+ | Stakeholder | Interest | Communication |
822
+ |-------------|----------|---------------|
823
+ | <!-- who --> | <!-- what they care about --> | <!-- how/when to update --> |
824
+ `,
825
+ },
826
+ {
827
+ path: "content/reference/metrics/kpis.md",
828
+ content: (ctx: TemplateContext) => `---
829
+ title: KPIs & Metrics
830
+ description: Key performance indicators for ${ctx.branding.brandName}
831
+ ---
832
+
833
+ # KPIs & Metrics
834
+
835
+ <!-- ← CUSTOMIZE: Define your success metrics -->
836
+
837
+ ## Product Metrics
838
+
839
+ | Metric | Target | Dashboard |
840
+ |--------|--------|-----------|
841
+ | <!-- metric --> | <!-- target --> | [Link] |
842
+
843
+ ## Business Metrics
844
+
845
+ | Metric | Target | Source |
846
+ |--------|--------|--------|
847
+ | <!-- metric --> | <!-- target --> | <!-- where measured --> |
848
+
849
+ ## Monitoring
850
+
851
+ | Alert | Warning | Critical | Action |
852
+ |-------|---------|----------|--------|
853
+ | <!-- what --> | <!-- threshold --> | <!-- threshold --> | <!-- response --> |
854
+ `,
855
+ },
856
+ // ---------------------------------------------------------------
857
+ // CUSTOMIZING.md
858
+ // ---------------------------------------------------------------
859
+ {
860
+ path: "CUSTOMIZING.md",
861
+ content: (ctx: TemplateContext) => `---
862
+ template: productbook
863
+ template_version: 1
864
+ created: ${new Date().toISOString().split("T")[0]}
865
+ ---
866
+
867
+ # Customizing ${ctx.branding.siteName}
868
+
869
+ This guide helps you (and AI assistants) understand how to customize this productbook.
870
+
871
+ ## Site Structure
872
+
873
+ \`\`\`
874
+ ${ctx.name}/
875
+ ├── site.yaml # Site configuration (sections, branding)
876
+ ├── theme.yaml # Theme customization (create if needed)
877
+ ├── index.md # Home page with product status
878
+ ├── CUSTOMIZING.md # This file
879
+ ├── content/
880
+ │ ├── product/ # Product definition
881
+ │ │ ├── features/ # Feature catalog
882
+ │ │ └── releases/ # Release history
883
+ │ ├── domain/ # Business domain knowledge
884
+ │ │ └── processes/ # Business process documentation
885
+ │ ├── planning/ # Roadmap, specs, decisions
886
+ │ │ ├── decisions/ # Decision records (ADRs)
887
+ │ │ ├── specs/ # Product specifications
888
+ │ │ └── research/ # Research and analysis
889
+ │ ├── operations/ # Deployment, environments
890
+ │ ├── guides/ # Onboarding, user guides, tutorials
891
+ │ └── reference/ # Supporting materials
892
+ │ ├── architecture/ # System architecture
893
+ │ ├── integrations/ # External system docs
894
+ │ ├── data-models/ # Database and API schemas
895
+ │ ├── contacts/ # Team and vendor contacts
896
+ │ └── metrics/ # KPIs, dashboards
897
+ └── assets/
898
+ └── brand/ # Logo, favicon
899
+ \`\`\`
900
+
901
+ ## Configuration Files
902
+
903
+ ### site.yaml - Site Configuration
904
+
905
+ \`\`\`yaml
906
+ title: "${ctx.branding.siteName}"
907
+
908
+ brand:
909
+ name: "${ctx.branding.brandName}" # Shown in header
910
+ url: "/" # Logo link destination
911
+
912
+ sections:
913
+ - name: "Product"
914
+ path: "content/product"
915
+ # Add or modify sections here
916
+ \`\`\`
917
+
918
+ ### theme.yaml - Visual Customization (optional)
919
+
920
+ Create \`theme.yaml\` to customize colors and typography:
921
+
922
+ \`\`\`yaml
923
+ colors:
924
+ primary: "#2563eb"
925
+ background: "#ffffff"
926
+ text: "#1f2937"
927
+
928
+ footer:
929
+ text: "© ${ctx.year} ${ctx.branding.brandName}"
930
+ \`\`\`
931
+
932
+ ## Adding Content
933
+
934
+ ### New Feature
935
+
936
+ 1. Create in \`content/product/features/\`:
937
+ \`\`\`
938
+ content/product/features/my-feature.md
939
+ \`\`\`
940
+ 2. Include: problem statement, user stories, acceptance criteria, success metrics
941
+ 3. Update the index table in \`content/product/features/index.md\`
942
+
943
+ ### Documenting a Business Process
944
+
945
+ 1. Create in \`content/domain/processes/\`:
946
+ \`\`\`
947
+ content/domain/processes/my-process.md
948
+ \`\`\`
949
+ 2. Include: trigger, actors, steps, variations, systems, business rules
950
+ 3. Update the index table in \`content/domain/processes/index.md\`
951
+ 4. Add new terms to [Data Dictionary](/content/domain/data-dictionary)
952
+
953
+ ### Recording a Decision
954
+
955
+ 1. Copy the [ADR Template](/content/planning/decisions/adr-template) to a new file:
956
+ \`\`\`
957
+ content/planning/decisions/adr-001-my-decision.md
958
+ \`\`\`
959
+ 2. Fill in: context, options, decision, consequences
960
+ 3. Update the index in \`content/planning/decisions/index.md\`
961
+
962
+ ### Adding an Integration
963
+
964
+ 1. Create in \`content/reference/integrations/\`:
965
+ \`\`\`
966
+ content/reference/integrations/my-system.md
967
+ \`\`\`
968
+ 2. Document: connection details, auth, endpoints, data format, error handling
969
+ 3. Update the integrations index
970
+ 4. Add data entities to [Data Models](/content/reference/data-models/)
971
+
972
+ ### New Section
973
+
974
+ 1. Create folder: \`content/newsection/\`
975
+ 2. Add to \`site.yaml\`:
976
+ \`\`\`yaml
977
+ sections:
978
+ - name: "New Section"
979
+ path: "content/newsection"
980
+ \`\`\`
981
+ 3. Add at least one markdown file
982
+
983
+ ## Document Conventions
984
+
985
+ ### Product (features, releases)
986
+
987
+ - State the user problem first
988
+ - Include acceptance criteria
989
+ - Define success metrics
990
+ - Link to related specs and domain context
991
+
992
+ ### Domain (processes, data dictionary)
993
+
994
+ - Write for someone new to the business
995
+ - Be precise with terminology — the data dictionary is canonical
996
+ - Document edge cases and variations, not just happy paths
997
+ - Explain *why* things work the way they do, not just *what*
998
+
999
+ ### Planning (decisions, specs, research)
1000
+
1001
+ - Decisions: capture context and alternatives, not just the choice
1002
+ - Specs: problem first, solution second
1003
+ - Research: state methodology and limitations
1004
+
1005
+ ### Guides (onboarding, user docs)
1006
+
1007
+ - Write for the audience (team member vs end user)
1008
+ - Start with what they need to know first
1009
+ - Include concrete examples
1010
+
1011
+ ## Linking and References
1012
+
1013
+ ### Internal Links
1014
+
1015
+ \`\`\`markdown
1016
+ See [Domain Overview](/content/domain/overview) for business context.
1017
+ \`\`\`
1018
+
1019
+ ### External Links
1020
+
1021
+ \`\`\`markdown
1022
+ See [Vendor Documentation](https://vendor.com/docs).
1023
+ \`\`\`
1024
+
1025
+ ## Getting Help
1026
+
1027
+ - [Kitfly Documentation](https://github.com/3leaps/kitfly)
1028
+ - [Markdown Guide](https://www.markdownguide.org/)
1029
+ `,
1030
+ },
1031
+ ],
1032
+ };