@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
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: tear-down
3
- description: "Guided destructive environment cleanup for local, Staging, Production, or all supported POC scopes. Preserves exact ownership boundaries, separate Production-data authorization, and delegates deletion mechanics to repository-provided tooling."
4
- argument-hint: "[local|staging|production|all]"
3
+ description: "Guided destructive cleanup for local state, one exact named logical environment, or all explicitly configured POC environments. Preserves ownership boundaries and separate Production-data authorization."
4
+ argument-hint: "[local|<environment>|all]"
5
5
  user-invocable: true
6
6
  disable-model-invocation: true
7
7
  ---
@@ -10,129 +10,169 @@ disable-model-invocation: true
10
10
 
11
11
  `/tear-down` is the human-facing destructive cleanup workflow for repository-owned POC environments and local runtime state.
12
12
 
13
- The skill owns scope selection, read-only preflight, destructive preview, and Human-in-the-Loop authorization. Repository-provided deployment tooling owns teardown mechanics.
13
+ The skill owns scope selection, read-only preflight, destructive preview, and Human-in-the-Loop authorization. Repository-provided deployment tooling owns deletion mechanics.
14
+
15
+ Logical environments are not limited to Staging and Production. A repository may define `demo`, `qa`, `staging`, `production`, or another safe named environment.
14
16
 
15
17
  Do not implement Docker, filesystem, route, database, registry, or host cleanup directly in the skill when an approved repository command exists.
16
18
 
17
19
  ## 1. Begin read-only
18
20
 
19
- Invocation starts read-only.
20
-
21
21
  Read only the minimum repository context needed to identify:
22
22
 
23
- - the repository's approved tear-down entry point;
24
- - the canonical repository/application identity used by that entry point;
25
- - configured Staging and Production environment-to-target bindings when those scopes are available;
26
- - the exact local image/package identity used to identify POC-owned local Docker state;
27
- - the currently supported tear-down scopes and their ownership boundaries.
23
+ - approved tear-down entry point and installed Deployment Kit version/baseline when applicable;
24
+ - canonical repository/application identity;
25
+ - repository-defined logical environments, their roles/purposes, and explicit target bindings;
26
+ - which selected environments are Production-class;
27
+ - exact local image/package identity used for POC-owned workstation Docker cleanup;
28
+ - supported tear-down scopes and ownership boundaries.
29
+
30
+ Do not assume:
28
31
 
29
- Do not assume script paths, container names, volume names, environment bindings, target addresses, or package coordinates unless the repository establishes them.
32
+ - Staging/Production are the only environments;
33
+ - Staging and Production use separate physical machines;
34
+ - `all` always means exactly local + Staging + Production;
35
+ - a local package exists;
36
+ - remote target addresses/aliases;
37
+ - container/volume names not established by the deterministic tool.
30
38
 
31
- If the repository does not provide an approved deterministic tear-down command for the requested scope, stop. Do not improvise destructive shell commands.
39
+ If the repository does not provide an approved deterministic command for the requested destructive scope, stop. Do not improvise shell commands.
32
40
 
33
- ## 2. Select the scope explicitly
41
+ ## 2. Select exact scope
34
42
 
35
- Supported generic scope names are:
43
+ Generic scope model:
36
44
 
37
45
  ```text
38
46
  local
39
- staging
40
- production
47
+ <one exact repository-defined named environment>
41
48
  all
42
49
  ```
43
50
 
44
- If the invocation did not name a scope, present only scopes the current repository actually supports and ask the human to select one.
51
+ If no scope is named, present only scopes the current repository actually supports.
45
52
 
46
53
  Rules:
47
54
 
48
- - never silently default to `production` or `all`;
49
- - never infer destructive scope from a previous deployment or prior conversation;
50
- - never widen a requested scope after a failure;
51
- - `all` means all supported tear-down scopes for this one repository/POC, not machine-wide cleanup;
52
- - selecting a scope does not itself authorize deletion.
55
+ - never silently default to a Production environment or `all`;
56
+ - never infer destructive scope from a prior deploy/conversation;
57
+ - never widen scope after failure;
58
+ - `all` means all explicitly configured/supplied scopes for this one POC, never machine-wide cleanup;
59
+ - selecting scope never authorizes deletion.
60
+
61
+ A named environment is independently targetable even when multiple environments share one physical target/failure domain.
62
+
63
+ If a named environment is unsupported/unconfigured, fail explicitly rather than falling back to another environment on the same host.
53
64
 
54
- If a named scope is unsupported or not configured, fail explicitly.
65
+ ## 3. Resolve ownership and Production classification
55
66
 
