@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,315 @@
1
+ ---
2
+ name: deliver
3
+ description: "Streamlined delivery after implementation review/approval: short-lived branch recovery/setup, selective commit/push/PR/CI mechanics, one explicit merge/finalize gate, post-merge CI, and safe delivered-branch cleanup."
4
+ argument-hint: "[optional work-item ID or external key]"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Deliver
10
+
11
+ `/deliver` is the clear handoff after:
12
+
13
+ ```text
14
+ implementation complete
15
+ → relevant local checks satisfactory
16
+ → Reviewer READY
17
+ → human meaningful-diff approval
18
+ ```
19
+
20
+ Existing repository conventions outrank Lean defaults. Preserve branch rules, PR template, CI, merge strategy, required reviews, long-lived branch policy, and other repository policy.
21
+
22
+ ## 1. Authorization model
23
+
24
+ Because `/deliver` is manually invoked, invoking it is one bounded authorization for the routine delivery mechanics of the already-reviewed/accepted work item:
25
+
26
+ ```text
27
+ establish/recover the short-lived work branch when needed
28
+ → selective stage
29
+ → verify staged diff
30
+ → generate repository-appropriate commit message
31
+ → commit
32
+ → normal push
33
+ → create/update PR
34
+ → populate PR body from observed evidence
35
+ → inspect/recheck PR CI
36
+ ```
37
+
38
+ Do **not** ask separate `Create branch?`, `Stage?`, `Commit?`, `Push?`, `Create PR?`, `Mark ready?`, or `Check CI?` questions when those actions are safe, deterministic, and within the current delivery scope.
39
+
40
+ Invocation does **not** authorize merge, production deployment, force push, unrelated branch deletion, scope expansion, code fixes, or destructive/history-rewriting Git operations.
41
+
42
+ ## 2. Phases
43
+
44
+ ```text
45
+ A. RESUME / PREFLIGHT
46
+ B. ROUTINE PR PREPARATION — automatic within /deliver authorization
47
+ C. PR CI — automatic read/recheck within practical limits
48
+ D. MERGE + FINALIZE DECISION — one human gate
49
+ E. POST-MERGE DEFAULT-BRANCH CI — automatic observation
50
+ F. DELIVERED-BRANCH FINALIZATION — automatic when authorized and safe
51
+ G. DELIVERY COMPLETE
52
+ ```
53
+
54
+ ## 3. Resume-aware initial inspection
55
+
56
+ Inspect only what is needed to determine the furthest safe delivery state, such as:
57
+
58
+ ```text
59
+ git branch --show-current
60
+ git status --short --branch
61
+ git diff --stat
62
+ git diff
63
+ git diff --cached --stat
64
+ git log -1 --oneline
65
+ git remote -v
66
+ ```
67
+
68
+ When available:
69
+
70
+ ```text
71
+ gh auth status
72
+ gh pr status
73
+ ```
74
+
75
+ Resolve current work-item/review evidence and detect already-completed delivery steps.
76
+
77
+ If implementation, required local checks, Reviewer, or human meaningful-diff approval are not ready, route back to the missing gate. Do not perform delivery writes merely because `/deliver` was invoked too early.
78
+
79
+ If `/deliver` is rerun after interruption/tool unavailability, continue from the observed safe state. Do not repeat already-completed branch/commit/push/PR operations and do not ask the human to re-authorize the same routine mechanics.
80
+
81
+ Examples:
82
+ - branch exists + changes uncommitted → continue with selective staging/commit/push/PR;
83
+ - commit exists + branch not pushed → push and continue;
84
+ - branch pushed + no PR → create PR and continue;
85
+ - PR exists + CI pending → inspect/recheck CI;
86
+ - PR merged + post-merge CI pending → resume observation/finalization rather than starting over.
87
+
88
+ ## 4. Short-lived branch handling
89
+
90
+ Normal implementation should already be on a short-lived work branch because `/start-work` establishes it when implementation begins.
91
+
92
+ If reviewed, scoped, uncommitted work is still on the default/integration branch, `/deliver` may recover automatically by creating/switching to the repository-appropriate short-lived work branch while preserving the current worktree.
93
+
94
+ Branch naming order:
95
+ 1. repository/team convention when defined,
96
+ 2. an already-existing branch clearly tied to the work item,
97
+ 3. Lean fallback: `<lowercase-work-item-id>-<concise-slug>` for ID-backed work, or `work/<concise-slug>` for an ad hoc change.
98
+
99
+ Before creating/switching, capture enough worktree evidence to confirm the scoped diff. After switching, verify the same files/content remain changed and no work was lost or broadened.
100
+
101
+ Do not ask a separate branch-creation question when the branch operation is safe and deterministic under this rule.
102
+
103
+ Stop instead when:
104
+ - branch policy/naming is materially ambiguous,
105
+ - an intended branch already exists with divergent/unrelated work,
106
+ - unrelated/unexpected files are present,
107
+ - switching would require stash/reset/rebase/force/history rewriting,
108
+ - repository policy forbids the planned branch operation.
109
+
110
+ ## 5. Routine PR preparation
111
+
112
+ Proceed automatically within `/deliver` authorization:
113
+
114
+ 1. Selectively stage only the accepted delivery scope. Do not use blind `git add .` when unrelated changes exist.
115
+ 2. Inspect staged diff/stat and verify it still matches the human-accepted implementation scope.
116
+ 3. Generate a concise repository-appropriate commit message; do not create a separate commit-message approval ceremony unless ambiguity is material.
117
+ 4. Commit.
118
+ 5. Push normally without force.
119
+ 6. Create a normal PR when none exists, or update/use the existing branch PR when appropriate.
120
+ 7. Use Draft PR only when repository policy/convention requires it or meaningful work is still intentionally incomplete. Because `/deliver` begins after implementation/review acceptance, a normal ready PR is the default Lean behavior.
121
+ 8. Populate the PR body from actual evidence only.
122
+ 9. Inspect PR CI.
123
+
124
+ The repository PR template is internal scaffolding. Do not ask the human to validate the template itself.
125
+
126
+ PR evidence may include:
127
+ - work item,
128
+ - change summary,
129
+ - approved requirements/acceptance criteria,
130
+ - local checks actually observed,
131
+ - Reviewer verdict,
132
+ - known limitations/follow-up,
133
+ - CI status when observed.
134
+
135
+ Do not claim evidence that was not observed.
136
+
137
+ ## 6. Stop conditions during routine delivery
138
+
139
+ Stop before/during routine writes for:
140
+ - unrelated/unexpected files,
141
+ - possible secrets,
142
+ - unclear work-item boundary,
143
+ - known failing required local checks,
144
+ - Reviewer `CHANGES REQUIRED`,
145
+ - conflicts,
146
+ - Git/GitHub authentication/permission failure,
147
+ - unexpected generated/tracked files,
148
+ - repository policy that blocks the planned action,
149
+ - a branch/remote state that requires rebase/reset/force or other history rewriting.
150
+
151
+ Never force-push unless separately and explicitly authorized.
152
+
153
+ ## 7. PR CI
154
+
155
+ Inspect repository-required PR checks without asking permission for each recheck.
156
+
157
+ ### Pending
158
+
159
+ Use bounded read-only polling/rechecks when practical. If CI is still running beyond the practical interaction/tool window, report:
160
+
161
+ ```text
162
+ PR CI: RUNNING
163
+ Delivery state preserved. Re-run /deliver to resume.
164
+ ```
165
+
166
+ Do not insert a new write-authorization prompt merely because CI is pending.
167
+
168
+ ### Failed
169
+
170
+ Inspect failing evidence when available. Report the failure and offer inspect/diagnose/targeted-fix/stop. Do not automatically change code because CI failed.
171
+
172
+ Any code fix returns through the review/meaningful-diff gate as warranted before delivery resumes.
173
+
174
+ ### Green
175
+
176
+ Before the merge gate, verify:
177
+ - PR head branch/head SHA are the expected delivered branch/commit,
178
+ - no unexpected commits appeared,
179
+ - PR diff still represents the locally reviewed/accepted implementation,
180
+ - Reviewer/policy/check state is still satisfactory,
181
+ - PR is mergeable under observed repository rules.
182
+
183
+ If the final PR differs materially from the accepted local implementation, require final diff review before merge. Do not silently treat changed evidence as accepted.
184
+
185
+ If a Draft PR was required earlier and all readiness conditions are now satisfied, mark it ready as routine delivery mechanics unless repository policy requires a different human/reviewer action.
186
+
187
+ ## 8. Single merge + finalize gate
188
+
189
+ When PR evidence still matches the accepted implementation and CI/policy are satisfactory, combine final PR acceptance and merge authorization into one meaningful gate:
190
+
191
+ ```text
192
+ MERGE READY
193
+
194
+ PR CI: GREEN
195
+ Reviewer: READY
196
+ PR diff: matches accepted delivery scope
197
+ Mergeable/policy: <observed state>
198
+
199
+ 1. Merge and finalize delivery [HUMAN ACCEPTANCE + GITHUB/GIT WRITE] — recommended
200
+ 2. Review final PR diff first [READ ONLY]
201
+ 3. Leave PR open [NO ACTION]
202
+ ```
203
+
204
+ Selecting option 1 means:
205
+ - the human accepts the final PR as observed,
206
+ - merge is authorized using the repository-approved strategy,
207
+ - required post-merge default-branch CI may be observed/rechecked automatically,
208
+ - after required post-merge CI is green, the delivered normal short-lived branch may be finalized automatically locally/remotely under the safety rules below.
209
+
210
+ Do not present a second `Accept PR?` prompt immediately followed by `Merge?` when the evidence has not changed.
211
+
212
+ If the human chooses to review the final PR diff, return to this same merge gate after the review if no new issues appear.
213
+
214
+ If merge strategy is materially ambiguous and repository convention does not resolve it, stop and ask rather than inventing one.
215
+
216
+ Before merge, record the PR head branch and head SHA so finalization can distinguish the approved delivered state from later work.
217
+
218
+ Stop before merge if checks regress, new commits appear, conflicts arise, or policy changes the state.
219
+
220
+ ## 9. Post-merge default-branch CI
221
+
222
+ After authorized merge, inspect the actual configured default branch/workflow automatically.
223
+
224
+ If required post-merge CI is pending, use bounded read-only rechecks when practical. If still pending beyond the practical interaction/tool window, report:
225
+
226
+ ```text
227
+ MERGED — DEFAULT-BRANCH CI PENDING
228
+ Delivery state preserved. Re-run /deliver to resume finalization.
229
+ ```
230
+
231
+ Do not ask the human to authorize observation again.
232
+
233
+ If post-merge CI fails, report it clearly and inspect/diagnose; do not silently revert, modify production, or delete the delivered branch.
234
+
235
+ Only after required post-merge CI is observed green may delivered-branch finalization proceed. If the repository has no post-merge CI policy, state that explicitly and proceed using the observed merged/default-branch state.
236
+
237
+ ## 10. Delivered-branch finalization
238
+
239
+ For a normal short-lived delivered branch, option 1 at the merge gate already authorizes finalization. Do not ask a separate `Delete branch?` question.
240
+
241
+ Preserve by default:
242
+ - the configured default branch,
243
+ - protected branches,
244
+ - release/integration/environment branches intended to be long-lived,
245
+ - branches repository policy says to retain,
246
+ - a branch the human explicitly asked to retain before/during the merge gate,
247
+ - any branch whose state changed or became ambiguous after merge.
248
+
249
+ Before deletion, revalidate:
250
+ - the PR is still merged,
251
+ - the recorded PR head branch/head SHA are unchanged as delivery evidence,
252
+ - the remote branch, when present, still points to the recorded PR head SHA,
253
+ - no open PR now depends on the branch,
254
+ - the local branch has no commits beyond the recorded approved PR head,
255
+ - the working tree is safe to switch to the default branch.
256
+
257
+ Then:
258
+ 1. switch to the default branch,
259
+ 2. update it using the repository's normal non-rewriting method, usually `git pull --ff-only`,
260
+ 3. delete the remote delivered branch when it still exists and policy allows,
261
+ 4. delete the local delivered branch,
262
+ 5. prune stale remote-tracking refs,
263
+ 6. confirm final default-branch/working-tree state.
264
+
265
+ For the local branch:
266
+ - prefer `git branch -d <branch>` when Git recognizes it as merged,
267
+ - squash/rebase merges may make `-d` reject even when the PR is merged,
268
+ - only when merged-PR evidence is exact and the local head has no commits beyond the recorded PR head may `git branch -D <branch>` be used under the merge-and-finalize authorization.
269
+
270
+ An already-auto-deleted remote branch is `already clean`, not a failure.
271
+
272
+ Never use force deletion merely to bypass uncertainty.
273
+
274
+ If any safety condition fails, preserve the branch and report `BRANCH CLEANUP PENDING` with the exact reason instead of asking repetitive yes/no questions.
275
+
276
+ ## 11. Delivery completion
277
+
278
+ Report the observed outcome:
279
+
280
+ ```text
281
+ DELIVERY COMPLETE
282
+
283
+ PR: MERGED
284
+ Default branch: UPDATED
285
+ Post-merge CI: GREEN / NOT CONFIGURED
286
+ Branch finalization: DELETED / RETAINED BY POLICY OR CHOICE / ALREADY CLEAN
287
+ ```
288
+
289
+ If merge/default-branch delivery is complete but requested/authorized cleanup could not be performed safely, report:
290
+
291
+ ```text
292
+ DELIVERY COMPLETE — BRANCH CLEANUP PENDING
293
+ ```
294
+
295
+ and preserve the branch.
296
+
297
+ ## 12. Production handoff
298
+
299
+ If the delivered work item owns production release/deployment, successful engineering delivery may hand off to:
300
+
301
+ ```text
302
+ /production-readiness <deployment-enabler-ID> enable
303
+ ```
304
+
305
+ Merge approval never implies production-deployment authorization.
306
+
307
+ ## 13. Relationship to /start-work, /next-step, and /cleanup-branches
308
+
309
+ `/start-work` establishes the short-lived work branch as routine implementation setup once implementation is actually authorized.
310
+
311
+ `/next-step` answers `Where am I?`.
312
+
313
+ `/deliver` takes reviewed/accepted work through routine branch/commit/push/PR/CI mechanics automatically, then stops once for the merge-and-finalize decision.
314
+
315
+ `/cleanup-branches` is the standalone preview-first path for accumulated, previously retained, unrelated, or otherwise out-of-band branch housekeeping.
@@ -0,0 +1,193 @@
1
+ ---
2
+ name: deploy
3
+ description: "Guided deployment orchestration for a configured named environment. Selects and verifies the environment/target, preserves production gates, and delegates deterministic execution to repository-provided platform scripts."
4
+ argument-hint: "[environment] [release-or-artifact]"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Deploy
10
+
11
+ `/deploy` is the normal human-facing deployment interface once deployment engineering and the selected environment are ready.
12
+
13
+ The skill owns interaction, validation, target safety, and authorization. Repository-provided scripts own deployment mechanics.
14
+
15
+ Do not implement application deployment logic directly in the skill when an approved repository script exists.
16
+
17
+ ## 1. Begin read-only
18
+
19
+ Invocation starts read-only.
20
+
21
+ Read only the minimum repository context needed to identify:
22
+
23
+ - the approved deployment/release requirements,
24
+ - configured named deployment environments,
25
+ - checkout-local environment-to-target bindings when the project uses them,
26
+ - the selected environment's readiness evidence,
27
+ - the approved release/artifact policy,
28
+ - repository-provided deployment entry points,
29
+ - expected developer-workstation and target operating systems.
30
+
31
+ Do not assume configuration file names, script paths, target OS, SSH aliases, container runtime, or release format unless the repository establishes them.
32
+
33
+ If deployment engineering is not delivered or the selected environment is not operationally ready, stop and route to the repository's deployment work item or `/production-readiness` as appropriate.
34
+
35
+ ## 2. Select an environment explicitly
36
+
37
+ If the invocation did not name an environment, enumerate only environments configured for this checkout and ask the human to select one.
38
+
39
+ Show enough non-secret identity to distinguish them, for example:
40
+
41
+ ```text
42
+ SELECT DEPLOYMENT ENVIRONMENT
43
+
44
+ 1. staging
45
+ Role: non-production
46
+ Target: portable-ubuntu
47
+ [REMOTE WRITE]
48
+
49
+ 2. production
50
+ Role: production
51
+ Target: home-production
52
+ [PRODUCTION WRITE]
53
+
54
+ 3. Stop
55
+ ```
56
+
57
+ Environment names and target labels above are examples only.
58
+
59
+ Rules:
60
+
61
+ - never silently default to `production`;
62
+ - never use a remembered prior selection as implicit production authorization;
63
+ - never fall back from one environment to another because discovery, access, readiness, or deployment failed;
64
+ - if an environment is named but is not configured in this checkout, fail explicitly;
65
+ - selecting an environment chooses scope but does not itself authorize the deployment write.
66
+
67
+ ## 3. Resolve and verify the target binding
68
+
69
+ Treat these as separate concepts:
70
+
71
+ ```text
72
+ named environment
73
+ → configured target binding
74
+ → stable logical/SSH identity
75
+ → current address discovery
76
+ → independently verified host identity
77
+ ```
78
+
79
+ Address discovery is not host trust.
80
+
81
+ Before a remote deployment:
82
+
83
+ - verify the selected environment resolves to its configured target;
84
+ - use the repository-approved stable target/SSH alias rather than a hard-coded transient address when that is the approved design;
85
+ - preserve enrolled SSH host-key verification independently of the current IP address;
86
+ - stop on an unknown host identity or changed host key;
87
+ - never bypass host-key checks, silently enroll new trust, scan/select another host, or weaken network controls as recovery;
88
+ - verify the actual target OS is compatible with the environment's approved expected target OS before choosing target-specific deployment behavior.
89
+
90
+ Changing an environment's bound target is configuration/readiness work, not a deployment fallback. Stop and route to the approved rebind/readiness workflow when rebinding is needed.
91
+
92
+ Keep private keys, passphrases, credentials, copied trust databases, and other secret values out of repository configuration and logs.
93
+
94
+ ## 4. Select the local launcher by developer workstation OS
95
+
96
+ Use repository-provided platform-appropriate deployment entry points.
97
+
98
+ Typical dispatch is:
99
+
100
+ ```text
101
+ Windows developer workstation → approved PowerShell deployment entry point
102
+ macOS/Linux developer workstation → approved shell deployment entry point
103
+ ```
104
+
105
+ The repository may define different supported launchers. Follow its contract rather than inventing a path.
106
+
107
+ The launcher choice is based on the developer workstation OS. Target-specific behavior is based on the selected environment's approved target OS. Do not confuse those two dimensions.
108
+
109
+ If the developer workstation or target OS is unsupported by the repository's approved deployment implementation, stop with a clear blocker.
110
+
111
+ ## 5. Preserve one deployment contract across launchers
112
+
113
+ Where a repository provides multiple local launchers, they must preserve equivalent deployment semantics and safety behavior.
114
+
115
+ Prefer a common logical contract such as:
116
+
117
+ ```text
118
+ environment
119
+ release/version or artifact identity
120
+ immutable digest when required
121
+ dry-run/check mode when supported
122
+ ```
123
+
124
+ Do not pass secret values on command lines merely to make launchers symmetric. Use the repository's approved protected credential mechanism.
125
+
126
+ Environment-specific values are configuration, not reasons to duplicate otherwise equivalent deployment procedures.
127
+
128
+ ## 6. Resolve release/artifact identity
129
+
130
+ Use the repository's approved policy for the selected environment.
131
+
132
+ For a production-role environment, require the approved formal release/artifact evidence, including immutable identity when the project requires it.
133
+
134
+ For non-production environments, the repository may allow the same formal release policy or a broader immutable CI/commit artifact policy. Do not invent broader permissions when the project has not approved them.
135
+
136
+ When promoting a tested artifact from a non-production environment to production, prefer deploying the exact same immutable artifact/digest rather than rebuilding it for production.
137
+
138
+ ## 7. Present the deployment preview and authorization gate
139
+
140
+ Before running the modifying deployment script, show the resolved non-secret facts:
141
+
142
+ ```text
143
+ DEPLOYMENT READY
144
+
145
+ Environment: <name>
146
+ Role: <production|non-production>
147
+ Target: <verified logical target>
148
+ Target OS: <verified>
149
+ Launcher: <repository-provided script>
150
+ Release/artifact: <verified identity>
151
+ Readiness blockers: NONE
152
+ ```
153
+
154
+ For a non-production remote deployment ask for one bounded authorization such as:
155
+
156
+ ```text
157
+ Authorize deployment to <environment>? [REMOTE WRITE]
158
+ ```
159
+
160
+ For a production-role environment require the project's explicit production deployment gate:
161
+
162
+ ```text
163
+ Authorize deployment to <environment>? [PRODUCTION WRITE]
164
+ ```
165
+
166
+ Production authorization applies only to the exact environment, verified target, release/artifact, and evidence shown. If any of those materially changes, stop and require renewed review/authorization.
167
+
168
+ No requirements approval, code review, PR merge, CI pass, environment selection, prior deployment, or readiness result implicitly authorizes this deployment.
169
+
170
+ ## 8. Execute only the approved script contract
171
+
172
+ After authorization, invoke the repository-provided launcher with the explicitly selected environment and approved release/artifact inputs.
173
+
174
+ Do not perform unrelated host provisioning, target rebinding, firewall changes, credential creation, destructive recovery, or other out-of-band remote writes as part of `/deploy` unless they are explicitly part of the already-approved deployment script contract and authorization scope.
175
+
176
+ If the script reports missing prerequisites, identity mismatch, unexpected target OS, lock contention, migration failure, readiness failure, or another blocker, stop according to the repository's deployment contract. Never redirect the deployment to another environment or host.
177
+
178
+ ## 9. Verify and record outcome
179
+
180
+ After the script completes, use repository-provided readiness/smoke checks and evidence recording when available.
181
+
182
+ Report at least the non-secret outcome supported by evidence:
183
+
184
+ - selected environment,
185
+ - verified target identity/label,
186
+ - release/artifact identity,
187
+ - deployment result,
188
+ - readiness/smoke result,
189
+ - rollback outcome when applicable.
190
+
191
+ Do not report success merely because a command returned or a container/process started if the repository requires stronger readiness evidence.
192
+
193
+ Application rollback and database restore/destructive recovery remain separate decisions when the project contract makes them separate.
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: grill-me
3
+ description: Continuously challenge requirements, architecture, plans, implementation assumptions, or work-item coverage without editing files.
4
+ argument-hint: "<work-item ID, external key, document, plan, or topic>"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Grill Me
10
+
11
+ Purpose: improve reasoning by challenging the highest-value uncertainty without adding process overhead.
12
+
13
+ ## Rules
14
+
15
+ - Read `.github/lean-workspace.json` when present and only the minimum relevant context.
16
+ - Ask one material question at a time.
17
+ - Explain briefly why the question matters.
18
+ - Challenge vague answers, hidden scope, contradictions, and weak assumptions.
19
+ - Recommend an answer or 2–3 options with tradeoffs when useful.
20
+ - Do not edit files.
21
+ - Do not invoke subagents.
22
+ - Do not create artifacts merely because grilling occurred.
23
+ - Do not claim external Jira/Issue content was read unless it was actually available.
24
+
25
+ Challenge areas may include:
26
+ - missing acceptance behavior,
27
+ - cross-work-item/Epic gaps,
28
+ - domain/business rules,
29
+ - lifecycle/state transitions,
30
+ - validation/failure behavior,
31
+ - data integrity,
32
+ - concurrency/transactions,
33
+ - destructive/reversible actions,
34
+ - architecture assumptions,
35
+ - security/operational risk,
36
+ - testability.
37
+
38
+ ## Cadence
39
+
40
+ ```text
41
+ QUESTION
42
+ <one focused question>
43
+
44
+ WHY IT MATTERS
45
+ <short explanation>
46
+
47
+ RECOMMENDATION
48
+ <recommended answer/options when useful>
49
+ ```
50
+
51
+ After the human answers:
52
+
53
+ ```text
54
+ analyze/challenge the answer
55
+ → explain implications when useful
56
+ → ask the next material question
57
+ ```
58
+
59
+ Do not ask `Do you want to continue?` after each answer. The human already entered a continuous grilling mode.
60
+
61
+ Stop only when:
62
+ - the human says stop/done/pause,
63
+ - no material issues remain,
64
+ - a true scope/decision/action gate appears,
65
+ - the human switches workflow.
66
+
67
+ ## Natural completion
68
+
69
+ Summarize once:
70
+ - decisions strengthened,
71
+ - unresolved issues,
72
+ - recommended next workflow.
73
+
74
+ Typical next workflows:
75
+ - `/grill-with-docs` to reconcile resolved decisions,
76
+ - `/refine-requirements` for systematic detailed coverage,
77
+ - `/start-work` when the item is ready.
@@ -0,0 +1,90 @@
1
+ ---
2
+ name: grill-with-docs
3
+ description: Continuously challenge requirements/design and reconcile resolved decisions into permitted authoritative/supplemental documents or proposed external-work-item updates.
4
+ argument-hint: "<work-item ID, external key, document, plan, or topic>"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Grill With Docs
10
+
11
+ This is the documentation-aware form of `/grill-me`.
12
+
13
+ ## 1. Resolve authority
14
+
15
+ Read `.github/lean-workspace.json` when present.
16
+
17
+ Determine:
18
+ - authoritative work-item source,
19
+ - which local documents are authoritative/supplemental/read-only/not-used,
20
+ - whether an external write integration is actually available and permitted.
21
+
22
+ Never assume Product/Feature Briefs exist. Never assume `Jira Epic == Feature Brief`.
23
+
24
+ ## 2. Continuous grilling
25
+
26
+ Ask one material question at a time and challenge:
27
+ - ambiguous outcomes,
28
+ - missing domain/engineering rules,
29
+ - contradictory requirements,
30
+ - lifecycle/destructive behavior,
31
+ - data integrity/concurrency,
32
+ - failure behavior,
33
+ - accessibility/UX implications when relevant,
34
+ - architecture/operational tradeoffs,
35
+ - testability.
36
+
37
+ When the challenge is a bounded decision with a small credible option set, use the choice-first interaction guidance from `INTERACTIVE_SESSION_GUIDE.md` and explain important tradeoffs. When the purpose is to expose or strengthen the human's reasoning, ask open-ended first; introduce options or hints later only when useful as scaffolding.
38
+
39
+ Cadence:
40
+
41
+ ```text
42
+ question
43
+ → human answer
44
+ → challenge/analyze
45
+ → reconcile the resolved decision when already authorized
46
+ → next material question
47
+ ```
48
+
49
+ Do not ask whether to continue after every answer.
50
+
51
+ ## 3. Reconcile to the right authority
52
+
53
+ When a decision is resolved:
54
+ - update an existing permitted local authority/supplement only when the current session authorizes document edits;
55
+ - if Jira/GitHub/another external system is authoritative and no permitted write integration is available, accumulate a concise `PROPOSED EXTERNAL WORK-ITEM UPDATE`;
56
+ - if a permitted external write integration exists, require an explicit `[EXTERNAL WRITE]` choice before writing externally;
57
+ - never create a competing local source merely to store an answer.
58
+
59
+ For local-document models, common homes are:
60
+ - brief: high-level scope/outcome/major rule,
61
+ - combined requirements: detailed user/engineering behavior and testable scenarios,
62
+ - decisions: resolved work-item decision/basis,
63
+ - ADR: only a meaningful cross-cutting architecture decision.
64
+
65
+ ## 4. Editing authorization
66
+
67
+ Invocation alone does not imply broad document-write permission.
68
+
69
+ When document changes are needed, present a bounded choice such as:
70
+
71
+ ```text
72
+ 1. Continue grilling only [READ ONLY]
73
+ 2. Reconcile resolved decisions during this session [MODIFIES DOCS]
74
+ 3. Stop [NO ACTION]
75
+ ```
76
+
77
+ After option 2 is selected, focused updates to the permitted current work-item documents are authorized for the active session. Do not ask again after each answer.
78
+
79
+ Pause only when a new answer would change higher-level approved scope, contradict another authority/ADR, or require a new cross-cutting decision.
80
+
81
+ ## 5. Stop boundary
82
+
83
+ Do not implement production code.
84
+
85
+ At natural completion summarize:
86
+ - decisions resolved,
87
+ - documents/proposed external updates changed,
88
+ - remaining conflicts/open items.
89
+
90
+ If systematic detailed coverage is still needed, recommend `/refine-requirements`.