@hassangameryt/freeflow 0.8.0 → 0.9.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 (290) hide show
  1. package/.agents/plugins/marketplace.json +2 -2
  2. package/.claude-plugin/marketplace.json +1 -1
  3. package/.claude-plugin/plugin.json +2 -2
  4. package/.codex-plugin/plugin.json +3 -3
  5. package/.cursor-plugin/plugin.json +1 -1
  6. package/README.md +96 -149
  7. package/capabilities/cognitive-routing/SKILL.md +21 -129
  8. package/capabilities/cognitive-routing/references/coordinator.md +163 -0
  9. package/capabilities/cognitive-routing/references/worker.md +38 -0
  10. package/capabilities/compaction/SKILL.md +3 -3
  11. package/capabilities/compaction/references/summary-format.md +26 -15
  12. package/capabilities/messaging/SKILL.md +49 -0
  13. package/capabilities/task-memory/SKILL.md +87 -0
  14. package/command-surface.json +6 -54
  15. package/gemini-extension.json +1 -1
  16. package/hooks/claude/hooks.json +13 -3
  17. package/hooks/codex/hooks.json +2 -1
  18. package/hooks/shared/runtime-context.mjs +69 -77
  19. package/package.json +25 -8
  20. package/pi-extension/dist/ask-user/ask.js +108 -0
  21. package/pi-extension/dist/ask-user/form.js +250 -0
  22. package/pi-extension/dist/ask-user/questions.js +66 -0
  23. package/pi-extension/dist/ask-user/tool.js +124 -0
  24. package/pi-extension/dist/cognitive-routing/assembler.js +35 -11
  25. package/pi-extension/dist/cognitive-routing/bootstrap.js +90 -0
  26. package/pi-extension/dist/cognitive-routing/config.js +3 -4
  27. package/pi-extension/dist/cognitive-routing/event-store.js +4 -1
  28. package/pi-extension/dist/cognitive-routing/gate.js +20 -5
  29. package/pi-extension/dist/cognitive-routing/handlers.js +15 -13
  30. package/pi-extension/dist/cognitive-routing/model-control.js +17 -8
  31. package/pi-extension/dist/cognitive-routing/projection.js +23 -6
  32. package/pi-extension/dist/cognitive-routing/provenance.js +3 -1
  33. package/pi-extension/dist/cognitive-routing/render.js +15 -15
  34. package/pi-extension/dist/cognitive-routing/runtime.js +4 -2
  35. package/pi-extension/dist/cognitive-routing/schemas.js +4 -4
  36. package/pi-extension/dist/cognitive-routing/session.js +3 -1
  37. package/pi-extension/dist/cognitive-routing/sources.js +29 -4
  38. package/pi-extension/dist/cognitive-routing/state.js +18 -8
  39. package/pi-extension/dist/cognitive-routing/status.js +4 -3
  40. package/pi-extension/dist/cognitive-routing/tools.js +29 -15
  41. package/pi-extension/dist/cognitive-routing/types.js +10 -1
  42. package/pi-extension/dist/compaction/carry.js +36 -22
  43. package/pi-extension/dist/compaction/config.js +4 -2
  44. package/pi-extension/dist/compaction/controller.js +52 -29
  45. package/pi-extension/dist/compaction/harness.js +19 -3
  46. package/pi-extension/dist/compaction/results.js +14 -13
  47. package/pi-extension/dist/compaction/tool.js +6 -6
  48. package/pi-extension/dist/host/catalog.js +20 -35
  49. package/pi-extension/dist/host/config-validation.js +233 -0
  50. package/pi-extension/dist/host/config.js +78 -91
  51. package/pi-extension/dist/host/inbound.js +142 -0
  52. package/pi-extension/dist/host/projection-tags.js +1 -1
  53. package/pi-extension/dist/host/prompts.js +24 -13
  54. package/pi-extension/dist/host/read-only-session.js +6 -1
  55. package/pi-extension/dist/host/request-history.js +7 -3
  56. package/pi-extension/dist/host/rows.js +25 -0
  57. package/pi-extension/dist/host/runtime-state.js +17 -2
  58. package/pi-extension/dist/host/section-keeper.js +85 -0
  59. package/pi-extension/dist/host/settings/freeflow-command.js +846 -93
  60. package/pi-extension/dist/host/settings/settings-view.js +27 -8
  61. package/pi-extension/dist/host/status.js +19 -5
  62. package/pi-extension/dist/index.js +638 -72
  63. package/pi-extension/dist/messaging/config.js +27 -0
  64. package/pi-extension/dist/messaging/messaging.js +398 -0
  65. package/pi-extension/dist/messaging/registry.js +57 -0
  66. package/pi-extension/dist/messaging/render.js +90 -0
  67. package/pi-extension/dist/messaging/tools.js +109 -0
  68. package/pi-extension/dist/messaging/transport.js +101 -0
  69. package/pi-extension/dist/provider-support/cache/keepalive.js +16 -4
  70. package/pi-extension/dist/task-memory/config.js +49 -0
  71. package/pi-extension/dist/task-memory/registry.js +119 -0
  72. package/pi-extension/dist/task-memory/render.js +107 -0
  73. package/pi-extension/dist/task-memory/runtime.js +994 -0
  74. package/pi-extension/dist/task-memory/tool.js +233 -0
  75. package/pi-extension/dist/tool-execution/apply-patch/tool.js +1 -1
  76. package/pi-extension/dist/tool-execution/background.js +220 -28
  77. package/pi-extension/dist/tool-execution/config.js +14 -3
  78. package/pi-extension/dist/tool-execution/file-tracking.js +24 -4
  79. package/pi-extension/dist/tool-execution/guidance-notices.js +124 -0
  80. package/pi-extension/dist/tool-execution/skill-reads.js +143 -0
  81. package/pi-extension/dist/tool-execution/tools.js +2 -2
  82. package/runtime/prompts/cognitive-routing.md +4 -4
  83. package/runtime/prompts/core.md +24 -14
  84. package/runtime/prompts/interaction-contract.md +7 -4
  85. package/runtime/prompts/tool-execution.md +3 -16
  86. package/runtime/prompts/working-method.md +16 -99
  87. package/skills/deliver-work/SKILL.md +76 -0
  88. package/skills/deliver-work/references/branch-closeout.md +134 -0
  89. package/skills/deliver-work/references/commit.md +83 -0
  90. package/skills/deliver-work/references/launch.md +94 -0
  91. package/skills/deliver-work/references/release.md +85 -0
  92. package/skills/deliver-work/scripts/commit-state.mjs +139 -0
  93. package/skills/deliver-work/scripts/delivery-state.mjs +107 -0
  94. package/skills/deliver-work/scripts/lib/git-state.mjs +178 -0
  95. package/skills/deliver-work/scripts/push-route.mjs +122 -0
  96. package/skills/deliver-work/scripts/release-preflight.mjs +177 -0
  97. package/skills/discuss-work/SKILL.md +148 -0
  98. package/skills/{discuss → discuss-work}/references/discussion-continuity.md +10 -27
  99. package/skills/discuss-work/references/learning-action.md +36 -0
  100. package/skills/discuss-work/scripts/choices.mjs +101 -0
  101. package/skills/discuss-work/scripts/lib/choices.mjs +159 -0
  102. package/skills/evaluate-behavior/SKILL.md +107 -0
  103. package/skills/evaluate-behavior/references/authoring.md +381 -0
  104. package/skills/evaluate-behavior/references/coding-tasks.md +145 -0
  105. package/skills/evaluate-behavior/references/conversations-pipelines-judges.md +177 -0
  106. package/skills/evaluate-behavior/references/design-and-measurement.md +273 -0
  107. package/skills/evaluate-behavior/references/running-and-evidence.md +245 -0
  108. package/skills/evaluate-behavior/scripts/claude-guard.mjs +76 -0
  109. package/skills/evaluate-behavior/scripts/guard-rules.mjs +309 -0
  110. package/skills/evaluate-behavior/scripts/lib/agreement.mjs +90 -0
  111. package/skills/evaluate-behavior/scripts/lib/arms.mjs +55 -0
  112. package/skills/evaluate-behavior/scripts/lib/budget.mjs +87 -0
  113. package/skills/evaluate-behavior/scripts/lib/build-source.mjs +287 -0
  114. package/skills/evaluate-behavior/scripts/lib/clear.mjs +74 -0
  115. package/skills/evaluate-behavior/scripts/lib/container.mjs +395 -0
  116. package/skills/evaluate-behavior/scripts/lib/decision.mjs +418 -0
  117. package/skills/evaluate-behavior/scripts/lib/definitions.mjs +1072 -0
  118. package/skills/evaluate-behavior/scripts/lib/freeflow.mjs +103 -0
  119. package/skills/evaluate-behavior/scripts/lib/grade-command.mjs +591 -0
  120. package/skills/evaluate-behavior/scripts/lib/grade-comparison.mjs +90 -0
  121. package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/grade-interaction.mjs +19 -18
  122. package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/grade-support.mjs +32 -5
  123. package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/grade-workspace.mjs +28 -12
  124. package/skills/evaluate-behavior/scripts/lib/grade.mjs +101 -0
  125. package/skills/evaluate-behavior/scripts/lib/hooks.mjs +98 -0
  126. package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/confinement.mjs +196 -0
  127. package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/constraints.mjs +111 -0
  128. package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/index.mjs +48 -0
  129. package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/isolation.mjs +74 -0
  130. package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/launch.mjs +123 -0
  131. package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/model-call.mjs +73 -0
  132. package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/recorder.mjs +178 -0
  133. package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/session.mjs +494 -0
  134. package/skills/evaluate-behavior/scripts/lib/hosts/claude-code/skills.mjs +81 -0
  135. package/skills/evaluate-behavior/scripts/lib/hosts/index.mjs +31 -0
  136. package/skills/evaluate-behavior/scripts/lib/hosts/names.mjs +3 -0
  137. package/skills/evaluate-behavior/scripts/lib/hosts/pi/confinement.mjs +173 -0
  138. package/skills/evaluate-behavior/scripts/lib/hosts/pi/host.mjs +148 -0
  139. package/skills/evaluate-behavior/scripts/lib/hosts/pi/index.mjs +70 -0
  140. package/skills/evaluate-behavior/scripts/lib/hosts/pi/isolation.mjs +81 -0
  141. package/skills/evaluate-behavior/scripts/lib/hosts/pi/model-call.mjs +79 -0
  142. package/skills/evaluate-behavior/scripts/lib/hosts/pi/process.mjs +241 -0
  143. package/skills/{evaluate-skill/scripts/lib → evaluate-behavior/scripts/lib/hosts/pi}/rpc.mjs +144 -26
  144. package/skills/evaluate-behavior/scripts/lib/identity.mjs +82 -0
  145. package/skills/evaluate-behavior/scripts/lib/judge.mjs +688 -0
  146. package/skills/evaluate-behavior/scripts/lib/metrics.mjs +332 -0
  147. package/skills/evaluate-behavior/scripts/lib/model-call.mjs +17 -0
  148. package/skills/evaluate-behavior/scripts/lib/participants.mjs +616 -0
  149. package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/process.mjs +22 -0
  150. package/skills/evaluate-behavior/scripts/lib/queue.mjs +54 -0
  151. package/skills/evaluate-behavior/scripts/lib/reference.mjs +343 -0
  152. package/skills/evaluate-behavior/scripts/lib/reuse.mjs +277 -0
  153. package/skills/evaluate-behavior/scripts/lib/review.mjs +933 -0
  154. package/skills/evaluate-behavior/scripts/lib/runner.mjs +732 -0
  155. package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/sandbox.mjs +119 -14
  156. package/skills/evaluate-behavior/scripts/lib/scan-shell.mjs +457 -0
  157. package/skills/evaluate-behavior/scripts/lib/scan.mjs +479 -0
  158. package/skills/evaluate-behavior/scripts/lib/seal.mjs +91 -0
  159. package/skills/evaluate-behavior/scripts/lib/shell.mjs +560 -0
  160. package/skills/evaluate-behavior/scripts/lib/source-override.mjs +64 -0
  161. package/skills/evaluate-behavior/scripts/lib/subject-file.mjs +88 -0
  162. package/skills/{evaluate-skill/scripts/lib/pi.mjs → evaluate-behavior/scripts/lib/subject.mjs} +235 -265
  163. package/skills/evaluate-behavior/scripts/lib/task-copy.mjs +124 -0
  164. package/skills/evaluate-behavior/scripts/lib/trials.mjs +524 -0
  165. package/skills/evaluate-behavior/scripts/lib/validity.mjs +68 -0
  166. package/skills/evaluate-behavior/scripts/lib/view-html.mjs +454 -0
  167. package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/view.mjs +159 -18
  168. package/skills/{evaluate-skill → evaluate-behavior}/scripts/pi-command-tool.mjs +21 -6
  169. package/skills/evaluate-behavior/scripts/pi-container-route.mjs +23 -0
  170. package/skills/evaluate-behavior/scripts/pi-guard.mjs +77 -0
  171. package/skills/evaluate-behavior/scripts/pi-login-refresh.mjs +31 -0
  172. package/skills/evaluate-behavior/scripts/skill-eval.mjs +586 -0
  173. package/skills/execute-work/SKILL.md +96 -104
  174. package/skills/execute-work/references/code-practices.md +27 -51
  175. package/skills/execute-work/references/design.md +271 -0
  176. package/skills/execute-work/references/diagnose.md +117 -0
  177. package/skills/execute-work/references/migration.md +108 -0
  178. package/skills/execute-work/references/simplify.md +65 -0
  179. package/skills/execute-work/scripts/self-review.mjs +422 -0
  180. package/skills/execute-work/scripts/touch-map.mjs +290 -0
  181. package/skills/review-work/SKILL.md +89 -65
  182. package/skills/review-work/references/adjudication.md +94 -0
  183. package/skills/review-work/references/artifact.md +198 -0
  184. package/skills/review-work/references/evals-and-judges.md +66 -0
  185. package/skills/review-work/references/work.md +177 -0
  186. package/skills/review-work/scripts/check-brief.mjs +128 -0
  187. package/skills/review-work/scripts/review-packet.mjs +233 -0
  188. package/skills/setup-freeflow/SKILL.md +68 -17
  189. package/skills/track-work/SKILL.md +52 -20
  190. package/skills/track-work/references/handoff.md +190 -0
  191. package/skills/track-work/references/projects.md +51 -0
  192. package/skills/track-work/references/working-record-format.md +36 -18
  193. package/skills/track-work/scripts/lib/document.mjs +17 -13
  194. package/skills/track-work/scripts/lib/format.mjs +2 -0
  195. package/skills/track-work/scripts/lib/recover.mjs +254 -0
  196. package/skills/track-work/scripts/lib/registry.mjs +656 -0
  197. package/skills/track-work/scripts/lib/search.mjs +40 -0
  198. package/skills/track-work/scripts/lib/store.mjs +46 -15
  199. package/skills/track-work/scripts/lib/views.mjs +50 -1
  200. package/skills/track-work/scripts/working-record.mjs +232 -13
  201. package/skills/verify-work/SKILL.md +45 -37
  202. package/skills/verify-work/references/feature-map.md +120 -0
  203. package/skills/verify-work/references/runtime-evidence.md +203 -0
  204. package/skills/verify-work/references/test-design.md +25 -6
  205. package/skills/verify-work/scripts/test-changes.mjs +246 -0
  206. package/skills/write-docs/SKILL.md +113 -25
  207. package/skills/write-docs/references/documentation-shapes.md +68 -3
  208. package/skills/write-docs/references/spec-and-plan-shapes.md +308 -0
  209. package/skills/write-docs/scripts/artifact-check.mjs +148 -0
  210. package/skills/write-docs/scripts/docs-check.mjs +96 -6
  211. package/skills/write-docs/scripts/plan-lint.mjs +123 -0
  212. package/skills/write-skill/SKILL.md +92 -52
  213. package/skills/write-skill/references/activation-and-wording.md +143 -0
  214. package/skills/write-skill/references/placement-and-dependencies.md +154 -0
  215. package/skills/write-skill/scripts/lib/compare.mjs +701 -0
  216. package/skills/write-skill/scripts/lib/skill-author.mjs +197 -3
  217. package/skills/write-skill/scripts/skill-author.mjs +51 -8
  218. package/capabilities/cognitive-routing/references/both-mode.md +0 -36
  219. package/capabilities/cognitive-routing/references/executor-mode.md +0 -48
  220. package/capabilities/cognitive-routing/references/helper-mode.md +0 -47
  221. package/plugin.json +0 -33
  222. package/skills/action-selection/SKILL.md +0 -92
  223. package/skills/action-selection/references/trajectory-stalls.md +0 -73
  224. package/skills/bypass/SKILL.md +0 -153
  225. package/skills/commit-work/SKILL.md +0 -93
  226. package/skills/commit-work/references/git-state-edges.md +0 -94
  227. package/skills/commit-work/references/simple-push.md +0 -94
  228. package/skills/commit-work/references/staging-decisions.md +0 -106
  229. package/skills/decision-gate/SKILL.md +0 -87
  230. package/skills/design-for-depth/SKILL.md +0 -108
  231. package/skills/design-for-depth/references/design-pressure-signals.md +0 -84
  232. package/skills/design-for-depth/references/implementation-decisions.md +0 -76
  233. package/skills/design-for-depth/references/interface-design-loop.md +0 -105
  234. package/skills/design-for-depth/references/module-and-dependency-design.md +0 -117
  235. package/skills/design-for-depth/references/state-and-failure-boundaries.md +0 -125
  236. package/skills/diagnose-failure/SKILL.md +0 -140
  237. package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +0 -50
  238. package/skills/diagnose-failure/references/flaky-and-performance-diagnosis.md +0 -51
  239. package/skills/discuss/SKILL.md +0 -140
  240. package/skills/evaluate-skill/SKILL.md +0 -188
  241. package/skills/evaluate-skill/references/evaluation-definition-schema.md +0 -415
  242. package/skills/evaluate-skill/references/evaluation-design.md +0 -112
  243. package/skills/evaluate-skill/references/execution-and-evidence.md +0 -111
  244. package/skills/evaluate-skill/references/review-and-revision.md +0 -94
  245. package/skills/evaluate-skill/scripts/lib/definitions.mjs +0 -448
  246. package/skills/evaluate-skill/scripts/lib/grade-comparison.mjs +0 -60
  247. package/skills/evaluate-skill/scripts/lib/grade.mjs +0 -64
  248. package/skills/evaluate-skill/scripts/lib/review.mjs +0 -196
  249. package/skills/evaluate-skill/scripts/lib/runner.mjs +0 -405
  250. package/skills/evaluate-skill/scripts/lib/trials.mjs +0 -103
  251. package/skills/evaluate-skill/scripts/pi-guard.mjs +0 -181
  252. package/skills/evaluate-skill/scripts/skill-eval.mjs +0 -182
  253. package/skills/execute-work/references/execute-work-edges.md +0 -78
  254. package/skills/finish-branch/SKILL.md +0 -117
  255. package/skills/finish-branch/references/integration-options.md +0 -80
  256. package/skills/handoff/SKILL.md +0 -82
  257. package/skills/handoff/references/handoff-templates.md +0 -150
  258. package/skills/launch-work/SKILL.md +0 -116
  259. package/skills/launch-work/references/launch-readiness.md +0 -85
  260. package/skills/migration-work/SKILL.md +0 -115
  261. package/skills/migration-work/references/migration-lifecycle.md +0 -82
  262. package/skills/release-work/SKILL.md +0 -118
  263. package/skills/release-work/references/release-evidence.md +0 -78
  264. package/skills/review-artifact/SKILL.md +0 -143
  265. package/skills/review-artifact/references/adjudicate-artifact-review.md +0 -101
  266. package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +0 -159
  267. package/skills/review-work/references/adjudicate-work-review.md +0 -97
  268. package/skills/review-work/references/independent-work-reviewer-contract.md +0 -139
  269. package/skills/review-work/references/security-risk-lens.md +0 -67
  270. package/skills/setup-freeflow/references/activation-contract.md +0 -103
  271. package/skills/setup-freeflow/references/host-setup.md +0 -67
  272. package/skills/simplify-code/SKILL.md +0 -85
  273. package/skills/simplify-code/references/simplification-patterns.md +0 -70
  274. package/skills/verify-work/references/browser-runtime-evidence.md +0 -51
  275. package/skills/verify-work/references/integration-evidence.md +0 -49
  276. package/skills/verify-work/references/performance-evidence.md +0 -59
  277. package/skills/workflow/SKILL.md +0 -171
  278. package/skills/workflow/references/domain-skill-composition.md +0 -45
  279. package/skills/write-plan/SKILL.md +0 -92
  280. package/skills/write-plan/references/plan-shapes.md +0 -156
  281. package/skills/write-skill/references/activation-boundaries.md +0 -106
  282. package/skills/write-skill/references/agent-first-instructions.md +0 -133
  283. package/skills/write-skill/references/progressive-disclosure.md +0 -129
  284. package/skills/write-skill/references/skill-dependency-graphs.md +0 -192
  285. package/skills/write-spec/SKILL.md +0 -85
  286. package/skills/write-spec/references/artifact-standards.md +0 -86
  287. package/skills/write-spec/references/decision-records.md +0 -80
  288. package/skills/write-spec/references/spec-shapes.md +0 -143
  289. /package/skills/{evaluate-skill → evaluate-behavior}/scripts/lib/evidence.mjs +0 -0
  290. /package/skills/{evaluate-skill → evaluate-behavior}/scripts/pi-observer.mjs +0 -0