56
- ## 3. Resolve exact ownership and target evidence
67
+ Before an authorization gate, resolve non-secret ownership/evidence required by the installed tear-down contract.
68
+
69
+ For local cleanup identify the exact POC-owned local runtime/package boundary.
70
+
71
+ For each selected remote environment identify:
72
+
73
+ ```text
74
+ environment name
75
+ role/purpose (including Production classification)
76
+ configured logical target
77
+ repository/application identity
78
+ ownership markers required by the deterministic tool
79
+ ```
57
80
 
58
- Before presenting an authorization gate, resolve the non-secret ownership evidence required by the repository's tear-down contract.
81
+ The literal environment name `production` should be treated as Production when the installed Deployment Kit does so for compatibility. Repositories may also classify another named environment as Production; pass that classification only through the installed tool's supported contract (for example `--production-environment <name>`).
59
82
 
60
- For local cleanup, this should identify the exact POC-owned local runtime/package boundary. For remote environments, this should identify the exact named environment, configured logical target, repository/application identity, and any ownership markers the deterministic tear-down tool verifies.
83
+ Physical colocation never merges ownership. `staging` cleanup must not remove `production` because both bind to the same VPS.
61
84
 
62
- Preserve the repository's shared-resource boundary. Normal POC tear-down must not broaden into deletion of shared platform infrastructure, unrelated POCs, workstation trust/credentials, or registry packages unless the repository defines a separate explicit lifecycle operation for those resources.
85
+ Preserve shared-resource boundaries. Normal POC tear-down must not broaden into shared platform infrastructure, unrelated POCs/environments, workstation trust/credentials, or registry packages unless a separate explicit lifecycle operation owns those resources.
63
86
 
64
- If ownership is ambiguous, a target binding changed, host identity cannot be verified, or the underlying tool reports mismatched ownership, stop without deletion.
87
+ If ownership is ambiguous, a binding/evidence set changed, host identity cannot be verified where required, or the tool reports mismatched ownership, stop without deletion.
65
88
 
66
- ## 4. Present the destructive preview
89
+ ## 4. Present exact destructive preview
67
90
 
68
- Before authorization, show what will be removed and what will be preserved using the repository's actual contract.
91
+ Show what will be removed and preserved using current repository/tool evidence.
69
92
 
70
- A typical preview is:
93
+ Example:
71
94
 
72
95
  ```text
73
96
  TEAR-DOWN READY
74
97
 
75
- Scope: <local|staging|production|all>
98
+ Scope: <local|demo|staging|production|other|all>
76
99
  Repository/app: <verified identity>
77
- Staging target: <verified logical target or not selected>
78
- Production target: <verified logical target or not selected>
79
- Local package/runtime identity: <exact identity or not selected>
100
+ Selected environments:
101
+ <env> → <logical target> — <Production/non-Production>
102
+ Local package/runtime: <exact identity or NOT SELECTED>
80
103
 
81
104
  Will remove:
82
- <repository-supported owned resources>
105
+ <tool/repository-supported owned resources for exactly these scopes>
83
106
 
84
107
  Will preserve:
85
- <shared/unrelated resources established by the repository contract>
108
+ <shared/unrelated environments/resources>
86
109
  ```
87
110
 
88
- For Deployment-Kit consumers, expected behavior includes:
111
+ For current Deployment-Kit consumers:
89
112
 
90
- - `local` — exact-package local containers/images and Docker-managed anonymous volumes attached to those owned containers;
91
- - `staging` — the owned Staging route, runtime, release/evidence state, persistent application data, and backups;
92
- - `production` — the owned Production route, runtime, release/evidence state, persistent application data, and backups;
93
- - `all` — Staging + Production + local for the selected POC only.
113
+ - `local` — exact-package local containers/images and Docker-managed anonymous volumes attached to those exact containers;
114
+ - `<environment>` — only that exact owned route/runtime/release/evidence/persistent-data/backup scope;
115
+ - `all` — all explicitly supplied named environment bindings plus optional exact-package local state when supplied.
94
116
 
95
- Do not promise deletion of named/shared Docker volumes or other resources unless the repository has an independent ownership model that safely proves they belong to this POC.
117
+ Do not promise deletion of named/shared Docker volumes or other resources unless independent ownership can be proven.
96
118
 
97
- ## 5. Require the destructive authorization gate
119
+ When selected logical environments share one physical target, say so in the preview so the user can verify that the deletion set remains environment-scoped.
98
120
 
99
- Every modifying tear-down requires one explicit bounded authorization for the exact previewed scope and evidence:
121
+ ## 5. Authorization gates
122
+
123
+ Every modifying tear-down requires:
100
124
 
101
125
  ```text
102
126
  [POC TEAR DOWN]
103
127
  ```
104
128
 
105
- For `production` or `all`, persistent Production data is part of the requested destructive scope. Require an additional independent authorization:
129
+ Additionally, whenever **any selected environment is Production-class**, require:
106
130
 
107
131
  ```text
108
132
  [PRODUCTION DATA DELETE]
109
133
  ```
110
134
 
