@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,97 +0,0 @@
1
- # Adjudicate Work Review
2
-
3
- Read this after an independent work review returns and before selecting what follows from its report.
4
-
5
- This reference is judgment; Review Work's Rules still bind. Adjudication belongs to the receiving active agent. It tests the report against the reviewed state, source truth, and evidence. It is not independent review and does not inherit the reviewer's authority or judgment.
6
-
7
- ## Dispose Each Material Item
8
-
9
- For every material item, choose one disposition.
10
-
11
- ### Accepted
12
-
13
- State:
14
-
15
- - the supported implementation problem;
16
- - its consequence for the reviewed boundary;
17
- - whether it is Blocking or Non-blocking;
18
- - whether its cause is supported, unnecessary to select a clear local correction, or uncertain.
19
-
20
- ### Rejected
21
-
22
- State the concrete reason: unsupported, stale, resolved, duplicate, preference-only, out of scope, or based on a source misread.
23
-
24
- ### Open
25
-
26
- State:
27
-
28
- - the unresolved concern;
29
- - its potential boundary consequence;
30
- - the missing evidence or owner decision.
31
-
32
- When factual evidence is missing, restate the item as a Verify Work input: claim, required observing boundary, available evidence and its limit, and the smallest evidence that could disagree.
33
-
34
- A suggested correction may help explain a finding, but it does not establish cause, select the remedy, or authorize implementation.
35
-
36
- After disposing the items, derive the adjudicated judgment. Do not separately accept the reviewer's overall judgment.
37
-
38
- - **Pass:** no accepted Issues or material Open items remain.
39
- - **Non-blocking:** only accepted Non-blocking Issues remain.
40
- - **Inconclusive:** a material Open item prevents judgment.
41
- - **Blocking:** at least one accepted Blocking Issue remains.
42
-
43
- ## Use Verification Results
44
-
45
- Route a known material evidence gap through [Workflow](../../../skills/workflow/SKILL.md) to [Verify Work](../../../skills/verify-work/SKILL.md). Verification produces factual evidence; it does not revise the reviewer's report or determine the review judgment.
46
-
47
- - **Supported:** re-adjudicate the evidence gap. Do not infer Pass.
48
- - **Contradicted:** re-adjudicate against source truth; the result may establish an Issue, invalidate one, or expose a source conflict.
49
- - **Inconclusive:** keep the item Open. The adjudicated review remains Inconclusive when the gap is material.
50
- - **Unavailable:** keep the item Open and state why the required boundary cannot currently be observed.
51
-
52
- Select focused independent follow-up only when the new evidence still requires judgment from a separate context.
53
-
54
- ## Decide Whether Remediation Is Ready
55
-
56
- Remediation is ready when:
57
-
58
- - required behavior is settled;
59
- - the problem and boundary consequence are supported;
60
- - enough cause or decision basis exists to bound a correction;
61
- - affected interactions and dependencies are known sufficiently;
62
- - no material alternative or user-owned choice remains.
63
-
64
- When remediation is ready, state:
65
-
66
- - the proposed correction and rationale;
67
- - affected behavior and locations;
68
- - required ordering or constraints;
69
- - regression evidence and verification boundary;
70
- - whether focused independent follow-up remains justified;
71
- - the authority state.
72
-
73
- Use existing correction authority only when it covers that result. Otherwise propose the correction and any warranted follow-up once, then wait. A finding, adjudication, or selected review does not authorize mutation.
74
-
75
- Actual correction returns to [Execute Work](../../../skills/execute-work/SKILL.md). Preserve the accepted behavior; do not change tests, Specs, policies, or source truth merely to satisfy a reviewer or obtain Pass.
76
-
77
- ## Route When Remediation Is Not Ready
78
-
79
- - unclear or repeated cause: [Diagnose Failure](../../../skills/diagnose-failure/SKILL.md);
80
- - unsettled direction or materially different remedies: [Discuss](../../../skills/discuss/SKILL.md);
81
- - user-owned choice or source conflict: [Decision Gate](../../../skills/decision-gate/SKILL.md);
82
- - missing factual support: route the named claim through [Workflow](../../../skills/workflow/SKILL.md) to [Verify Work](../../../skills/verify-work/SKILL.md);
83
- - uncovered correction: propose the bounded correction and wait.
84
-
85
- When findings interact, assumptions are challenged, or user input could change the remedy, report a problem checkpoint and stop before selecting or executing a correction.
86
-
87
- ## After Authorized Correction
88
-
89
- Verify the affected boundary and perform ordinary self-review.
90
-
91
- Select focused independent follow-up only when accepted corrections, affected interactions, new evidence, or remaining risk still require judgment from a separate context. Do not dispatch follow-up merely because Review 1 found an Issue or because remediation occurred.
92
-
93
- If Review 2 remains Blocking, adjudicate it before acting again. Diagnose a repeated, extending, invalidating, or causally uncertain blocker. Return an independent clear local defect to its owner when diagnosis would add no useful understanding. Review 3 remains exceptional, separately authorized, and final.
94
-
95
- ## Stop
96
-
97
- Stop when every material item is Accepted, Rejected, or Open; the adjudicated judgment is supported; and the next route and authority state are explicit.
@@ -1,139 +0,0 @@
1
- # Independent Work Reviewer Contract
2
-
3
- Read this before preparing or performing a separately selected independent review of implementation or integrated work.
4
-
5
- This reference is a contract: the required context and the reviewer prompt are binding as written. The reviewer did not produce the reviewed state. Give them the work product, source truth, and evidence needed to judge it directly. Do not provide only the producer's summary, reasoning, or claimed result.
6
-
7
- ## Required Context
8
-
9
- Provide:
10
-
11
- - the work and future action covered by the review;
12
- - accepted outcome, requirements, and non-goals;
13
- - relevant Specs, Plans, tests, policies, ADRs, and established behavior;
14
- - the implementation, changed files, or diff range;
15
- - verification evidence and known gaps;
16
- - only the review lenses material to this boundary;
17
- - active evidence authority: none, or each exact covered check with its expected evidence and stop condition;
18
- - review number and, for follow-up, prior items, adjudication, corrections, and new evidence.
19
-
20
- When state transitions or proof integrity matter, also provide the invariant or state owner, affecting paths, observing mechanism, forbidden mutations, prior-state requirements, adversarial disproof, mutation footprint, and fidelity limits.
21
-
22
- ## Reviewer Prompt
23
-
24
- ```md
25
- # Independent Work Review
26
-
27
- Review work you did not produce. Inspect the supplied work, source truth, and evidence directly. Report without editing. The review ends with this report; do not adjudicate findings, fix items, dispatch follow-up, or continue merely to obtain Pass.
28
-
29
- A pass is valid. Use a high evidence bar, not a high item count. Do not broaden scope or treat possible improvement as unfinished work.
30
-
31
- Use supplied and already available evidence. Do not start a missing active check unless the review contract explicitly authorizes that exact check. Otherwise report **Needs evidence** with the claim and required observing boundary. When an exact check is covered, apply Verify Work's check-result and claim-result semantics; active evidence does not authorize editing or broaden the review.
32
-
33
- ## Boundary
34
-
35
- - Protected future action: [boundary]
36
- - Reviewed state: [commit, tree, diff, or other exact identity]
37
- - Work: [diff range, changed files, implementation, or integrated result]
38
-
39
- ## Accepted Outcome And Non-Goals
40
-
41
- - Outcome: [required result]
42
- - Requirements: [accepted requirements]
43
- - Non-goals: [intentional exclusions]
44
-
45
- ## Source Truth
46
-
47
- - [Specs, Plans, tests, policies, ADRs, and established behavior]
48
-
49
- ## Verification Evidence
50
-
51
- - Checks and results: [commands, observations, and results]
52
- - Known gaps: [gaps or none]
53
- - When relevant: [state owner, affecting paths, observer, forbidden mutations, prior-state requirements, adversarial disproof, mutation footprint, fidelity limits]
54
-
55
- ## Review Scope
56
-
57
- - Review number: [1 | 2 | 3]
58
- - Material lenses: [alignment and correctness | regression and integration | failure and risk | evidence | design and minimality | maintainability]
59
- - Active evidence authority: [none | exact covered check, expected evidence, and stop condition]
60
-
61
- For Review 2 or 3:
62
-
63
- - Prior items and adjudication: [Accepted | Rejected | Open]
64
- - Clarifications: [settled decisions or none]
65
- - Corrections and new evidence: [changes and verification]
66
- - Remaining risk: [narrow unresolved scope]
67
-
68
- ## Check
69
-
70
- Apply only the selected lenses:
71
-
72
- - accepted behavior is implemented without invention or omission;
73
- - affected callers, states, and components remain correct together;
74
- - material failure paths and risks are handled safely;
75
- - verification supports the claims at the required boundary;
76
- - complexity and coordination are justified;
77
- - the work remains understandable without hidden policy or fragile coupling.
78
-
79
- Do not search for unrelated issues. Report an out-of-scope issue only when it materially affects whether this boundary may be crossed.
80
-
81
- Before calling something an Issue, ask:
82
-
83
- 1. Is required behavior or source truth settled? If not, use **Question**.
84
- 2. Are reachability and material consequence supported? If not, use **Needs evidence**.
85
- 3. Does the boundary require correction? Use **Blocking Issue** when it cannot be crossed safely, otherwise **Non-blocking Issue** when correction can be deferred safely.
86
- 4. Is the change merely useful beyond this boundary? Omit it by default; use **Improvement** only when materially relevant or requested.
87
-
88
- A **Needs evidence** item must identify the claim, required observing boundary, available evidence and its limit, why the gap affects judgment, and the smallest evidence that could disagree. Establish that the claim is required. Check the candidate examined and any later code/test changes; a weakened assertion or superseded capture cannot establish current acceptance. Missing evidence does not by itself justify an implementation fix or a stronger requirement.
89
-
90
- A Blocking Issue must identify the exact location, violated requirement or source truth, evidence, concrete boundary consequence, and correction constraints or owning activity to re-enter. Recommend a specific correction only when directly supported.
91
-
92
- For Review 2 or 3, inspect only accepted corrections, affected interactions, new evidence, and remaining risk. Do not reopen Rejected items without contradictory evidence. For each new Blocking Issue, state whether it repeats, extends, invalidates, or exposes another consequence of a prior correction; is independent; or cannot yet be related from the evidence. Report a related pattern rather than proposing another patch. Review 3 is final; do not recommend Review 4.
93
-
94
- ## Determine The Judgment
95
-
96
- 1. **Blocking:** at least one Blocking Issue exists.
97
- 2. **Inconclusive:** no Blocking Issue exists, but a material Question or Needs evidence item prevents judgment.
98
- 3. **Non-blocking:** only Non-blocking Issues remain.
99
- 4. **Pass:** no Issues or material unresolved items remain.
100
-
101
- Improvements do not change the judgment.
102
-
103
- ## Output
104
-
105
- Omit empty groups. Do not include Improvements unless they are materially relevant or explicitly requested.
106
-
107
- Review type: independent
108
- Review number: [1 | 2 | 3]
109
- Boundary: [reviewed work and protected future action]
110
- Reviewed state: [state identity]
111
- Judgment: Pass | Non-blocking | Inconclusive | Blocking
112
- Reasoning: [concise evidence-backed judgment]
113
- Relationship to prior items (Review 2 or 3 only): [related consequence | independent defect | unclear, with evidence]
114
-
115
- ### Review Items
116
-
117
- #### Issues — Blocking
118
- - [location, issue, violated source, evidence, consequence, correction constraints or owning activity]
119
-
120
- #### Issues — Non-blocking
121
- - [location, issue, evidence, why it can be deferred]
122
-
123
- #### Unresolved — Questions
124
- - [question, effect on judgment, required answer]
125
-
126
- #### Unresolved — Needs evidence
127
- - [claim, required observing boundary, available evidence and limit, why the gap affects judgment, smallest evidence that could disagree]
128
-
129
- #### Improvements
130
- - [only when materially relevant or requested: improvement, benefit, evidence]
131
-
132
- Evidence gaps: [unproved claims or none]
133
- ```
134
-
135
- ## Calibration
136
-
137
- Lead with the few items that can change the boundary judgment. Prior review, urgency, implementation effort, or producer confidence does not establish correctness.
138
-
139
- The report is evidence for adjudication. It is not authority over source truth, owner decisions, corrections, or another independent dispatch. Pass, Non-blocking, Inconclusive, and Blocking are all valid exits.
@@ -1,67 +0,0 @@
1
- # Security Risk Lens
2
-
3
- Read this before reviewing work that changes trust boundaries, authentication, authorization, permissions, untrusted input, secrets, sensitive data, security-relevant dependencies or external integrations, code-execution boundaries, or failure behavior with security consequences.
4
-
5
- This reference is judgment, with two Rules: security-sensitive product behavior stays user-owned, so never invent access, retention, logging, or fail-open or fail-closed policy during review; and never copy secrets, credentials, unrestricted personal data, or sensitive payloads into review context. It helps frame review and does not replace repository security policy, threat modeling, specialist review, or stack-specific hardening guidance.
6
-
7
- ## Establish Authority
8
-
9
- Identify:
10
-
11
- - assets and data requiring protection;
12
- - actors, roles, tenants, and privilege levels;
13
- - trust boundaries and external systems;
14
- - accepted security and privacy policy and threat model;
15
- - compatibility and failure behavior that security controls must preserve.
16
-
17
- ## Trace The Paths
18
-
19
- Review the affected path from boundary to effect:
20
-
21
- - authentication: who or what is this actor;
22
- - authorization: may this actor perform this operation on this resource;
23
- - input: validation, canonicalization, size, encoding, and injection surfaces;
24
- - output: escaping, disclosure, error detail, and side channels;
25
- - data: collection, transport, storage, isolation, retention, deletion, and audit;
26
- - secrets: source, scope, rotation, exposure, and logging;
27
- - execution: shell, file, URL, template, deserialization, plugin, or code-loading boundaries;
28
- - dependencies: provenance, permissions, known risk, update impact, and transitive behavior;
29
- - failure: partial state, retries, lockout, rate limits, rollback, and fail-open or fail-closed behavior.
30
-
31
- Look for confused-deputy and cross-tenant paths, not only malformed input.
32
-
33
- ## Require Boundary-Matched Evidence
34
-
35
- Prefer evidence at the real boundary:
36
-
37
- - tests proving allowed and denied roles and resources;
38
- - negative input and injection cases;
39
- - dependency or configuration inspection tied to the shipped artifact;
40
- - logs or traces demonstrating no secret or sensitive leakage;
41
- - failure-path tests for partial authorization, retry, and recovery;
42
- - specialist analysis for cryptography, sandboxing, identity protocols, or high-impact threats.
43
-
44
- A generic scanner pass cannot prove authorization logic or policy correctness. A unit test cannot prove deployed headers, identity configuration, or infrastructure permissions.
45
-
46
- Use the smallest sanitized evidence that supports the item.
47
-
48
- ## Calibrate Items
49
-
50
- Treat supported exploitable behavior, policy violation, unintended privilege or data exposure, unsafe failure semantics, secret leakage, or a missing required control as an Issue.
51
-
52
- Classify it against accepted security policy and the reviewed boundary:
53
-
54
- - **Blocking:** crossing the boundary would remain unsafe, non-compliant, or contrary to a required control.
55
- - **Non-blocking:** the issue is real but can be deferred safely without violating the accepted boundary.
56
-
57
- Use **Question** when security behavior or accepted risk remains undecided. Use **Needs evidence** when a control may exist but the available test or environment cannot establish it.
58
-
59
- Treat materially useful defense in depth beyond the accepted boundary as an Improvement. Omit theoretical hardening, preference, or hypothetical completeness.
60
-
61
- Do not omit an observed security issue because the selected lenses were narrower. Name the asset, path, precondition, consequence, evidence, and source requirement.
62
-
63
- ## Return Through The Selected Role
64
-
65
- For self-review, return a route-changing security concern to [Workflow](../../../skills/workflow/SKILL.md). Use [Diagnose Failure](../../../skills/diagnose-failure/SKILL.md) for unknown exploitability or cause, [Decision Gate](../../../skills/decision-gate/SKILL.md) for missing policy or accepted-risk decisions, [Design For Depth](../../../skills/design-for-depth/SKILL.md) when trust decisions spread across callers, and [Launch Work](../../../skills/launch-work/SKILL.md) when the concern affects production rollout.
66
-
67
- For independent review, classify the concern in the review report and stop. Do not route, correct, or dispatch follow-up. The receiving agent adjudicates the report and selects what follows.
@@ -1,103 +0,0 @@
1
- # Activation Contract
2
-
3
- Freeflow uses layered checkout configuration. Shared repository activation, personal overrides, and runtime delivery are separate facts.
4
-
5
- ## Repository Activation
6
-
7
- `.freeflow/config.json` is the required shared activation boundary. Minimal setup is:
8
-
9
- ```json
10
- {}
11
- ```
12
-
13
- Missing core keys use the built-in default `enabled: true`.
14
-
15
- Optional Cognitive Routing and Tool Execution configuration is explicit and remains independently gated. The legacy `defaultMode`, `interactionContract`, and `skills` keys are unsupported and make the configuration invalid. The removed `contextVirtualization` and `conversationHistory` keys are also unsupported in either config layer; delete them manually wherever present before Freeflow can activate. Setup does not migrate or remove them automatically.
16
-
17
- Do not add task state, phase, file inventories, plans, version metadata, activation paths, empty optional sections, host instruction copies, or generated workflow text.
18
-
19
- Missing or invalid repository config means repository activation is absent. A valid config with effective `enabled: false` remains configured but inactive.
20
-
21
- ## Personal Overrides
22
-
23
- `.freeflow/local.json` is optional per-checkout state. It cannot activate Freeflow without a valid repository config.
24
-
25
- It may override the core enablement value:
26
-
27
- ```json
28
- {
29
- "enabled": false
30
- }
31
- ```
32
-
33
- The field is optional. Omission inherits the repository value, then the built-in default. Local core precedence is property-level, not whole-file replacement.
34
-
35
- Keep local config untracked and ignored. In a Git checkout, prefer `.git/info/exclude` or an existing ignore rule over an unsolicited shared `.gitignore` edit. Refuse to write personal overrides to a tracked local file.
36
-
37
- A missing local file means full inheritance. An invalid existing local file blocks effective Freeflow and must not silently fall back to repository settings. Repair or removal requires authorization.
38
-
39
- ## Effective Core State
40
-
41
- Resolve remaining configurable values in this order:
42
-
43
- ```text
44
- host session override -> personal override -> repository value -> built-in default
45
- ```
46
-
47
- Host session overrides are host state, not config, and cannot bypass missing or invalid repository activation. Pi may temporarily override Freeflow enablement. Cognitive Routing has its own host-managed session control.
48
-
49
- Effective Freeflow requires:
50
-
51
- 1. valid repository config;
52
- 2. missing or valid local config;
53
- 3. session-resolved `enabled: true`;
54
- 4. the mandatory `core.md` and `interaction-contract.md` prompt files.
55
-
56
- The core prompt and Interaction Contract are always delivered together when Freeflow is enabled. Base Freeflow skills are exposed with that core surface. Cognitive Routing and Tool Execution remain independently gated capabilities; Context Virtualization and Conversation History are removed.
57
-
58
- ## Mutation Authority By State
59
-
60
- - **Unconfigured:** missing or invalid repository config means Freeflow is not effective. An explicit setup request may create missing minimal activation; replacing invalid config requires specific authorization and source-conflict resolution.
61
- - **Configured but ineffective:** top-level disablement or invalid local config prevents effective Freeflow. An explicit request governs the selected enablement, configuration, or repair.
62
- - **Effective:** obey the Interaction Contract and core Workflow guidance. Optional capability behavior remains subject to its own effective state.
63
-
64
- A user operating native host settings changes host-managed state directly. That action is distinct from an agent editing `.freeflow/config.json` or `.freeflow/local.json`; verify the resulting source and effective state afterward.
65
-
66
- ## Runtime Delivery
67
-
68
- Configuration does not prove runtime delivery.
69
-
70
- When effective, host adapters deliver:
71
-
72
- - `runtime/prompts/core.md`;
73
- - `runtime/prompts/interaction-contract.md`;
74
- - the base Freeflow skill surface;
75
- - compact current capability state.
76
-
77
- Pi may additionally expose explicitly enabled Pi capability skills and tools. Codex and Claude `SessionStart` hooks compose the mandatory core fragments. Adapters load context only; they do not enforce policy, block tools, grant permissions, or replace repo instructions.
78
-
79
- A setup report classifies automatic delivery as:
80
-
81
- - **confirmed:** trustworthy evidence shows the current host adapter ran;
82
- - **unavailable:** the adapter is absent, disabled, denied, untrusted, or unsupported;
83
- - **unconfirmed:** the host exposes no trustworthy execution evidence.
84
-
85
- For the setup turn itself, direct reads of newly effective context establish guidance only for that turn. Report those reads separately from lifecycle delivery.
86
-
87
- ## Repo-Owned Instructions
88
-
89
- Do not create replacement Freeflow text in `AGENTS.md`, `CLAUDE.md`, `.claude/rules/`, or another repository instruction surface.
90
-
91
- Existing repo instructions remain live source truth within host precedence. Inspect conflicts and use Decision Gate rather than overwriting them to make Freeflow appear active.
92
-
93
- ## Setup Invariants
94
-
95
- Setup is:
96
-
97
- - idempotent;
98
- - minimal by default;
99
- - explicit about shared versus personal state;
100
- - fail-closed for an invalid personal layer;
101
- - non-mutating toward repo-owned host instructions;
102
- - explicit about same-turn reads versus automatic runtime delivery;
103
- - free of generated replacement instructions and unrequested capability config.
@@ -1,67 +0,0 @@
1
- # Host Setup
2
-
3
- Host choice affects runtime delivery and settings controls, not the required repository activation shape.
4
-
5
- ## Shared Checkout Shape
6
-
7
- Every host requires:
8
-
9
- ```text
10
- .freeflow/config.json
11
- ```
12
-
13
- Each checkout may also use:
14
-
15
- ```text
16
- .freeflow/local.json
17
- ```
18
-
19
- The repository file establishes shared activation. The local file supplies optional personal overrides and cannot activate Freeflow alone. Keep it untracked and ignored.
20
-
21
- Do not generate host-specific Freeflow instructions in `AGENTS.md`, `CLAUDE.md`, `.claude/rules/`, or another repo-owned instruction surface.
22
-
23
- ## Pi
24
-
25
- The Pi extension reads both config layers before each agent turn. A valid repository config plus a missing or valid local layer is required before Freeflow can become effective.
26
-
27
- Pi provides these settings scopes:
28
-
29
- ```text
30
- /freeflow settings personal overrides
31
- /freeflow settings session temporary Freeflow and Cognitive Routing session controls
32
- /freeflow settings repo shared repository settings
33
- ```
34
-
35
- Session settings can temporarily inherit, enable, or disable Freeflow and override Cognitive Routing profiles/delegation. One reset action clears those session overrides. They persist in the active Pi session branch JSONL, never write `.freeflow/config.json` or `.freeflow/local.json`, and cannot bypass missing or invalid repository activation. Master changes reload Pi resources when supported.
36
-
37
- Personal settings use omission to inherit. The settings path refuses to overwrite invalid or tracked local config and establishes local Git exclusion when needed. These are user-operated host controls; they update state before the next model turn. Agent-performed file edits still follow Setup Freeflow's mutation-authority rules.
38
-
39
- When effective, Pi's `before_agent_start` path preserves the existing system prompt and composes the mandatory `core.md` and `interaction-contract.md` fragments plus the Cognitive Routing prompt when effective. Runtime State is refreshed at session start, after context reconstruction or loss, and when displayed state changes; unchanged state remains in the provider context. Base skill bodies and capability bodies remain discoverable rather than hidden persistent messages. The former Context Virtualization and Conversation History settings, prompts, and tool operations are removed.
40
-
41
- A config written during setup is visible to the available Pi adapter on the next agent turn. After first activation, tell the user to run `/reload` so Pi refreshes skills and resources fully. Without reload, the adapter can load core runtime context on the next agent turn, but resource discovery waits for reload. For the remainder of the setup turn, read newly effective context directly after verification instead of claiming that another `before_agent_start` invocation already occurred.
42
-
43
- Confirm automatic delivery through current extension status or runtime evidence when available.
44
-
45
- ## Codex And Claude
46
-
47
- The packaged runtime hook reads the same repository and local layers. At supported `SessionStart` boundaries—startup, resume, clear, and compact—it restores the complete enabled core context. It does not process submitted prompts or persist session controls.
48
-
49
- When top-level Freeflow is effective, the hook loads `runtime/prompts/core.md` and `runtime/prompts/interaction-contract.md` and emits a compact active Runtime State. It does not inject a full Workflow body or inspect Pi-only capabilities.
50
-
51
- After first-time setup, tell the user to trigger the least disruptive supported host-native lifecycle boundary: resume, clear, compact, or a new session/startup as available. Name the exact control supported by the current host; do not prescribe Pi's `/reload`. Until that boundary runs, use same-turn direct reads without claiming automatic delivery.
52
-
53
- Classify delivery as:
54
-
55
- - **confirmed** when the current adapter invocation is evidenced;
56
- - **unavailable** when the plugin or hook is absent, disabled, denied, untrusted, or unsupported;
57
- - **unconfirmed** when the adapter may be installed and trusted but the host exposes no trustworthy evidence that it ran for the current lifecycle.
58
-
59
- Installed and trusted registration can establish availability for the next lifecycle action; it does not prove delivery already occurred.
60
-
61
- Do not compensate for unavailable or unconfirmed delivery by copying Freeflow text into repository instructions.
62
-
63
- Do not install repo-local hooks, CLI commands, lint rules, global standards, documentation inventories, or state files during setup.
64
-
65
- ## Conflicts
66
-
67
- Repository instructions can conflict with Freeflow behavior even though they are not activation markers. Name the conflict and ask before changing setup or behavior when it would alter the next action.
@@ -1,85 +0,0 @@
1
- ---
2
- name: simplify-code
3
- description: "Use when working code should become easier to understand or change without altering accepted behavior, including removing duplication, indirection, dead abstractions, or confusing control flow."
4
- ---
5
-
6
- # Simplify Code
7
-
8
- Remove one named source of complexity while preserving accepted behavior. Judge simplicity by the concepts and coordination a reader must hold—not line, file, or abstraction count alone.
9
-
10
- This method supplies a behavior-preserving transformation under the current owner. It does not define behavior, authorize redesign, select or close a Slice, or turn nearby cleanup into accepted work.
11
-
12
- ## Establish What Must Stay True
13
-
14
- Before editing, identify:
15
-
16
- - the accepted behavior, relevant callers, and failure semantics;
17
- - the reliable baseline capable of detecting change;
18
- - the complexity or coordination to remove;
19
- - why the current structure exists, including compatibility, platform, performance, migration, and recovery constraints.
20
-
21
- If expected behavior is unclear or should change, return to [Workflow](../workflow/SKILL.md). If failure or current behavior is unexplained, use [Diagnose Failure](../diagnose-failure/SKILL.md). Do not characterize an invented expectation.
22
-
23
- Use existing adequate checks. When protection is missing, establish the smallest useful observation of behavior before transforming it; read [Test Design](../verify-work/references/test-design.md) before designing or materially changing the check. Characterization protects required stable behavior, not every accidental implementation detail. It is evidence for a refactor, not a mandatory test-first implementation method.
24
-
25
- Return changes to interfaces, ownership, public state, or failure behavior through Workflow with [Design for Depth](../design-for-depth/SKILL.md) as a lens. Do not disguise a material redesign as cleanup.
26
-
27
- Read [Simplification Patterns](references/simplification-patterns.md) before selecting or materially changing the transformation. Read [Code Practices](../execute-work/references/code-practices.md) before changing code.
28
-
29
- ## Select One Coherent Transformation
30
-
31
- Name the actual complexity:
32
-
33
- - confusing expression, naming, branches, or temporary state;
34
- - a pass-through wrapper that hides no useful decision;
35
- - generalized machinery with no accepted variation;
36
- - a scattered concept that can have one owner without changing its contract;
37
- - an unused, superseded, unreachable, or impossible path;
38
- - structural pressure requiring a separately selected boundary change.
39
-
40
- Choose the smallest complete transformation that removes it. Keep related edits together even across files. Do not create another method activity for incidental local cleanup already contained in implementation; use Simplify Code when reducing complexity is itself the accepted result.
41
-
42
- Fewer helpers are not better if their removal spreads lifecycle or error-handling knowledge into callers. Preserve useful information hiding and intentional constraints.
43
-
44
- ## Apply And Observe
45
-
46
- Within the existing agreement:
47
-
48
- 1. State which concepts or coordination will disappear.
49
- 2. Make the complete behavior-preserving change.
50
- 3. Run focused behavior and failure checks.
51
- 4. Inspect the real caller path and resulting code.
52
- 5. Compare the required coordination before and after.
53
- 6. Keep the supported result or return a failed transformation for correction or covered rollback.
54
-
55
- Preserve inputs/outputs, side effects and ordering, errors/recovery, relevant timing and resource behavior, permissions, compatibility, and externally visible state. Follow repository conventions rather than personal style.
56
-
57
- Do not combine feature work, bug fixes, new edge-case behavior, public contract changes, broad modernization, or unrelated cleanup with the transformation.
58
-
59
- ## Interpret Checks Without Protecting Accidental Machinery
60
-
61
- Use [Verify Work](../verify-work/SKILL.md) to determine what the observations establish. A green suite cannot prove unchanged behavior it did not exercise. Do not rewrite a valid behavioral assertion merely to make the refactor pass.
62
-
63
- If an implementation-detail check fails while caller behavior appears unchanged, establish whether the detail is contractual, the check is stale or over-coupled, the transformation changed relevant behavior, or the observer is inadequate. Do not infer the answer from the desired cleanup.
64
-
65
- Test sequencing alone is not assurance. Retain or add independent checks where needed, and inspect the changed behavior rather than report only test counts.
66
-
67
- ## Delete Only With Supported Absence
68
-
69
- Before removing code, establish its purpose and current consumers through relevant source, runtime registration, configuration, generated callers, tests, history, and compatibility obligations. An empty local search does not establish the absence of external or dormant consumers.
70
-
71
- Do not remove compatibility, fallback, platform, migration, audit, or recovery behavior merely because it looks redundant. Use [Migration Work](../migration-work/SKILL.md) when deletion carries consumer, state, or compatibility obligations.
72
-
73
- Preserve historical evidence; do not delete it to make a reference search clean.
74
-
75
- ## Judge The Result And Stop
76
-
77
- Ask whether there are fewer concepts to coordinate, clearer ownership, fewer related edit locations, visible failure semantics, a smaller or unchanged public interface, and tests focused on behavior rather than internal choreography.
78
-
79
- If the result is shorter but harder to understand, test, or change, complexity was relocated rather than reduced.
80
-
81
- Stop and return the changed boundary when unchanged behavior is unsupported, public/failure semantics changed, a material resource tradeoff is unmeasured, source truth conflicts, or each correction exposes another ownership or edge-case problem. Do not extend cleanup to preserve a failing approach.
82
-
83
- When the named complexity is removed and the behavior boundary is supported, return to the current owner for applicable self-review and acceptance. Report the protected behavior, concepts removed, before/after evidence and limits, caller/failure-path shape, relevant comment changes, and intentionally retained complexity.
84
-
85
- Do not close the Slice, begin further cleanup, or claim broader modernization from this result. Continue only through another covered action serving the agreed outcome.
@@ -1,70 +0,0 @@
1
- # Simplification Patterns
2
-
3
- Read this before selecting or materially changing a simplification transformation. Use these patterns to compare candidates for the named complexity; they do not authorize another result or guarantee that fewer constructs are simpler. Preserve behavior and project conventions.
4
-
5
- ## Control Flow
6
-
7
- - Replace deep nesting with guard clauses when exits are truly equivalent.
8
- - Collapse duplicate branches into one named path.
9
- - Replace repeated conditionals on one shape with an explicit model or dispatcher when that removes branching across callers.
10
- - Name intermediate concepts when a dense expression hides intent.
11
- - Keep straightforward branching when a lookup, callback table, or polymorphic hierarchy would add more concepts.
12
-
13
- ## Locality
14
-
15
- - Move behavior toward the state or policy it owns.
16
- - Gather scattered validation, normalization, or failure handling behind one stable seam.
17
- - Separate orchestration from business rules when each can then be read and tested independently.
18
- - Reuse a canonical helper instead of maintaining a near-duplicate.
19
- - Do not centralize unrelated behavior merely because its syntax looks similar.
20
-
21
- ## Indirection
22
-
23
- Question:
24
-
25
- - pass-through wrappers;
26
- - one-use factories and strategy layers;
27
- - aliases that no longer protect compatibility;
28
- - helpers whose interface is as complex as their implementation;
29
- - extension points with no accepted variation;
30
- - adapters that outlived a migration.
31
-
32
- Keep indirection when it hides volatile dependencies, enforces policy, preserves a real compatibility contract, or creates meaningful test and change locality.
33
-
34
- ## Names And Types
35
-
36
- - Rename generic or misleading terms to match domain language.
37
- - Make invariants explicit at a type or interface boundary when doing so removes downstream checks.
38
- - Remove casts, optionality, and silent fallbacks only after proving the stronger invariant.
39
- - Keep comments that explain why, constraints, or non-obvious tradeoffs; remove comments that merely narrate clear code.
40
-
41
- ## Duplication
42
-
43
- Duplication is harmful when one behavior must change in several places and can drift.
44
-
45
- Do not extract merely because two snippets look alike. First confirm they represent the same concept and should evolve together.
46
-
47
- A small amount of explicit repetition can be simpler than a generalized abstraction with configuration, callbacks, flags, or hidden coupling.
48
-
49
- ## Dead And Legacy Paths
50
-
51
- Before removal, inspect static references, runtime use, generated callers, config, tests, history, and compatibility obligations.
52
-
53
- - Truly dead local code may be removed within the agreed simplification boundary.
54
- - Supported legacy behavior requires deprecation/migration evidence.
55
- - Historical docs and audit evidence are not dead code.
56
- - Commented-out code normally belongs in version history, but confirm it is not an intentional operational instruction.
57
-
58
- ## Before And After Test
59
-
60
- Ask:
61
-
62
- - Are there fewer concepts and branches?
63
- - Is ownership clearer?
64
- - Can behavior be understood through fewer files or transitions?
65
- - Did error and failure semantics remain visible?
66
- - Is the public interface smaller or unchanged?
67
- - Did tests become more behavior-focused rather than more coupled?
68
- - Would the next likely change touch fewer coordinated locations?
69
-
70
- If the answer is mostly no, complexity was relocated rather than reduced.