@@ -1,87 +0,0 @@
1
- ---
2
- name: "decision-gate"
3
- description: "Use when proceeding would silently choose a consequential outcome for the user, or when accepted sources conflict in a way that leaves one material choice blocking the next action."
4
- ---
5
-
6
- # Decision Gate
7
-
8
- Resolve one known blocking decision without making it for the user.
9
-
10
- A **blocking decision** is a choice whose realistic answers materially change the accepted outcome, scope, behavior, risk, persistence, compatibility, evidence boundary, or next safe action.
11
-
12
- Decision Gate is not general discussion, factual investigation, or an approval checkpoint for routine work. The [Interaction Contract](../../runtime/prompts/interaction-contract.md) governs whether the user is asking, proposing, deciding, or authorizing action; [Workflow](../workflow/SKILL.md) owns authority and routing.
13
-
14
- The **Rules** below are binding; if one cannot be met, stop and say why. Everything else is **judgment**: follow its stated goal, and adapt when a different choice serves that goal better.
15
-
16
- ## Rules
17
-
18
- - After asking, stop. Do not perform the blocked action in the same response, and never settle a user-owned choice by proceeding.
19
- - Never ask the user to choose between factual claims that available evidence can settle.
20
- - Urgency, prior effort, reviewer confidence, common practice, or general approval to continue does not resolve an unnamed decision or source conflict.
21
- - An explicit choice resolves only the decision that was asked. A question, criticism, hypothesis, preference, conditional answer, or request for more information is not a decision, and no answer authorizes unrelated effects, another outcome, or a separately controlled boundary.
22
- - Decision Gate runs no experiments and does not change task memory; return those needs to Workflow.
23
-
24
- ## Enter With One Decision
25
-
26
- Goal: use the gate only for a real, bounded, blocking choice.
27
-
28
- Use Decision Gate when:
29
-
30
- - the requested or accepted path is known;
31
- - one unresolved choice or material source conflict can be stated precisely;
32
- - available evidence and established source precedence do not already settle it;
33
- - different realistic answers would materially change what follows;
34
- - proceeding would silently decide for the user or override accepted source truth.
35
-
36
- Do not use it for facts available through focused passive inspection, reversible implementation details that preserve the accepted outcome, ordinary authorization for one clear additional action, preferences that do not affect the result, hypothetical edge cases without supported reachability or consequence, or broad option spaces that still need exploration; use [Discuss](../discuss/SKILL.md) when the problem, alternatives, assumptions, or direction are not yet bounded enough for one decision.
37
-
38
- When several decisions appear, ask the earliest one whose answer determines whether the others remain relevant. Do not turn the gate into an interview.
39
-
40
- ## Resolve Facts Before Asking
41
-
42
- Goal: the question the user receives contains only what they must decide.
43
-
44
- Inspect the smallest existing evidence that can settle the factual part: the current request, accepted decisions, code, tests, documentation, Specs, policies, ADRs, repository state, supplied artifacts, and current primary sources when relevant.
45
-
46
- When accepted sources appear to conflict:
47
-
48
- 1. state each source's exact claim and applicable scope;
49
- 2. determine whether each is current, accepted, draft, historical, generated, or advisory;
50
- 3. apply repository-defined precedence or maintenance policy when one exists;
51
- 4. identify the observable consequence of following each claim.
52
-
53
- A difference is material only when applicable sources make incompatible claims and selecting between them changes the accepted result or next safe action. Do not invent a universal hierarchy: code is not correct because it runs, tests are not requirements because they fail, documentation is not stale because implementation differs, and task memory does not override live accepted source truth.
54
-
55
- If established precedence resolves the conflict, return the supported result to Workflow without asking. Updating an inconsistent source belongs to its owning activity and needs its own authority. If framing the choice responsibly needs new active evidence, return the exact claim, proposed observer, expected evidence, and stop condition to Workflow.
56
-
57
- ## Ask One Direct Question
58
-
59
- Goal: the user can decide from one message, and knows what you recommend.
60
-
61
- State proportionately:
62
-
63
- 1. the requested or previously accepted path;
64
- 2. the exact missing choice or conflicting evidence;
65
- 3. why it changes the next action;
66
- 4. the realistic options and material tradeoffs;
67
- 5. a recommendation when evidence supports one;
68
- 6. one direct question that resolves the block.
69
-
70
- Frame the choice around the outcome the user owns, not implementation mechanics: do not ask which file to change when the real decision is which behavior or contract should govern. Do not manufacture a menu; omit dominated, unsafe, unavailable, or hypothetical options. A yes-or-no question fits when one supported deviation needs a decision. Include preserving current behavior, waiting, or stopping only when each is real.
71
-
72
- Recommend plainly when one path is better supported, with its principal tradeoff and what would change the recommendation. A recommendation is not the user's decision.
73
-
74
- ## Interpret And Return The Decision
75
-
76
- Goal: carry exactly the decision made, no more and no less, back to the work.
77
-
78
- Respond to the substance of anything that is not a decision, and keep the blocked action stopped. Route narrowly:
79
-
80
- - explicit choice with a clear covered path -> Workflow;
81
- - answer that reopens alternatives or assumptions -> Discuss;
82
- - unresolved factual evidence -> Workflow and the appropriate evidence owner;
83
- - defer, preserve, or stop -> return that outcome without forcing progress.
84
-
85
- A resolved decision may complete the missing intent for a still-valid request. Return to Workflow with the exact decision and who or what established it, the selected outcome and important exclusions, material consequences and affected source truth, remaining uncertainty or revisit condition, and the authority state of the next action. When losing the decision or its rationale could cause later misalignment, Workflow may route [Track Work](../track-work/SKILL.md) to preserve it.
86
-
87
- Stop when one direct question has been asked and no answer exists, the answer does not resolve the material block, the decision owner is unavailable, or active evidence is required before a responsible choice can be framed. A supported wait, deferment, preservation boundary, or stop is a valid result.
@@ -1,108 +0,0 @@
1
- ---
2
- name: design-for-depth
3
- description: "Use during coding and software design to keep boundaries, interfaces, ownership, state, dependencies, and failure behavior simple and proportionate."
4
- ---
5
-
6
- # Design For Depth
7
-
8
- Hide coherent, likely-changing decisions behind small, stable, outcome-level interfaces. Reduce the knowledge and coordination callers need without changing the accepted outcome.
9
-
10
- A module is anything with an interface and an implementation. Its interface includes every fact a caller needs for correct use: operations, decisions, inputs, state, ordering, effects, errors, dependencies, timing, and recovery. A module is **deep** when it provides much useful, coherent behavior per unit of caller knowledge; depth is not fewer methods or more responsibilities.
11
-
12
- Use this lens under the current activity. It is not a mandatory phase, an architecture owner, or permission to refactor.
13
-
14
- The **Rules** below are binding; if one cannot be met, stop and say why. Everything else is **judgment**: follow its stated goal, and adapt when a different choice serves that goal better.
15
-
16
- ## Rules
17
-
18
- - A design recommendation is not implementation authority, and this lens never enlarges a task by itself. A new dependency must earn its place through the accepted outcome or a demonstrated need.
19
- - Never remove required correctness, trust, or safety to make a design smaller. Never turn hypothetical lifecycle completeness into a production requirement.
20
- - Never design around an invented product or failure policy. When a boundary changes product behavior, public interfaces, compatibility, permissions, security, privacy, billing, data-loss behavior, migration direction, or another user-owned outcome, use [Decision Gate](../decision-gate/SKILL.md) with its concrete consequences and supported alternatives.
21
- - Do not invent APIs, files, or stronger guarantees to make a design look complete; name the missing observation or choice instead.
22
-
23
- ## Start With The Required Outcome
24
-
25
- Goal: know whether the change touches a boundary worth designing, before designing anything.
26
-
27
- Understand enough breadth to identify the caller's complete outcome, accepted constraints, current interface, dependencies, canonical state, and relevant success and failure boundary. Do not survey the entire system or settle future variations without a present question.
28
-
29
- Ask:
30
-
31
- 1. What outcome is changing?
32
- 2. What must callers currently know or coordinate?
33
- 3. Does the change spread policy, state, dependency choices, or lifecycle knowledge?
34
- 4. Would the current boundary make correct use or the next likely change materially harder?
35
-
36
- For a local, source-backed, reversible change that leaves these boundaries sound, apply the lens silently and continue: load no references, generate no alternatives, add no abstraction because another shape is imaginable. A large mechanical change may need no design escalation; a one-line change may need it when it changes permissions, public behavior, canonical state, or consequential failure semantics.
37
-
38
- ## Intervene Where The Decision Can Still Change
39
-
40
- Goal: settle consequential choices before they harden into caller contracts, and leave ordinary mechanics free.
41
-
42
- Use the lens early when interface, ownership, state, or failure choices could harden. It can support discussion, a Spec or Plan, implementation preparation, or choosing a test seam.
43
-
44
- Read [Implementation Decisions](references/implementation-decisions.md) when unresolved representation, identity, ownership, algorithm, dependency, or failure choices could materially change a technical recommendation or invalidate significant dependent work, before recommending a mechanism, writing its guiding design, or beginning substantial implementation.
45
-
46
- Once a boundary is supported, do not reopen it because this skill remains in context. Re-enter when evidence shows growing caller coordination, scattered policy, exposed internal states, fragile test choreography, unclear dependency or failure ownership, or an invalidated design assumption. Ordinary bugs, duplication, test awkwardness, finding count, and preference do not establish structural pressure. Use [Diagnose Failure](../diagnose-failure/SKILL.md) first when repeated or unexplained failures lack a supported cause; this lens consumes a structural finding rather than inventing one.
47
-
48
- ## Bound Success And Failure Proportionately
49
-
50
- Goal: the failure behavior that matters is owned, and nothing more is built.
51
-
52
- Before choosing classes, services, packages, flags, or states, name:
53
-
54
- - the caller and complete accepted outcome;
55
- - caller-owned decisions and observable success and failure;
56
- - the likely-changing coordination the module could hide;
57
- - the **failure unit**: what must succeed, fail, and recover as one coherent boundary.
58
-
59
- Where effects or partial state are consequential, establish the material failure contract: observer, canonical and diagnostic state, forbidden outcomes, stop/degrade/fail/retry behavior, and supported recovery. Include cancellation, concurrency, or reconciliation only where required behavior or observed reachability makes them material. Read [State And Failure Boundaries](references/state-and-failure-boundaries.md) when correctness depends on them.
60
-
61
- Distinguish required correctness and safety from optional stronger guarantees. Efficiency, scale, and portability need an accepted requirement or observed pressure before they shape the design. A module owning a failure unit does not automatically need durable replay, rollback, universal provenance, or every recovery mechanism.
62
-
63
- ## Hide Coordination Without Hiding Caller Choices
64
-
65
- Goal: callers request outcomes; the module owns the protocol.
66
-
67
- Before exposing a flag, path, state, ordering rule, retry, provider detail, or recovery step, ask whether the caller genuinely owns it, whether it makes correct use easier, and whether it is stable enough to become a supported contract.
68
-
69
- Keep public: caller-owned outcomes and decisions, necessary inputs and stable invariants, observable success and failure, and information required for correct recovery. Keep internal unless callers genuinely control it: sequencing, storage layout, dependency construction, provider mechanics, retries, cleanup, temporary states, caches, optimization machinery, and diagnostic details.
70
-
71
- A **seam** lets behavior, a dependency, or an observer change without coordinated surrounding edits; the adapter, clock, provider, or probe that plugs into it is what varies. Add one for demonstrated variation, a known migration, a required observer, or a dependency needing control, not for imagined flexibility.
72
-
73
- Do not centralize unrelated responsibilities to reduce interface count, or scatter an old protocol into callers while claiming an abstraction was removed.
74
-
75
- ## Load Only The Depth The Question Needs
76
-
77
- Goal: read the one reference that answers the open question, and stop.
78
-
79
- - [Design Pressure Signals](references/design-pressure-signals.md): observed coordination could change the route, or pressure is supported but the missing boundary cannot yet be named.
80
- - [Interface Design Loop](references/interface-design-loop.md): comparing materially different interfaces, choosing consequential ownership, freezing an important correctness boundary, or choosing among real seam placements.
81
- - [State And Failure Boundaries](references/state-and-failure-boundaries.md): correctness depends on canonical state, partial effects, atomic visibility, concurrency, cancellation, retries, idempotency, recovery, reconciliation, or failure evidence.
82
- - [Module And Dependency Design](references/module-and-dependency-design.md): decomposition, cohesion, dependency direction, cycles, layering, shared ownership, policy versus infrastructure, or ports and adapters.
83
-
84
- Read references one at a time while each distinct question remains. Do not convert their lists into obligations unrelated to the accepted result.
85
-
86
- ## Learn Without Building The Future System
87
-
88
- Goal: when evidence cannot choose between boundaries, answer that question cheaply.
89
-
90
- Frame a bounded prototype or observation through the current owner: question, alternatives, adequate observer, permitted effects, evidence, return condition, and disposition. The experiment must answer the design question; if its next prerequisite is future production infrastructure, reassess before building it. One failed extension or technique does not prove every in-scope approach impossible.
91
-
92
- Return a supported boundary or an explicit limitation. Working exploratory code is evidence, not production architecture; promotion needs deliberate selection and authority, and a negative answer does not require another, broader prototype.
93
-
94
- ## Check Through The Intended Interface
95
-
96
- Goal: tests protect the behavior callers rely on, not the machinery.
97
-
98
- The intended interface should normally be the behavior and test surface. Question the design when callers or tests must bypass it, coordinate private lifecycle steps, replace many internals, or know dependency construction the module should own. An internal test inspecting internals is not itself a defect; the concern is callers needing hidden knowledge, or a fixture manufacturing the behavior it claims to observe.
99
-
100
- Architecture-bearing checks protect accepted behavior, visible failures, required state invariants, forbidden partial outcomes, settled recovery, and real dependency or observation seams. Tests that protect accidental machinery do not justify keeping it. Test order is not a design criterion.
101
-
102
- ## Return The Smallest Supported Change
103
-
104
- Return to [Workflow](../workflow/SKILL.md) when ownership, scope, authority, or the route changes. Otherwise return to the current activity with the structural evidence, affected outcome, boundary, likely-changing decision, assumptions, and remaining evidence or user-owned choice.
105
-
106
- Compare alternatives only when real. Recommend the simplest supported boundary that preserves required behavior, with its principal cost and what would invalidate it. Results include keeping the existing design, a local correction, diagnosis, an artifact revision, a bounded learning action, an accepted deepening, explicit deferral, or a stop for owner direction. Use [Simplify Code](../simplify-code/SKILL.md) when the selected result is behavior-preserving reduction.
107
-
108
- Freeze a sufficiently supported boundary instead of pursuing architectural completeness.
@@ -1,84 +0,0 @@
1
- # Design Pressure Signals
2
-
3
- Read this when observed coordination could change the next route and an equivalent design-route classification is not already supported, or when structural pressure is supported but the likely-changing decision or missing information-hiding boundary cannot yet be named.
4
-
5
- This reference is judgment. Identify the pressure that changes the next action, or conclude that none does; do not count smells, and do not produce a literature review or system-wide redesign.
6
-
7
- ## Classify The Evidence
8
-
9
- Ask:
10
-
11
- 1. What caller outcome and interface are affected?
12
- 2. What facts must callers know or coordinate?
13
- 3. Did the current change add to that knowledge?
14
- 4. What policy, dependency, state transition, or failure behavior is spreading?
15
- 5. Is the cause supported?
16
- 6. Can the issue be resolved inside accepted scope and authority?
17
-
18
- Choose the narrowest supported route:
19
-
20
- - **Continue:** the current boundary remains sound.
21
- - **Local correction:** the defect stays within one module and contract.
22
- - **Diagnosis:** a failure is repeated or unexplained and its cause is unsupported.
23
- - **Spec or Plan revision:** behavior, acceptance, or the execution boundary is incomplete.
24
- - **User decision:** resolving the pressure changes a user-owned outcome.
25
- - **Learning:** evidence cannot distinguish viable boundaries.
26
- - **Deepening:** a supported information-hiding improvement fits accepted scope.
27
- - **Deferred deepening:** the pressure is real but not worth resolving now.
28
-
29
- ## Recognize The Signals
30
-
31
- Complexity is coordination, not line count. It shows up as change amplification (one change needs many surrounding edits), cognitive load (callers must remember many facts), obscurity (important rules are hard to find), dependency burden (safe change needs unrelated modules understood), and unknown unknowns (a caller cannot tell what else to inspect). A large implementation can be simple to use; a small helper can be complex when every caller must know its quirks.
32
-
33
- - **Change amplification.** One policy change needs edits across unrelated callers, such as a retry policy touching routes, workers, UI state, and tests. Name the decision causing the edits; do not merely move the same choreography into one helper.
34
- - **Caller protocol growth.** Callers perform internal lifecycle steps (`configure -> open -> retry -> translate error -> clean up -> publish evidence`), each correction adds a state or flag, recovery becomes ordinary caller behavior, or callers depend on paths, filenames, provider errors, or queue names. Ask whether one operation can own the complete success and failure unit while publishing diagnostics separately.
35
- - **Scattered policy.** One product or operational decision is encoded in several places, such as billing transition timing in a webhook, dashboard, email, and worker. Do not centralize it until the policy is accepted; stop for a decision when it is user-owned or conflicting.
36
- - **Unowned state or failure.** No module owns canonical state and its visibility point, forbidden partial outcomes, retry or escalation, cancellation and reconciliation, recovery after partial completion, or the evidence proving the final state.
37
- - **Contract-surface growth.** Each patch adds public flags, temporary states, manifest fields, retry links, recovery instructions, provider-specific errors, or cache and integrity controls. Ask whether callers own those facts or are being forced to understand internal protocol.
38
- - **Distorted tests.** Tests reproduce caller choreography, mock many helpers to verify one outcome, depend on private lifecycle states, protect machinery from recent patches, prove rejection without checking forbidden writes, or make provider mechanics look like domain requirements. First inspect whether the production boundary owns the complete behavior; do not automatically add mocks or test-only seams.
39
- - **Edge-case patch streams.** Related fixes keep adding conditions, states, or caller rules (missing contact, then fallback, then duplicate delivery, then retry telemetry, then another exposed state). Diagnose whether the cases share one missing contract, state owner, or failure unit; finding count alone is not architecture.
40
- - **Scope growth.** A bounded result unexpectedly needs a subsystem, expands remaining work, pulls in deferred capabilities, invalidates earlier evidence, or requires unrelated callers to change. Return the evidence; the route may be simplify, split, revise an artifact, learn, defer, or stop.
41
-
42
- Common interface mismatches:
43
-
44
- - **Pass-through wrapper:** renames a call without hiding policy or provider behavior; keep it only for a real domain, compatibility, or observation boundary.
45
- - **Leaky interface:** callers know infrastructure-specific details.
46
- - **God module:** unrelated decisions collected behind one interface.
47
- - **Speculative seam:** indirection for imagined variation.
48
- - **Dependency cycle:** modules cannot change independently because their responsibilities point at each other.
49
- - **Premature artifact detail:** a Spec or Plan freezes classes, factories, tables, or algorithms before evidence supports the boundary.
50
-
51
- ## Rule Out False Positives
52
-
53
- Do not escalate when stable repetition is small and local, broad edits are mechanical and source-backed, a one-off script needs no long-term abstraction, a wrapper preserves a real compatibility contract, an isolated condition is wrong but the interface is sound, an internal test intentionally verifies an internal module, or resolving the pressure would exceed the user's goal without blocking it.
54
-
55
- ## Name The Missing Boundary
56
-
57
- When pressure is supported, find the decision the module should hide.
58
-
59
- Organize modules around decisions likely to change, not processing steps. Instead of exposing `parse -> validate -> retry -> send -> log -> clean up`, look for the decision those steps implement, such as a notification delivery policy. Ask which decision would cause the most surrounding edits if it changed, which callers know it now, who should own it, what outcome-level interface would let callers stop knowing it, and whether it is accepted or still user-owned. Failure and recovery policy are often the likely-changing decision.
60
-
61
- A deep module lets callers state the outcome while it owns sequencing, likely-changing policy, internal transitions, cleanup, provider mechanics, and internal failure handling. A wrapper is not deep because it hides lines; it is deep when callers stop knowing concepts or coordinating protocol. Depth is not breadth: a god module hiding unrelated decisions is not deep.
62
-
63
- Prefer proportionate strategic design over tactical patching, not maximal architecture: stop the current patch when it clearly spreads a likely-changing decision, adds caller protocol, exposes internal state, creates another required workaround, or makes the next accepted change materially harder.
64
-
65
- Preserve conceptual integrity: one coherent model of the outcome, state, and failure behavior. Pressure exists when a concept has different names or rules across callers, several modules partly own one decision, callers translate between incompatible representations, or each feature adds another exception to the shared concept. This does not mean one module or one abstraction.
66
-
67
- Every observable fact is a contract callers may depend on: flags, paths, states, errors, timing rules, fallbacks, ordering, filenames, retry counts. Expose a fact only when the caller owns the decision, correct use requires it, it is stable enough to support, and its compatibility cost is understood.
68
-
69
- Classify each proposed mechanism by what it is for: **trust** (knowing the result is valid), **safety** (preventing damage, leakage, or runaway behavior), **efficiency**, **scale**, or **portability**. Trust and safety cannot be deferred to simplify a design; efficiency, scale, and portability need an accepted requirement or observed pressure.
70
-
71
- Name the boundary with supported evidence:
72
-
73
- ```text
74
- Outcome:
75
- Coordination currently spread across:
76
- Likely-changing decision:
77
- Current owners:
78
- Proposed owner:
79
- What callers would stop knowing:
80
- Failure unit:
81
- Evidence still missing:
82
- ```
83
-
84
- If the decision cannot yet be named, define one bounded learning question rather than a generic abstraction. Stop once the route is classified and the missing boundary is named, or evidence shows no worthwhile boundary change; return the evidence and classification without redesigning automatically.
@@ -1,76 +0,0 @@
1
- # Implementation Decisions
2
-
3
- Read this when unresolved representation, identity, ownership, algorithm, dependency, or failure choices could materially change a technical recommendation or invalidate significant dependent work. Apply it before recommending a mechanism during discussion, writing its guiding design, or beginning substantial implementation. Skip it for a supported local change whose remaining mechanics do not alter those boundaries.
4
-
5
- This reference is judgment, used under Design for Depth and the current activity. It does not create another planning phase, document requirement, approval gate, or compute role.
6
-
7
- ## Identify What Implementation Would Still Have To Invent
8
-
9
- Start from the current goal and constraints, relevant source evidence, and existing design. During discussion, mark unsettled outcomes and approaches as provisional: compare their consequences without turning an explored option into an accepted requirement. Select supported engineering details within the agreement; return user-owned choices through the current activity. Ask:
10
-
11
- > Which remaining choices could change correctness, complexity, failure behavior, or force substantial dependent work to be redone?
12
-
13
- Name the actual question, not a generic demand for more design. For example, deciding which occurrence identifies a source matters more than choosing Map versus array; deciding what survives a failed transfer matters more than choosing a retry helper.
14
-
15
- For each consequential unknown, choose one route:
16
-
17
- - **Evidence supports a mechanism:** select it and explain why it fits.
18
- - **An environmental fact is missing:** identify the observation that distinguishes the alternatives before dependent implementation.
19
- - **A user-owned boundary is unsettled:** return that choice through the current owner.
20
- - **Only ordinary mechanics remain:** leave them to implementation and continue.
21
-
22
- Do not invent APIs, future files, or stronger guarantees to complete the design. Nor should the user have to choose implementation syntax: explain user-owned consequences and resolve supported engineering details within the agreement.
23
-
24
- ## Choose The Representation And Mechanism
25
-
26
- Develop only the decisions that answer the current question. Reuse supported design rather than filling every category:
27
-
28
- | Decision | Make explicit when material |
29
- | --- | --- |
30
- | Representation and identity | Domain objects and independent lifetimes; what counts as the same occurrence; what must remain distinct |
31
- | State and ownership | Authoritative facts, derived caches, transition owner, and permitted mutations |
32
- | Algorithm and cost | Essential steps; collection keys and relationships; update/invalidation rules; work repeated as input grows |
33
- | Effects and failure | Required ordering; what is accepted or visible at each boundary; what survives failure and what may be retried |
34
- | Modules and dependencies | Who hides each decision; which callers consume the result; dependencies or coordination that must not spread |
35
- | Evidence | Observable required behavior and a plausible wrong implementation the check must reject |
36
-
37
- Use Design for Depth's interface, state/failure, and module references when their named questions need resolution; do not repeat their full methods here. Compare materially different approaches only when they remain viable. Prefer eliminating unnecessary coordination to hiding the same protocol behind another helper.
38
-
39
- ## Preserve The Decision, Not A Complete Patch
40
-
41
- Communicate enough for another implementer, or your later context, to retain the chosen approach:
42
-
43
- - the decision and its source basis;
44
- - why it fits and the invariant it protects;
45
- - the essential mechanism, including a small type or control-flow sketch when useful;
46
- - the counterexample and distinguishing observer;
47
- - required constraints versus suggested mechanics and local freedom;
48
- - the evidence or condition that would invalidate the choice.
49
-
50
- Use a paragraph, example, or compact table. Do not prescribe every loop or helper, or reproduce the whole program in prose. Naming a data structure without its keys, meaning, and maintenance rules is not useful algorithmic direction.
51
-
52
- Keep durable decisions in the owning technical design; keep execution order in the Plan and changed understanding in task memory. A current assignment should carry the applicable decisions and relevant source section, not another complete copy of every artifact. A path or hash does not establish that its contents are available to the implementer.
53
-
54
- ## Check Realization Before Dependent Expansion
55
-
56
- When an unfamiliar boundary could invalidate substantial later work, choose the first coherent implementation path that can disagree with the design. It may span several files and a failure case. A skeleton, happy-path result, or green summary alone may not exercise the decision.
57
-
58
- Assess the actual implementation and observation: which important choices were realized, omitted, contradicted, or replaced with a supported reason? Check ownership, identity, ordering, and the observer—not fidelity to suggested filenames or helper syntax.
59
-
60
- A precise sketch can be wrong. Preserve accepted behavior, stop dependent effects when the mechanism is invalidated, and resolve the affected choice through the current owner. Supported local corrections need no design restart. Once the boundary is established, reuse it rather than repeating this assessment after every edit.
61
-
62
- ## Examples
63
-
64
- ### Identity And Indexing
65
-
66
- Weak direction: "Use a Map and avoid repeated scans."
67
-
68
- Useful direction: "Keep native occurrence IDs as source identity. Equal bodies may identify several candidates; do not merge their occurrences. Let the source owner maintain the result-to-exchange relationship. Update appended sources and rebuild affected indexes after ancestry replacement. Check repeated equal bodies, late attribution, and a branch change; measure the repeated preparation path rather than only an isolated lookup. Helper layout is local. Reconsider the index if the source does not provide the assumed stable identity."
69
-
70
- ### Acknowledgment And Retry
71
-
72
- Weak direction: "Make persistence idempotent and robust."
73
-
74
- Useful direction: "The append owner distinguishes observed acknowledgment from an uncertain attempt. An equal entry in memory does not resolve an earlier failure. Validate before mutation; publish accepted state only at the supported acknowledgment boundary. Test append advancing memory then failing, followed by the identical operation: uncertainty must remain until supported reconciliation. Also test an acknowledged duplicate so the implementation does not reject every retry. Do not infer filesystem durability from readback. Reconsider the mechanism if the actual host boundary differs."
75
-
76
- Stop when the current discussion has a supported recommendation or explicit open question, or the next implementation has a supported approach and intentional local freedom. Preserve provisional versus accepted decisions when passing the result back to the current activity; discussion does not authorize implementation. Do not pursue a complete blueprint for later work whose premises remain unsettled.
@@ -1,105 +0,0 @@
1
- # Interface Design Loop
2
-
3
- Read this before comparing materially different interfaces or settling an important correctness boundary where ownership is consequential.
4
-
5
- This reference is judgment. Use only evidence and criteria capable of distinguishing viable boundaries; the numbered steps are an order of thinking, not output to emit.
6
-
7
- ## 1. Frame The Complete Outcome
8
-
9
- Orient broadly enough to state:
10
-
11
- - caller and complete outcome;
12
- - source-backed behavior and non-goals;
13
- - decisions the caller genuinely owns;
14
- - dependencies and current constraints;
15
- - material state and failure boundaries;
16
- - why the current seam requires attention.
17
-
18
- Do not begin from existing flags, storage paths, classes, or temporary states. They may be symptoms of the current design.
19
-
20
- ## 2. Define The Failure Unit
21
-
22
- Name the failure unit as Design for Depth's Bound Success And Failure describes, including whether partial reuse is required or merely an optimization. When correctness depends on canonical state, partial effects, atomic visibility, concurrency, cancellation, retries, recovery, reconciliation, or final-outcome evidence, read [State And Failure Boundaries](state-and-failure-boundaries.md).
23
-
24
- ## 3. Inventory Material Caller Knowledge
25
-
26
- List only facts callers must know and that could affect the boundary:
27
-
28
- - operations and inputs;
29
- - caller-owned decisions;
30
- - ordering and lifecycle states;
31
- - configuration and provider details;
32
- - dependencies;
33
- - errors and failure semantics;
34
- - compatibility and migration;
35
- - recovery, cost, and performance expectations.
36
-
37
- For each fact ask:
38
-
39
- - Does the caller own it?
40
- - Could the module own it?
41
- - Is it stable enough to expose?
42
- - Would changing it force surrounding edits?
43
-
44
- The goal is not zero interface knowledge. It is the smallest honest contract.
45
-
46
- ## 4. Classify What Each Mechanism Is For
47
-
48
- Separate required trust and safety from efficiency, scale, and portability, as [Design Pressure Signals](design-pressure-signals.md) describes. Do not defer required correctness for a simpler-looking interface, or promote hypothetical efficiency, scale, or portability into present architecture.
49
-
50
- ## 5. Produce Alternatives Only When Real
51
-
52
- When materially different ownership choices remain viable, design two or three interfaces that change seam placement—not only terminology.
53
-
54
- For each show:
55
-
56
- 1. ordinary caller usage;
57
- 2. caller-owned decisions;
58
- 3. hidden internal protocol;
59
- 4. failure unit and observable behavior;
60
- 5. dependency and adapter strategy;
61
- 6. evidence needed;
62
- 7. material cost or limitation.
63
-
64
- When module decomposition, cohesion, dependency direction, cycles, layering, policy-versus-infrastructure ownership, or change propagation materially affects the design, read [Module And Dependency Design](module-and-dependency-design.md).
65
-
66
- Do not manufacture alternatives for a local, reversible, source-backed choice.
67
-
68
- ## 6. Compare On Discriminating Criteria
69
-
70
- Use only criteria that could change the recommendation:
71
-
72
- - behavior per interface fact;
73
- - locality of likely change;
74
- - cohesion and ownership clarity;
75
- - correct-use ergonomics;
76
- - misuse and hidden-decision risk;
77
- - dependency direction;
78
- - failure honesty and recovery;
79
- - contract stability;
80
- - test surface;
81
- - reversibility;
82
- - maturity fit;
83
- - implementation and evidence cost.
84
-
85
- Prefer the boundary that removes concepts and coordination, not one that centralizes the same protocol behind additional terminology.
86
-
87
- ## 7. Learn Before Freezing
88
-
89
- When evidence cannot distinguish viable boundaries, define one bounded learning slice:
90
-
91
- ```text
92
- Question:
93
- Competing boundaries:
94
- Smallest prototype or observation:
95
- Evidence required:
96
- Time or cost boundary:
97
- Discard-or-promote rule:
98
- Return condition:
99
- ```
100
-
101
- The learning slice answers the design question. It does not quietly implement the whole subsystem.
102
-
103
- ## 8. Return The Supported Boundary
104
-
105
- Return the selected boundary with its structural evidence, hidden decision, caller-owned contract, failure behavior, the discriminating reason when alternatives were real, unresolved user-owned decisions, and the narrowest next route. Stop once a boundary is supported or a bounded learning question is identified.
@@ -1,117 +0,0 @@
1
- # Module And Dependency Design
2
-
3
- Read this when module decomposition, cohesion, dependency direction, cycles, layering, policy-versus-infrastructure ownership, or change propagation materially affects the design.
4
-
5
- This reference is judgment. Do not use it merely because the codebase has many files or dependencies.
6
-
7
- ## Decompose Around Coherent Decisions
8
-
9
- A module should own one coherent outcome, policy, state boundary, or failure unit.
10
-
11
- Do not split only by:
12
-
13
- - processing step;
14
- - technical file type;
15
- - framework convention;
16
- - arbitrary size;
17
- - desire for more abstractions.
18
-
19
- Ask:
20
-
21
- - Which behavior changes together?
22
- - Which decision has one reason to change?
23
- - Which state and failure behavior belong together?
24
- - What should callers stop coordinating?
25
-
26
- ## Prefer Cohesion Over Convenience
27
-
28
- High cohesion means related behavior, invariants, state, and failure handling live together.
29
-
30
- Pressure exists when:
31
-
32
- - one module owns unrelated policies;
33
- - one policy is spread across many modules;
34
- - state transitions are separated from their invariants;
35
- - failure handling is detached from the operation it protects;
36
- - callers assemble the real behavior from helpers.
37
-
38
- Do not centralize unrelated behavior merely to reduce duplication.
39
-
40
- ## Direct Dependencies Toward Stable Policy
41
-
42
- Policy should not depend directly on volatile infrastructure details when those details can change independently.
43
-
44
- Prefer:
45
-
46
- ```text
47
- stable outcome or policy
48
- -> small dependency interface
49
- -> infrastructure adapter
50
- ```
51
-
52
- Use dependency inversion only when it hides real variation, provider mechanics, migration, or testing control.
53
-
54
- Do not add interfaces around every concrete implementation.
55
-
56
- ## Detect Dependency Cycles
57
-
58
- A dependency cycle often indicates:
59
-
60
- - responsibilities are divided incorrectly;
61
- - shared policy has no owner;
62
- - state is jointly owned;
63
- - interfaces expose implementation details;
64
- - modules must know each other’s lifecycle.
65
-
66
- Do not break a cycle by moving imports or creating a neutral-looking utility while preserving the same conceptual cycle.
67
-
68
- Name the shared decision and assign ownership.
69
-
70
- ## Preserve Honest Layering
71
-
72
- A layer is useful when it hides a distinct level of decision.
73
-
74
- A layer is shallow when it:
75
-
76
- - forwards calls;
77
- - renames types;
78
- - exposes lower-layer errors and states;
79
- - requires callers to understand both layers;
80
- - exists only to satisfy a pattern.
81
-
82
- Allow a higher-level module to request outcomes. Keep infrastructure details below the boundary.
83
-
84
- ## Use Ports And Adapters Proportionately
85
-
86
- A port is an outcome or capability required by policy. An adapter supplies concrete infrastructure.
87
-
88
- Use when:
89
-
90
- - provider variation exists;
91
- - migration is known;
92
- - infrastructure details leak into policy;
93
- - tests require safe dependency control.
94
-
95
- Avoid when:
96
-
97
- - one stable implementation exists;
98
- - the wrapper hides no decision;
99
- - the generic interface preserves provider quirks;
100
- - caller complexity does not decrease.
101
-
102
- ## Keep Shared Code From Becoming Shared Ownership
103
-
104
- A shared helper may centralize syntax while leaving policy ownership scattered.
105
-
106
- Before extracting shared code, ask:
107
-
108
- - Is this one concept that should evolve together?
109
- - Who owns its behavior and failure contract?
110
- - Are callers still making the same decision independently?
111
- - Does extraction remove coordination or merely relocate code?
112
-
113
- Some duplication is cheaper than a shared abstraction with unclear ownership.
114
-
115
- ## Return
116
-
117
- Test module shape through its contract, as Design for Depth's Check Through The Intended Interface describes; do not make production architecture imitate the test framework. Return the affected responsibilities, policy/state/failure ownership, dependency direction, any cycle or layering pressure, and the proposed boundary with the variation or migration that justifies its seams. Stop when dependencies support the outcome without unnecessary coordination; do not reorganize the codebase for conceptual purity.