@mriekki/lean 0.4.3 → 0.4.5

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 (35) hide show
  1. package/assets/components.json +3 -3
  2. package/assets/core/distribution.json +8 -0
  3. package/assets/deployment/distribution.json +2 -0
  4. package/assets/generated/ASSEMBLY.json +73 -23
  5. package/assets/generated/core/core/instructions/lean-docs.instructions.md +33 -2
  6. package/assets/generated/core/core/instructions/lean-workflow.instructions.md +42 -0
  7. package/assets/generated/core/core/learning/DIAGRAM_GUIDE.md +46 -6
  8. package/assets/generated/core/core/learning/ENGINEERING_LEARNING_WORKBOOK.md +29 -6
  9. package/assets/generated/core/core/learning/LEARNING_MAP.md +37 -2
  10. package/assets/generated/core/core/learning/LEARNING_PROGRESS.md +15 -7
  11. package/assets/generated/core/core/learning/SYSTEM_DESIGN_DRILLS.md +299 -19
  12. package/assets/generated/core/core/process/COACHING_GUIDE.md +35 -2
  13. package/assets/generated/core/core/process/DATABASE_LEARNING_WORKBENCH.md +153 -102
  14. package/assets/generated/core/core/process/DEPLOYMENT_ENABLEMENT.md +108 -71
  15. package/assets/generated/core/core/process/LEAN_ENGINEERING_GUIDE.md +317 -0
  16. package/assets/generated/core/core/process/PROJECT_DOCUMENTATION_FRAMEWORK.md +324 -0
  17. package/assets/generated/core/core/process/SYSTEM_DESIGN_LEARNING_WORKBENCH.md +520 -0
  18. package/assets/generated/core/core/skills/coach/SKILL.md +31 -4
  19. package/assets/generated/core/core/skills/db-lab/SKILL.md +59 -16
  20. package/assets/generated/core/core/skills/deliver/SKILL.md +77 -5
  21. package/assets/generated/core/core/skills/deploy/SKILL.md +164 -121
  22. package/assets/generated/core/core/skills/deployment-readiness/SKILL.md +223 -250
  23. package/assets/generated/core/core/skills/docs/SKILL.md +116 -0
  24. package/assets/generated/core/core/skills/next-step/SKILL.md +21 -6
  25. package/assets/generated/core/core/skills/system-lab/SKILL.md +333 -0
  26. package/assets/generated/core/core/skills/tear-down/SKILL.md +101 -61
  27. package/assets/generated/core/core/templates/ADR_TEMPLATE.md +41 -0
  28. package/assets/generated/core/tools/docs_site/docs_site.py +382 -0
  29. package/assets/generated/core/tools/system_lab/system_workbench.py +243 -0
  30. package/assets/generated/deployment/src/lean_poc_deployment/entrypoint.py +5 -1
  31. package/assets/generated/deployment/src/lean_poc_deployment/local_cli.py +112 -0
  32. package/assets/generated/deployment/src/lean_poc_deployment/local_runtime.py +523 -0
  33. package/assets/generated/deployment/src/lean_poc_deployment/teardown.py +49 -35
  34. package/assets/generated/deployment/src/lean_poc_deployment/teardown_cli.py +31 -12
  35. package/package.json +1 -1
