@mriekki/lean 0.0.0-stage → 0.1.1

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 (82) hide show
  1. package/README.md +66 -2
  2. package/assets/components.json +33 -0
  3. package/assets/core/distribution.json +51 -0
  4. package/assets/deployment/distribution.json +34 -0
  5. package/assets/generated/ASSEMBLY.json +382 -0
  6. package/assets/generated/core/core/agents/coach.agent.md +69 -0
  7. package/assets/generated/core/core/agents/reviewer.agent.md +85 -0
  8. package/assets/generated/core/core/instructions/lean-docs.instructions.md +14 -0
  9. package/assets/generated/core/core/instructions/lean-workflow.instructions.md +35 -0
  10. package/assets/generated/core/core/learning/CODING_DRILLS.md +35 -0
  11. package/assets/generated/core/core/learning/DIAGRAM_GUIDE.md +19 -0
  12. package/assets/generated/core/core/learning/ENGINEERING_LEARNING_WORKBOOK.md +82 -0
  13. package/assets/generated/core/core/learning/LEARNING_MAP.md +51 -0
  14. package/assets/generated/core/core/learning/LEARNING_PROGRESS.md +31 -0
  15. package/assets/generated/core/core/learning/RESOURCE_CATALOG.md +25 -0
  16. package/assets/generated/core/core/learning/SQL_DRILLS.md +27 -0
  17. package/assets/generated/core/core/learning/SYSTEM_DESIGN_DRILLS.md +21 -0
  18. package/assets/generated/core/core/process/COACHING_GUIDE.md +57 -0
  19. package/assets/generated/core/core/process/GUIDED_NEXT_STEPS.md +48 -0
  20. package/assets/generated/core/core/process/HUMAN_GATES.md +81 -0
  21. package/assets/generated/core/core/process/INTERACTIVE_SESSION_GUIDE.md +62 -0
  22. package/assets/generated/core/core/process/PRODUCTION_ENABLEMENT.md +59 -0
  23. package/assets/generated/core/core/process/PR_WORKFLOW.md +53 -0
  24. package/assets/generated/core/core/process/SETUP_ACCEPTANCE_CHECKLIST.md +72 -0
  25. package/assets/generated/core/core/process/WORK_ITEM_MODEL.md +56 -0
  26. package/assets/generated/core/core/skills/cleanup-branches/SKILL.md +190 -0
  27. package/assets/generated/core/core/skills/coach/SKILL.md +136 -0
  28. package/assets/generated/core/core/skills/code-walkthrough/SKILL.md +197 -0
  29. package/assets/generated/core/core/skills/core-sync/SKILL.md +220 -0
  30. package/assets/generated/core/core/skills/define-feature/SKILL.md +144 -0
  31. package/assets/generated/core/core/skills/deliver/SKILL.md +315 -0
  32. package/assets/generated/core/core/skills/deploy/SKILL.md +193 -0
  33. package/assets/generated/core/core/skills/grill-me/SKILL.md +77 -0
  34. package/assets/generated/core/core/skills/grill-with-docs/SKILL.md +90 -0
  35. package/assets/generated/core/core/skills/learning-review/SKILL.md +90 -0
  36. package/assets/generated/core/core/skills/next-step/SKILL.md +166 -0
  37. package/assets/generated/core/core/skills/production-readiness/SKILL.md +357 -0
  38. package/assets/generated/core/core/skills/pull-latest/SKILL.md +166 -0
  39. package/assets/generated/core/core/skills/refine-requirements/SKILL.md +207 -0
  40. package/assets/generated/core/core/skills/start-work/SKILL.md +178 -0
  41. package/assets/generated/core/core/skills/tear-down/SKILL.md +138 -0
  42. package/assets/generated/core/core/skills/upstream-fix/SKILL.md +206 -0
  43. package/assets/generated/core/core/skills/wait-what/SKILL.md +86 -0
  44. package/assets/generated/core/core/templates/FEATURE_BRIEF_TEMPLATE.md +27 -0
  45. package/assets/generated/core/core/templates/PRODUCT_BRIEF_TEMPLATE.md +27 -0
  46. package/assets/generated/core/core/templates/PULL_REQUEST_TEMPLATE.md +37 -0
  47. package/assets/generated/core/core/templates/REQUIREMENTS_TEMPLATE.md +17 -0
  48. package/assets/generated/core/profiles/greenfield/lean-workspace.json +12 -0
  49. package/assets/generated/core/tools/package/check_baseline.py +102 -0
  50. package/assets/generated/core/tools/package/check_upstream.py +171 -0
  51. package/assets/generated/deployment/distribution/lean-poc-deploy.py +8 -0
  52. package/assets/generated/deployment/src/lean_poc_deployment/__init__.py +3 -0
  53. package/assets/generated/deployment/src/lean_poc_deployment/__main__.py +3 -0
  54. package/assets/generated/deployment/src/lean_poc_deployment/app_cli.py +140 -0
  55. package/assets/generated/deployment/src/lean_poc_deployment/app_runtime.py +455 -0
  56. package/assets/generated/deployment/src/lean_poc_deployment/app_runtime_remote.py +416 -0
  57. package/assets/generated/deployment/src/lean_poc_deployment/box_platform.py +208 -0
  58. package/assets/generated/deployment/src/lean_poc_deployment/box_platform_assets.py +100 -0
  59. package/assets/generated/deployment/src/lean_poc_deployment/box_platform_remote.py +271 -0
  60. package/assets/generated/deployment/src/lean_poc_deployment/cli.py +437 -0
  61. package/assets/generated/deployment/src/lean_poc_deployment/doctor.py +121 -0
  62. package/assets/generated/deployment/src/lean_poc_deployment/entrypoint.py +25 -0
  63. package/assets/generated/deployment/src/lean_poc_deployment/errors.py +5 -0
  64. package/assets/generated/deployment/src/lean_poc_deployment/keys.py +171 -0
  65. package/assets/generated/deployment/src/lean_poc_deployment/profiles.py +204 -0
  66. package/assets/generated/deployment/src/lean_poc_deployment/route_registry.py +367 -0
  67. package/assets/generated/deployment/src/lean_poc_deployment/route_registry_remote.py +443 -0
  68. package/assets/generated/deployment/src/lean_poc_deployment/security.py +290 -0
  69. package/assets/generated/deployment/src/lean_poc_deployment/sqlite_adapter.py +335 -0
  70. package/assets/generated/deployment/src/lean_poc_deployment/sqlite_adapter_remote.py +340 -0
  71. package/assets/generated/deployment/src/lean_poc_deployment/sqlite_cli.py +86 -0
  72. package/assets/generated/deployment/src/lean_poc_deployment/sqlite_import_recovery.py +437 -0
  73. package/assets/generated/deployment/src/lean_poc_deployment/ssh.py +118 -0
  74. package/assets/generated/deployment/src/lean_poc_deployment/teardown.py +286 -0
  75. package/assets/generated/deployment/src/lean_poc_deployment/teardown_cli.py +120 -0
  76. package/assets/generated/deployment/src/lean_poc_deployment/teardown_remote.py +100 -0
  77. package/assets/generated/deployment/src/lean_poc_deployment/trust.py +278 -0
  78. package/bin/lean.mjs +9 -0
  79. package/package.json +31 -4
  80. package/src/cli.mjs +131 -0
  81. package/src/engine.mjs +243 -0
  82. package/src/package-data.mjs +18 -0
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: learning-review
3
+ description: Optional structured post-build understanding check using actual implementation, tests, decisions, and work-item context.
4
+ argument-hint: "<work-item ID, external key, or topic>"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Learning Review
10
+
11
+ Default to post-build learning from real evidence.
12
+
13
+ `/learning-review` is primarily assessment. For an instructional changed-file walkthrough first, use `/code-walkthrough`.
14
+
15
+ ## 1. Context
16
+
17
+ Read only relevant:
18
+ - work-item/requirements context,
19
+ - changed code/diff,
20
+ - tests and observed results,
21
+ - important decisions/architecture.
22
+
23
+ Identify 3–6 concepts the developer should understand.
24
+
25
+ ## 2. Continuous cadence
26
+
27
+ Ask one question at a time:
28
+
29
+ ```text
30
+ question
31
+ → human answer
32
+ → critique accuracy/depth/credibility
33
+ → teach missing concept when useful
34
+ → next question
35
+ ```
36
+
37
+ Do not ask whether to continue after every answer.
38
+
39
+ Assess:
40
+ - architecture/request/data flow,
41
+ - technical decisions and alternatives,
42
+ - debugging/testing,
43
+ - failure modes/tradeoffs,
44
+ - interview explanation.
45
+
46
+ Do not edit production code while in learning-review mode.
47
+
48
+ ## 3. Relationship to code walkthrough
49
+
50
+ Use `/code-walkthrough` when the primary need is:
51
+
52
+ ```text
53
+ AI explains the actual implementation
54
+ → developer explores changed files
55
+ → developer builds a mental model
56
+ ```
57
+
58
+ Use `/learning-review` when the primary need is:
59
+
60
+ ```text
61
+ AI asks
62
+ → developer explains
63
+ → AI critiques
64
+ → gaps become visible
65
+ ```
66
+
67
+ A walkthrough may naturally hand off to a learning review, but neither is required for engineering completion or delivery.
68
+
69
+ ## 4. Credibility
70
+
71
+ Explicitly distinguish:
72
+ - what the developer actually implemented/used,
73
+ - what AI generated but the developer reviewed/understands,
74
+ - what was studied/practiced,
75
+ - what remains a gap.
76
+
77
+ Do not manufacture professional experience.
78
+
79
+ ## 5. Completion
80
+
81
+ Stop when the human stops/switches workflow, the planned check is complete, or no material learning gaps remain for this session.
82
+
83
+ Summarize:
84
+ - understood well,
85
+ - needs reinforcement,
86
+ - optional next target.
87
+
88
+ Then offer a small menu such as continue, optional learning notes/progress, return to engineering workflow, or stop.
89
+
90
+ `/learning-review` is optional and never blocks engineering completion/delivery.
@@ -0,0 +1,166 @@
1
+ ---
2
+ name: next-step
3
+ description: Read-only orientation over work-item, Git, review, PR, PR CI, merge, post-merge default-branch CI, deployment readiness, and deployment handoff state.
4
+ argument-hint: "[optional work-item ID or external key]"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Next Step
10
+
11
+ Purpose: answer `Where am I, and what is the sensible next action?`
12
+
13
+ Invocation is read-only.
14
+
15
+ ## 1. Resolve minimum context
16
+
17
+ Read `.github/lean-workspace.json` when present and use the optional work-item key or infer from current branch/session context.
18
+
19
+ Inspect only what is needed.
20
+
21
+ Local Git examples:
22
+
23
+ ```text
24
+ git branch --show-current
25
+ git status --short --branch
26
+ git diff --stat
27
+ git diff --cached --stat
28
+ git log -1 --oneline
29
+ ```
30
+
31
+ When GitHub CLI is available/authenticated:
32
+
33
+ ```text
34
+ gh pr status
35
+ gh pr view
36
+ gh pr checks
37
+ ```
38
+
39
+ When post-merge CI matters, inspect the configured default branch/workflow rather than assuming it is named `main`.
40
+
41
+ Never invent Jira/Issue/PR/CI/review/merge/readiness/deployment state.
42
+
43
+ ## 2. Useful states
44
+
45
+ Examples:
46
+
47
+ ```text
48
+ IMPLEMENTING
49
+ LOCAL_REVIEW_PENDING
50
+ REVIEW_CHANGES_REQUIRED
51
+ REVIEW_READY
52
+ HUMAN_LOCAL_ACCEPTANCE_PENDING
53
+ DELIVERY_READY
54
+ PUSHED_NO_PR
55
+ PR_CI_PENDING
56
+ PR_CI_FAILED
57
+ PR_CI_GREEN
58
+ MERGE_READY
59
+ MERGED_DEFAULT_BRANCH_CI_PENDING
60
+ MERGED_DEFAULT_BRANCH_CI_FAILED
61
+ DELIVERY_COMPLETE
62
+ ENVIRONMENT_READINESS_PENDING
63
+ ENVIRONMENT_READY
64
+ ```
65
+
66
+ Use only states supported by observed evidence.
67
+
68
+ Do not add a separate final-PR-acceptance state when the PR still exactly matches the already accepted local implementation. In that normal case, `/deliver` combines final acceptance and merge into the single `MERGE_READY` decision. If PR evidence changed materially, describe the required final PR review explicitly before returning to `MERGE_READY`.
69
+
70
+ Do not add learning-only states such as `CODE_WALKTHROUGH_PENDING`. Optional coaching does not change engineering delivery state.
71
+
72
+ ## 3. Output
73
+
74
+ ```text
75
+ CURRENT STATE
76
+ <evidence-backed summary>
77
+
78
+ RECOMMENDED NEXT STEP
79
+ <one action and why>
80
+
81
+ OPTIONS
82
+ 1. ... [READ ONLY]
83
+ 2. ... [MODIFIES FILES]
84
+ 3. ... [GIT + GITHUB WRITE]
85
+ 4. Stop [NO ACTION]
86
+ ```
87
+
88
+ Only show relevant options. `/next-step` orients; it does not become another workflow database.
89
+
90
+ ## 4. Optional learning choices
91
+
92
+ When implementation is stable enough to learn from and the human appears interested in understanding the code, `/next-step` may offer learning choices without making them gates:
93
+
94
+ ```text
95
+ /code-walkthrough <scope> — guided changed-file explanation [READ ONLY]
96
+ /learning-review <scope> — understanding assessment [READ ONLY]
97
+ /coach <topic> — focused concept coaching [READ ONLY]
98
+ ```
99
+
100
+ Prefer `/code-walkthrough` when the user wants to understand what changed across an implementation. Do not recommend it as mandatory before `/deliver`.
101
+
102
+ ## 5. Delivery handoff
103
+
104
+ When all are ready:
105
+
106
+ ```text
107
+ implementation complete
108
+ local verification satisfactory
109
+ Reviewer READY
110
+ human meaningful-diff approval complete
111
+ ```
112
+
113
+ recommend `/deliver` rather than separate branch/commit/push/create-PR confirmations.
114
+
115
+ `/deliver` owns the compound delivery action:
116
+
117
+ ```text
118
+ short-lived branch setup/recovery when needed
119
+ → selective stage
120
+ → verify staged diff
121
+ → commit
122
+ → push
123
+ → create/update PR
124
+ → PR CI
125
+ → one Merge and finalize delivery decision
126
+ → merge
127
+ → post-merge default-branch CI
128
+ → safe delivered-branch finalization
129
+ ```
130
+
131
+ Because `/deliver` is manually invoked, do not insert another permission menu merely to begin those routine mechanics. It will stop itself for changed evidence, ambiguity/risk, CI failure requiring code changes, or the merge/finalize decision.
132
+
133
+ If PR CI failed, recommend inspect/diagnose/targeted fix. Do not silently change code.
134
+
135
+ If PR CI is green and evidence still matches the accepted implementation, return to `/deliver` for the single merge/finalize gate.
136
+
137
+ Never merge from `/next-step` merely because CI is green.
138
+
139
+ After merge:
140
+ - if required default-branch CI is pending, return to `/deliver` to resume observation/finalization;
141
+ - if failed, inspect/diagnose;
142
+ - if green and branch finalization is safe/complete, report delivery complete.
143
+
144
+ ## 6. Deployment handoff
145
+
146
+ For a release/deployment engineering enabler after engineering delivery is complete, recommend:
147
+
148
+ ```text
149
+ /production-readiness <deployment-enabler-ID> enable [environment]
150
+ ```
151
+
152
+ when the selected environment still needs operational discovery/enablement.
153
+
154
+ When evidence shows a configured named environment is ready for deployment, recommend:
155
+
156
+ ```text
157
+ /deploy [environment]
158
+ ```
159
+
160
+ rather than treating `/production-readiness` as the normal application-deployment executor.
161
+
162
+ Do not infer readiness of one environment from another. Production is never an implicit/default environment, and `/next-step` never authorizes a remote or production deployment merely by recommending `/deploy`.
163
+
164
+ ## 7. Keep it lean
165
+
166
+ Do not auto-run Reviewer, auto-run learning activities, auto-merge, auto-deploy, pin/select a model, or maintain duplicate workflow state outside Git/GitHub and the configured work-item/readiness authority.
@@ -0,0 +1,357 @@
1
+ ---
2
+ name: production-readiness
3
+ description: Guided continuous deployment-environment discovery and enablement, including target OS/access, SSH trust, security/network/TLS, read-only checks, bounded provisioning, and readiness handoff to /deploy.
4
+ argument-hint: "<deployment-enabler-ID> [discovery|enable|resume] [environment]"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Production Readiness
10
+
11
+ This is a guided operational workflow for preparing named deployment environments. It is not an autonomous production administrator and it is not the normal deployment executor.
12
+
13
+ Modes:
14
+
15
+ ```text
16
+ discovery
17
+ enable
18
+ resume
19
+ ```
20
+
21
+ ## 1. Resolve minimum context
22
+
23
+ Read `.github/lean-workspace.json` when present plus only the relevant deployment enabler requirements/decisions/readiness record, release/deployment guidance, environment/target configuration contract, and deployment code/workflows.
24
+
25
+ Do not assume:
26
+
27
+ - there is only one deployment environment,
28
+ - an environment named `production` exists,
29
+ - a particular work-item path,
30
+ - target OS/runtime/hostname/IP,
31
+ - SSH alias or discovery mechanism,
32
+ - certificate model or hosting environment.
33
+
34
+ Use the approved project context and checkout-local non-secret target configuration when the project defines it.
35
+
36
+ ## 2. Mode boundaries
37
+
38
+ ### discovery
39
+
40
+ May begin early after the application's foundation/walking skeleton is proven.
41
+
42
+ Purpose:
43
+
44
+ - identify intended named deployment environments and their roles,
45
+ - discover each selected environment's real target and expected target OS,
46
+ - identify access/security/network/TLS/certificate dependencies,
47
+ - establish the environment-to-target readiness contract without embedding household- or checkout-specific secrets in reusable source,
48
+ - record non-secret facts,
49
+ - surface blockers early.
50
+
51
+ Discovery does not authorize remote writes or deployment.
52
+
53
+ ### enable
54
+
55
+ Require evidence that deployment engineering completed the normal delivery path, such as:
56
+
57
+ ```text
58
+ requirements approved under the configured authority model
59
+ implementation complete
60
+ local verification satisfactory
61
+ Reviewer READY
62
+ human meaningful-diff approval
63
+ PR CI green
64
+ merged to default branch
65
+ required post-merge default-branch CI green
66
+ ```
67
+
68
+ If evidence is missing, stop enablement and route back through the failed gate or `/deliver`.
69
+
70
+ Enablement prepares the selected environment so `/deploy` can safely use it. It does not itself authorize an application deployment.
71
+
72
+ ### resume
73
+
74
+ Continue from the project's existing environment-specific readiness record when one exists.
75
+
76
+ ## 3. Select the environment before environment-specific readiness
77
+
78
+ When more than one configured deployment environment exists, select the environment being discovered or enabled before asking environment-specific questions.
79
+
80
+ Treat these as separate concepts:
81
+
82
+ ```text
83
+ named environment
84
+ → environment role/policy
85
+ → configured target binding
86
+ → stable logical/SSH identity
87
+ → current address discovery
88
+ → independently verified host identity
89
+ ```
90
+
91
+ A non-production portable/staging target and a true production target may use the same deployment implementation while retaining independent target identities, data, credentials, readiness evidence, and deployment policy.
92
+
93
+ Never let one environment silently fall back to another environment or target because discovery/access/readiness fails.
94
+
95
+ ## 4. Session authorization
96
+
97
+ Invocation begins read-only.
98
+
99
+ Present a state/menu such as:
100
+
101
+ ```text
102
+ CURRENT STATE
103
+ <selected environment + readiness summary>
104
+
105
+ RECOMMENDED NEXT STEP
106
+ <one action and why>
107
+
108
+ OPTIONS
109
+ 1. Begin/resume guided readiness [MODIFIES DOCS]
110
+ 2. Review readiness evidence [READ ONLY]
111
+ 3. Run available read-only checks only [READ ONLY]
112
+ 4. Stop [NO ACTION]
113
+ ```
114
+
115
+ If option 1 is selected, focused updates to the existing deployment-readiness/decision record are authorized for the active session. If the repository has no permitted readiness document, keep session notes/proposed updates rather than inventing a competing authority.
116
+
117
+ Never record secret values.
118
+
119
+ ## 5. Continuous cadence
120
+
121
+ Once a modifying readiness session is authorized:
122
+
123
+ ```text
124
+ ask one material question
125
+ → human answers
126
+ → record the non-secret resolved fact
127
+ → explain impact/blocker
128
+ → ask the next material question
129
+ ```
130
+
131
+ Use choice-first presentation from `INTERACTIVE_SESSION_GUIDE.md` for bounded operational decisions such as environment role, exposure mode, approved runtime model, TLS termination pattern, or another small set of credible policy/configuration alternatives.
132
+
133
+ Ask environment-specific facts such as OS/version, hostname, IP address, target label, account, port, filesystem path, certificate identity, or observed system state as free-form/confirmation questions; do not invent plausible-looking operational values merely to offer choices.
134
+
135
+ Do not ask after every answer whether to continue/update.
136
+
137
+ Pause only for:
138
+
139
+ - human stop,
140
+ - natural readiness/action gate,
141
+ - architecture/security conflict requiring a separate decision,
142
+ - remote/GitHub/security write requiring explicit authorization.
143
+
144
+ ## 6. Resolve the actual target OS and runtime per environment
145
+
146
+ Do not choose commands before the selected environment and real target are confirmed.
147
+
148
+ For the selected environment discover/verify, one at a time as relevant:
149
+
150
+ - environment name and role (`production` or approved non-production role),
151
+ - stable target label / binding,
152
+ - expected target OS and version,
153
+ - actual target OS and version,
154
+ - CPU architecture,
155
+ - hostname/current address/discovery model,
156
+ - LAN/private/public exposure,
157
+ - deployment/SSH account,
158
+ - SSH port/authentication,
159
+ - service-account model,
160
+ - approved runtime (Docker/Compose or other),
161
+ - persistent-data path,
162
+ - backup path,
163
+ - storage capacity.
164
+
165
+ If the actual target conflicts materially with the environment's approved target OS/runtime/architecture, stop and resolve the design rather than silently adapting.
166
+
167
+ Readiness is environment-specific. Do not treat successful readiness of one target as evidence that another target is ready.
168
+
169
+ ## 7. SSH target identity and portable discovery
170
+
171
+ When SSH is the approved deployment transport, keep address discovery separate from trust.
172
+
173
+ Verify as applicable:
174
+
175
+ - the selected environment resolves through its approved stable logical target/SSH alias,
176
+ - the expected SSH host identity was independently verified before trust enrollment,
177
+ - an unknown or changed host key stops access,
178
+ - changing DHCP/mDNS/current address does not require weakening host-key verification,
179
+ - no fallback scans the LAN, silently chooses another host, disables strict host-key checks, or enrolls new trust merely because discovery failed,
180
+ - repository configuration does not contain private keys, passphrases, copied trust databases, or secret credentials.
181
+
182
+ If the project uses a portable trusted-LAN target, a stable discovery name such as mDNS may be appropriate, but discovery technology is project/profile-specific. The reusable invariant is stable logical target identity plus independently verified host identity.
183
+
184
+ When changing SSH authentication policy, verify intended key access before disabling alternative authentication and preserve an approved recovery path while making the bounded change.
185
+
186
+ ## 8. Network, security, DNS, TLS
187
+
188
+ Ask/verify as relevant:
189
+
190
+ - inbound ports,
191
+ - outbound registry/source-hosting/DNS/NTP dependencies,
192
+ - firewall/security approvals,
193
+ - DNS/server name,
194
+ - HTTP vs HTTPS,
195
+ - TLS/certificate source,
196
+ - termination point,
197
+ - trust chain,
198
+ - renewal owner/process.
199
+
200
+ Certificates may legitimately be N/A for an approved private HTTP design. Public exposure/HTTPS changes that contradict approved design are material security/architecture decisions.
201
+
202
+ Record external blockers and continue unrelated discovery. Never propose bypassing organizational controls.
203
+
204
+ ## 9. Developer-system read-only checks
205
+
206
+ Offer a bounded read-only check before changing anything.
207
+
208
+ Use repository-provided helpers when present; otherwise show platform-appropriate commands for inspection. Common checks include Git, source-hosting CLI/auth, build tooling, approved container runtime, SSH, HTTP tooling, and TLS inspection capability.
209
+
210
+ Determine the developer workstation OS independently of the deployment target OS. A repository may use different local launchers (for example PowerShell on Windows and shell on macOS/Linux) that invoke the same target-side deployment contract.
211
+
212
+ State what was actually checked and what was not.
213
+
214
+ ## 10. Source-hosting / CI read-only checks
215
+
216
+ Where GitHub is used, inspect only non-secret metadata needed for readiness, such as:
217
+
218
+ - repository/default branch,
219
+ - workflows/recent required CI,
220
+ - environment names,
221
+ - variable names,
222
+ - secret names (never values),
223
+ - release metadata.
224
+
225
+ For other source/CI systems, use their repository-approved equivalent.
226
+
227
+ ## 11. Remote selected-environment check
228
+
229
+ After the selected environment's target/user/port are known, explicitly ask:
230
+
231
+ ```text
232
+ Run read-only check against <environment>? [REMOTE READ ONLY]
233
+ ```
234
+
235
+ Only after authorization may remote inspection occur.
236
+
237
+ Allowed examples:
238
+
239
+ - host identity/fingerprint evidence when the approved process permits it,
240
+ - OS/version and architecture,
241
+ - current identity/groups,
242
+ - approved runtime version/state,
243
+ - disk/memory,
244
+ - listening ports,
245
+ - basic system state,
246
+ - existence/ownership of approved data/backup paths.
247
+
248
+ Read-only authorization does not permit:
249
+
250
+ - package installation,
251
+ - user/group or directory creation,
252
+ - firewall changes,
253
+ - registry login,
254
+ - image pulls,
255
+ - migrations,
256
+ - deployment,
257
+ - data changes.
258
+
259
+ If automated remote access is prohibited, provide exact read-only commands for an authorized human/admin to run and return non-secret output.
260
+
261
+ ## 12. TLS/certificate check
262
+
263
+ Only when TLS is part of the selected environment's approved design.
264
+
265
+ A read-only endpoint certificate check may inspect:
266
+
267
+ - subject/SAN,
268
+ - issuer,
269
+ - validity dates,
270
+ - trust/policy result,
271
+ - expected server name/port.
272
+
273
+ Never inspect/copy private keys.
274
+
275
+ ## 13. Bounded provisioning/configuration writes
276
+
277
+ After discovery, present missing prerequisites as small explicit write actions, for example:
278
+
279
+ ```text
280
+ Create service/deployment account [REMOTE WRITE]
281
+ Install/upgrade runtime [REMOTE WRITE]
282
+ Create data/backup directories [REMOTE WRITE]
283
+ Configure SSH access [SECURITY / REMOTE WRITE]
284
+ Configure firewall [SECURITY / REMOTE WRITE]
285
+ Configure registry credential [SECRET / REMOTE WRITE]
286
+ Create source-hosting environment [SOURCE-HOSTING WRITE]
287
+ Set secret/variable [SOURCE-HOSTING WRITE]
288
+ Install/configure certificate [SECURITY / REMOTE WRITE]
289
+ ```
290
+
291
+ Do not execute a write merely because it is needed. Each bounded write requires explicit human authorization.
292
+
293
+ Changing an environment's target binding or enrolling a replacement host identity is readiness/configuration work and requires explicit authorization. Do not perform it implicitly from `/deploy`.
294
+
295
+ Keep secret values out of tracked files and logs.
296
+
297
+ ## 14. Environment deployment readiness
298
+
299
+ Before declaring the selected environment ready for `/deploy`, verify the evidence required by its approved role/policy.
300
+
301
+ Common evidence includes:
302
+
303
+ - selected environment and independently verified target binding,
304
+ - supported developer workstation launcher,
305
+ - expected target OS matches actual target OS,
306
+ - approved release/artifact policy,
307
+ - immutable artifact/image digest when applicable,
308
+ - artifact/registry access,
309
+ - independent environment data/backup paths,
310
+ - migration path,
311
+ - deployment lock behavior,
312
+ - readiness checks,
313
+ - smoke tests,
314
+ - application rollback,
315
+ - explicit database-restore/recovery boundary,
316
+ - unresolved security blockers = none.
317
+
318
+ A non-production environment may use a less restrictive release policy only when the project's approved requirements say so. Do not infer that staging may deploy arbitrary mutable artifacts.
319
+
320
+ ## 15. Production readiness handoff
321
+
322
+ For a production-role environment, when readiness prerequisites are satisfied present a summary such as:
323
+
324
+ ```text
325
+ PRODUCTION ENVIRONMENT READY FOR DEPLOYMENT WORKFLOW
326
+
327
+ Environment: <name>
328
+ Target: <verified target>
329
+ OS/architecture: <verified>
330
+ Release/artifact policy: <verified>
331
+ Exposure/TLS: <verified mode>
332
+ Security blockers: NONE
333
+ Backup: READY
334
+ Migration: READY
335
+ Readiness/Smoke: READY
336
+ Rollback: READY
337
+
338
+ NEXT
339
+ /deploy <environment>
340
+ ```
341
+
342
+ This is readiness evidence, not deployment authorization.
343
+
344
+ The actual production write gate belongs to `/deploy`, where the exact environment, verified target, release/artifact, and current evidence are shown together immediately before execution.
345
+
346
+ Requirements approval, code review, PR merge, CI success, environment readiness, or a previous deployment never imply the next deployment authorization.
347
+
348
+ ## 16. Post-readiness
349
+
350
+ Once an environment is ready:
351
+
352
+ - record non-secret readiness evidence in the repository-approved place,
353
+ - keep environment readiness independent from other environments,
354
+ - use `/deploy [environment]` for the repeatable deployment workflow,
355
+ - return to readiness when the target binding, expected OS/runtime, security posture, credentials, or other material prerequisites change.
356
+
357
+ Deployment outcome evidence may update the repository's operational record after an authorized `/deploy`, but application rollback and database restore/destructive recovery remain separate decisions when data safety warrants it.