@mriekki/project-forge 0.0.0-stage → 2.0.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.
Files changed (117) hide show
  1. package/README.md +134 -2
  2. package/assets/components.json +33 -0
  3. package/assets/core/distribution.json +66 -0
  4. package/assets/deployment/distribution.json +54 -0
  5. package/assets/generated/ASSEMBLY.json +557 -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/project-forge-docs.instructions.md +45 -0
  9. package/assets/generated/core/core/instructions/project-forge-workflow.instructions.md +79 -0
  10. package/assets/generated/core/core/learning/CODING_DRILLS.md +35 -0
  11. package/assets/generated/core/core/learning/DIAGRAM_GUIDE.md +59 -0
  12. package/assets/generated/core/core/learning/ENGINEERING_LEARNING_WORKBOOK.md +108 -0
  13. package/assets/generated/core/core/learning/LEARNING_MAP.md +108 -0
  14. package/assets/generated/core/core/learning/LEARNING_PROGRESS.md +39 -0
  15. package/assets/generated/core/core/learning/RESOURCE_CATALOG.md +25 -0
  16. package/assets/generated/core/core/learning/SQL_DRILLS.md +90 -0
  17. package/assets/generated/core/core/learning/SYSTEM_DESIGN_DRILLS.md +301 -0
  18. package/assets/generated/core/core/process/COACHING_GUIDE.md +92 -0
  19. package/assets/generated/core/core/process/DATABASE_LEARNING_WORKBENCH.md +397 -0
  20. package/assets/generated/core/core/process/DEPLOYMENT_ENABLEMENT.md +166 -0
  21. package/assets/generated/core/core/process/GUIDED_NEXT_STEPS.md +48 -0
  22. package/assets/generated/core/core/process/HUMAN_GATES.md +83 -0
  23. package/assets/generated/core/core/process/INTERACTIVE_SESSION_GUIDE.md +64 -0
  24. package/assets/generated/core/core/process/PROJECT_DOCUMENTATION_FRAMEWORK.md +326 -0
  25. package/assets/generated/core/core/process/PROJECT_FORGE_ENGINEERING_GUIDE.md +308 -0
  26. package/assets/generated/core/core/process/PR_WORKFLOW.md +55 -0
  27. package/assets/generated/core/core/process/SETUP_ACCEPTANCE_CHECKLIST.md +72 -0
  28. package/assets/generated/core/core/process/SYSTEM_DESIGN_LEARNING_WORKBENCH.md +520 -0
  29. package/assets/generated/core/core/process/WORK_ITEM_MODEL.md +56 -0
  30. package/assets/generated/core/core/skills/cleanup-branches/SKILL.md +190 -0
  31. package/assets/generated/core/core/skills/coach/SKILL.md +174 -0
  32. package/assets/generated/core/core/skills/code-walkthrough/SKILL.md +197 -0
  33. package/assets/generated/core/core/skills/core-sync/SKILL.md +178 -0
  34. package/assets/generated/core/core/skills/db-lab/SKILL.md +245 -0
  35. package/assets/generated/core/core/skills/define-feature/SKILL.md +144 -0
  36. package/assets/generated/core/core/skills/deliver/SKILL.md +397 -0
  37. package/assets/generated/core/core/skills/deploy/SKILL.md +188 -0
  38. package/assets/generated/core/core/skills/deployment-readiness/SKILL.md +234 -0
  39. package/assets/generated/core/core/skills/developer-env-mode/SKILL.md +231 -0
  40. package/assets/generated/core/core/skills/docs/SKILL.md +116 -0
  41. package/assets/generated/core/core/skills/grill-me/SKILL.md +77 -0
  42. package/assets/generated/core/core/skills/grill-with-docs/SKILL.md +90 -0
  43. package/assets/generated/core/core/skills/learning-review/SKILL.md +90 -0
  44. package/assets/generated/core/core/skills/next-step/SKILL.md +221 -0
  45. package/assets/generated/core/core/skills/progress/SKILL.md +207 -0
  46. package/assets/generated/core/core/skills/project-forge-update/SKILL.md +228 -0
  47. package/assets/generated/core/core/skills/pull-latest/SKILL.md +166 -0
  48. package/assets/generated/core/core/skills/refine-requirements/SKILL.md +207 -0
  49. package/assets/generated/core/core/skills/setup/SKILL.md +362 -0
  50. package/assets/generated/core/core/skills/start-work/SKILL.md +190 -0
  51. package/assets/generated/core/core/skills/system-lab/SKILL.md +333 -0
  52. package/assets/generated/core/core/skills/tear-down/SKILL.md +140 -0
  53. package/assets/generated/core/core/skills/upstream-fix/SKILL.md +221 -0
  54. package/assets/generated/core/core/skills/wait-what/SKILL.md +86 -0
  55. package/assets/generated/core/core/templates/ADR_TEMPLATE.md +41 -0
  56. package/assets/generated/core/core/templates/FEATURE_BRIEF_TEMPLATE.md +27 -0
  57. package/assets/generated/core/core/templates/PRODUCT_BRIEF_TEMPLATE.md +27 -0
  58. package/assets/generated/core/core/templates/PULL_REQUEST_TEMPLATE.md +37 -0
  59. package/assets/generated/core/core/templates/REQUIREMENTS_TEMPLATE.md +17 -0
  60. package/assets/generated/core/profiles/greenfield/project-forge-workspace.json +12 -0
  61. package/assets/generated/core/tools/db_lab/sqlite_workbench.py +463 -0
  62. package/assets/generated/core/tools/docs_site/docs_site.py +512 -0
  63. package/assets/generated/core/tools/package/check_baseline.py +102 -0
  64. package/assets/generated/core/tools/package/check_upstream.py +171 -0
  65. package/assets/generated/core/tools/system_lab/system_workbench.py +243 -0
  66. package/assets/generated/deployment/distribution/project-forge-deploy.py +8 -0
  67. package/assets/generated/deployment/docs/DEVELOPER_ENVIRONMENTS.md +335 -0
  68. package/assets/generated/deployment/docs/ENVIRONMENT_PROOF.md +95 -0
  69. package/assets/generated/deployment/docs/WORKSPACE_INSTANCES.md +154 -0
  70. package/assets/generated/deployment/docs/images/developer-environment-journey.svg +56 -0
  71. package/assets/generated/deployment/docs/images/personal-environment-architecture.svg +54 -0
  72. package/assets/generated/deployment/docs/images/poc-environment-model.svg +61 -0
  73. package/assets/generated/deployment/src/project_forge_deployment/__init__.py +3 -0
  74. package/assets/generated/deployment/src/project_forge_deployment/__main__.py +3 -0
  75. package/assets/generated/deployment/src/project_forge_deployment/app_cli.py +163 -0
  76. package/assets/generated/deployment/src/project_forge_deployment/app_runtime.py +455 -0
  77. package/assets/generated/deployment/src/project_forge_deployment/app_runtime_remote.py +416 -0
  78. package/assets/generated/deployment/src/project_forge_deployment/app_runtime_workstation.py +136 -0
  79. package/assets/generated/deployment/src/project_forge_deployment/box_platform.py +208 -0
  80. package/assets/generated/deployment/src/project_forge_deployment/box_platform_assets.py +100 -0
  81. package/assets/generated/deployment/src/project_forge_deployment/box_platform_remote.py +271 -0
  82. package/assets/generated/deployment/src/project_forge_deployment/cli.py +437 -0
  83. package/assets/generated/deployment/src/project_forge_deployment/doctor.py +121 -0
  84. package/assets/generated/deployment/src/project_forge_deployment/entrypoint.py +37 -0
  85. package/assets/generated/deployment/src/project_forge_deployment/environment_cli.py +271 -0
  86. package/assets/generated/deployment/src/project_forge_deployment/environment_probe.py +228 -0
  87. package/assets/generated/deployment/src/project_forge_deployment/errors.py +5 -0
  88. package/assets/generated/deployment/src/project_forge_deployment/home_lab.py +328 -0
  89. package/assets/generated/deployment/src/project_forge_deployment/image_transfer.py +105 -0
  90. package/assets/generated/deployment/src/project_forge_deployment/keys.py +171 -0
  91. package/assets/generated/deployment/src/project_forge_deployment/local_cli.py +189 -0
  92. package/assets/generated/deployment/src/project_forge_deployment/local_runtime.py +526 -0
  93. package/assets/generated/deployment/src/project_forge_deployment/local_spec.py +82 -0
  94. package/assets/generated/deployment/src/project_forge_deployment/local_sqlite.py +205 -0
  95. package/assets/generated/deployment/src/project_forge_deployment/portable_profile.py +181 -0
  96. package/assets/generated/deployment/src/project_forge_deployment/profile_migration.py +70 -0
  97. package/assets/generated/deployment/src/project_forge_deployment/profile_repository.py +348 -0
  98. package/assets/generated/deployment/src/project_forge_deployment/profiles.py +204 -0
  99. package/assets/generated/deployment/src/project_forge_deployment/registry_access.py +114 -0
  100. package/assets/generated/deployment/src/project_forge_deployment/registry_cli.py +51 -0
  101. package/assets/generated/deployment/src/project_forge_deployment/route_registry.py +367 -0
  102. package/assets/generated/deployment/src/project_forge_deployment/route_registry_remote.py +443 -0
  103. package/assets/generated/deployment/src/project_forge_deployment/security.py +290 -0
  104. package/assets/generated/deployment/src/project_forge_deployment/sqlite_adapter.py +335 -0
  105. package/assets/generated/deployment/src/project_forge_deployment/sqlite_adapter_remote.py +340 -0
  106. package/assets/generated/deployment/src/project_forge_deployment/sqlite_cli.py +86 -0
  107. package/assets/generated/deployment/src/project_forge_deployment/sqlite_import_recovery.py +437 -0
  108. package/assets/generated/deployment/src/project_forge_deployment/ssh.py +119 -0
  109. package/assets/generated/deployment/src/project_forge_deployment/teardown.py +300 -0
  110. package/assets/generated/deployment/src/project_forge_deployment/teardown_cli.py +139 -0
  111. package/assets/generated/deployment/src/project_forge_deployment/teardown_remote.py +100 -0
  112. package/assets/generated/deployment/src/project_forge_deployment/trust.py +278 -0
  113. package/bin/project-forge.mjs +9 -0
  114. package/package.json +31 -4
  115. package/src/cli.mjs +150 -0
  116. package/src/engine.mjs +243 -0
  117. package/src/package-data.mjs +18 -0