@@ -0,0 +1,324 @@
1
+ # Lean Project Documentation Framework
2
+
3
+ Lean project documentation is a small, evidence-aware engineering system rather than a pile of unrelated Markdown files.
4
+
5
+ ## Goals
6
+
7
+ - Keep a short, obvious root-level front door.
8
+ - Keep Markdown as the canonical human-readable source.
9
+ - Preserve one authority for product and work-item requirements.
10
+ - Separate project-owned prose from Lean-managed process material and disposable generated evidence.
11
+ - Make architecture, database, operations, learning, and decision context easy to find.
12
+ - Provide a local documentation website without requiring a documentation framework dependency.
13
+ - Make stale generated views visible instead of asking developers to maintain diagrams manually.
14
+ - Keep documentation support non-blocking for normal engineering delivery.
15
+
16
+ ## Canonical shape
17
+
18
+ Greenfield POCs should normally converge on:
19
+
20
+ ```text
21
+ README.md
22
+ PROJECT_BRIEF.md
23
+
24
+ docs/
25
+ index.md
26
+ lean-docs.json
27
+
28
+ product/
29
+ PRODUCT_BRIEF.md
30
+ IMPLEMENTATION_ROADMAP.md
31
+
32
+ architecture/
33
+ OVERVIEW.md
34
+ DATA.md
35
+ RUNTIME_FLOWS.md
36
+ decisions/
37
+ README.md
38
+ ADR-*.md
39
+
40
+ engineering/
41
+ DEVELOPMENT.md
42
+ TESTING.md
43
+ DELIVERY.md
44
+
45
+ operations/
46
+ ENVIRONMENTS.md
47
+ DEPLOYMENT.md
48
+ TROUBLESHOOTING.md
49
+
50
+ learning/
51
+ OVERVIEW.md
52
+ DATABASE.md
53
+ SYSTEM_DESIGN.md
54
+
55
+ generated/
56
+ README.md
57
+
58
+ lean/
59
+ LEAN_ENGINEERING_GUIDE.md
60
+
61
+ tools/
62
+ lean-docs/
63
+ docs-site.py
64
+ ```
65
+
66
+ The exact set may vary for an adopted repository, but ownership and authority rules should remain explicit.
67
+
68
+ ## Root-level front doors
69
+
70
+ ### `README.md`
71
+
72
+ Keep it short. It should answer:
73
+
74
+ - what the repository is;
75
+ - where to start;
76
+ - how to set up/run the project;
77
+ - where the authoritative product/work-item docs live;
78
+ - how to open project documentation;
79
+ - what the first approved work item is when applicable.
80
+
81
+ ### `PROJECT_BRIEF.md`
82
+
83
+ `PROJECT_BRIEF.md` is the integrated project briefing and navigation surface. It may summarize approved product scope, stack, environments, initial work items, learning goals, and important documentation links.
84
+
85
+ It is **not** a second requirements authority. In a normal Lean greenfield POC:
86
+
87
+ - `docs/product/PRODUCT_BRIEF.md` remains product authority;
88
+ - approved work-item briefs/requirements remain work-item authority;
89
+ - `PROJECT_BRIEF.md` summarizes and links to those authorities.
90
+
91
+ If a repository already has a different accepted authority model, preserve it.
92
+
93
+ ## Ownership classes
94
+
95
+ Each document in `docs/lean-docs.json` should identify one of these ownership classes.
96
+
97
+ ### `project`
98
+
99
+ Project-owned material. It may be created by Bootstrap and then evolve with the application.
100
+
101
+ Examples:
102
+
103
+ - `PROJECT_BRIEF.md`
104
+ - product/architecture/engineering/operations/learning docs
105
+ - ADRs
106
+
107
+ Do not overwrite project-owned prose during Lean package updates merely because a newer template exists.
108
+
109
+ ### `lean`
110
+
111
+ Reusable Lean-managed material whose source lives in a reusable platform repository and whose accepted bytes/provenance are controlled through the package/baseline mechanism.
112
+
113
+ Examples:
114
+
115
+ - Lean process guides
116
+ - `docs/lean/LEAN_ENGINEERING_GUIDE.md`
117
+ - the local documentation viewer
118
+ - reusable templates
119
+
120
+ ### `generated-evidence`
121
+
122
+ Disposable projections reconstructed from current repository/database evidence.
123
+
124
+ Examples:
125
+
126
+ - System Lab workbench snapshots
127
+ - DB Lab workbench snapshots
128
+ - local documentation site output
129
+
130
+ Generated evidence is not authoritative prose and should not normally be committed. The default local cache is:
131
+
132
+ ```text
133
+ .lean/docs-cache/
134
+ ```
135
+
136
+ ## Documentation manifest
137
+
138
+ `docs/lean-docs.json` is a small project-owned index, not a competing content store.
139
+
140
+ Recommended schema:
141
+
142
+ ```json
143
+ {
144
+ "schemaVersion": 1,
145
+ "site": {
146
+ "title": "Example POC",
147
+ "entry": "PROJECT_BRIEF.md"
148
+ },
149
+ "documents": [
150
+ {
151
+ "path": "PROJECT_BRIEF.md",
152
+ "section": "Overview",
153
+ "type": "project-brief",
154
+ "ownership": "project",
155
+ "authority": "navigation"
156
+ },
157
+ {
158
+ "path": "docs/product/PRODUCT_BRIEF.md",
159
+ "section": "Product",
160
+ "type": "product-brief",
161
+ "ownership": "project",
162
+ "authority": "product"
163
+ },
164
+ {
165
+ "path": "docs/lean/LEAN_ENGINEERING_GUIDE.md",
166
+ "section": "Lean",
167
+ "type": "platform-guide",
168
+ "ownership": "lean",
169
+ "authority": "reference"
170
+ }
171
+ ]
172
+ }
173
+ ```
174
+
175
+ The site renderer should tolerate missing optional documents so Bootstrap and reusable-package application can remain separate deterministic phases.
176
+
177
+ ## Local documentation website
178
+
179
+ The reusable viewer is intentionally dependency-free and local-only.
180
+
181
+ Normal command:
182
+
183
+ ```powershell
184
+ python .\tools\lean-docs\docs-site.py serve --root .
185
+ ```
186
+
187
+ Build-only mode:
188
+
189
+ ```powershell
190
+ python .\tools\lean-docs\docs-site.py build --root . --out .\.lean\docs-site
191
+ ```
192
+
193
+ The viewer should:
194
+
195
+ - bind to loopback only;
196
+ - discover `docs/lean-docs.json` when present;
197
+ - fall back to safe Markdown discovery for adopted repositories;
198
+ - provide section navigation and full-text search;
199
+ - render common Markdown without external dependencies;
200
+ - render the simple `flowchart` Mermaid subset used by the Lean engineering guide and preserve unsupported Mermaid source visibly rather than failing;
201
+ - show document ownership/authority metadata when known;
202
+ - show the current Git commit when available;
203
+ - show DB/System Lab cache availability and freshness where evidence permits;
204
+ - never mutate project prose merely by being opened.
205
+
206
+ The HTML/site is a projection. Markdown remains canonical.
207
+
208
+ ## Lab integration
209
+
210
+ Use the standard local cache paths:
211
+
212
+ ```text
213
+ .lean/docs-cache/system/
214
+ .lean/docs-cache/database/
215
+ ```
216
+
217
+ ### System Lab
218
+
219
+ Because System Lab can reconstruct its model from repository evidence, the docs viewer may best-effort prepare the current System Lab projection when it starts and the tool is available:
220
+
221
+ ```powershell
222
+ python .\tools\lean-system-lab\system-workbench.py export --repo . --out .\.lean\docs-cache\system
223
+ ```
224
+
225
+ This is read-only and non-blocking.
226
+
227
+ ### DB Lab
228
+
229
+ Do not guess a database path. The docs viewer may surface an existing DB Lab projection and the `/db-lab` entry point. Automatic DB Lab generation is allowed only when a safe local development/test database path is already explicit in project configuration/evidence.
230
+
231
+ Never create a database, apply migrations, mutate data, or inspect Production to make documentation look current.
232
+
233
+ ## Freshness model
234
+
235
+ Generated views should report one of:
236
+
237
+ ```text
238
+ CURRENT
239
+ STALE
240
+ AVAILABLE / FRESHNESS UNKNOWN
241
+ NOT GENERATED
242
+ ```
243
+
244
+ For System Lab, compare its recorded repository commit/fingerprint with the current checkout when possible.
245
+
246
+ For DB Lab, freshness is evidence-dependent. Do not call a DB projection current merely because the HTML exists when no repository/schema binding proves it.
247
+
248
+ Tracked narrative docs are not automatically rewritten based on file timestamps. Instead, delivery/change analysis should identify likely documentation impact.
249
+
250
+ ## Delivery-completion behavior
251
+
252
+ After engineering delivery is complete, classify documentation impact separately from delivery state.
253
+
254
+ Examples of likely impact:
255
+
256
+ - public API/contract change → architecture/API/runtime docs;
257
+ - new service/dependency/queue/cache → architecture/runtime/system evidence;
258
+ - schema/migration/query/index change → data/database evidence;
259
+ - environment/deployment change → operations docs;
260
+ - new architectural tradeoff → possible ADR;
261
+ - test strategy or developer workflow change → engineering docs.
262
+
263
+ Safe generated projections may be rebuilt automatically. Human/project-authored prose should not be silently rewritten merely because the code changed.
264
+
265
+ A useful completion surface is:
266
+
267
+ ```text
268
+ DOCUMENTATION IMPACT
269
+
270
+ ✓ Project brief: no material change detected
271
+ ★ System evidence: changed; current projection prepared
272
+ ★ Database evidence: changed; /db-lab recommended
273
+ ○ ADR consideration: new synchronous external dependency introduced
274
+ ```
275
+
276
+ This is informative and non-blocking.
277
+
278
+ ## ADRs
279
+
280
+ Use ADRs for consequential architecture decisions that benefit from preserving context and tradeoffs.
281
+
282
+ An ADR should record:
283
+
284
+ - status;
285
+ - context;
286
+ - decision;
287
+ - alternatives considered;
288
+ - tradeoffs/consequences;
289
+ - evidence/links.
290
+
291
+ Do not create an ADR for every implementation detail. Do not silently invent a decision on the human's behalf. When delivery evidence reveals a material architectural choice without an ADR, surface the opportunity rather than auto-approving prose.
292
+
293
+ ## Evidence and safety
294
+
295
+ - Never put secret values in tracked Markdown or generated site data.
296
+ - Do not infer runtime behavior from architecture prose alone.
297
+ - Label architecture claims with evidence provenance where appropriate.
298
+ - Repository and runtime/database evidence outrank stale generated diagrams.
299
+ - A generated site build failure must not invalidate otherwise successful engineering delivery.
300
+ - Production access is never required merely to render documentation.
301
+
302
+ ## Relationship to learning
303
+
304
+ Project documentation is a learning surface, not just reference material.
305
+
306
+ The site should keep these entry points visible when available:
307
+
308
+ ```text
309
+ /db-lab
310
+ /system-lab
311
+ /code-walkthrough
312
+ /learning-review
313
+ /coach
314
+ ```
315
+
316
+ System/database diagrams remain current-by-default projections. The learner should think “open the lab,” not “maintain the diagram.”
317
+
318
+ ## Relationship to Lean updates
319
+
320
+ Lean-managed files may be updated through the controlled Lean package/baseline path.
321
+
322
+ Project-owned docs and ADRs must be preserved unless a change explicitly owns them. Generated evidence/cache is reconstructed instead of merged.
323
+
324
+ This keeps package updates deterministic without turning documentation into a regeneration hazard.