@mriekki/lean 0.0.0-stage → 0.1.0
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.
- package/README.md +67 -3
- package/assets/components.json +33 -0
- package/assets/core/distribution.json +51 -0
- package/assets/deployment/distribution.json +34 -0
- package/assets/generated/ASSEMBLY.json +382 -0
- package/assets/generated/core/core/agents/coach.agent.md +69 -0
- package/assets/generated/core/core/agents/reviewer.agent.md +85 -0
- package/assets/generated/core/core/instructions/lean-docs.instructions.md +14 -0
- package/assets/generated/core/core/instructions/lean-workflow.instructions.md +35 -0
- package/assets/generated/core/core/learning/CODING_DRILLS.md +35 -0
- package/assets/generated/core/core/learning/DIAGRAM_GUIDE.md +19 -0
- package/assets/generated/core/core/learning/ENGINEERING_LEARNING_WORKBOOK.md +82 -0
- package/assets/generated/core/core/learning/LEARNING_MAP.md +51 -0
- package/assets/generated/core/core/learning/LEARNING_PROGRESS.md +31 -0
- package/assets/generated/core/core/learning/RESOURCE_CATALOG.md +25 -0
- package/assets/generated/core/core/learning/SQL_DRILLS.md +27 -0
- package/assets/generated/core/core/learning/SYSTEM_DESIGN_DRILLS.md +21 -0
- package/assets/generated/core/core/process/COACHING_GUIDE.md +57 -0
- package/assets/generated/core/core/process/GUIDED_NEXT_STEPS.md +48 -0
- package/assets/generated/core/core/process/HUMAN_GATES.md +81 -0
- package/assets/generated/core/core/process/INTERACTIVE_SESSION_GUIDE.md +62 -0
- package/assets/generated/core/core/process/PRODUCTION_ENABLEMENT.md +59 -0
- package/assets/generated/core/core/process/PR_WORKFLOW.md +53 -0
- package/assets/generated/core/core/process/SETUP_ACCEPTANCE_CHECKLIST.md +72 -0
- package/assets/generated/core/core/process/WORK_ITEM_MODEL.md +56 -0
- package/assets/generated/core/core/skills/cleanup-branches/SKILL.md +190 -0
- package/assets/generated/core/core/skills/coach/SKILL.md +136 -0
- package/assets/generated/core/core/skills/code-walkthrough/SKILL.md +197 -0
- package/assets/generated/core/core/skills/core-sync/SKILL.md +220 -0
- package/assets/generated/core/core/skills/define-feature/SKILL.md +144 -0
- package/assets/generated/core/core/skills/deliver/SKILL.md +315 -0
- package/assets/generated/core/core/skills/deploy/SKILL.md +193 -0
- package/assets/generated/core/core/skills/grill-me/SKILL.md +77 -0
- package/assets/generated/core/core/skills/grill-with-docs/SKILL.md +90 -0
- package/assets/generated/core/core/skills/learning-review/SKILL.md +90 -0
- package/assets/generated/core/core/skills/next-step/SKILL.md +166 -0
- package/assets/generated/core/core/skills/production-readiness/SKILL.md +357 -0
- package/assets/generated/core/core/skills/pull-latest/SKILL.md +166 -0
- package/assets/generated/core/core/skills/refine-requirements/SKILL.md +207 -0
- package/assets/generated/core/core/skills/start-work/SKILL.md +178 -0
- package/assets/generated/core/core/skills/tear-down/SKILL.md +138 -0
- package/assets/generated/core/core/skills/upstream-fix/SKILL.md +206 -0
- package/assets/generated/core/core/skills/wait-what/SKILL.md +86 -0
- package/assets/generated/core/core/templates/FEATURE_BRIEF_TEMPLATE.md +27 -0
- package/assets/generated/core/core/templates/PRODUCT_BRIEF_TEMPLATE.md +27 -0
- package/assets/generated/core/core/templates/PULL_REQUEST_TEMPLATE.md +37 -0
- package/assets/generated/core/core/templates/REQUIREMENTS_TEMPLATE.md +17 -0
- package/assets/generated/core/profiles/greenfield/lean-workspace.json +12 -0
- package/assets/generated/core/tools/package/check_baseline.py +102 -0
- package/assets/generated/core/tools/package/check_upstream.py +171 -0
- package/assets/generated/deployment/distribution/lean-poc-deploy.py +8 -0
- package/assets/generated/deployment/src/lean_poc_deployment/__init__.py +3 -0
- package/assets/generated/deployment/src/lean_poc_deployment/__main__.py +3 -0
- package/assets/generated/deployment/src/lean_poc_deployment/app_cli.py +140 -0
- package/assets/generated/deployment/src/lean_poc_deployment/app_runtime.py +455 -0
- package/assets/generated/deployment/src/lean_poc_deployment/app_runtime_remote.py +416 -0
- package/assets/generated/deployment/src/lean_poc_deployment/box_platform.py +208 -0
- package/assets/generated/deployment/src/lean_poc_deployment/box_platform_assets.py +100 -0
- package/assets/generated/deployment/src/lean_poc_deployment/box_platform_remote.py +271 -0
- package/assets/generated/deployment/src/lean_poc_deployment/cli.py +437 -0
- package/assets/generated/deployment/src/lean_poc_deployment/doctor.py +121 -0
- package/assets/generated/deployment/src/lean_poc_deployment/entrypoint.py +25 -0
- package/assets/generated/deployment/src/lean_poc_deployment/errors.py +5 -0
- package/assets/generated/deployment/src/lean_poc_deployment/keys.py +171 -0
- package/assets/generated/deployment/src/lean_poc_deployment/profiles.py +204 -0
- package/assets/generated/deployment/src/lean_poc_deployment/route_registry.py +367 -0
- package/assets/generated/deployment/src/lean_poc_deployment/route_registry_remote.py +443 -0
- package/assets/generated/deployment/src/lean_poc_deployment/security.py +290 -0
- package/assets/generated/deployment/src/lean_poc_deployment/sqlite_adapter.py +335 -0
- package/assets/generated/deployment/src/lean_poc_deployment/sqlite_adapter_remote.py +340 -0
- package/assets/generated/deployment/src/lean_poc_deployment/sqlite_cli.py +86 -0
- package/assets/generated/deployment/src/lean_poc_deployment/sqlite_import_recovery.py +437 -0
- package/assets/generated/deployment/src/lean_poc_deployment/ssh.py +118 -0
- package/assets/generated/deployment/src/lean_poc_deployment/teardown.py +286 -0
- package/assets/generated/deployment/src/lean_poc_deployment/teardown_cli.py +120 -0
- package/assets/generated/deployment/src/lean_poc_deployment/teardown_remote.py +100 -0
- package/assets/generated/deployment/src/lean_poc_deployment/trust.py +278 -0
- package/bin/lean.mjs +9 -0
- package/package.json +33 -6
- package/src/cli.mjs +131 -0
- package/src/engine.mjs +243 -0
- package/src/package-data.mjs +18 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Continuous Interactive Sessions
|
|
2
|
+
|
|
3
|
+
The following modes are continuous after the human explicitly enters them:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
/grill-me
|
|
7
|
+
/grill-with-docs
|
|
8
|
+
/refine-requirements
|
|
9
|
+
/coach
|
|
10
|
+
/learning-review
|
|
11
|
+
/production-readiness
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Default cadence:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
question
|
|
18
|
+
→ human answer
|
|
19
|
+
→ critique / teach / reconcile / update as permitted
|
|
20
|
+
→ next material question
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Question presentation
|
|
24
|
+
|
|
25
|
+
Choose the question shape based on what the interaction is trying to learn or decide.
|
|
26
|
+
|
|
27
|
+
When a material question has a reasonable bounded answer space and the human is choosing or confirming a decision, prefer a concise choice-first presentation:
|
|
28
|
+
|
|
29
|
+
- offer a small set of plausible choices, normally 3-6;
|
|
30
|
+
- mark a materially preferred option as `RECOMMENDED` when current evidence or repository guidance justifies it;
|
|
31
|
+
- include `Other / specify` when the choices are not exhaustive;
|
|
32
|
+
- include `Not sure — recommend one` when the human can reasonably delegate the choice;
|
|
33
|
+
- accept a choice label/text or a free-form answer;
|
|
34
|
+
- treat choices as interaction aids, not additional requirements.
|
|
35
|
+
|
|
36
|
+
Keep questions open-ended when predefined choices would weaken the purpose of the interaction. This includes:
|
|
37
|
+
|
|
38
|
+
- user-authored problem/outcome/workflow framing where the human's own wording matters;
|
|
39
|
+
- factual values such as a hostname, IP address, path, account, observed error, or environment-specific fact;
|
|
40
|
+
- learning/understanding assessment where the human should explain or reason in their own words;
|
|
41
|
+
- debugging, design, or grilling questions whose purpose is to expose the human's reasoning before options or hints are introduced.
|
|
42
|
+
|
|
43
|
+
If an open-ended reasoning question stalls, options/hints may be introduced as scaffolding after the initial attempt. Do not manufacture bounded choices merely to make every question look structured.
|
|
44
|
+
|
|
45
|
+
Do not repeatedly ask `Do you want to continue?`.
|
|
46
|
+
|
|
47
|
+
Stop when:
|
|
48
|
+
- the human says stop/done/pause,
|
|
49
|
+
- the objective naturally completes,
|
|
50
|
+
- no material questions remain,
|
|
51
|
+
- a genuine approval/scope/action gate appears,
|
|
52
|
+
- the human switches workflows.
|
|
53
|
+
|
|
54
|
+
Continuous conversation never implies permission for unrelated file, Git, external-system, remote, or production writes.
|
|
55
|
+
|
|
56
|
+
For modifying sessions such as requirement refinement or production-readiness documentation, one explicit session-level authorization may cover focused updates within the defined scope; do not re-ask after every answer.
|
|
57
|
+
|
|
58
|
+
Compound action skills may also define their own bounded authorization. In particular, manually invoking `/deliver` after its prerequisites are satisfied authorizes routine branch/stage/commit/push/PR/CI mechanics within the accepted delivery scope. Do not interrupt that compound action with repeated ceremonial permission prompts. `/deliver` still stops for changed evidence, ambiguity/risk, and the explicit merge/finalize decision.
|
|
59
|
+
|
|
60
|
+
If a tool/channel interruption leaves a compound workflow partially complete, a later invocation should inspect current state and resume from the furthest safe point rather than assuming nothing happened or requiring the same routine authorization again.
|
|
61
|
+
|
|
62
|
+
`/wait-what` is different. It is a one-turn, read-only communication repair for the immediately preceding explanation. It re-establishes context and clarity, then returns control to the current workflow without silently continuing a pending action or approval gate.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Production Enablement
|
|
2
|
+
|
|
3
|
+
Production enablement is a guided operational lane separate from ordinary engineering delivery.
|
|
4
|
+
|
|
5
|
+
A repository may have multiple named deployment environments, for example a non-production staging/portable environment and a true production environment. Each environment owns its own verified target binding, readiness evidence, data/backup state, credentials, and deployment policy.
|
|
6
|
+
|
|
7
|
+
Use:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
/production-readiness <deployment-enabler-ID> discovery [environment]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
early enough to discover real target dependencies.
|
|
14
|
+
|
|
15
|
+
After deployment engineering is reviewed, delivered, merged, and required post-merge default-branch CI is green, use:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
/production-readiness <deployment-enabler-ID> enable [environment]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The readiness workflow covers:
|
|
22
|
+
|
|
23
|
+
- named environment role/policy,
|
|
24
|
+
- actual target OS/version/architecture/host discovery,
|
|
25
|
+
- stable environment-to-target binding,
|
|
26
|
+
- deployment identity/access,
|
|
27
|
+
- SSH host-trust and portable-addressing safety when SSH is used,
|
|
28
|
+
- developer-machine and source-hosting/CI read-only checks,
|
|
29
|
+
- optionally authorized read-only remote target checks,
|
|
30
|
+
- runtime/storage/data/backup readiness,
|
|
31
|
+
- network/firewall/security/DNS/TLS/certificate readiness,
|
|
32
|
+
- external blockers,
|
|
33
|
+
- separately authorized bounded provisioning/configuration,
|
|
34
|
+
- approved release/artifact policy,
|
|
35
|
+
- migration/readiness/smoke/rollback evidence.
|
|
36
|
+
|
|
37
|
+
Address discovery is not host trust. When SSH is used, unknown or changed host identity stops access; readiness must not recover by disabling host-key verification, silently enrolling new trust, scanning/selecting another host, weakening network controls, or redirecting to another environment.
|
|
38
|
+
|
|
39
|
+
Readiness is environment-specific. Readiness of staging does not prove production is ready, and failure of one environment must never cause fallback to another environment or target.
|
|
40
|
+
|
|
41
|
+
Once the selected environment is ready, the repeatable deployment entry point is:
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
/deploy [environment]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
`/deploy` requires explicit environment selection when omitted, verifies the environment/target/artifact evidence, dispatches to the repository-provided platform-appropriate deployment launcher, and presents the applicable write gate immediately before execution.
|
|
48
|
+
|
|
49
|
+
Production is never an implicit/default deployment target. A production-role deployment requires a distinct `[PRODUCTION WRITE]` authorization for the exact environment, verified target, release/artifact, and current evidence shown by `/deploy`.
|
|
50
|
+
|
|
51
|
+
A non-production remote deployment still requires bounded `[REMOTE WRITE]` authorization.
|
|
52
|
+
|
|
53
|
+
Developer workstation OS and deployment target OS are separate dimensions. A repository may provide PowerShell on Windows and shell on macOS/Linux while both invoke equivalent deployment behavior against an approved Ubuntu target. Future Windows/macOS target support requires target-specific implementation/readiness; common SSH transport alone does not establish runtime/deployment parity.
|
|
54
|
+
|
|
55
|
+
Remote read-only authorization never implies permission for writes.
|
|
56
|
+
|
|
57
|
+
No requirements approval, Reviewer verdict, PR merge, CI result, environment selection, readiness result, or previous deployment implies production-deployment authorization.
|
|
58
|
+
|
|
59
|
+
Secret values stay out of tracked documentation and logs. Database restore/destructive recovery remains a separate decision when data safety warrants it.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Pull Request / Merge Workflow
|
|
2
|
+
|
|
3
|
+
After:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
implementation complete
|
|
7
|
+
→ relevant local checks satisfactory
|
|
8
|
+
→ Reviewer READY
|
|
9
|
+
→ human meaningful local-diff approval
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
run `/deliver`.
|
|
13
|
+
|
|
14
|
+
Normal delivery is intentionally streamlined:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
/deliver
|
|
18
|
+
→ establish/recover short-lived work branch if needed
|
|
19
|
+
→ selective stage
|
|
20
|
+
→ verify staged diff
|
|
21
|
+
→ commit
|
|
22
|
+
→ push
|
|
23
|
+
→ create/update PR
|
|
24
|
+
→ PR CI
|
|
25
|
+
→ one MERGE + FINALIZE decision
|
|
26
|
+
→ merge
|
|
27
|
+
→ post-merge default-branch CI when configured/required
|
|
28
|
+
→ safe delivered-branch cleanup
|
|
29
|
+
→ delivery complete
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Invoking `/deliver` is the bounded authorization for the routine mechanics through PR creation/update and PR-CI inspection. Do not add separate branch/commit/push/PR/CI permission prompts when the work remains inside the already-reviewed delivery scope.
|
|
33
|
+
|
|
34
|
+
Key rules:
|
|
35
|
+
- existing repository branch/PR/CI/merge policy outranks Lean defaults,
|
|
36
|
+
- `/start-work` should establish the short-lived work branch when implementation begins; `/deliver` may recover safely if reviewed work is still on the default branch,
|
|
37
|
+
- PR templates are internal scaffolding and do not require a separate validation ceremony,
|
|
38
|
+
- because implementation was already meaningfully accepted locally, a final PR acceptance prompt does not need to be separate from merge when the PR head/diff still exactly matches that accepted scope,
|
|
39
|
+
- green PR CI is necessary evidence but never merge authorization by itself,
|
|
40
|
+
- the explicit `Merge and finalize delivery` choice is both final acceptance of the observed PR and merge authorization,
|
|
41
|
+
- if new commits/material diff changes/conflicts/regressed checks appear, final PR review is required before merge,
|
|
42
|
+
- merge authorization is not production-deployment authorization,
|
|
43
|
+
- for a normal short-lived delivered branch, `Merge and finalize delivery` also authorizes safe local/remote cleanup after required post-merge default-branch CI is observed green,
|
|
44
|
+
- no second branch-deletion prompt is needed for that delivered branch when the cleanup evidence remains exact and safe,
|
|
45
|
+
- unrelated, accumulated, protected/default, release/integration/environment, policy-retained, changed, or ambiguous branches are preserved,
|
|
46
|
+
- squash/rebase merges require merged-PR/head-SHA evidence before any local force deletion is considered safe,
|
|
47
|
+
- do not claim checks passed or branches were deleted unless the remote/local state was actually observed,
|
|
48
|
+
- do not silently modify code after CI failure; inspect/diagnose and return through review as warranted,
|
|
49
|
+
- rerunning `/deliver` after interruption resumes from the furthest observed safe delivery state instead of repeating completed actions or re-asking routine authorization.
|
|
50
|
+
|
|
51
|
+
If PR CI or post-merge CI remains pending beyond the practical interaction/tool window, preserve state and report that rerunning `/deliver` will resume observation/finalization.
|
|
52
|
+
|
|
53
|
+
Use `/cleanup-branches` for preview-first maintenance of accumulated, previously retained, unrelated, or otherwise out-of-band branches outside the active `/deliver` flow.
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Setup Acceptance Checklist
|
|
2
|
+
|
|
3
|
+
Do not confuse generated files, installed tools, operational dependencies, editor/agent discovery, AI execution-surface discovery, and human acceptance.
|
|
4
|
+
|
|
5
|
+
Use this checklist after creating or adopting a Lean workspace and before beginning the first substantive work item.
|
|
6
|
+
|
|
7
|
+
## Workstation
|
|
8
|
+
|
|
9
|
+
- [ ] All required tools declared by the workspace environment are installed at acceptable versions.
|
|
10
|
+
- [ ] Required external CLIs are authenticated to the intended account when authentication is part of the workflow.
|
|
11
|
+
- [ ] Required local services or engines are actually running, not merely installed.
|
|
12
|
+
- [ ] Container tooling and Compose work when the selected stack declares containers.
|
|
13
|
+
- [ ] Repository-pinned runtimes are active.
|
|
14
|
+
- [ ] Optional tools are either available or consciously deferred.
|
|
15
|
+
|
|
16
|
+
## Repository / workspace
|
|
17
|
+
|
|
18
|
+
- [ ] Git repository and remote state are understood.
|
|
19
|
+
- [ ] `AGENTS.md` is present and identifies the repository source-of-truth hierarchy.
|
|
20
|
+
- [ ] `.github/lean-workspace.json` is present.
|
|
21
|
+
- [ ] expected Lean agents, instructions, and skills are present.
|
|
22
|
+
- [ ] product/work-item source documents needed for the next work item are present.
|
|
23
|
+
- [ ] CI configuration is present when CI is part of the workspace contract.
|
|
24
|
+
- [ ] Core baseline integrity passes when `CORE_BASELINE.json` is present.
|
|
25
|
+
|
|
26
|
+
## Editor / agentic AI discovery
|
|
27
|
+
|
|
28
|
+
After opening/reloading the intended editor workspace:
|
|
29
|
+
|
|
30
|
+
- [ ] the selected AI coding assistant is signed in and usable when required.
|
|
31
|
+
- [ ] `Reviewer` is discoverable.
|
|
32
|
+
- [ ] `Coach` is discoverable when the workspace includes coaching.
|
|
33
|
+
- [ ] expected Lean skills are discoverable, including `/start-work`, `/deliver`, and `/wait-what` when included by the distribution/capability set.
|
|
34
|
+
- [ ] path-specific instructions are present when the workspace declares them.
|
|
35
|
+
- [ ] path-specific instructions are recognized/applied for matching files when the host supports them.
|
|
36
|
+
- [ ] the human controls the routine model/tier; the workspace does not silently pin or upgrade it.
|
|
37
|
+
|
|
38
|
+
## Copilot CLI + VS Code discovery
|
|
39
|
+
|
|
40
|
+
When GitHub Copilot CLI is an intended execution surface:
|
|
41
|
+
|
|
42
|
+
- [ ] `copilot` starts successfully from the repository checkout without requiring `--allow-all` or `--yolo`.
|
|
43
|
+
- [ ] `/user` reports the intended GitHub identity.
|
|
44
|
+
- [ ] `/skills list` shows the expected repository-local Lean skills from `.github/skills/`.
|
|
45
|
+
- [ ] the expected custom agents are selectable, including `Reviewer` and `Coach` when included by the distribution/capability set.
|
|
46
|
+
- [ ] `/ide` is connected to the intended trusted VS Code workspace when editor/CLI integration is desired.
|
|
47
|
+
- [ ] CLI-proposed edits can be reviewed through the configured approval flow; when VS Code diff integration is enabled, proposed file edits appear as editor diffs rather than being silently applied.
|
|
48
|
+
- [ ] the `Reviewer` agent exposes only the intended `read`, `search`, and `execute` tool classes and remains non-mutating in practice.
|
|
49
|
+
- [ ] Lean human gates behave the same whether the interaction starts in Copilot Chat or Copilot CLI.
|
|
50
|
+
|
|
51
|
+
Copilot CLI is an additional supported execution surface, not a separate Lean workflow. Normal Lean use must not require blanket tool approval. Autopilot/delegated execution is outside the default Lean delivery lifecycle unless a repository explicitly defines and accepts that behavior.
|
|
52
|
+
|
|
53
|
+
## Application stage
|
|
54
|
+
|
|
55
|
+
- [ ] application scaffold is either intentionally absent for the current stage or present as expected.
|
|
56
|
+
- [ ] declared restore/build/test commands succeed for the artifacts that currently exist.
|
|
57
|
+
- [ ] deferred scaffold-dependent checks are clearly identified rather than reported as passed.
|
|
58
|
+
|
|
59
|
+
## Smoke test
|
|
60
|
+
|
|
61
|
+
- [ ] static workspace diagnostics pass when provided.
|
|
62
|
+
- [ ] normal AI chat can summarize the approved product/work-item intent without inventing scope.
|
|
63
|
+
- [ ] a read-only challenge/review capability can be invoked without editing files.
|
|
64
|
+
- [ ] `/wait-what` can re-explain a prior response without changing repository state when the workspace includes it.
|
|
65
|
+
- [ ] the Reviewer remains review-focused when selected.
|
|
66
|
+
- [ ] when Copilot CLI is enabled, invoking a Lean skill there preserves the same scope, source-of-truth, and Human-in-the-Loop rules as the editor chat surface.
|
|
67
|
+
|
|
68
|
+
## Human acceptance
|
|
69
|
+
|
|
70
|
+
Setup is accepted only when the human confirms this checkout is usable for the next intended work item.
|
|
71
|
+
|
|
72
|
+
A successful generator, installer, static file check, tool-version probe, CLI connection, or agent/skill discovery check alone is not human acceptance.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Work-Item Model
|
|
2
|
+
|
|
3
|
+
Lean reasons from the repository's authoritative work-item system rather than requiring one universal artifact hierarchy.
|
|
4
|
+
|
|
5
|
+
Possible sources include:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
Product Brief
|
|
9
|
+
Jira Epic
|
|
10
|
+
Feature Brief
|
|
11
|
+
Engineering Enabler
|
|
12
|
+
Jira Story
|
|
13
|
+
GitHub Issue
|
|
14
|
+
local requirements
|
|
15
|
+
ADR
|
|
16
|
+
small session context
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Authority labels:
|
|
20
|
+
|
|
21
|
+
```text
|
|
22
|
+
PRIMARY
|
|
23
|
+
SUPPLEMENTAL
|
|
24
|
+
REFERENCE
|
|
25
|
+
NOT USED
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Role labels:
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
PRODUCT CONTEXT
|
|
32
|
+
FEATURE CONTEXT
|
|
33
|
+
WORK GROUPING
|
|
34
|
+
IMPLEMENTABLE REQUIREMENT
|
|
35
|
+
TECHNICAL DECISION
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Product/Feature Brief modes may be:
|
|
39
|
+
|
|
40
|
+
```text
|
|
41
|
+
not-used
|
|
42
|
+
read-existing
|
|
43
|
+
supplemental-experimental
|
|
44
|
+
authoritative
|
|
45
|
+
suggest-complex
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Never assume:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
Jira Epic == Feature Brief
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Possible relationships vary by team: an Epic may be a feature, initiative, technical workstream, or delivery container; one Epic may have no Feature Brief, one brief, or several.
|
|
55
|
+
|
|
56
|
+
Existing team conventions outrank Lean defaults. Do not create a competing local source of truth merely because Lean has a template.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cleanup-branches
|
|
3
|
+
description: Preview-first cleanup of completed short-lived Git branches locally and on the configured remote, using merged-PR evidence and explicit destructive authorization.
|
|
4
|
+
argument-hint: "[optional branch name/prefix]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
disable-model-invocation: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Cleanup Branches
|
|
10
|
+
|
|
11
|
+
`/cleanup-branches` removes completed short-lived branches without treating branch-name patterns or Git ancestry alone as proof that deletion is safe.
|
|
12
|
+
|
|
13
|
+
Existing repository conventions outrank Lean defaults. Preserve configured default/protected branches, release/integration branches, and any branch the repository intentionally keeps long-lived.
|
|
14
|
+
|
|
15
|
+
Invocation begins read-only.
|
|
16
|
+
|
|
17
|
+
## 1. Purpose
|
|
18
|
+
|
|
19
|
+
Use this skill for branch housekeeping outside the normal `/deliver` path, especially when historical feature/fix/chore branches have accumulated.
|
|
20
|
+
|
|
21
|
+
Normal delivery should clean its own short-lived branch after merge and successful required post-merge default-branch CI. This skill is for backlog cleanup, interrupted delivery, or explicit inspection.
|
|
22
|
+
|
|
23
|
+
## 2. Read-only discovery
|
|
24
|
+
|
|
25
|
+
Inspect current repository state and resolve the actual default branch and remotes. Typical evidence includes:
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
git status --short --branch
|
|
29
|
+
git branch --show-current
|
|
30
|
+
git branch -vv
|
|
31
|
+
git branch -r
|
|
32
|
+
git remote -v
|
|
33
|
+
git fetch --all --prune --dry-run
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
When GitHub CLI is available, inspect repository/PR evidence rather than inferring from names alone:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
gh repo view
|
|
40
|
+
gh pr list --state merged
|
|
41
|
+
gh pr list --state open
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For each candidate branch, record when observable:
|
|
45
|
+
- local head SHA,
|
|
46
|
+
- remote head SHA,
|
|
47
|
+
- merged PR number/state,
|
|
48
|
+
- PR head ref and head SHA,
|
|
49
|
+
- whether an open PR still references the branch,
|
|
50
|
+
- whether the branch is default/protected/long-lived by repository policy,
|
|
51
|
+
- whether local commits exist beyond the remote/merged PR head.
|
|
52
|
+
|
|
53
|
+
Do not modify anything during discovery.
|
|
54
|
+
|
|
55
|
+
## 3. Classification
|
|
56
|
+
|
|
57
|
+
Classify every observed non-default branch into one of these buckets.
|
|
58
|
+
|
|
59
|
+
### SAFE TO DELETE
|
|
60
|
+
|
|
61
|
+
A branch may be classified safe only when evidence shows it is completed and unchanged since completion. Strong evidence is:
|
|
62
|
+
- a merged PR exists for that exact head branch,
|
|
63
|
+
- the observed branch head still matches the PR head SHA (or the branch is already absent remotely),
|
|
64
|
+
- no open PR references the branch,
|
|
65
|
+
- no local-only commits were added after the approved/merged head,
|
|
66
|
+
- it is not the default, protected, release, integration, environment, or intentionally long-lived branch.
|
|
67
|
+
|
|
68
|
+
A branch fully merged by ancestry may also be safe when repository policy and commit history make that unambiguous.
|
|
69
|
+
|
|
70
|
+
### REVIEW REQUIRED
|
|
71
|
+
|
|
72
|
+
Use this when any material evidence is missing or ambiguous, including:
|
|
73
|
+
- no merged PR and ancestry is not conclusive,
|
|
74
|
+
- remote/local heads differ,
|
|
75
|
+
- branch moved after its PR merged,
|
|
76
|
+
- local-only commits exist,
|
|
77
|
+
- an open PR references it,
|
|
78
|
+
- branch purpose/lifecycle is unclear.
|
|
79
|
+
|
|
80
|
+
### PRESERVE
|
|
81
|
+
|
|
82
|
+
Always preserve by default:
|
|
83
|
+
- the configured default branch,
|
|
84
|
+
- protected branches,
|
|
85
|
+
- active/open-PR branches,
|
|
86
|
+
- release/integration/environment branches unless repository policy explicitly says otherwise,
|
|
87
|
+
- any branch the human marks to keep.
|
|
88
|
+
|
|
89
|
+
Never classify by prefix alone.
|
|
90
|
+
|
|
91
|
+
## 4. Preview
|
|
92
|
+
|
|
93
|
+
Present a concrete preview before deletion:
|
|
94
|
+
|
|
95
|
+
```text
|
|
96
|
+
BRANCH CLEANUP PREVIEW
|
|
97
|
+
|
|
98
|
+
Default branch: <name>
|
|
99
|
+
Working tree: <clean / details>
|
|
100
|
+
|
|
101
|
+
SAFE TO DELETE
|
|
102
|
+
<branch> local=<sha|absent> remote=<sha|absent> evidence=<merged PR / ancestry>
|
|
103
|
+
|
|
104
|
+
REVIEW REQUIRED
|
|
105
|
+
<branch> <reason>
|
|
106
|
+
|
|
107
|
+
PRESERVE
|
|
108
|
+
<branch> <reason>
|
|
109
|
+
|
|
110
|
+
NO CHANGES HAVE BEEN MADE
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
If no branch is safely deletable, stop after the preview.
|
|
114
|
+
|
|
115
|
+
## 5. Cleanup gate
|
|
116
|
+
|
|
117
|
+
For a non-empty verified-safe set, present one bounded destructive gate:
|
|
118
|
+
|
|
119
|
+
```text
|
|
120
|
+
BRANCH CLEANUP READY
|
|
121
|
+
|
|
122
|
+
1. Delete verified-safe local + remote branches [GIT + GITHUB WRITE] — recommended
|
|
123
|
+
2. Delete verified-safe remote branches only [GITHUB WRITE]
|
|
124
|
+
3. Delete verified-safe local branches only [GIT WRITE]
|
|
125
|
+
4. Stop [NO ACTION]
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Only the selected option authorizes the corresponding deletions. Do not include REVIEW REQUIRED branches in the bounded action.
|
|
129
|
+
|
|
130
|
+
## 6. Revalidate before deletion
|
|
131
|
+
|
|
132
|
+
Immediately before any deletion:
|
|
133
|
+
- fetch/prune remote state,
|
|
134
|
+
- re-resolve the default branch,
|
|
135
|
+
- confirm every candidate branch head still matches the previewed SHA/evidence,
|
|
136
|
+
- confirm no new/open PR now references it,
|
|
137
|
+
- confirm the working tree is safe to switch branches,
|
|
138
|
+
- confirm the current branch is not about to be deleted.
|
|
139
|
+
|
|
140
|
+
If anything materially changed, stop and return to preview. Do not silently widen the approved set.
|
|
141
|
+
|
|
142
|
+
## 7. Apply cleanup
|
|
143
|
+
|
|
144
|
+
Switch to the default branch before deleting the current feature branch and update it with the repository-approved non-rewriting method, normally `git pull --ff-only`.
|
|
145
|
+
|
|
146
|
+
For each approved remote branch, use the repository's normal remote-deletion mechanism, for example:
|
|
147
|
+
|
|
148
|
+
```text
|
|
149
|
+
git push origin --delete <branch>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
If the remote branch is already absent, treat that as already-clean rather than an error.
|
|
153
|
+
|
|
154
|
+
For each approved local branch:
|
|
155
|
+
- prefer `git branch -d <branch>` when Git recognizes it as merged,
|
|
156
|
+
- squash/rebase merges may cause `-d` to reject even though the PR is merged,
|
|
157
|
+
- only when merged-PR evidence is exact and the local head has no commits beyond the approved PR head may `git branch -D <branch>` be used under the explicit cleanup authorization.
|
|
158
|
+
|
|
159
|
+
Never use `-D` merely to bypass uncertainty.
|
|
160
|
+
|
|
161
|
+
After deletion:
|
|
162
|
+
|
|
163
|
+
```text
|
|
164
|
+
git fetch origin --prune
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## 8. Completion report
|
|
168
|
+
|
|
169
|
+
Report exactly what happened:
|
|
170
|
+
|
|
171
|
+
```text
|
|
172
|
+
BRANCH CLEANUP COMPLETE
|
|
173
|
+
|
|
174
|
+
Deleted remote:
|
|
175
|
+
...
|
|
176
|
+
Deleted local:
|
|
177
|
+
...
|
|
178
|
+
Already absent:
|
|
179
|
+
...
|
|
180
|
+
Preserved / review required:
|
|
181
|
+
...
|
|
182
|
+
Default branch: <name>
|
|
183
|
+
Working tree: <state>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Do not claim a branch was deleted unless the resulting local/remote state was observed.
|
|
187
|
+
|
|
188
|
+
## 9. Relationship to /deliver
|
|
189
|
+
|
|
190
|
+
`/deliver` owns branch finalization for the work it is actively delivering. `/cleanup-branches` is the standalone maintenance path for accumulated or previously retained branches.
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: coach
|
|
3
|
+
description: "Optional guided engineering learning before, during, or after work using actual repository context: concepts, code walkthroughs, debugging, coding/DSA, SQL, design, system design, interview drills, diagrams, and resources."
|
|
4
|
+
argument-hint: "[topic/work-item] [light|focused|deep|broad] [L1-L6]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
disable-model-invocation: true
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Coach
|
|
10
|
+
|
|
11
|
+
Coaching is optional and never blocks planning, implementation, review, delivery, merge, or work-item completion.
|
|
12
|
+
|
|
13
|
+
## 1. Context and boundaries
|
|
14
|
+
|
|
15
|
+
- Read only minimum relevant code/work-item/learning context.
|
|
16
|
+
- Do not edit production code or implement fixes while in Coach mode.
|
|
17
|
+
- Do not invoke subagents.
|
|
18
|
+
- Do not silently broaden scope.
|
|
19
|
+
- Do not pin/request/switch to a premium model automatically.
|
|
20
|
+
- Distinguish actual implementation/understanding from AI-generated work and study.
|
|
21
|
+
|
|
22
|
+
## 2. Depth
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
Light — quick explanation/check
|
|
26
|
+
Focused — one topic, moderate depth
|
|
27
|
+
Deep — trace/apply/debug/defend one topic
|
|
28
|
+
Broad — survey related areas and find gaps
|
|
29
|
+
Coach recommends
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Do not force the human to choose a depth when their prompt already makes intent clear.
|
|
33
|
+
|
|
34
|
+
## 3. Learning levels
|
|
35
|
+
|
|
36
|
+
```text
|
|
37
|
+
L1 Recognize
|
|
38
|
+
L2 Explain
|
|
39
|
+
L3 Trace
|
|
40
|
+
L4 Apply / Debug
|
|
41
|
+
L5 Defend / Design
|
|
42
|
+
L6 Interview Ready
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
These measure understanding, not seniority. Do not inflate mastery.
|
|
46
|
+
|
|
47
|
+
## 4. Modes
|
|
48
|
+
|
|
49
|
+
Support:
|
|
50
|
+
1. learn a concept,
|
|
51
|
+
2. walk through real project code,
|
|
52
|
+
3. debugging exercise/review,
|
|
53
|
+
4. coding/DSA drill,
|
|
54
|
+
5. SQL/database drill,
|
|
55
|
+
6. design defense,
|
|
56
|
+
7. system-design exercise,
|
|
57
|
+
8. interview drill,
|
|
58
|
+
9. learning-gap assessment,
|
|
59
|
+
10. recommended learning path,
|
|
60
|
+
11. docs/tutorial/video resources,
|
|
61
|
+
12. return to engineering workflow.
|
|
62
|
+
|
|
63
|
+
Use installed learning assets when present; do not assume they exist.
|
|
64
|
+
|
|
65
|
+
For a structured walkthrough of implementation changes across a Git/PR/commit change set, prefer `/code-walkthrough`. Coach remains available for ad-hoc explanation of a file, symbol, concept, design choice, or selected code block.
|
|
66
|
+
|
|
67
|
+
## 5. Continuous adaptive cadence
|
|
68
|
+
|
|
69
|
+
```text
|
|
70
|
+
question
|
|
71
|
+
→ human answer
|
|
72
|
+
→ critique/teach
|
|
73
|
+
→ next material question
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Do not repeatedly ask whether to continue.
|
|
77
|
+
|
|
78
|
+
Adapt difficulty:
|
|
79
|
+
- weak answer: teach missing mental model, simplify, ask for own-words explanation;
|
|
80
|
+
- solid: apply/edge case;
|
|
81
|
+
- strong: tradeoff/debug/design;
|
|
82
|
+
- very strong: interviewer pressure or changed scale/assumptions.
|
|
83
|
+
|
|
84
|
+
## 6. Mode guidance
|
|
85
|
+
|
|
86
|
+
Concept:
|
|
87
|
+
|
|
88
|
+
```text
|
|
89
|
+
definition → repository/example → diagram if useful → check understanding → application
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Debugging:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
symptom → hypotheses → distinguishing evidence → root cause → fix concept → prevention
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Do not implement the fix during Coach mode.
|
|
99
|
+
|
|
100
|
+
Coding/DSA:
|
|
101
|
+
|
|
102
|
+
```text
|
|
103
|
+
problem → clarifying questions → approach → complexity → code → edge cases/tests → hints → alternatives → feedback
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Do not reveal the solution immediately.
|
|
107
|
+
|
|
108
|
+
SQL/database:
|
|
109
|
+
|
|
110
|
+
```text
|
|
111
|
+
schema/query problem → human writes SQL → correctness → edge cases → indexing/query plan → ORM translation when useful
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
System design: start from the actual repository, ask one question at a time, and make the human drive the design.
|
|
115
|
+
|
|
116
|
+
Interview drill: critique correctness, depth, credibility, structure, concision, overstatement, and missed follow-ups.
|
|
117
|
+
|
|
118
|
+
## 7. Diagrams/resources
|
|
119
|
+
|
|
120
|
+
Mermaid diagrams in chat may be used for architecture, request/sequence/state/data/CI/deployment/concurrency understanding. Diagrams are ephemeral unless explicitly requested as durable artifacts.
|
|
121
|
+
|
|
122
|
+
External resources are optional. Prefer official docs/vendor tutorials, then a small number of current high-quality resources. Show 1–3 at a time, not a link dump. Never make external resources an engineering prerequisite.
|
|
123
|
+
|
|
124
|
+
## 8. Optional learning progress
|
|
125
|
+
|
|
126
|
+
Only update a learning-progress tracker when the human explicitly chooses to do so. Skipping it has no engineering impact.
|
|
127
|
+
|
|
128
|
+
## 9. Credibility
|
|
129
|
+
|
|
130
|
+
For interview/portfolio discussion distinguish:
|
|
131
|
+
- actually implemented/used,
|
|
132
|
+
- AI-generated but reviewed/understood,
|
|
133
|
+
- studied/practiced,
|
|
134
|
+
- not yet understood.
|
|
135
|
+
|
|
136
|
+
Never manufacture professional experience.
|