@hassangameryt/freeflow 0.2.0 → 0.4.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 (312) hide show
  1. package/.agents/plugins/marketplace.json +1 -1
  2. package/.claude-plugin/marketplace.json +4 -4
  3. package/{plugins/freeflow/.claude-plugin → .claude-plugin}/plugin.json +5 -2
  4. package/{plugins/freeflow/.codex-plugin → .codex-plugin}/plugin.json +8 -9
  5. package/README.md +194 -127
  6. package/assets/feedback-loop.png +0 -0
  7. package/assets/freeflow-plugin-icon.png +0 -0
  8. package/assets/freeflow_workflow_map.png +0 -0
  9. package/assets/workflow.png +0 -0
  10. package/command-surface.json +129 -0
  11. package/hooks/freeflow-runtime-context.mjs +419 -0
  12. package/hooks/tests/check-runtime-context-hook.sh +223 -0
  13. package/package.json +41 -22
  14. package/pi-extension/dist/index.js +269 -0
  15. package/pi-extension/dist/integrations/mcp-config.js +29 -0
  16. package/pi-extension/dist/output-router/host-producer-identification.js +232 -0
  17. package/pi-extension/dist/output-router/native-safety-net.js +216 -0
  18. package/pi-extension/dist/output-router/observed-tool-routing.js +122 -0
  19. package/pi-extension/dist/output-router/renderers.js +1023 -0
  20. package/pi-extension/dist/output-router/router-tools.js +554 -0
  21. package/pi-extension/dist/output-router/schemas.js +383 -0
  22. package/pi-extension/dist/output-router/status.js +744 -0
  23. package/pi-extension/dist/output-router/utils.js +502 -0
  24. package/pi-extension/dist/runtime/runtime-context.js +798 -0
  25. package/pi-extension/dist/settings/settings-tui.js +314 -0
  26. package/pi-extension/dist/settings/settings-ui.js +1487 -0
  27. package/pi-extension/freeflow/index.js +1 -0
  28. package/pi-extension/src/index.ts +295 -0
  29. package/pi-extension/src/integrations/mcp-config.ts +32 -0
  30. package/pi-extension/src/output-router/host-producer-identification.ts +256 -0
  31. package/pi-extension/src/output-router/native-safety-net.ts +248 -0
  32. package/pi-extension/src/output-router/observed-tool-routing.ts +134 -0
  33. package/pi-extension/src/output-router/renderers.ts +1108 -0
  34. package/pi-extension/src/output-router/router-tools.ts +579 -0
  35. package/pi-extension/src/output-router/schemas.ts +387 -0
  36. package/pi-extension/src/output-router/status.ts +791 -0
  37. package/pi-extension/src/output-router/utils.ts +554 -0
  38. package/pi-extension/src/runtime/runtime-context.ts +895 -0
  39. package/pi-extension/src/settings/settings-tui.ts +408 -0
  40. package/pi-extension/src/settings/settings-ui.ts +1730 -0
  41. package/pi-extension/tests/integration/pi-extension.test.js +4018 -0
  42. package/pi-extension/tests/output-router/observed-producers.test.js +132 -0
  43. package/pi-extension/tests/output-router/search.test.js +722 -0
  44. package/pi-extension/tests/settings/settings-tui.test.js +243 -0
  45. package/pi-extension/tsconfig.json +16 -0
  46. package/{plugins/freeflow/router/dist → router/dist/benchmarks}/benchmark-harness.d.ts +16 -13
  47. package/router/dist/benchmarks/benchmark-harness.js +92 -0
  48. package/router/dist/benchmarks/benchmarks.d.ts +109 -0
  49. package/router/dist/benchmarks/benchmarks.js +979 -0
  50. package/router/dist/benchmarks/codex-qa-benchmarks.d.ts +95 -0
  51. package/router/dist/benchmarks/codex-qa-benchmarks.js +500 -0
  52. package/router/dist/benchmarks/command-benchmarks.d.ts +143 -0
  53. package/router/dist/benchmarks/command-benchmarks.js +698 -0
  54. package/router/dist/benchmarks/context-mode-normalized-benchmarks.d.ts +82 -0
  55. package/router/dist/benchmarks/context-mode-normalized-benchmarks.js +773 -0
  56. package/router/dist/benchmarks/context-mode-real-deep-benchmark.d.ts +132 -0
  57. package/router/dist/benchmarks/context-mode-real-deep-benchmark.js +1380 -0
  58. package/router/dist/benchmarks/context-saving-baseline.d.ts +60 -0
  59. package/router/dist/benchmarks/context-saving-baseline.js +470 -0
  60. package/router/dist/benchmarks/index-benchmarks.d.ts +103 -0
  61. package/router/dist/benchmarks/index-benchmarks.js +862 -0
  62. package/router/dist/benchmarks/storage-policy-benchmarks.d.ts +101 -0
  63. package/router/dist/benchmarks/storage-policy-benchmarks.js +618 -0
  64. package/router/dist/benchmarks/vault-index-benchmarks.d.ts +56 -0
  65. package/router/dist/benchmarks/vault-index-benchmarks.js +322 -0
  66. package/router/dist/config/config.d.ts +103 -0
  67. package/router/dist/config/config.js +632 -0
  68. package/{plugins/freeflow/router/dist → router/dist/config}/router-contract.d.ts +2 -2
  69. package/router/dist/config/router-contract.js +54 -0
  70. package/{plugins/freeflow/router/dist → router/dist/config}/schema.d.ts +19 -10
  71. package/router/dist/config/schema.js +648 -0
  72. package/router/dist/config/types.d.ts +573 -0
  73. package/router/dist/config/types.js +41 -0
  74. package/router/dist/evidence/bounded-evidence.d.ts +40 -0
  75. package/router/dist/evidence/bounded-evidence.js +323 -0
  76. package/router/dist/evidence/evidence-range-selector.d.ts +24 -0
  77. package/router/dist/evidence/evidence-range-selector.js +232 -0
  78. package/router/dist/evidence/evidence-search.d.ts +27 -0
  79. package/router/dist/evidence/evidence-search.js +490 -0
  80. package/{plugins/freeflow/router/dist → router/dist/evidence}/evidence.d.ts +18 -18
  81. package/router/dist/evidence/evidence.js +200 -0
  82. package/router/dist/evidence/failure-contracts.d.ts +37 -0
  83. package/router/dist/evidence/failure-contracts.js +166 -0
  84. package/router/dist/evidence/line-ranges.d.ts +24 -0
  85. package/router/dist/evidence/line-ranges.js +22 -0
  86. package/router/dist/experiments/local-index.d.ts +64 -0
  87. package/router/dist/experiments/local-index.js +581 -0
  88. package/router/dist/index.d.ts +30 -0
  89. package/router/dist/index.js +32 -0
  90. package/router/dist/local/local-traversal.d.ts +18 -0
  91. package/router/dist/local/local-traversal.js +334 -0
  92. package/router/dist/processing/engine.d.ts +132 -0
  93. package/router/dist/processing/engine.js +533 -0
  94. package/router/dist/processing/reducers.d.ts +280 -0
  95. package/router/dist/processing/reducers.js +1673 -0
  96. package/router/dist/processing/renderers.d.ts +31 -0
  97. package/router/dist/processing/renderers.js +195 -0
  98. package/router/dist/processing/scripts.d.ts +91 -0
  99. package/router/dist/processing/scripts.js +386 -0
  100. package/{plugins/freeflow/router/dist → router/dist/repo}/repo-traversal.d.ts +9 -9
  101. package/router/dist/repo/repo-traversal.js +245 -0
  102. package/router/dist/routing/observed-reducers.d.ts +41 -0
  103. package/router/dist/routing/observed-reducers.js +661 -0
  104. package/router/dist/routing/observed-routing.d.ts +26 -0
  105. package/router/dist/routing/observed-routing.js +378 -0
  106. package/router/dist/routing/parsers.d.ts +16 -0
  107. package/router/dist/routing/parsers.js +521 -0
  108. package/router/dist/routing/run-filters.d.ts +60 -0
  109. package/router/dist/routing/run-filters.js +238 -0
  110. package/router/dist/routing/run-reducers.d.ts +49 -0
  111. package/router/dist/routing/run-reducers.js +122 -0
  112. package/router/dist/sandbox/adapter-roots.d.ts +46 -0
  113. package/router/dist/sandbox/adapter-roots.js +66 -0
  114. package/router/dist/sandbox/eryx-python-adapter.d.ts +13 -0
  115. package/router/dist/sandbox/eryx-python-adapter.js +868 -0
  116. package/router/dist/sandbox/jq-wasm-adapter.d.ts +9 -0
  117. package/router/dist/sandbox/jq-wasm-adapter.js +429 -0
  118. package/router/dist/sandbox/quickjs-wasi-adapter.d.ts +13 -0
  119. package/router/dist/sandbox/quickjs-wasi-adapter.js +384 -0
  120. package/router/dist/sandbox/script-sandbox.d.ts +134 -0
  121. package/router/dist/sandbox/script-sandbox.js +337 -0
  122. package/router/dist/setup/script-transform-adapters.d.ts +32 -0
  123. package/router/dist/setup/script-transform-adapters.js +278 -0
  124. package/router/dist/tools/batch.d.ts +33 -0
  125. package/router/dist/tools/batch.js +586 -0
  126. package/router/dist/tools/run.d.ts +62 -0
  127. package/router/dist/tools/run.js +1304 -0
  128. package/router/dist/tools/search.d.ts +66 -0
  129. package/router/dist/tools/search.js +1364 -0
  130. package/router/dist/transform/engine.d.ts +168 -0
  131. package/router/dist/transform/engine.js +2072 -0
  132. package/router/dist/vault/vault-index.d.ts +125 -0
  133. package/router/dist/vault/vault-index.js +416 -0
  134. package/router/dist/vault/vault.d.ts +138 -0
  135. package/router/dist/vault/vault.js +630 -0
  136. package/runtime/interaction-contract.md +16 -0
  137. package/skills/bypass/SKILL.md +82 -0
  138. package/skills/commit-work/SKILL.md +106 -0
  139. package/skills/commit-work/references/staging-decisions.md +73 -0
  140. package/skills/decision-gate/SKILL.md +48 -0
  141. package/skills/design-for-depth/SKILL.md +106 -0
  142. package/skills/design-for-depth/references/design-pressure-signals.md +314 -0
  143. package/skills/design-for-depth/references/interface-design-loop.md +156 -0
  144. package/skills/design-for-depth/references/software-design-philosophy.md +248 -0
  145. package/skills/diagnose-failure/SKILL.md +105 -0
  146. package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +36 -0
  147. package/skills/diagnose-failure/references/flaky-and-performance.md +43 -0
  148. package/skills/discuss/SKILL.md +121 -0
  149. package/skills/discuss/references/checkpoints.md +66 -0
  150. package/skills/evaluate-skill/SKILL.md +105 -0
  151. package/skills/evaluate-skill/references/definition-schema.md +345 -0
  152. package/skills/evaluate-skill/references/evaluation-design.md +86 -0
  153. package/skills/evaluate-skill/references/execution-and-evidence.md +85 -0
  154. package/skills/evaluate-skill/references/review-and-revision.md +51 -0
  155. package/skills/evaluate-skill/scripts/lib/definitions.mjs +296 -0
  156. package/skills/evaluate-skill/scripts/lib/evidence.mjs +46 -0
  157. package/skills/evaluate-skill/scripts/lib/grade-comparison.mjs +60 -0
  158. package/skills/evaluate-skill/scripts/lib/grade-interaction.mjs +148 -0
  159. package/skills/evaluate-skill/scripts/lib/grade-support.mjs +126 -0
  160. package/skills/evaluate-skill/scripts/lib/grade-workspace.mjs +192 -0
  161. package/skills/evaluate-skill/scripts/lib/grade.mjs +56 -0
  162. package/skills/evaluate-skill/scripts/lib/pi.mjs +489 -0
  163. package/skills/evaluate-skill/scripts/lib/process.mjs +79 -0
  164. package/skills/evaluate-skill/scripts/lib/rpc.mjs +444 -0
  165. package/skills/evaluate-skill/scripts/lib/runner.mjs +346 -0
  166. package/skills/evaluate-skill/scripts/lib/sandbox.mjs +409 -0
  167. package/skills/evaluate-skill/scripts/lib/view.mjs +337 -0
  168. package/skills/evaluate-skill/scripts/pi-guard.mjs +164 -0
  169. package/skills/evaluate-skill/scripts/skill-eval.mjs +101 -0
  170. package/skills/execute-work/SKILL.md +99 -0
  171. package/skills/execute-work/references/code-practices.md +78 -0
  172. package/skills/execute-work/references/execution-loop.md +77 -0
  173. package/skills/finish-branch/SKILL.md +117 -0
  174. package/skills/finish-branch/references/integration-options.md +80 -0
  175. package/skills/handoff/SKILL.md +92 -0
  176. package/skills/handoff/references/templates.md +141 -0
  177. package/skills/launch-work/SKILL.md +116 -0
  178. package/skills/launch-work/references/launch-readiness.md +85 -0
  179. package/skills/migration-work/SKILL.md +115 -0
  180. package/skills/migration-work/references/migration-lifecycle.md +82 -0
  181. package/skills/mode-contract/SKILL.md +82 -0
  182. package/skills/output-router/SKILL.md +206 -0
  183. package/skills/output-router/references/safety-policy.md +40 -0
  184. package/skills/release-work/SKILL.md +118 -0
  185. package/skills/release-work/references/release-evidence.md +78 -0
  186. package/skills/review-artifact/SKILL.md +126 -0
  187. package/skills/review-artifact/references/reviewer-prompt.md +148 -0
  188. package/skills/review-work/SKILL.md +126 -0
  189. package/skills/review-work/references/reviewer-prompt.md +134 -0
  190. package/skills/review-work/references/security-risk-lens.md +67 -0
  191. package/skills/setup-freeflow/SKILL.md +98 -0
  192. package/skills/setup-freeflow/references/activation-contract.md +120 -0
  193. package/skills/setup-freeflow/references/host-setup.md +72 -0
  194. package/skills/setup-freeflow/references/output-router-setup.md +110 -0
  195. package/skills/simplify-code/SKILL.md +80 -0
  196. package/skills/simplify-code/references/simplification-patterns.md +70 -0
  197. package/skills/tdd/SKILL.md +96 -0
  198. package/skills/tdd/references/test-design.md +96 -0
  199. package/skills/track-work/SKILL.md +84 -0
  200. package/skills/track-work/references/working-record-schema.md +378 -0
  201. package/skills/verify-work/SKILL.md +85 -0
  202. package/skills/verify-work/references/browser-runtime-evidence.md +55 -0
  203. package/skills/verify-work/references/integration-evidence.md +51 -0
  204. package/skills/verify-work/references/performance-evidence.md +57 -0
  205. package/skills/workflow/SKILL.md +91 -0
  206. package/skills/workflow/references/domain-skill-composition.md +57 -0
  207. package/skills/workflow/references/workflow-loop.md +92 -0
  208. package/skills/write-plan/SKILL.md +123 -0
  209. package/skills/write-plan/references/plan-shapes.md +156 -0
  210. package/skills/write-skill/SKILL.md +119 -0
  211. package/skills/write-skill/references/activation-boundaries.md +62 -0
  212. package/skills/write-skill/references/agent-first-instructions.md +87 -0
  213. package/skills/write-skill/references/progressive-disclosure.md +63 -0
  214. package/skills/write-skill/scripts/lib/skill-author.mjs +653 -0
  215. package/skills/write-skill/scripts/skill-author.mjs +104 -0
  216. package/skills/write-spec/SKILL.md +104 -0
  217. package/skills/write-spec/references/artifact-standards.md +86 -0
  218. package/skills/write-spec/references/decision-records.md +77 -0
  219. package/skills/write-spec/references/spec-shapes.md +128 -0
  220. package/plugins/freeflow/command-surface.json +0 -77
  221. package/plugins/freeflow/docs/README.md +0 -40
  222. package/plugins/freeflow/docs/adr/0001-three-modes.md +0 -27
  223. package/plugins/freeflow/docs/adr/0002-evals-before-hooks.md +0 -17
  224. package/plugins/freeflow/docs/adr/0003-release-boundary.md +0 -21
  225. package/plugins/freeflow/docs/adr/0004-research-replaces-shallow-discovery-skills.md +0 -26
  226. package/plugins/freeflow/docs/adr/README.md +0 -8
  227. package/plugins/freeflow/docs/architecture.md +0 -86
  228. package/plugins/freeflow/docs/output-router.md +0 -212
  229. package/plugins/freeflow/docs/release-evidence.md +0 -69
  230. package/plugins/freeflow/docs/skills.md +0 -43
  231. package/plugins/freeflow/docs/workflow.md +0 -57
  232. package/plugins/freeflow/hooks/freeflow-runtime-context.mjs +0 -257
  233. package/plugins/freeflow/pi-extension/index.js +0 -1176
  234. package/plugins/freeflow/router/dist/benchmark-harness.js +0 -92
  235. package/plugins/freeflow/router/dist/benchmarks.d.ts +0 -102
  236. package/plugins/freeflow/router/dist/benchmarks.js +0 -880
  237. package/plugins/freeflow/router/dist/bounded-evidence.d.ts +0 -40
  238. package/plugins/freeflow/router/dist/bounded-evidence.js +0 -310
  239. package/plugins/freeflow/router/dist/codex-qa-benchmarks.d.ts +0 -91
  240. package/plugins/freeflow/router/dist/codex-qa-benchmarks.js +0 -461
  241. package/plugins/freeflow/router/dist/command-benchmarks.d.ts +0 -128
  242. package/plugins/freeflow/router/dist/command-benchmarks.js +0 -652
  243. package/plugins/freeflow/router/dist/config.d.ts +0 -22
  244. package/plugins/freeflow/router/dist/config.js +0 -114
  245. package/plugins/freeflow/router/dist/evidence-range-selector.d.ts +0 -22
  246. package/plugins/freeflow/router/dist/evidence-range-selector.js +0 -180
  247. package/plugins/freeflow/router/dist/evidence-search.d.ts +0 -25
  248. package/plugins/freeflow/router/dist/evidence-search.js +0 -450
  249. package/plugins/freeflow/router/dist/evidence.js +0 -196
  250. package/plugins/freeflow/router/dist/experimental-local-index.d.ts +0 -1
  251. package/plugins/freeflow/router/dist/experimental-local-index.js +0 -1
  252. package/plugins/freeflow/router/dist/experiments/local-index.d.ts +0 -58
  253. package/plugins/freeflow/router/dist/experiments/local-index.js +0 -562
  254. package/plugins/freeflow/router/dist/index-benchmarks.d.ts +0 -84
  255. package/plugins/freeflow/router/dist/index-benchmarks.js +0 -458
  256. package/plugins/freeflow/router/dist/index.d.ts +0 -12
  257. package/plugins/freeflow/router/dist/index.js +0 -12
  258. package/plugins/freeflow/router/dist/line-ranges.d.ts +0 -22
  259. package/plugins/freeflow/router/dist/line-ranges.js +0 -22
  260. package/plugins/freeflow/router/dist/parsers.d.ts +0 -16
  261. package/plugins/freeflow/router/dist/parsers.js +0 -473
  262. package/plugins/freeflow/router/dist/repo-traversal.js +0 -242
  263. package/plugins/freeflow/router/dist/retrieve.d.ts +0 -33
  264. package/plugins/freeflow/router/dist/retrieve.js +0 -855
  265. package/plugins/freeflow/router/dist/router-contract.js +0 -54
  266. package/plugins/freeflow/router/dist/run.d.ts +0 -26
  267. package/plugins/freeflow/router/dist/run.js +0 -356
  268. package/plugins/freeflow/router/dist/schema.js +0 -354
  269. package/plugins/freeflow/router/dist/types.d.ts +0 -234
  270. package/plugins/freeflow/router/dist/types.js +0 -9
  271. package/plugins/freeflow/router/dist/vault.d.ts +0 -80
  272. package/plugins/freeflow/router/dist/vault.js +0 -484
  273. package/plugins/freeflow/skills/bypass/SKILL.md +0 -68
  274. package/plugins/freeflow/skills/commit-work/SKILL.md +0 -98
  275. package/plugins/freeflow/skills/commit-work/references/staging-decisions.md +0 -51
  276. package/plugins/freeflow/skills/diagnose-failure/SKILL.md +0 -95
  277. package/plugins/freeflow/skills/diagnose-failure/references/feedback-loop-catalog.md +0 -25
  278. package/plugins/freeflow/skills/diagnose-failure/references/flaky-and-performance.md +0 -31
  279. package/plugins/freeflow/skills/evaluate-skill/SKILL.md +0 -96
  280. package/plugins/freeflow/skills/evaluate-skill/references/eval-patterns.md +0 -41
  281. package/plugins/freeflow/skills/evaluate-skill/references/grading-priority.md +0 -33
  282. package/plugins/freeflow/skills/execute-plan/SKILL.md +0 -132
  283. package/plugins/freeflow/skills/execute-plan/references/execution-map.md +0 -122
  284. package/plugins/freeflow/skills/handoff/SKILL.md +0 -66
  285. package/plugins/freeflow/skills/handoff/references/templates.md +0 -64
  286. package/plugins/freeflow/skills/interview-gate/SKILL.md +0 -90
  287. package/plugins/freeflow/skills/mode-contract/SKILL.md +0 -79
  288. package/plugins/freeflow/skills/output-router/SKILL.md +0 -69
  289. package/plugins/freeflow/skills/output-router/references/safety-policy.md +0 -33
  290. package/plugins/freeflow/skills/research/ARTIFACT-DESTINATIONS.md +0 -58
  291. package/plugins/freeflow/skills/research/CHECKPOINTS.md +0 -74
  292. package/plugins/freeflow/skills/research/LANGUAGE.md +0 -61
  293. package/plugins/freeflow/skills/research/SKILL.md +0 -128
  294. package/plugins/freeflow/skills/review-artifact/SKILL.md +0 -115
  295. package/plugins/freeflow/skills/review-artifact/references/reviewer-prompt.md +0 -56
  296. package/plugins/freeflow/skills/review-work/SKILL.md +0 -96
  297. package/plugins/freeflow/skills/review-work/references/reviewer-prompt.md +0 -97
  298. package/plugins/freeflow/skills/setup-freeflow/SKILL.md +0 -94
  299. package/plugins/freeflow/skills/setup-freeflow/references/activation-contract.md +0 -99
  300. package/plugins/freeflow/skills/setup-freeflow/references/host-setup.md +0 -35
  301. package/plugins/freeflow/skills/setup-freeflow/references/output-router-setup.md +0 -52
  302. package/plugins/freeflow/skills/verify-work/SKILL.md +0 -62
  303. package/plugins/freeflow/skills/workflow/SKILL.md +0 -95
  304. package/plugins/freeflow/skills/workflow/references/workflow-map.md +0 -102
  305. package/plugins/freeflow/skills/write-plan/SKILL.md +0 -88
  306. package/plugins/freeflow/skills/write-plan/references/plan-shapes.md +0 -70
  307. package/plugins/freeflow/skills/write-skill/SKILL.md +0 -88
  308. package/plugins/freeflow/skills/write-spec/SKILL.md +0 -90
  309. package/plugins/freeflow/skills/write-spec/references/artifact-standards.md +0 -67
  310. package/plugins/freeflow/skills/write-spec/references/spec-shapes.md +0 -69
  311. /package/{plugins/freeflow/assets → assets}/freeflow-plugin-icon-transparent.png +0 -0
  312. /package/{plugins/freeflow/hooks → hooks}/hooks.json +0 -0