111
- The Production-data authorization is required even when Production was previously deployed, tested, approved, or selected. Deployment authorization does not authorize data deletion.
135
+ Do not tie the Production-data gate only to literal scope strings `production` or `all`. It depends on the resolved deletion set and Production classification.
136
+
137
+ Deployment authorization, prior testing, CI, merge approval, environment selection, and physical colocation do not authorize persistent Production data deletion.
138
+
139
+ If repository/app identity, selected environments, Production classification, target binding, ownership evidence, or deletion set changes after preview, require renewed review/authorization.
140
+
141
+ ## 6. Execute only repository-provided command
142
+
143
+ After exact authorization, invoke only the approved tear-down command with the exact selected scopes and resolved inputs.
112
144
 
113
- If the resolved repository/app identity, target binding, ownership evidence, or deletion set materially changes after the preview, stop and require renewed review and authorization.
145
+ For generalized Deployment Kit consumers this may include repeated explicit environment bindings such as:
114
146
 
115
- ## 6. Execute only the approved repository command
147
+ ```text
148
+ --environment-target demo=<target>
149
+ --environment-target staging=<target>
150
+ --environment-target production=<target>
151
+ ```
152
+
153
+ and, when needed for a non-literal Production environment:
116
154
 
117
- After the required authorization phrase or phrases are explicitly provided, invoke only the repository-approved tear-down command with the exact selected scope and resolved inputs.
155
+ ```text
156
+ --production-environment prod-east
157
+ ```
118
158
 
119
- Pass authorization through only when the repository command expects the same bounded contract. Do not translate one approval into broader deletion authority.
159
+ Do not manually substitute another binding format if the installed version has a different contract; inspect the distributed tool/help/docs first.
120
160
 
121
- Do not add machine-wide Docker prune, shared-network removal, shared Caddy/Avahi removal, unrelated branch/repository cleanup, registry-package deletion, host reprovisioning, target rebinding, or secret/trust cleanup unless those operations are separately defined and explicitly authorized by the repository.
161
+ Never add machine-wide Docker prune, shared-network/Caddy/Avahi removal, unrelated environment cleanup, registry-package deletion, host reprovisioning, target rebinding, or secret/trust deletion unless separately defined and explicitly authorized.
122
162
 
123
- If the deterministic command stops partway through `all`, report the completed and remaining scopes. Do not compensate by manually deleting the remainder.
163
+ If an aggregate `all` operation stops partway, report completed/remaining scopes. Do not manually compensate by deleting the rest.
124
164
 
125
- ## 7. Verify and report the outcome
165
+ ## 7. Verify/report outcome
126
166
 
127
- Use repository-provided evidence/status commands when available. Report only what the evidence supports, including:
167
+ Use repository-provided evidence/status commands when available. Report only supported evidence:
128
168
 
129
169
  - requested scope;
130
170
  - repository/application identity;
131
- - environments/targets actually processed;
132
- - local runtime state actually processed;
133
- - whether persistent Production data was included;
171
+ - exact logical environments/targets processed;
172
+ - Production-class environments included;
173
+ - local runtime state processed;
134
174
  - removed versus already-absent resources;
135
- - any failure point or remaining scope after a partial stop;
136
- - confirmation that shared/unrelated resources were preserved when the repository provides evidence for that claim.
175
+ - failure point/remaining scopes after a partial stop;
176
+ - preservation of shared/unrelated resources only when evidence supports it.
137
177
 
138
- The operation should remain safe to rerun for already-absent owned resources when the repository's tear-down contract says it is idempotent.
178
+ The operation should remain safe to rerun for already-absent owned resources when the installed tear-down contract is idempotent.
@@ -0,0 +1,41 @@
1
+ # ADR-NNN — <Decision title>
2
+
3
+ Status: **PROPOSED**
4
+
5
+ Date: `<YYYY-MM-DD>`
6
+
7
+ ## Context
8
+
9
+ What engineering/product constraint or tradeoff requires a durable decision?
10
+
11
+ ## Decision
12
+
13
+ What was decided?
14
+
15
+ Do not mark an ADR accepted until the human/repository process has actually accepted the decision.
16
+
17
+ ## Alternatives considered
18
+
19
+ - `<alternative>` — why it was considered and why it was not selected.
20
+ - `<alternative>` — why it was considered and why it was not selected.
21
+
22
+ ## Tradeoffs / consequences
23
+
24
+ ### Benefits
25
+
26
+ - `<benefit>`
27
+
28
+ ### Costs / risks
29
+
30
+ - `<cost or risk>`
31
+
32
+ ## Evidence / links
33
+
34
+ - Work item: `<ID or link>`
35
+ - Relevant code/config: `<path>`
36
+ - System Lab scenario/component: `<reference when useful>`
37
+ - Other docs: `<link>`
38
+
39
+ ## Follow-up / review trigger
40
+
41
+ What future condition should cause this decision to be revisited?