@@ -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 Project Forge 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,174 @@
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 and lab routing
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
+ For database learning, use `/coach` for concept teaching, adaptive questioning, gap assessment, and interview pressure. When the task needs concrete repository/database evidence — schema exploration, ORM-to-SQL tracing, query plans, migrations, database debugging, query-to-ERD highlighting, or database-change impact — route to `/db-lab` when that skill is installed.
68
+
69
+ For system-design learning, use `/coach` for concepts, mental models, adaptive questioning, tradeoff practice, and interview pressure. When the task needs concrete repository/system evidence — architecture/components, runtime scenarios, APIs, dependencies, messaging, failure behavior, capacity/performance, observability, security, deployment, testing, architecture-change impact, or an interactive system view — route to `/system-lab` when installed.
70
+
71
+ `/db-lab` and `/system-lab` are sibling evidence labs. Do not duplicate a database query-plan deep dive in System Lab or a system-wide availability discussion in Database Lab when the other lab is available.
72
+
73
+ ## 5. Continuous adaptive cadence
74
+
75
+ ```text
76
+ question
77
+ → human answer
78
+ → critique/teach
79
+ → next material question
80
+ ```
81
+
82
+ Do not repeatedly ask whether to continue.
83
+
84
+ Adapt difficulty:
85
+ - weak answer: teach missing mental model, simplify, ask for own-words explanation;
86
+ - solid: apply/edge case;
87
+ - strong: tradeoff/debug/design;
88
+ - very strong: interviewer pressure or changed scale/assumptions.
89
+
90
+ For advanced database/system-design work, prefer **prediction before reveal** when practical: ask what the learner expects from a plan, failure, scale change, duplicate message, timeout, or architecture perturbation before showing the strongest evidence. Do not force quiz mode when the learner explicitly wants explanation first.
91
+
92
+ ## 6. Mode guidance
93
+
94
+ Concept:
95
+
96
+ ```text
97
+ definition → repository/example → diagram if useful → check understanding → application
98
+ ```
99
+
100
+ Debugging:
101
+
102
+ ```text
103
+ symptom → hypotheses → distinguishing evidence → root cause → fix concept → prevention
104
+ ```
105
+
106
+ Do not implement the fix during Coach mode.
107
+
108
+ Coding/DSA:
109
+
110
+ ```text
111
+ problem → clarifying questions → approach → complexity → code → edge cases/tests → hints → alternatives → feedback
112
+ ```
113
+
114
+ Do not reveal the solution immediately.
115
+
116
+ SQL/database:
117
+
118
+ ```text
119
+ requirements/schema/query problem
120
+ → human models or writes SQL
121
+ → correctness
122
+ → edge cases/invariants
123
+ → access patterns + indexing/query plan
124
+ → transactions/concurrency when relevant
125
+ → ORM translation when useful
126
+ → design/interview defense
127
+ ```
128
+
129
+ Treat relational modeling, constraints, normalization, querying, indexes/plans, transactions, ORM translation, migrations, debugging, and design defense as separate competencies rather than one SQL score. Prefer `/db-lab` for hands-on evidence.
130
+
131
+ System design:
132
+
133
+ ```text
134
+ requirements + constraints
135
+ → learner states assumptions
136
+ → architecture/API/data choices
137
+ → runtime/data/event trace
138
+ → failure + consistency reasoning
139
+ → capacity/latency/scaling
140
+ → security/observability/deployment/testing
141
+ → alternatives + why-not questions
142
+ → changed constraint / evolution
143
+ → design defense
144
+ ```
145
+
146
+ Treat requirements framing, capacity, API design, decomposition, data/storage, caching, messaging, consistency, scaling, availability, performance, deployment, observability, security, cost/complexity, evolution, incident/debugging, testing strategy, tradeoff defense, and interview communication as separate competencies rather than one system-design score. Prefer `/system-lab` for hands-on evidence.
147
+
148
+ Challenge cargo-cult complexity. Ask credible questions such as `Why not keep the monolith?`, `Why not use the existing relational database?`, `Why not make this synchronous?`, `Why not avoid the cache?`, `Why not wait to shard?`, or `What evidence justifies this queue/service?`.
149
+
150
+ Interview drill: critique correctness, depth, credibility, structure, concision, overstatement, adaptability to changed constraints, and missed follow-ups.
151
+
152
+ ## 7. Diagrams/resources
153
+
154
+ 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.
155
+
156
+ When `/db-lab` or `/system-lab` provides an interactive view, treat it as a disposable projection of current evidence, not a source of truth. The lab should re-discover current evidence when invoked so the human does not need to maintain or manually refresh learning diagrams.
157
+
158
+ 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.
159
+
160
+ ## 8. Optional learning progress
161
+
162
+ Only update a learning-progress tracker when the human explicitly chooses to do so. Skipping it has no engineering impact.
163
+
164
+ A generated lab artifact or completed walkthrough is evidence of learning activity, not automatic mastery. Record demonstrated understanding conservatively and by competency when depth matters.
165
+
166
+ ## 9. Credibility
167
+
168
+ For interview/portfolio discussion distinguish:
169
+ - actually implemented/used,
170
+ - AI-generated but reviewed/understood,
171
+ - studied/practiced,
172
+ - not yet understood.
173
+
174
+ Never manufacture professional experience.
@@ -0,0 +1,197 @@
1
+ ---
2
+ name: code-walkthrough
3
+ description: "Read-only guided walkthrough of an implementation diff, explaining changed files functionally and technically with optional deeper coaching, tracing, diagrams, quizzes, debugging discussion, and interview practice."
4
+ argument-hint: "[work-item|PR|commit|current] [light|focused|deep]"
5
+ user-invocable: true
6
+ disable-model-invocation: true
7
+ ---
8
+
9
+ # Code Walkthrough
10
+
11
+ Purpose: help the developer understand an actual implementation by walking through the changed files in a sensible order and connecting functional behavior to technical design.
12
+
13
+ `/code-walkthrough` is optional, read-only, and never blocks review, delivery, merge, or work-item completion.
14
+
15
+ ## 1. Boundaries
16
+
17
+ - Do not edit production code or tests.
18
+ - Do not implement fixes during the walkthrough.
19
+ - Do not commit, push, merge, or modify a PR.
20
+ - Do not update learning-progress files unless the human explicitly chooses that after the walkthrough.
21
+ - Do not invoke subagents.
22
+ - Do not silently broaden the implementation scope.
23
+ - Do not pin/request/switch to a premium model automatically.
24
+ - Distinguish observed implementation evidence from assumptions.
25
+ - Distinguish AI-generated code, developer-reviewed understanding, study, and actual implementation experience when credibility matters.
26
+
27
+ If a bug, design concern, or missing test is discovered, explain it and offer a return to the normal implementation/review workflow. Do not fix it while in walkthrough mode.
28
+
29
+ ## 2. Resolve the change set
30
+
31
+ Use Git/GitHub evidence as the source of truth. VS Code Source Control/diff views are visual aids, not workflow state.
32
+
33
+ Resolve in this order when possible:
34
+
35
+ ```text
36
+ explicit PR / commit / ref
37
+ → work-item-associated branch or PR supported by evidence
38
+ → current feature branch versus the merge-base of the configured default branch
39
+ → current staged/unstaged tracked changes
40
+ → ask one concise scope question when materially ambiguous
41
+ ```
42
+
43
+ For an explicit PR, use the PR base/head change set and do not silently mix unrelated local changes.
44
+
45
+ For an active feature branch, prefer the branch change from the default-branch merge base. Identify relevant tracked working changes and call out untracked files explicitly rather than silently omitting them.
46
+
47
+ For merged work, use the PR, merge commit, or explicit historical commit range.
48
+
49
+ Never invent branch, work-item, PR, or commit associations.
50
+
51
+ ## 3. Depth
52
+
53
+ ```text
54
+ Light — what changed, why, and major connections
55
+ Focused — default; behavior, important mechanics, relationships, tests, and learning hooks
56
+ Deep — important methods/blocks, state/data flow, dependencies, edge cases, failure modes, tests, and tradeoffs
57
+ ```
58
+
59
+ Depth may vary by file. Treat trivial configuration lightly unless it materially affects behavior; spend more depth on implementation anchors.
60
+
61
+ ## 4. Build the walkthrough plan
62
+
63
+ Before explaining the first file:
64
+
65
+ 1. identify the changed files and change types,
66
+ 2. read only enough work-item/requirements context to understand intended behavior,
67
+ 3. identify likely implementation anchors and relationships,
68
+ 4. order files for understanding rather than alphabetically,
69
+ 5. present a concise plan and start with the first meaningful file.
70
+
71
+ Use repository architecture rather than a fixed stack assumption. A common web-application order may be:
72
+
73
+ ```text
74
+ domain/data model
75
+ → persistence
76
+ → service/business logic
77
+ → API/controller
78
+ → client model/service/state
79
+ → UI/component
80
+ → tests near the behavior they verify
81
+ → configuration/operational files
82
+ ```
83
+
84
+ An event-driven or systems repository may require a different path. Infer from actual imports, references, paths, changed symbols, tests, and architecture.
85
+
86
+ ## 5. Per-file walkthrough
87
+
88
+ For each meaningful changed file, cover only what is useful:
89
+
90
+ ```text
91
+ FILE <n> OF <total>
92
+ <path>
93
+
94
+ ROLE
95
+ Why this file exists in the system.
96
+
97
+ FUNCTIONAL CHANGE
98
+ What behavior or capability changed.
99
+
100
+ TECHNICAL CHANGE
101
+ Important classes/functions/data structures/framework mechanisms and how they changed.
102
+
103
+ HOW THIS CONNECTS
104
+ Upstream/downstream callers, data flow, state flow, persistence, UI, events, or other dependencies.
105
+
106
+ WHY THIS DESIGN
107
+ Important choice, convention, or tradeoff when evidence supports it.
108
+
109
+ TESTING
110
+ Relevant tests/evidence and what they do or do not prove. Never claim a test passed unless execution evidence was observed.
111
+
112
+ LEARNING HOOKS
113
+ Concepts worth understanding more deeply.
114
+ ```
115
+
116
+ For change types:
117
+ - new file: explain why the responsibility now exists;
118
+ - modified file: explain meaningful before-versus-after behavior;
119
+ - deleted file: explain what responsibility disappeared or moved;
120
+ - renamed/moved file: distinguish structural movement from behavioral change.
121
+
122
+ Group trivial generated/configuration changes when that improves learning, but do not hide behaviorally important files.
123
+
124
+ ## 6. Guided navigation
125
+
126
+ Default to one file or one tightly related file group at a time. Do not dump the whole implementation at once.
127
+
128
+ At a natural file boundary, show a compact navigation cue such as:
129
+
130
+ ```text
131
+ NEXT: <suggested file>
132
+ Use: next | deeper | explain this | trace | why this design | diagram | quiz | debug | interview | skip | stop
133
+ ```
134
+
135
+ Interpret these naturally:
136
+ - `next` — continue to the suggested next file;
137
+ - `deeper` — increase depth for the current file/topic;
138
+ - `explain this` — focus on the selected/current method, block, symbol, or diff hunk;
139
+ - `trace` — follow request/data/state/event flow across files;
140
+ - `why this design` — discuss alternatives and tradeoffs grounded in repository context;
141
+ - `diagram` — use an ephemeral Mermaid diagram when useful;
142
+ - `quiz` — briefly switch to adaptive Coach-style understanding questions;
143
+ - `debug` — discuss likely failure modes, evidence, and debugging approach without implementing a fix;
144
+ - `interview` — practice explaining or defending the implementation credibly;
145
+ - `skip` — cover the current file lightly and move on;
146
+ - `stop` — end without affecting engineering status.
147
+
148
+ Do not repeatedly ask whether to continue when the next action is obvious.
149
+
150
+ ## 7. Tracing and learning depth
151
+
152
+ When tracing, connect actual call/data/state flow. Example shape only:
153
+
154
+ ```text
155
+ UI/input
156
+ → client/service
157
+ → API/handler
158
+ → application/service logic
159
+ → persistence/event/system boundary
160
+ → response/result
161
+ ```
162
+
163
+ Map deeper exploration to the shared learning levels when useful:
164
+
165
+ ```text
166
+ L1 Recognize
167
+ L2 Explain
168
+ L3 Trace
169
+ L4 Apply / Debug
170
+ L5 Defend / Design
171
+ L6 Interview Ready
172
+ ```
173
+
174
+ Use `/coach` for broader concept learning and `/learning-review` for structured assessment after the walkthrough.
175
+
176
+ ## 8. Completion
177
+
178
+ When the planned change set is covered or the human stops, summarize:
179
+
180
+ - end-to-end implementation flow,
181
+ - major functional changes,
182
+ - important technical decisions and connections,
183
+ - concepts explored deeply versus lightly,
184
+ - tests/evidence actually observed,
185
+ - learning gaps or topics worth revisiting,
186
+ - optional next learning actions.
187
+
188
+ Offer only relevant next choices, such as:
189
+
190
+ ```text
191
+ 1. /learning-review <same scope> [READ ONLY]
192
+ 2. /coach <specific concept> [READ ONLY]
193
+ 3. Return to engineering workflow [NO ACTION]
194
+ 4. Stop [NO ACTION]
195
+ ```
196
+
197
+ Do not create a new engineering state such as `CODE_WALKTHROUGH_PENDING`. Walkthrough completion is learning evidence, not a delivery gate.