@@ -0,0 +1,248 @@
1
+ # Software Design Philosophy
2
+
3
+ Use this reference when `design-for-depth` needs deeper reasoning than the active skill can carry.
4
+
5
+ This is not a checklist to run every time. Pull the idea that changes the next route.
6
+
7
+ ## Core Claim
8
+
9
+ Good design reduces coordination.
10
+
11
+ A deep module lets callers, tests, reviewers, and future agents use a small interface to get a lot of behavior. A shallow module makes them learn almost as much as the implementation.
12
+
13
+ Design work is worthwhile when it hides a decision that would otherwise spread.
14
+
15
+ ## Ousterhout: Complexity, Deep Modules, Strategic Programming
16
+
17
+ ### Complexity
18
+
19
+ Complexity shows up as:
20
+
21
+ - too many dependencies;
22
+ - obscurity, where important facts are hard to find;
23
+ - change amplification, where a small behavior change touches many places;
24
+ - cognitive load, where the user of a module must remember too much;
25
+ - unknown unknowns, where a future agent cannot tell what it must inspect.
26
+
27
+ For Freeflow, complexity is not “many lines.” A single compact helper can be complex if callers must know its quirks. A large implementation can be simple to use if the interface hides the hard parts.
28
+
29
+ ### Deep modules
30
+
31
+ A deep module has a simple interface and useful behavior behind it.
32
+
33
+ Deep means:
34
+
35
+ - callers say what outcome they need;
36
+ - implementation owns sequencing and policy details;
37
+ - tests can verify behavior through the public interface;
38
+ - future changes stay localized;
39
+ - docs and review comments do not need to explain the hidden machinery every time.
40
+
41
+ Shallow means:
42
+
43
+ - the interface mirrors the implementation;
44
+ - callers pass many flags and know ordering rules;
45
+ - tests assert internal call sequences;
46
+ - wrappers rename work without hiding decisions;
47
+ - future agents still need to inspect everything to use it safely.
48
+
49
+ ### Strategic vs tactical programming
50
+
51
+ Tactical programming makes the current patch fit, even if it spreads complexity.
52
+
53
+ Strategic programming spends a little extra attention to preserve future locality.
54
+
55
+ Freeflow translation:
56
+
57
+ - Do not redesign everything up front.
58
+ - Do stop when the local patch clearly makes the next slice, review, or bug fix harder.
59
+ - Return the structural evidence to [Workflow](../../workflow/SKILL.md) when a tactical patch is becoming structural work.
60
+
61
+ ## Parnas: Information Hiding
62
+
63
+ Parnas's key design move: modules should hide design decisions likely to change.
64
+
65
+ Do not decompose only by processing steps:
66
+
67
+ ```text
68
+ parse -> validate -> send -> log
69
+ ```
70
+
71
+ when the real likely-changing decision is:
72
+
73
+ ```text
74
+ notification delivery policy: provider choice, retry, fallback, telemetry, failure semantics
75
+ ```
76
+
77
+ A good module hides the unstable decision.
78
+
79
+ For consequential systems, failure behavior is often the unstable decision. Hide the contract in the module before callers invent their own retries, fallbacks, state writes, escalation paths, or graceful-failure claims.
80
+
81
+ Ask:
82
+
83
+ - What decision would cause the most edits if it changed?
84
+ - What can fail, who observes it, what state is written, and what must not happen?
85
+ - Does the system fail closed, fail open, degrade, escalate, retry, or stop?
86
+ - What recovery path and evidence prove graceful handling?
87
+ - Which callers currently know that decision?
88
+ - Can one module own it?
89
+ - What interface would let callers stop knowing it?
90
+
91
+ Examples:
92
+
93
+ - Billing grace period policy should not be spread across webhook handlers, email copy, UI guards, and tests.
94
+ - Notification retry/fallback policy should not be duplicated in each route.
95
+ - Permission semantics should not be separately encoded in frontend, backend, and test setup.
96
+ - Cache invalidation rules should not require every caller to remember freshness knobs.
97
+
98
+ ## Feathers: Seams And Enabling Points
99
+
100
+ A seam is where behavior can change without editing the surrounding work.
101
+
102
+ A seam needs an enabling point: the place where a different adapter, test double, probe, or behavior can be supplied.
103
+
104
+ Freeflow use:
105
+
106
+ - Use seams to make hard-to-test or hard-to-change behavior tractable.
107
+ - Do not create seams merely because a pattern sounds clean.
108
+ - Prefer seams that match real variation or observability needs.
109
+
110
+ Questions:
111
+
112
+ - What behavior needs to vary?
113
+ - Where can that variation enter without editing callers?
114
+ - What enabling point supplies the adapter or behavior?
115
+ - Does the seam protect production code and tests, or only add indirection?
116
+
117
+ Good seam candidates:
118
+
119
+ - provider variation: email/SMS/payment/search/storage;
120
+ - environment variation: prod/test/offline/fake implementations;
121
+ - observability variation: probes, clocks, log sinks, metrics;
122
+ - migration variation: old and new implementations behind one interface.
123
+
124
+ Weak seam candidates:
125
+
126
+ - one implementation with no likely variation;
127
+ - a seam created only to mock internals while the real interface stays awkward;
128
+ - a factory/registry around every function;
129
+ - an adapter whose interface still exposes provider-specific quirks.
130
+
131
+ ## Ports And Adapters
132
+
133
+ Ports/adapters protects core behavior from infrastructure details.
134
+
135
+ Freeflow wording:
136
+
137
+ - The core owns policy.
138
+ - The adapter owns provider mechanics.
139
+ - The interface between them says what the core needs or provides.
140
+
141
+ Use this idea when infrastructure details are leaking into product logic.
142
+
143
+ Examples:
144
+
145
+ - Stripe event parsing is adapter work; billing policy is core work.
146
+ - Email provider retries are adapter work; user notification policy may be core work.
147
+ - Database query syntax is adapter work; permission semantics are core work.
148
+ - Browser event plumbing is adapter work; user-flow state is core work.
149
+
150
+ Do not over-apply ports/adapters:
151
+
152
+ - simple scripts may not need ports;
153
+ - a single stable library call may not need an adapter;
154
+ - wrapping an SDK without hiding policy or provider quirks is often shallow.
155
+
156
+ ## Public Contract Cost
157
+
158
+ Hyrum's Law applies beyond public HTTP APIs: every observable flag, path, state, ordering rule, filename, error, timing behavior, and fallback can become depended upon.
159
+
160
+ Expose a fact only when the caller owns it or correct use requires it. Internal protocols may remain detailed and independently tested without becoming public seams.
161
+
162
+ A useful split:
163
+
164
+ - **Public:** caller-owned outcome, decisions, stable invariants, and observable failure semantics.
165
+ - **Internal:** storage layout, provider mechanics, retries, cleanup, integrity publication, temporary states, and optimization machinery.
166
+
167
+ Public flexibility has permanent coordination cost. One outcome-level operation is often deeper than a toolkit that lets callers reconstruct the module's lifecycle.
168
+
169
+ ## Maturity And Learning
170
+
171
+ Classify mechanisms before adding them:
172
+
173
+ - required trust and safety cannot be deferred merely to simplify the design;
174
+ - efficiency, scale, and portability require accepted requirements or observed pressure.
175
+
176
+ When the best interface cannot be known from source inspection, use a bounded learning slice. Name the question, competing designs, evidence, cost boundary, and discard-or-promote rule. Code can answer a design question without becoming the production design automatically.
177
+
178
+ ## Refactoring Pressure
179
+
180
+ Design pressure often appears as ordinary implementation pain:
181
+
182
+ - shotgun surgery;
183
+ - repeated review findings;
184
+ - flaky tests around ordering;
185
+ - many mocks for one behavior;
186
+ - hard-to-explain correctness;
187
+ - one bug fix causing another;
188
+ - “just add this flag everywhere.”
189
+
190
+ Do not treat all pressure as a command to refactor.
191
+
192
+ Classify it:
193
+
194
+ - **Real design pressure:** complexity spread blocks safe progress.
195
+ - **Local mess:** cleanup can happen within current scope.
196
+ - **Deferred deepening:** record the candidate, finish current work.
197
+ - **Owner decision:** deeper change affects product/API/security/compatibility.
198
+
199
+ ## Applying The Philosophy In Freeflow
200
+
201
+ ### In discussion
202
+
203
+ Use design ideas to ask better questions, not to freeze architecture.
204
+
205
+ Good questions:
206
+
207
+ - Which decision is most likely to change?
208
+ - Who should know this rule?
209
+ - What should callers stop coordinating?
210
+ - What future variation is real, not imagined?
211
+ - Which tests should survive a provider or implementation change?
212
+
213
+ ### In specs
214
+
215
+ Specs name behavior and boundaries. They should not lock in unproven module shapes.
216
+
217
+ Use:
218
+
219
+ ```text
220
+ Tentative: notification delivery may need one policy-owning module if retries/fallbacks continue spreading.
221
+ Open: whether provider variation is real now or deferred.
222
+ ```
223
+
224
+ not:
225
+
226
+ ```text
227
+ Requirement: implement NotificationDeliveryPortFactoryStrategy.
228
+ ```
229
+
230
+ ### In plans
231
+
232
+ Use [Write Plan](../../write-plan/SKILL.md) only when the ordered strategy can be stated without guessing. When later direction remains provisional, keep it in [Track Work](../../track-work/SKILL.md) or return the evidence to [Workflow](../../workflow/SKILL.md) rather than freezing it as a Plan.
233
+
234
+ For consequential systems, make failure behavior explicit before implementation choices harden. Do not leave it as an implementer guess after planning only the happy path.
235
+
236
+ A good slice can be verified through the intended interface. If the slice requires broad caller choreography, revise the slice.
237
+
238
+ ### In review
239
+
240
+ Review design depth by asking whether the diff reduces or increases caller knowledge.
241
+
242
+ A diff can pass tests and still fail design review if it scatters policy or creates a shallow interface.
243
+
244
+ ### In diagnosis
245
+
246
+ Repeated failures may indicate that the system is missing a module, seam, or source-truth decision.
247
+
248
+ Do not keep fixing symptoms when every fix reveals another coordination problem.
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: diagnose-failure
3
+ description: Use when a bug, failure, regression, performance problem, or repeated unsuccessful fix lacks a supported cause.
4
+ ---
5
+
6
+ # Diagnose Failure
7
+
8
+ Establish what is failing and why before selecting a correction.
9
+
10
+ A **diagnostic loop** is a repeatable check or observation that can reproduce, support, or contradict the failure claim or current hypothesis at the boundary where it matters. A **supported cause** is a causal explanation strong enough to distinguish meaningful alternatives and choose the next action; it does not require impossible certainty.
11
+
12
+ A requested patch, plausible code path, reviewer theory, or one favorable rerun is not a supported cause.
13
+
14
+ ## Follow The Diagnostic Route
15
+
16
+ ```text
17
+ [Failure without a supported cause]
18
+ -> [Establish expected and observed behavior]
19
+ -> [Choose the smallest diagnostic loop]
20
+ -> [Reproduce or capture the failure]
21
+ -> [State a falsifiable hypothesis]
22
+ -> [Run one distinguishing observation]
23
+ -> [Route from evidence]
24
+ -> hypothesis contradicted -> refine or replace it -> observe again
25
+ -> evidence unavailable -> stop with the smallest missing evidence
26
+ -> cause supported -> return cause and correction boundary to Workflow
27
+ -> user-owned behavior or source conflict -> Decision Gate
28
+ -> structural cause -> Design for Depth
29
+ -> active harm before cause -> propose bounded containment
30
+ ```
31
+
32
+ Diagnosis may recur inside one Track Work slice. A new hypothesis, observation, or owning-skill route does not create a new slice by itself.
33
+
34
+ ## Enter Diagnosis Deliberately
35
+
36
+ Use this method for unexplained bugs, failed tests, regressions, flaky behavior, performance problems, unexpected runtime behavior, or related corrections that keep failing.
37
+
38
+ Use it for repeated workflow trouble only when evidence suggests an unclear shared cause: related findings keep appearing, verification contradicts successive corrections, edge-case patches expose more states, or coordination spreads through shared ownership. Reaching a review cap alone is not diagnostic evidence.
39
+
40
+ If fresh direct evidence already establishes one clear local defect and intended behavior is settled, return the correction to [Workflow](../workflow/SKILL.md). Do not manufacture diagnosis around an ordinary mistake.
41
+
42
+ ## Establish The Failure And Loop
43
+
44
+ Before changing behavior:
45
+
46
+ 1. establish expected behavior from accepted intent and source truth;
47
+ 2. reproduce or capture the reported failure at its required boundary;
48
+ 3. state a falsifiable hypothesis;
49
+ 4. change or observe one distinguishing variable at a time;
50
+ 5. trace the causal chain from trigger and state to the observed result;
51
+ 6. preserve evidence that contradicts the leading hypothesis.
52
+
53
+ Prefer the reported path, input, environment, and observer. A nearby failure may suggest a hypothesis but does not prove the reported failure. Reduced-fidelity reproduction is diagnostic evidence only; name what it cannot establish.
54
+
55
+ Read [the diagnostic-loop catalog](references/diagnostic-loop-catalog.md) when the best loop is unclear. Read [flaky and performance diagnosis](references/flaky-and-performance.md) when timing, randomness, environment variance, or resources shape the failure.
56
+
57
+ Allowed behavior is not a reproduction. A cache hit does not prove a stale-read bug when caching is permitted. A possible race in source does not explain a report until timing, traces, steps, logs, or an existing expectation connect it.
58
+
59
+ Do not invent a check around the requested patch and use that check to prove the patch was needed. Do not rewrite tests, Specs, policies, thresholds, or expected behavior merely to make the signal red or green.
60
+
61
+ When no safe useful loop is possible, stop and name the smallest missing evidence: a command, failing input, trace, log window, timestamped screenshot, environment boundary, or permission for isolated instrumentation. Leave the cause unresolved.
62
+
63
+ ## Protect Diagnostic Evidence
64
+
65
+ Treat logs, traces, payloads, screenshots, dumps, and production samples as potentially sensitive. Minimize and sanitize them. Do not expose credentials, tokens, unrestricted personal data, or private payloads.
66
+
67
+ Bound repeated checks by time, cost, side effects, and environment safety. Do not repeatedly exercise a mutating production path without explicit authority and an understood recovery boundary.
68
+
69
+ Temporary instrumentation must distinguish hypotheses. Keep it isolated, identify its removal condition, and report whether it remains.
70
+
71
+ ## Identify The Owning Cause
72
+
73
+ Classify only what evidence supports:
74
+
75
+ - local implementation defect;
76
+ - invalid, stale, or inadequate check;
77
+ - environment, dependency, data, timing, or configuration cause;
78
+ - missing observer or insufficient evidence;
79
+ - unsettled behavior or source conflict;
80
+ - wrong result, scope, order, or execution strategy;
81
+ - structural ownership, interface, state, or failure-unit pressure.
82
+
83
+ Use [Decision Gate](../decision-gate/SKILL.md) when correction requires a user-owned behavior, risk, compatibility, security, privacy, billing, data-loss, or hard-to-reverse decision.
84
+
85
+ Use [Design for Depth](../design-for-depth/SKILL.md) only when diagnosis establishes a structural cause or direct evidence already shows caller coordination, state, ownership, interface, or failure-unit pressure. Ordinary bugs and finding count do not prove bad architecture.
86
+
87
+ If evidence supports only the strongest remaining hypothesis, report it as such and name the observation that would confirm or refute it.
88
+
89
+ ## Contain Harm Without Claiming A Fix
90
+
91
+ When harm must be limited before the cause is supported, return one bounded containment option to Workflow. Apply it only when already authorized or explicitly approved.
92
+
93
+ Containment must reduce immediate harm without destroying evidence, remain narrower and more reversible than a guessed correction, define verification and recovery, preserve unsettled behavior, and be reported as mitigation rather than resolution.
94
+
95
+ A requested patch may instead be an authorized learning action. Its result can strengthen or weaken a hypothesis; it does not become selected production behavior automatically.
96
+
97
+ ## Return The Supported Result
98
+
99
+ When evidence supports a cause, return the failure boundary, diagnostic loop, causal explanation, regression signal, and smallest coherent correction to Workflow. Return an authorized implementation correction to [Execute Work](../execute-work/SKILL.md); use [TDD](../tdd/SKILL.md) when the diagnostic loop provides a failing behavior check that should guide it. Use [Simplify Code](../simplify-code/SKILL.md) when the supported cause shows that obsolete, duplicated, or workaround machinery can be removed while preserving accepted behavior. Mess left by unsuccessful attempts is not enough: settle any behavior or contract change through Workflow first, and do not use cleanup in place of correcting the supported failure or while its evidence remains unresolved. The correction may remain in the current Track Work slice while that slice still has one coherent result.
100
+
101
+ After correction, use [Verify Work](../verify-work/SKILL.md) to rerun both the minimized regression signal and the original reported path or strongest available observer. If correction fails or exposes related shared-state consequences, re-enter diagnosis before another patch.
102
+
103
+ Do not claim fixed when only containment succeeded, a minimized check passed, or the original boundary remains unavailable.
104
+
105
+ Report the failure claim, required boundary, diagnostic loop and observations, supported cause or strongest remaining hypothesis, active containment or instrumentation, recommended route, verification status, and missing evidence.
@@ -0,0 +1,36 @@
1
+ # Diagnostic Loop Catalog
2
+
3
+ Read this when the smallest useful diagnostic loop for a reported failure or current hypothesis is unclear.
4
+
5
+ ## Common Loops
6
+
7
+ - **Failing test:** use when an existing stable interface or test boundary reaches the reported behavior.
8
+ - **Reproduction command:** one CLI, package task, or script with representative fixture input.
9
+ - **HTTP or protocol script:** the smallest real request sequence that crosses the affected boundary.
10
+ - **Browser path:** the user flow with relevant DOM, console, network, and visual observations.
11
+ - **Captured trace:** a sanitized log window, HAR, event payload, seed, timestamped screenshot, dump, or production sample replayed safely.
12
+ - **Throwaway harness:** a minimal script around the real module when no test framework reaches it.
13
+ - **Differential loop:** the same input through old and new code, configuration, dataset, dependency, or environment.
14
+ - **Instrumented run:** targeted probes at boundaries that distinguish competing hypotheses.
15
+
16
+ ## Improve The Loop
17
+
18
+ Prefer a loop that is:
19
+
20
+ - **Sharper:** observes the reported symptom or hypothesis rather than generic failure.
21
+ - **More representative:** preserves the relevant input, state, environment, and observing boundary.
22
+ - **More distinguishing:** can support one plausible cause while contradicting another.
23
+ - **More deterministic:** pins time, randomness, dependencies, filesystem, or network only when doing so preserves the failure.
24
+ - **Faster:** removes unrelated setup without narrowing the claim.
25
+ - **Safer:** isolates mutation, sanitizes sensitive evidence, and has bounded cleanup or recovery.
26
+
27
+ An observer must sit on the real path and cover the complete operation. A manual counter beside the path, a helper call, or a nearby mocked flow does not prove the reported boundary ran.
28
+
29
+ ## Boundary Examples
30
+
31
+ - A UI save remains pending → exercise the browser path and inspect the request, console, and rendered state; a reducer unit test does not prove the reported boundary.
32
+ - A registered callback allegedly never runs → invoke or observe the registered entrypoint; calling its helper directly proves only helper behavior.
33
+ - A failure appears only in CI → compare the same input across local and CI configuration before changing timing or adding retries.
34
+ - Two causes fit one symptom → choose an observation whose outcomes differ between them; another generic failure is not distinguishing evidence.
35
+
36
+ If no safe useful loop is possible, identify the smallest missing artifact or access: command, logs, trace, failing input, timestamped screenshot, environment boundary, or permission for isolated temporary instrumentation. Leave the cause unresolved rather than substituting a weaker claim.
@@ -0,0 +1,43 @@
1
+ # Flaky And Performance Diagnosis
2
+
3
+ Read this when timing, randomness, environment variance, or resource behavior makes the failure difficult to reproduce or explain.
4
+
5
+ ## Flaky Failures
6
+
7
+ The goal is not one lucky rerun. Raise the reproduction rate or capture the distinguishing event until the failure can be explained.
8
+
9
+ Use, when safe and representative:
10
+
11
+ - bounded repetition of the exact failing path;
12
+ - captured seeds, time, timezone, locale, viewport, browser, runtime, and dependency versions;
13
+ - controlled scheduling, fake clocks, CPU pressure, network delay, or concurrency;
14
+ - console, network, event-order, scheduler, screenshot, or video traces;
15
+ - old-versus-new, local-versus-CI, or headed-versus-headless differential runs.
16
+
17
+ Choose the repetition count from runtime, cost, side effects, and the failure rate. Preserve every unfavorable result. Do not loop mutating production behavior merely to improve reproduction.
18
+
19
+ Do not stabilize a flake with arbitrary sleeps, retries, wider timeouts, swallowed errors, or disabled checks unless evidence shows that mechanism addresses the causal timing or availability contract. Suppressing observation is not correction.
20
+
21
+ ## Performance Problems
22
+
23
+ Measure the reported path before optimizing it.
24
+
25
+ Useful causal evidence includes:
26
+
27
+ - baseline timing or resource use for the representative workload;
28
+ - slow input, dataset, concurrency, cache, and dependency state;
29
+ - profiler, flamegraph, query plan, allocation profile, or browser trace;
30
+ - old-versus-new comparison under matched conditions;
31
+ - a benchmark that exercises the dominant work identified by evidence.
32
+
33
+ A microbenchmark can test a hypothesis but does not explain the reported slowdown unless the isolated operation materially determines the real path. Repeated calls with one object justify memoization only when the reported workload repeats that object and measurement shows the repeated work dominates.
34
+
35
+ Sanitize production traces and payloads. When safe production evidence is unavailable, use representative non-production evidence and downgrade the claim.
36
+
37
+ ## Boundary Examples
38
+
39
+ - Twenty green reruns after widening a timeout → the failure was suppressed or became rarer; its cause is still unresolved.
40
+ - A parser microbenchmark improves while the representative trace is dominated by database waiting → the benchmark does not explain the reported slowdown.
41
+ - Median latency improves while tail latency or memory crosses the accepted boundary → the performance claim remains contradicted or incomplete.
42
+
43
+ After an authorized correction, verify that the representative baseline improves and required behavior remains correct. Report variance and relevant resource tradeoffs rather than one favorable run.
@@ -0,0 +1,121 @@
1
+ ---
2
+ name: discuss
3
+ description: Use when discussing, exploring, shaping, challenging, or revisiting an idea, request, artifact, design, or implementation direction, or when an open-ended request or new evidence makes the next approach uncertain.
4
+ ---
5
+
6
+ # Discuss
7
+
8
+ Build enough shared understanding to choose the next sound action.
9
+
10
+ Discussion may shape understanding, recommendations, proposed work, and checkpoints. It does not authorize mutation, settle a user-owned choice implicitly, or turn exploratory output into production behavior.
11
+
12
+ ## Follow The Discussion Route
13
+
14
+ Use this as a directed map, not a checklist:
15
+
16
+ ```text
17
+ [Entry or re-entry]
18
+ -> [Orient from accepted context and live evidence]
19
+ -> [Focus the highest uncertainty that could change the route]
20
+ -> [Inspect facts / ask / compare meaningful paths]
21
+ -> [Route from what is now supported]
22
+ -> enough understanding
23
+ -> task-shaped and continuity may matter
24
+ -> Track Work decides whether to recommend a Working Record
25
+ -> otherwise -> return direction to Workflow
26
+ -> one user-owned choice or source conflict -> Decision Gate
27
+ -> evidence needed -> propose a bounded learning action
28
+ -> when authorized -> Track Work
29
+ -> Execute Work or wait from its result
30
+ -> re-enter Discuss with evidence
31
+ -> unexplained or repeated failure -> Diagnose Failure
32
+ -> stable accepted content or strategy -> Write Spec / Write Plan
33
+ ```
34
+
35
+ Preserve decisions, evidence, artifacts, and work that still hold whenever discussion re-enters from implementation, verification, review, failure, or another conversation.
36
+
37
+ ## Enter Or Exit Cleanly
38
+
39
+ Use Discuss when:
40
+
41
+ - the user is exploring what to build or how to approach it;
42
+ - important outcomes, boundaries, alternatives, or tradeoffs remain open;
43
+ - an artifact, design, implementation direction, or earlier assumption needs reconsideration;
44
+ - new evidence makes the next approach uncertain.
45
+
46
+ Do not force discussion for a direct factual question or clear bounded action whose intended result is understood. Feedback alone does not require discussion. Re-enter only when it reopens assumptions, options, or direction.
47
+
48
+ When one known choice or source conflict blocks progress, use [Decision Gate](../decision-gate/SKILL.md). When a failure lacks a supported cause or keeps recurring, use [Diagnose Failure](../diagnose-failure/SKILL.md) before treating it as a design problem.
49
+
50
+ ## Orient Without Restarting
51
+
52
+ Identify only what the next decision needs:
53
+
54
+ - goal and current direction;
55
+ - settled facts and explicit decisions;
56
+ - tentative assumptions or viable alternatives;
57
+ - evidence and uncertainty that could change the route.
58
+
59
+ When a Working Record exists, orient from its current context and check important claims against live evidence. Read older history only when the present direction or rationale is unclear. Update only what new evidence affects.
60
+
61
+ ## Focus The Discussion
62
+
63
+ Stay with the highest unresolved question that could change the outcome, boundary, approach, or acceptance. Leave dependent details until that question is sufficiently understood.
64
+
65
+ Inspect code, tests, docs, policies, artifacts, repository state, supplied material, or current primary sources when they can answer factual questions. Ask the user about intent, priorities, constraints, and tradeoffs that evidence cannot decide.
66
+
67
+ When materially different paths remain viable:
68
+
69
+ 1. compare only the few that matter, including the current path or waiting when real;
70
+ 2. state what each optimizes, its main assumptions and tradeoffs, and evidence that could rule it out;
71
+ 3. recommend a direction when evidence supports one and say what could change that recommendation;
72
+ 4. leave user-owned choices with the user and do not keep arguing for a rejected path without new evidence.
73
+
74
+ Ask in natural prose, usually about one main topic at a time. Use a menu only for genuinely closed choices. Do not manufacture alternatives for an obvious local decision.
75
+
76
+ When architecture, interfaces, ownership, state, failure contracts, or spreading complexity shape the direction, use [Design for Depth](../design-for-depth/SKILL.md) as a lens and retain it while the boundary remains design-bearing.
77
+
78
+ ## Learn Through Bounded Action
79
+
80
+ When discussion alone cannot answer a material question, propose the smallest useful learning or delivery action:
81
+
82
+ ```text
83
+ Type: Learning | Delivery | Deepening
84
+ Question or outcome:
85
+ Smallest bounded action:
86
+ Expected evidence:
87
+ Useful checkpoint, if any:
88
+ Stop, discard, revise, or promote when:
89
+ ```
90
+
91
+ A proposal is not authorization. Before execution, confirm that the action is requested or approved. When the action is authorized, use [Track Work](../track-work/SKILL.md) to decide whether durable task memory is needed, then follow its result to [Execute Work](../execute-work/SKILL.md) or wait.
92
+
93
+ Return with the observed result. Treat prototypes, tests, benchmarks, sketches, and working behavior as evidence, not automatic approval of their design or promotion. Preserve what still holds and re-enter only the affected question.
94
+
95
+ ## Preserve Only Useful State
96
+
97
+ Keep discussion legible as:
98
+
99
+ - **Settled:** supported fact or explicit decision.
100
+ - **Tentative:** current hypothesis or provisional direction.
101
+ - **Open:** unresolved and capable of changing the next action.
102
+
103
+ Keep this state in conversation while context is sufficient. Use Track Work when evolving context must survive compaction, pause, or another session. Use [Write Spec](../write-spec/SKILL.md) for stable accepted content and [Write Plan](../write-plan/SKILL.md) for a stable ordered strategy. Do not create an artifact merely because discussion occurred.
104
+
105
+ Recommend independent review, local commit, user decision, or continuity checkpoints only when they protect dependent work or reduce material risk. Discussion may shape and preserve an approved checkpoint, but does not execute it. Normal verification and silent self-review provide the ordinary self-check; Workflow establishes the slice outcome.
106
+
107
+ Read [discussion checkpoints](references/checkpoints.md) when selecting or preserving a compact discussion checkpoint or re-entry state.
108
+
109
+ ## Return Supported Direction
110
+
111
+ Converge when the next sound action no longer depends on unresolved direction, not when every future question is answered.
112
+
113
+ Return to [Workflow](../workflow/SKILL.md) with:
114
+
115
+ - current shared understanding;
116
+ - settled and tentative direction;
117
+ - open questions that still change the route;
118
+ - recommended next action or bounded proposal;
119
+ - its authority state and any selected checkpoint.
120
+
121
+ If no action is needed, answer or stop. If work is proposed but unapproved, recommend the exact action and wait for the user's response.
@@ -0,0 +1,66 @@
1
+ # Discussion Checkpoints
2
+
3
+ Read this when closing or preserving a compact discussion checkpoint.
4
+
5
+ A checkpoint records enough shared understanding to continue or choose the next action. It does not mean discussion is permanently complete.
6
+
7
+ ## Keep It In Chat When Possible
8
+
9
+ Keep the checkpoint in the conversation when the current context can safely continue. Use only the fields that help:
10
+
11
+ ```text
12
+ Goal or question:
13
+ Current understanding:
14
+ Settled:
15
+ Tentative:
16
+ Open:
17
+ Evidence or alternatives that matter:
18
+ Approved or proposed checkpoints, if any:
19
+ Recommended or accepted next action:
20
+ Authority source or approval needed:
21
+ ```
22
+
23
+ Do not turn a checkpoint into a transcript, questionnaire, frozen architecture, automatic spec, or complete plan.
24
+
25
+ ## Preserve Selected Checkpoints
26
+
27
+ When discussion proposes or approves an execution checkpoint, preserve only what later action needs:
28
+
29
+ ```text
30
+ Status: Proposed | Approved
31
+ Type:
32
+ Purpose:
33
+ Due boundary:
34
+ Conditions:
35
+ Approval scope:
36
+ ```
37
+
38
+ Do not infer authorization from a recommendation. Keep local commit approval separate from push or integration, and keep migration, deprecation, release, and launch separately controlled.
39
+
40
+ ## Preserve It When Needed
41
+
42
+ Choose the artifact by the information that must survive:
43
+
44
+ - **Working Record:** evolving task and checkpoint state, slices, decisions, evidence, history, and next action. Read [Track Work](../../track-work/SKILL.md).
45
+ - **Write Spec:** stable accepted content needs a separate durable artifact. Read [Write Spec](../../write-spec/SKILL.md).
46
+ - **Write Plan:** a stable ordered strategy and its selected checkpoints need a separate artifact. Read [Write Plan](../../write-plan/SKILL.md).
47
+ - **ADR:** a surprising, hard-to-reverse repo-level decision needs durable rationale.
48
+ - **Handoff:** one point-in-time continuation state must be transferred to another context or owner.
49
+ - **Domain documentation:** stable terminology or domain meaning belongs in an existing glossary or domain source.
50
+
51
+ Do not create an artifact merely because discussion occurred. Prefer an existing repository convention; ask before inventing a destination whose authority, durability, or ownership matters.
52
+
53
+ ## Re-Entry Checkpoint
54
+
55
+ When new evidence reopens discussion, preserve only the affected change:
56
+
57
+ ```text
58
+ New evidence:
59
+ Invalidated assumption:
60
+ Still valid:
61
+ Decision, slice, or artifact affected:
62
+ Question or experiment now needed:
63
+ Authority or decision needed:
64
+ ```
65
+
66
+ Do not restart from zero or rewrite unaffected decisions and work.