@hassangameryt/freeflow 0.4.0 → 0.6.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 (285) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +2 -1
  3. package/.codex-plugin/plugin.json +2 -1
  4. package/README.md +150 -155
  5. package/capabilities/cognitive-routing/SKILL.md +229 -0
  6. package/capabilities/context-virtualization/SKILL.md +103 -0
  7. package/capabilities/conversation-history/SKILL.md +53 -0
  8. package/command-surface.json +17 -13
  9. package/hooks/freeflow-runtime-context.mjs +393 -159
  10. package/hooks/hooks.json +26 -1
  11. package/hooks/tests/check-runtime-context-hook.sh +223 -54
  12. package/package.json +25 -16
  13. package/pi-extension/dist/cognitive-routing/commands.js +96 -0
  14. package/pi-extension/dist/cognitive-routing/config.js +236 -0
  15. package/pi-extension/dist/cognitive-routing/controller.js +862 -0
  16. package/pi-extension/dist/cognitive-routing/history.js +439 -0
  17. package/pi-extension/dist/cognitive-routing/host.js +126 -0
  18. package/pi-extension/dist/cognitive-routing/runtime.js +43 -0
  19. package/pi-extension/dist/cognitive-routing/tool.js +211 -0
  20. package/pi-extension/dist/cognitive-routing/types.js +6 -0
  21. package/pi-extension/dist/context-virtualization/commands.js +89 -0
  22. package/pi-extension/dist/context-virtualization/projector.js +42 -0
  23. package/pi-extension/dist/context-virtualization/runtime.js +356 -0
  24. package/pi-extension/dist/context-virtualization/state.js +57 -0
  25. package/pi-extension/dist/context-virtualization/types.js +10 -0
  26. package/pi-extension/dist/conversation-history/passages.js +66 -0
  27. package/pi-extension/dist/conversation-history/ranking.js +105 -0
  28. package/pi-extension/dist/conversation-history/runtime.js +226 -0
  29. package/pi-extension/dist/conversation-history/search.js +56 -0
  30. package/pi-extension/dist/conversation-history/types.js +1 -0
  31. package/pi-extension/dist/freeflow-context/resolver.js +120 -0
  32. package/pi-extension/dist/freeflow-context/runtime.js +80 -0
  33. package/pi-extension/dist/freeflow-context/source-projector.js +95 -0
  34. package/pi-extension/dist/freeflow-context/tool.js +308 -0
  35. package/pi-extension/dist/freeflow-context/types.js +12 -0
  36. package/pi-extension/dist/freeflow-context/visibility.js +28 -0
  37. package/pi-extension/dist/index.js +516 -98
  38. package/pi-extension/dist/runtime/runtime-context.js +318 -271
  39. package/pi-extension/dist/runtime/runtime-identity.js +5 -0
  40. package/pi-extension/dist/settings/settings-tui.js +78 -0
  41. package/pi-extension/dist/settings/settings-ui.js +593 -563
  42. package/pi-extension/dist/ui/text-component.js +57 -0
  43. package/pi-extension/src/cognitive-routing/commands.ts +119 -0
  44. package/pi-extension/src/cognitive-routing/config.ts +307 -0
  45. package/pi-extension/src/cognitive-routing/controller.ts +1118 -0
  46. package/pi-extension/src/cognitive-routing/history.ts +638 -0
  47. package/pi-extension/src/cognitive-routing/host.ts +172 -0
  48. package/pi-extension/src/cognitive-routing/runtime.ts +57 -0
  49. package/pi-extension/src/cognitive-routing/tool.ts +272 -0
  50. package/pi-extension/src/cognitive-routing/types.ts +89 -0
  51. package/pi-extension/src/context-virtualization/commands.ts +111 -0
  52. package/pi-extension/src/context-virtualization/projector.ts +62 -0
  53. package/pi-extension/src/context-virtualization/runtime.ts +406 -0
  54. package/pi-extension/src/context-virtualization/state.ts +79 -0
  55. package/pi-extension/src/context-virtualization/types.ts +92 -0
  56. package/pi-extension/src/conversation-history/passages.ts +81 -0
  57. package/pi-extension/src/conversation-history/ranking.ts +155 -0
  58. package/pi-extension/src/conversation-history/runtime.ts +250 -0
  59. package/pi-extension/src/conversation-history/search.ts +79 -0
  60. package/pi-extension/src/conversation-history/types.ts +31 -0
  61. package/pi-extension/src/freeflow-context/resolver.ts +139 -0
  62. package/pi-extension/src/freeflow-context/runtime.ts +100 -0
  63. package/pi-extension/src/freeflow-context/source-projector.ts +106 -0
  64. package/pi-extension/src/freeflow-context/tool.ts +360 -0
  65. package/pi-extension/src/freeflow-context/types.ts +70 -0
  66. package/pi-extension/src/freeflow-context/visibility.ts +53 -0
  67. package/pi-extension/src/index.ts +553 -101
  68. package/pi-extension/src/runtime/runtime-context.ts +339 -281
  69. package/pi-extension/src/runtime/runtime-identity.ts +8 -0
  70. package/pi-extension/src/settings/settings-tui.ts +93 -0
  71. package/pi-extension/src/settings/settings-ui.ts +700 -613
  72. package/pi-extension/src/ui/text-component.ts +66 -0
  73. package/pi-extension/tests/cognitive-routing/commands.test.js +134 -0
  74. package/pi-extension/tests/cognitive-routing/controller.test.js +1099 -0
  75. package/pi-extension/tests/cognitive-routing/extension-lifecycle.test.js +1071 -0
  76. package/pi-extension/tests/cognitive-routing/history.test.js +274 -0
  77. package/pi-extension/tests/cognitive-routing/host-fixture.js +4 -0
  78. package/pi-extension/tests/cognitive-routing/host-identity.test.js +63 -0
  79. package/pi-extension/tests/cognitive-routing/profile-resolution.test.js +236 -0
  80. package/pi-extension/tests/cognitive-routing/tool.test.js +230 -0
  81. package/pi-extension/tests/context-virtualization/extension.test.js +749 -0
  82. package/pi-extension/tests/context-virtualization/projector.test.js +110 -0
  83. package/pi-extension/tests/context-virtualization/runtime.test.js +216 -0
  84. package/pi-extension/tests/conversation-history/runtime.test.js +98 -0
  85. package/pi-extension/tests/conversation-history/search.test.js +97 -0
  86. package/pi-extension/tests/integration/pi-extension.test.js +928 -2047
  87. package/pi-extension/tests/integration/prompt-architecture.test.js +305 -0
  88. package/runtime/prompts/cognitive-routing.md +9 -0
  89. package/runtime/prompts/context-virtualization.md +3 -0
  90. package/runtime/prompts/conversation-history.md +3 -0
  91. package/runtime/prompts/core.md +13 -0
  92. package/runtime/prompts/interaction-contract.md +7 -0
  93. package/runtime/prompts/skills.md +65 -0
  94. package/skills/action-selection/SKILL.md +91 -0
  95. package/skills/bypass/SKILL.md +3 -2
  96. package/skills/commit-work/SKILL.md +1 -1
  97. package/skills/commit-work/references/staging-decisions.md +1 -1
  98. package/skills/decision-gate/SKILL.md +1 -1
  99. package/skills/design-for-depth/SKILL.md +14 -33
  100. package/skills/design-for-depth/references/design-pressure-signals.md +1 -1
  101. package/skills/design-for-depth/references/interface-design-loop.md +1 -1
  102. package/skills/design-for-depth/references/software-design-philosophy.md +1 -1
  103. package/skills/diagnose-failure/SKILL.md +20 -14
  104. package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +1 -3
  105. package/skills/diagnose-failure/references/{flaky-and-performance.md → flaky-and-performance-diagnosis.md} +1 -1
  106. package/skills/discuss/SKILL.md +34 -22
  107. package/skills/discuss/references/discussion-continuity.md +71 -0
  108. package/skills/evaluate-skill/SKILL.md +5 -5
  109. package/skills/evaluate-skill/references/{definition-schema.md → evaluation-definition-schema.md} +42 -2
  110. package/skills/evaluate-skill/references/execution-and-evidence.md +8 -3
  111. package/skills/evaluate-skill/scripts/lib/definitions.mjs +114 -3
  112. package/skills/evaluate-skill/scripts/lib/grade-interaction.mjs +156 -1
  113. package/skills/evaluate-skill/scripts/lib/grade.mjs +9 -1
  114. package/skills/evaluate-skill/scripts/lib/pi.mjs +147 -32
  115. package/skills/evaluate-skill/scripts/lib/rpc.mjs +4 -4
  116. package/skills/evaluate-skill/scripts/lib/runner.mjs +36 -14
  117. package/skills/evaluate-skill/scripts/lib/sandbox.mjs +92 -0
  118. package/skills/evaluate-skill/scripts/pi-guard.mjs +1 -1
  119. package/skills/evaluate-skill/scripts/pi-observer.mjs +66 -0
  120. package/skills/evaluate-skill/scripts/skill-eval.mjs +6 -5
  121. package/skills/execute-work/SKILL.md +18 -15
  122. package/skills/execute-work/references/code-practices.md +1 -1
  123. package/skills/execute-work/references/execute-work-edges.md +42 -0
  124. package/skills/finish-branch/SKILL.md +2 -2
  125. package/skills/finish-branch/references/integration-options.md +1 -1
  126. package/skills/handoff/SKILL.md +3 -3
  127. package/skills/launch-work/SKILL.md +1 -1
  128. package/skills/launch-work/references/launch-readiness.md +2 -2
  129. package/skills/migration-work/SKILL.md +2 -2
  130. package/skills/migration-work/references/migration-lifecycle.md +1 -1
  131. package/skills/mode-contract/SKILL.md +32 -10
  132. package/skills/release-work/SKILL.md +1 -1
  133. package/skills/release-work/references/release-evidence.md +1 -1
  134. package/skills/review-artifact/SKILL.md +28 -26
  135. package/skills/review-work/SKILL.md +28 -26
  136. package/skills/review-work/references/{reviewer-prompt.md → independent-work-reviewer-contract.md} +1 -1
  137. package/skills/review-work/references/security-risk-lens.md +1 -1
  138. package/skills/setup-freeflow/SKILL.md +6 -10
  139. package/skills/setup-freeflow/references/activation-contract.md +5 -10
  140. package/skills/setup-freeflow/references/host-setup.md +3 -7
  141. package/skills/simplify-code/SKILL.md +1 -1
  142. package/skills/simplify-code/references/simplification-patterns.md +1 -1
  143. package/skills/tdd/SKILL.md +18 -38
  144. package/skills/tdd/references/test-design.md +2 -2
  145. package/skills/track-work/SKILL.md +362 -58
  146. package/skills/track-work/scripts/lib/codec.mjs +570 -0
  147. package/skills/track-work/scripts/lib/commands.mjs +568 -0
  148. package/skills/track-work/scripts/lib/contract.mjs +303 -0
  149. package/skills/track-work/scripts/lib/model.mjs +506 -0
  150. package/skills/track-work/scripts/lib/operations.mjs +965 -0
  151. package/skills/track-work/scripts/lib/record-store.mjs +264 -0
  152. package/skills/track-work/scripts/lib/result.mjs +37 -0
  153. package/skills/track-work/scripts/lib/rewrites.mjs +740 -0
  154. package/skills/track-work/scripts/lib/schema.mjs +277 -0
  155. package/skills/track-work/scripts/lib/source-inventory.mjs +162 -0
  156. package/skills/track-work/scripts/lib/views.mjs +443 -0
  157. package/skills/track-work/scripts/lib/workspace.mjs +134 -0
  158. package/skills/track-work/scripts/working-record.mjs +122 -0
  159. package/skills/verify-work/SKILL.md +14 -2
  160. package/skills/verify-work/references/browser-runtime-evidence.md +1 -1
  161. package/skills/verify-work/references/integration-evidence.md +1 -1
  162. package/skills/verify-work/references/performance-evidence.md +1 -1
  163. package/skills/workflow/SKILL.md +105 -53
  164. package/skills/workflow/references/domain-skill-composition.md +22 -42
  165. package/skills/write-plan/SKILL.md +1 -1
  166. package/skills/write-skill/SKILL.md +3 -2
  167. package/skills/write-skill/references/progressive-disclosure.md +17 -3
  168. package/pi-extension/dist/output-router/host-producer-identification.js +0 -232
  169. package/pi-extension/dist/output-router/native-safety-net.js +0 -216
  170. package/pi-extension/dist/output-router/observed-tool-routing.js +0 -122
  171. package/pi-extension/dist/output-router/renderers.js +0 -1023
  172. package/pi-extension/dist/output-router/router-tools.js +0 -554
  173. package/pi-extension/dist/output-router/schemas.js +0 -383
  174. package/pi-extension/dist/output-router/status.js +0 -744
  175. package/pi-extension/dist/output-router/utils.js +0 -502
  176. package/pi-extension/src/output-router/host-producer-identification.ts +0 -256
  177. package/pi-extension/src/output-router/native-safety-net.ts +0 -248
  178. package/pi-extension/src/output-router/observed-tool-routing.ts +0 -134
  179. package/pi-extension/src/output-router/renderers.ts +0 -1108
  180. package/pi-extension/src/output-router/router-tools.ts +0 -579
  181. package/pi-extension/src/output-router/schemas.ts +0 -387
  182. package/pi-extension/src/output-router/status.ts +0 -791
  183. package/pi-extension/src/output-router/utils.ts +0 -554
  184. package/pi-extension/tests/output-router/observed-producers.test.js +0 -132
  185. package/pi-extension/tests/output-router/search.test.js +0 -722
  186. package/router/dist/benchmarks/benchmark-harness.d.ts +0 -35
  187. package/router/dist/benchmarks/benchmark-harness.js +0 -92
  188. package/router/dist/benchmarks/benchmarks.d.ts +0 -109
  189. package/router/dist/benchmarks/benchmarks.js +0 -979
  190. package/router/dist/benchmarks/codex-qa-benchmarks.d.ts +0 -95
  191. package/router/dist/benchmarks/codex-qa-benchmarks.js +0 -500
  192. package/router/dist/benchmarks/command-benchmarks.d.ts +0 -143
  193. package/router/dist/benchmarks/command-benchmarks.js +0 -698
  194. package/router/dist/benchmarks/context-mode-normalized-benchmarks.d.ts +0 -82
  195. package/router/dist/benchmarks/context-mode-normalized-benchmarks.js +0 -773
  196. package/router/dist/benchmarks/context-mode-real-deep-benchmark.d.ts +0 -132
  197. package/router/dist/benchmarks/context-mode-real-deep-benchmark.js +0 -1380
  198. package/router/dist/benchmarks/context-saving-baseline.d.ts +0 -60
  199. package/router/dist/benchmarks/context-saving-baseline.js +0 -470
  200. package/router/dist/benchmarks/index-benchmarks.d.ts +0 -103
  201. package/router/dist/benchmarks/index-benchmarks.js +0 -862
  202. package/router/dist/benchmarks/storage-policy-benchmarks.d.ts +0 -101
  203. package/router/dist/benchmarks/storage-policy-benchmarks.js +0 -618
  204. package/router/dist/benchmarks/vault-index-benchmarks.d.ts +0 -56
  205. package/router/dist/benchmarks/vault-index-benchmarks.js +0 -322
  206. package/router/dist/config/config.d.ts +0 -103
  207. package/router/dist/config/config.js +0 -632
  208. package/router/dist/config/router-contract.d.ts +0 -10
  209. package/router/dist/config/router-contract.js +0 -54
  210. package/router/dist/config/schema.d.ts +0 -27
  211. package/router/dist/config/schema.js +0 -648
  212. package/router/dist/config/types.d.ts +0 -573
  213. package/router/dist/config/types.js +0 -41
  214. package/router/dist/evidence/bounded-evidence.d.ts +0 -40
  215. package/router/dist/evidence/bounded-evidence.js +0 -323
  216. package/router/dist/evidence/evidence-range-selector.d.ts +0 -24
  217. package/router/dist/evidence/evidence-range-selector.js +0 -232
  218. package/router/dist/evidence/evidence-search.d.ts +0 -27
  219. package/router/dist/evidence/evidence-search.js +0 -490
  220. package/router/dist/evidence/evidence.d.ts +0 -38
  221. package/router/dist/evidence/evidence.js +0 -200
  222. package/router/dist/evidence/failure-contracts.d.ts +0 -37
  223. package/router/dist/evidence/failure-contracts.js +0 -166
  224. package/router/dist/evidence/line-ranges.d.ts +0 -24
  225. package/router/dist/evidence/line-ranges.js +0 -22
  226. package/router/dist/experiments/local-index.d.ts +0 -64
  227. package/router/dist/experiments/local-index.js +0 -581
  228. package/router/dist/index.d.ts +0 -30
  229. package/router/dist/index.js +0 -32
  230. package/router/dist/local/local-traversal.d.ts +0 -18
  231. package/router/dist/local/local-traversal.js +0 -334
  232. package/router/dist/processing/engine.d.ts +0 -132
  233. package/router/dist/processing/engine.js +0 -533
  234. package/router/dist/processing/reducers.d.ts +0 -280
  235. package/router/dist/processing/reducers.js +0 -1673
  236. package/router/dist/processing/renderers.d.ts +0 -31
  237. package/router/dist/processing/renderers.js +0 -195
  238. package/router/dist/processing/scripts.d.ts +0 -91
  239. package/router/dist/processing/scripts.js +0 -386
  240. package/router/dist/repo/repo-traversal.d.ts +0 -18
  241. package/router/dist/repo/repo-traversal.js +0 -245
  242. package/router/dist/routing/observed-reducers.d.ts +0 -41
  243. package/router/dist/routing/observed-reducers.js +0 -661
  244. package/router/dist/routing/observed-routing.d.ts +0 -26
  245. package/router/dist/routing/observed-routing.js +0 -378
  246. package/router/dist/routing/parsers.d.ts +0 -16
  247. package/router/dist/routing/parsers.js +0 -521
  248. package/router/dist/routing/run-filters.d.ts +0 -60
  249. package/router/dist/routing/run-filters.js +0 -238
  250. package/router/dist/routing/run-reducers.d.ts +0 -49
  251. package/router/dist/routing/run-reducers.js +0 -122
  252. package/router/dist/sandbox/adapter-roots.d.ts +0 -46
  253. package/router/dist/sandbox/adapter-roots.js +0 -66
  254. package/router/dist/sandbox/eryx-python-adapter.d.ts +0 -13
  255. package/router/dist/sandbox/eryx-python-adapter.js +0 -868
  256. package/router/dist/sandbox/jq-wasm-adapter.d.ts +0 -9
  257. package/router/dist/sandbox/jq-wasm-adapter.js +0 -429
  258. package/router/dist/sandbox/quickjs-wasi-adapter.d.ts +0 -13
  259. package/router/dist/sandbox/quickjs-wasi-adapter.js +0 -384
  260. package/router/dist/sandbox/script-sandbox.d.ts +0 -134
  261. package/router/dist/sandbox/script-sandbox.js +0 -337
  262. package/router/dist/setup/script-transform-adapters.d.ts +0 -32
  263. package/router/dist/setup/script-transform-adapters.js +0 -278
  264. package/router/dist/tools/batch.d.ts +0 -33
  265. package/router/dist/tools/batch.js +0 -586
  266. package/router/dist/tools/run.d.ts +0 -62
  267. package/router/dist/tools/run.js +0 -1304
  268. package/router/dist/tools/search.d.ts +0 -66
  269. package/router/dist/tools/search.js +0 -1364
  270. package/router/dist/transform/engine.d.ts +0 -168
  271. package/router/dist/transform/engine.js +0 -2072
  272. package/router/dist/vault/vault-index.d.ts +0 -125
  273. package/router/dist/vault/vault-index.js +0 -416
  274. package/router/dist/vault/vault.d.ts +0 -138
  275. package/router/dist/vault/vault.js +0 -630
  276. package/runtime/interaction-contract.md +0 -16
  277. package/skills/discuss/references/checkpoints.md +0 -66
  278. package/skills/execute-work/references/execution-loop.md +0 -77
  279. package/skills/output-router/SKILL.md +0 -206
  280. package/skills/output-router/references/safety-policy.md +0 -40
  281. package/skills/setup-freeflow/references/output-router-setup.md +0 -110
  282. package/skills/track-work/references/working-record-schema.md +0 -378
  283. package/skills/workflow/references/workflow-loop.md +0 -92
  284. /package/skills/handoff/references/{templates.md → handoff-templates.md} +0 -0
  285. /package/skills/review-artifact/references/{reviewer-prompt.md → independent-artifact-reviewer-contract.md} +0 -0
@@ -0,0 +1,122 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { fileURLToPath } from "node:url";
4
+ import { resolve } from "node:path";
5
+ import { CommittedResultError } from "./lib/record-store.mjs";
6
+ import { WorkingRecordError, fail } from "./lib/model.mjs";
7
+ import { baseEnvelope, errorItems } from "./lib/result.mjs";
8
+ import { executeCommand, readJsonInput } from "./lib/commands.mjs";
9
+
10
+ function parseCliArgs(args) {
11
+ const positionals = [];
12
+ const options = {};
13
+ const flags = new Set(["--dry-run", "--help"]);
14
+ for (let index = 0; index < args.length; index += 1) {
15
+ const argument = args[index];
16
+ if (!argument.startsWith("--")) {
17
+ positionals.push(argument);
18
+ continue;
19
+ }
20
+ const equals = argument.indexOf("=");
21
+ const key = equals >= 0 ? argument.slice(0, equals) : argument;
22
+ if (Object.hasOwn(options, key)) fail("duplicate-option", `Option may be supplied once: ${key}`);
23
+ if (flags.has(key)) {
24
+ options[key] = true;
25
+ if (equals >= 0) fail("invalid-option", `${key} does not accept a value`);
26
+ continue;
27
+ }
28
+ const value = equals >= 0 ? argument.slice(equals + 1) : args[++index];
29
+ if (value === undefined || value.startsWith("--")) fail("missing-option-value", `Option requires a value: ${key}`);
30
+ options[key] = value;
31
+ }
32
+ return { positionals, options };
33
+ }
34
+ function usage() {
35
+ return `Usage: node skills/track-work/scripts/working-record.mjs <command> [options]
36
+
37
+ Commands:
38
+ init --root <repo> --name <short-name> [--input <json-file|->] [--dry-run]
39
+ view --record <record.md> --view <resume|discuss|execute|recent|entity|full> [--entity <id-or-title>]
40
+ schema --command <init|update|start|block|resume|reopen|close|unlock|migrate|compress|all> [--help]
41
+ update --record <record.md> --expected-sha <sha256> --input <json-file|-> [--dry-run]
42
+ start --record <record.md> --expected-sha <sha256> --input <json-file|-> [--dry-run]
43
+ block --record <record.md> --expected-sha <sha256> --input <json-file|-> [--dry-run]
44
+ resume --record <record.md> --expected-sha <sha256> --input <json-file|-> [--dry-run]
45
+ reopen --record <record.md> --expected-sha <sha256> --input <json-file|-> [--dry-run]
46
+ close --record <record.md> --expected-sha <sha256> --input <json-file|-> [--dry-run]
47
+ unlock --record <record.md> --input <json-file|->
48
+ migrate --record <record.md> --expected-sha <sha256> --input <json-file|-> [--dry-run]
49
+ compress --record <record.md> --expected-sha <sha256> --input <json-file|-> [--dry-run]
50
+ validate --record <record.md>
51
+ inspect --record <record.md>
52
+
53
+ Views emit bounded Markdown text. Other commands emit one JSON result. Existing-record mutations require the current SHA-256. Use --input - to read semantic JSON from stdin.
54
+ `;
55
+ }
56
+
57
+ export { executeCommand };
58
+
59
+ async function main() {
60
+ const [command, ...args] = process.argv.slice(2);
61
+ if (!command || command === "--help" || command === "-h") {
62
+ process.stdout.write(usage());
63
+ return;
64
+ }
65
+ const { positionals, options } = parseCliArgs(args);
66
+ if (options["--help"]) {
67
+ process.stdout.write(usage());
68
+ return;
69
+ }
70
+ const root = options["--root"] ? resolve(options["--root"]) : process.cwd();
71
+ if (positionals.length > 1) fail("invalid-arguments", "Only one positional record or task path is supported");
72
+ if (positionals.length === 1 && !options["--record"] && !options["--task"]) options["--record"] = positionals[0];
73
+ const input = await readJsonInput(options);
74
+ const result = await executeCommand(command, { root, options, input });
75
+ if (command === "view" || command === "resume-view") {
76
+ process.stdout.write(result.view?.content ?? "");
77
+ } else if (command === "schema") {
78
+ process.stdout.write(result.content ?? "");
79
+ } else {
80
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
81
+ }
82
+ if (result.status === "committed-unconfirmed") process.exitCode = 2;
83
+ else if (result.status === "failed") process.exitCode = 1;
84
+ }
85
+
86
+ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
87
+ try {
88
+ await main();
89
+ } catch (error) {
90
+ if (error instanceof CommittedResultError) {
91
+ process.stdout.write(`${JSON.stringify(error.result, null, 2)}\n`);
92
+ process.exitCode = 2;
93
+ } else {
94
+ const knownError = error instanceof WorkingRecordError;
95
+ const command = process.argv[2] ?? null;
96
+ if (command === "view" || command === "resume-view") {
97
+ process.stdout.write(`Track Work view failed [${error.code ?? "view-failed"}]: ${error.message}\n`);
98
+ process.exitCode = error instanceof WorkingRecordError ? error.exitCode : 1;
99
+ } else if (command === "schema") {
100
+ process.stdout.write(`Track Work schema failed [${error.code ?? "schema-failed"}]: ${error.message}\n`);
101
+ process.exitCode = error instanceof WorkingRecordError ? error.exitCode : 1;
102
+ } else {
103
+ const result = baseEnvelope(command, command, knownError ? error.record : null);
104
+ if (!result.record && knownError && error.details?.path) {
105
+ result.record = {
106
+ path: error.details.path,
107
+ confirmation: "unavailable",
108
+ sha256: error.details.sha256 ?? null,
109
+ schemaVersion: null,
110
+ taskState: null,
111
+ lastUpdated: null,
112
+ currentSlice: null,
113
+ unavailable: ["recordProjectionUnavailable"],
114
+ };
115
+ }
116
+ result.errors = errorItems(knownError ? error : new WorkingRecordError("unexpected-error", error.message));
117
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
118
+ process.exitCode = error instanceof WorkingRecordError ? error.exitCode : 1;
119
+ }
120
+ }
121
+ }
122
+ }
@@ -7,7 +7,7 @@ description: Use when verifying work or a claim after implementation, tests, bui
7
7
 
8
8
  Determine whether fresh evidence supports a specific claim at the required observing boundary.
9
9
 
10
- Verification is factual: what ran, what happened, and what that result proves. The active agent owns verification and routes from its result. Reading or invoking this skill changes neither role nor authority; it creates no review judgment or permission to continue.
10
+ Verification is factual: what ran, what happened, and what that result proves. The active agent owns verification and routes from its result. Reading or invoking this skill changes neither role nor authority and creates no review judgment or permission to continue.
11
11
 
12
12
  ## Name The Claim
13
13
 
@@ -28,14 +28,26 @@ Do not let an available check silently narrow a broader claim.
28
28
 
29
29
  Use the smallest direct evidence that can falsify the claim. Evidence must be fresh for the code, configuration, environment, and artifact being assessed.
30
30
 
31
+ Verification inherits the current authority envelope. Existing evidence may be inspected without a new run. Run a new active check only when that envelope covers it directly or as contained verification; otherwise return its purpose, expected evidence, and stop condition to Workflow and wait.
32
+
33
+ Verify Work owns the claim and required evidence boundary. When several covered observers can falsify the same claim, or the likely check is broad, use [Action Selection](../action-selection/SKILL.md) to choose and bound one environment interaction. It returns the observation; Verify Work interprets and classifies support. Skip it when one exact check is already selected.
34
+
31
35
  Passing tests do not prove behavior they do not exercise. A happy path does not prove failure handling. Source inspection does not prove runtime execution. A helper call does not prove registration, host dispatch, or installed-package behavior.
32
36
 
33
- Read [integration evidence](references/integration-evidence.md) for callback, host-lifecycle, installed-artifact, absence, or mutation-footprint claims. Read [browser runtime evidence](references/browser-runtime-evidence.md) for rendered, interactive, network, accessibility, console, or visual claims. Read [performance evidence](references/performance-evidence.md) for latency, throughput, memory, CPU, bundle, query, or resource claims.
37
+ Before selecting or running evidence:
38
+
39
+ - read [integration evidence](references/integration-evidence.md) when a claim depends on a registered callback or executor, host lifecycle, producer invocation, fallback protocol, installed package, absence counter, or a check that may mutate shared state;
40
+ - read [browser runtime evidence](references/browser-runtime-evidence.md) when a claim depends on rendered UI, browser behavior, accessibility, client networking, console state, visual output, or browser runtime performance;
41
+ - read [performance evidence](references/performance-evidence.md) when verifying latency, throughput, memory, CPU, bundle, query, rendering, capacity, or resource-regression claims.
42
+
43
+ For browser-performance claims, read both Browser Runtime Evidence for runtime fidelity and Performance Evidence for workload, baseline, variance, and metrics.
34
44
 
35
45
  Review may judge whether evidence is sufficient, but review does not prove that behavior occurred.
36
46
 
37
47
  ## Run And Interpret
38
48
 
49
+ Once the selected check is authorized:
50
+
39
51
  1. Run the complete selected check.
40
52
  2. Read the relevant output, exit status, and lower-level evidence that can contradict a summary.
41
53
  3. Confirm the intended success or failure path and observing boundary were exercised.
@@ -1,6 +1,6 @@
1
1
  # Browser Runtime Evidence
2
2
 
3
- Read this when a claim depends on rendered UI, browser behavior, accessibility, client networking, console state, visual output, or browser performance.
3
+ Read this before selecting or running evidence when a claim depends on rendered UI, browser behavior, accessibility, client networking, console state, visual output, or browser runtime performance.
4
4
 
5
5
  Use the available browser or DevTools capability for the host. This reference defines evidence quality, not tool-specific commands.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Integration Evidence
2
2
 
3
- Use this when a claim depends on a registered callback or executor, host lifecycle, producer invocation, fallback protocol, installed package, absence counter, or checks that may mutate shared state.
3
+ Read this before selecting or running evidence when a claim depends on a registered callback or executor, host lifecycle, producer invocation, fallback protocol, installed package, absence counter, or a check that may mutate shared state.
4
4
 
5
5
  ## Match The Boundary
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Performance Evidence
2
2
 
3
- Read this when verifying latency, throughput, memory, CPU, bundle, query, rendering, capacity, or resource-regression claims.
3
+ Read this before selecting or running evidence when verifying latency, throughput, memory, CPU, bundle, query, rendering, capacity, or resource-regression claims.
4
4
 
5
5
  A faster synthetic operation does not prove the reported path improved. Preserve correctness while measuring representative work.
6
6
 
@@ -1,91 +1,143 @@
1
1
  ---
2
- name: workflow
3
- description: Use when coordinating discussion, decisions, durable task memory, execution, verification, review, or a route change from feedback.
2
+ name: "workflow"
3
+ description: "Use when authority, ownership, route changes, context recovery, selected checkpoints, or Supported Exit must be coordinated across Freeflow methods."
4
4
  ---
5
5
 
6
6
  # Workflow
7
7
 
8
- Use feedback to choose the smallest useful next action. Treat work as an **Interaction Lifecycle** with an internal **Feedback Loop**, not a fixed sequence.
8
+ Own the outer Interaction Lifecycle. Establish authority, keep one owner for the current bounded activity, route from evidence, and decide when a Supported Exit is justified.
9
9
 
10
- The active agent owns understanding, routing, authorized work, verification, correction, and completion. It adjudicates selected review; independent judgment does not take over workflow control.
10
+ Workflow coordinates methods; it does not replace their detailed jobs. Selecting a skill, tool, artifact, review, or compute profile never widens authority.
11
11
 
12
- Read the [expanded Workflow loop](references/workflow-loop.md) when the complete lifecycle, skill relationships, or exits are unclear. Read [domain skill composition](references/domain-skill-composition.md) when specialized engineering guidance must run inside the active route.
12
+ ## Enter Through Authority
13
13
 
14
- ## Route The Interaction
14
+ Interpret the whole user turn and still-valid prior approval. Establish or confirm the authority envelope before consequential action.
15
+
16
+ Classify effects cumulatively:
17
+
18
+ - **Passive observation:** inspect existing evidence without exercising target behavior or intentionally changing task state.
19
+ - **Active evidence generation:** exercise target behavior to produce new evidence.
20
+ - **Mutation or delivery:** change repository, durable task or session, or external state.
21
+
22
+ A direct request authorizes its bounded outcome and entailed tools, checks, and reversible local choices. A Spec, Plan, task-memory artifact, review, recommendation, silence, mode, or newly useful evidence does not create authority.
23
+
24
+ Before an uncovered action, return one bounded proposal:
15
25
 
16
26
  ```text
17
- [Entry] -> [Feedback Loop when needed] -> [Supported Exit]
18
- ^ ^ | |
19
- | |________| |
20
- |__________________________________________|
21
- later user turn or evidence
27
+ Purpose:
28
+ Action:
29
+ Expected evidence or result:
30
+ Stop condition:
22
31
  ```
23
32
 
24
- Entry begins with a user turn or new evidence interpreted through the Interaction Contract and effective mode. It may route directly to an answer, wait, deferment, or stop. When work is needed, choose the narrowest owner:
33
+ Ask one direct authorization question and wait. Do not perform the proposed action or a dependent step while waiting.
34
+
35
+ ## Choose One Owner
25
36
 
26
- - **Understand and decide:** [Discuss](../discuss/SKILL.md), [Decision Gate](../decision-gate/SKILL.md), [Bypass](../bypass/SKILL.md), with [Design for Depth](../design-for-depth/SKILL.md) when the direction is design-bearing.
27
- - **Preserve memory or accepted artifacts:** [Track Work](../track-work/SKILL.md), [Write Spec](../write-spec/SKILL.md), [Write Plan](../write-plan/SKILL.md), and [Review Artifact](../review-artifact/SKILL.md).
28
- - **Execute and learn:** [Execute Work](../execute-work/SKILL.md), [Migration Work](../migration-work/SKILL.md), [Diagnose Failure](../diagnose-failure/SKILL.md), [Verify Work](../verify-work/SKILL.md), and [Review Work](../review-work/SKILL.md).
29
- - **Preserve or close out:** [Commit Work](../commit-work/SKILL.md), [Handoff](../handoff/SKILL.md), [Finish Branch](../finish-branch/SKILL.md), [Release Work](../release-work/SKILL.md), and [Launch Work](../launch-work/SKILL.md).
37
+ Choose the narrowest discoverable owner whose job matches the current need:
30
38
 
31
- These are owners, not mandatory phases. Method and domain skills compose inside one active route without overriding accepted behavior, live evidence, or user authority.
39
+ - **Understand and decide:** [Discuss](../discuss/SKILL.md), [Decision Gate](../decision-gate/SKILL.md), or [Bypass](../bypass/SKILL.md), with [Design for Depth](../design-for-depth/SKILL.md) as a lens when direction is design-bearing.
40
+ - **Preserve task state or accepted artifacts:** [Track Work](../track-work/SKILL.md), [Write Spec](../write-spec/SKILL.md), [Write Plan](../write-plan/SKILL.md), or [Review Artifact](../review-artifact/SKILL.md).
41
+ - **Execute and learn:** [Execute Work](../execute-work/SKILL.md), [Migration Work](../migration-work/SKILL.md), [Diagnose Failure](../diagnose-failure/SKILL.md), [Verify Work](../verify-work/SKILL.md), or [Review Work](../review-work/SKILL.md).
42
+ - **Preserve or close out:** [Commit Work](../commit-work/SKILL.md), [Handoff](../handoff/SKILL.md), [Finish Branch](../finish-branch/SKILL.md), [Release Work](../release-work/SKILL.md), or [Launch Work](../launch-work/SKILL.md).
32
43
 
33
- ## Authorize Or Wait
44
+ These are owners, not mandatory phases. Keep the current owner while its question, authority, and evidence boundary remain coherent.
34
45
 
35
- Before any state-changing or separately controlled action, identify the bounded action, confirm that the effective mode permits it, and establish its authority source. Authority may come from a clear direct request, explicit approval, or an action or checkpoint explicitly authorized through a user-approved Plan or discussion. An accepted Spec or Plan alone establishes direction, not execution authority. A Working Record may preserve authority but cannot create it.
46
+ Recommend Discuss before authorized work only when user input could materially change the outcome, boundary, tradeoff, approach, or acceptance. Inspect facts and choose reversible local details without asking.
36
47
 
37
- If the action is not covered, recommend its exact purpose and scope, ask one direct authorization question, and wait for the user's response. Waiting means do not perform the proposed mutation, dispatch, or dependent next action. Mode, settled direction, a recommendation, review findings, silence, and task memory do not authorize work.
48
+ When the owner needs an environment interaction and the action or tool choice is not already obvious, use [Action Selection](../action-selection/SKILL.md). Return its observation and state change to the same owner.
38
49
 
39
- Authorization covers the bounded outcome, not each tool call. Do not ask again for contained edits, tests, verification, or reversible local choices. Ask again when the result, scope, evidence boundary, stop condition, or separately controlled action changes.
50
+ Read [Domain Skill Composition](./references/domain-skill-composition.md) when specialized engineering guidance must operate inside the current owner.
40
51
 
41
- Before authorized work begins, recommend Discuss only when user input could materially change the outcome, boundary, tradeoff, approach, or acceptance. Name the question and wait. Use Design for Depth while the direction remains design-bearing. Inspect facts and choose reversible local details without asking. If the user declines optional discussion, do not ask again without new evidence. A discussion recommendation creates no artifact or slice.
52
+ ## Run The Feedback Loop
42
53
 
43
- ## Run One Feedback Loop
54
+ For each bounded activity:
44
55
 
45
- For one bounded activity:
56
+ 1. orient to accepted intent, the authority envelope, relevant task memory, and live evidence;
57
+ 2. use the owner to discuss, preserve, implement, observe, verify, or judge;
58
+ 3. determine what the result proves at the required evidence boundary;
59
+ 4. after initial support, perform the stable self-review once;
60
+ 5. correct a clear local defect inside existing authority and re-verify the affected boundary;
61
+ 6. otherwise re-enter only the owner whose responsibility changed;
62
+ 7. continue only while authority, evidence, checkpoints, and convergence support the route.
46
63
 
47
- 1. Orient to accepted intent, relevant task memory, and live evidence.
48
- 2. Use the owning skill to discuss, implement, test, observe, or otherwise act.
49
- 3. Verify what the evidence proves at the required boundary.
50
- 4. When supported, self-review once for alignment, suitability, and unnecessary complexity.
51
- 5. Continue, correct, diagnose, revise, ask, defer, or stop from the result.
64
+ Do not review unsupported work as ready, continue because implementation began, or restart the task because one responsibility changed.
52
65
 
53
- Self-review is silent and creates no formal judgment or cycle. Correct clear local issues within authority, re-verify, then freeze the supported state. Freezing does not itself close a current Track Work slice; selected review, checkpoints, discussion, and accepted in-scope correction may continue inside it. Further polish, advisory warnings, and unrelated issues require another selected slice.
66
+ ## Route From Evidence
54
67
 
55
- If verification fails, correct one clear local defect or diagnose an unsupported cause. Do not review unsupported work as ready. Handle only edge cases required by accepted behavior, observed evidence, or material safety. A stream of related patches routes to diagnosis of the shared requirement, cause, ownership, or interface.
68
+ - **Continue:** evidence supports the current owner and authority envelope.
69
+ - **Correct:** one clear local defect preserves accepted intent and effects.
70
+ - **Broaden evidence:** the claim exceeds the current observer.
71
+ - **Diagnose:** a cause is unclear or failure repeats.
72
+ - **Discuss:** options, assumptions, or direction materially changed.
73
+ - **Decision Gate:** a user-owned choice or source conflict blocks progress.
74
+ - **Track Work:** durable task state must be created, reconciled, or recovered.
75
+ - **Revise an artifact:** accepted content, strategy, decision, or handoff changed.
76
+ - **Verify Work:** a material claim needs fresh direct evidence.
77
+ - **Review:** selected judgment is needed after factual support.
78
+ - **Stop or defer:** no safe worthwhile continuation remains.
56
79
 
57
- Continue only while authority remains clear, evidence supports the route, no checkpoint is due, and the work converges.
80
+ Preserve unaffected decisions, artifacts, work, and evidence. New evidence changes the route only where its consequence applies.
58
81
 
59
- ## Preserve Necessary State
82
+ ## Preserve Continuity Deliberately
60
83
 
61
- When authorized work is concrete and direction is settled, use Track Work to decide whether continuity needs a Working Record, then follow its result to Execute Work or wait. Create durable memory only when forgetting would risk misalignment: a Working Record for living task state, a Spec for stable accepted content, a Plan for ordered strategy, an ADR for a surprising hard-to-reverse decision, or a Handoff for point-in-time transfer.
84
+ Track Work owns a **Working Record** for durable task memory. Decide whether durable task memory is needed before routing to Track Work. Use it when losing decisions, evidence, authority, current work, blockers, or the next useful action could cause later misalignment. Do not create task memory for a short disposable action merely because work occurred.
62
85
 
63
- When an ongoing task resumes after compaction, summarization, clear, resume, or session navigation, read the complete owning Working Record before continuing and compare it with the conversation and live state. Another conversation branch may preserve memory, not authority.
86
+ After compaction, summarization, session navigation, or ownership transfer:
64
87
 
65
- Synchronize durable architecture, plugin, setup, or similar documentation when stabilized behavior or dependent work requires it—not after every slice. Never finish with a known required-doc inconsistency.
88
+ 1. use the current runtime state and user turn;
89
+ 2. recover the bounded current task view when one exists;
90
+ 3. re-read an owning skill whose body is absent when its exact method still matters;
91
+ 4. reopen only the accepted artifacts or exact history needed for the next decision;
92
+ 5. compare memory with live repository or environment state;
93
+ 6. re-establish authority from valid current-session sources.
66
94
 
67
- ## Control Reviews And Checkpoints
95
+ When a Working Record exists after context loss, treat its recovery, reconciliation, and mutation as a bounded Track Work activity even when another method owns the surrounding outcome. Read Track Work before the first record operation, begin with its bounded `resume` view, and obtain the current command schema before mutation. Do not read the full record or reconstruct record commands from memory.
68
96
 
69
- A local commit, independent review, correction, follow-up review, push, integration, release, or launch is separately controlled unless existing authority explicitly covers it. At a supported boundary, recommend a local commit only when it materially improves rollback, provenance, handoff, integration, or preservation; a slice ending alone is insufficient. When a useful boundary is unapproved, recommend its exact purpose and scope, then wait; do not stage, edit, dispatch, or cross the boundary from the recommendation.
97
+ A summary, historical skill body, Working Record, Plan, or Handoff preserves context but does not become current authority or live source truth.
70
98
 
71
- Specs and Plans receive separate independent Review Artifact after author self-review. Working Records do not by default. Select independent work review for sensitive, hard-to-reverse, architecture-bearing, strongly interacting, plan-selected, or explicitly requested boundaries—not merely because a slice ended. Reading a review skill does not create independence.
99
+ ## Route Reviews And Checkpoints
72
100
 
73
- Independent review ends with **Pass**, **Non-blocking**, **Inconclusive**, or **Blocking**. The active agent adjudicates the items and routes accordingly: proceed, proceed with explicit deferrals, gather missing evidence or a decision, or stop before the blocked boundary.
101
+ Select a checkpoint only when it materially protects dependent work, rollback, provenance, transfer, integration, or delivery. Examples include a user decision, independent review, local commit, handoff, integration, release, or launch. Do not select one merely because work paused or a bounded activity ended.
74
102
 
75
- Review findings are evidence, not commands, and do not authorize edits. Ask once for unapproved corrections plus any warranted focused follow-up, or corrections alone, then wait. A review budget caps dispatches; it does not authorize them. Return implementation corrections to Execute Work and artifact revisions to their owner, verify them, and run a focused follow-up only when needed and authorized. Never create an automatic review-fix-review loop or keep editing merely to obtain Pass.
103
+ Self-review belongs to the Feedback Loop and is not a checkpoint. Use Review Work for implementation or integrated work. Use Review Artifact for a Working Record, Spec, Plan, decision record, handoff, or another durable guide.
76
104
 
77
- ## Route And Exit From Evidence
105
+ An independent reviewer reports without editing. The active agent adjudicates every material finding against source truth and evidence:
78
106
 
79
- - **Continue:** evidence supports the current route.
80
- - **Correct:** one clear local defect preserves intent and scope.
81
- - **Broaden evidence:** the claim exceeds the check.
82
- - **Diagnose:** the cause is unclear or failure repeats.
83
- - **Discuss:** new options or invalid assumptions change direction.
84
- - **Track Work:** task memory or history must be reconciled.
85
- - **Revise Spec or Plan:** accepted content, contract, order, mechanism, dependencies, or checks changed.
86
- - **Decision Gate:** a user-owned choice or source conflict blocks progress.
87
- - **Stop or defer:** no safe worthwhile continuation remains.
107
+ - **Accept:** the problem is supported and applicable.
108
+ - **Reject:** the item is stale, duplicate, resolved, preference-only, out of scope, or unsupported.
109
+ - **Open:** evidence or a user decision is missing.
110
+
111
+ Review methods return:
112
+
113
+ - **Pass:** continue within existing authority.
114
+ - **Non-blocking:** continue with explicit deferrals.
115
+ - **Inconclusive:** obtain the missing evidence or decision.
116
+ - **Blocking:** do not cross the boundary; re-enter the narrowest owner, defer, or stop.
117
+
118
+ A finding, judgment, suggested remedy, or useful checkpoint does not authorize correction or continuation. Establish the problem, consequence, remedy basis, verification boundary, and authority before acting.
119
+
120
+ When findings interact, assumptions are challenged, materially different remedies remain, or user input could change the approach, report a problem checkpoint and stop before selecting a remedy.
121
+
122
+ A local commit, handoff, user decision, integration, push, release, or launch remains separately controlled unless the authority envelope explicitly covers it.
123
+
124
+ Do not create an automatic review–fix–review loop or keep editing merely to obtain Pass. Review skills own their exact role rules, item taxonomy, evidence lenses, reviewer contracts, reports, and cycle limits.
125
+
126
+ ## Reach A Supported Exit
127
+
128
+ A Supported Exit may answer, wait, pause, hand off, defer, stop, preserve a controlled boundary, or complete.
129
+
130
+ Claim completion only when:
131
+
132
+ - fresh evidence supports the accepted outcome at the required boundary;
133
+ - every completed bounded activity crossed self-review with no unresolved material issue;
134
+ - selected reviews and checkpoints are resolved;
135
+ - task memory and required artifacts are accurate;
136
+ - no material contradiction, source conflict, or user-owned decision remains hidden;
137
+ - no separately controlled action is being implied as complete.
138
+
139
+ Report the outcome, evidence, proof limits, unresolved gaps, and current route. A recommendation for a next action does not authorize it.
88
140
 
89
- Preserve valid work and revise only the affected layer. A supported exit may answer, wait, pause, hand off, defer, stop, preserve a controlled boundary, or complete the task.
141
+ ## Stop
90
142
 
91
- Claim completion only when fresh verification supports the outcome, self-review has no unresolved material issue, selected reviews are resolved, task memory is accurate, required artifacts are synchronized, and no user-owned decision or source conflict remains hidden. Report the outcome, evidence, gaps, and route. Use `Next:` only when one useful recommendation remains; it does not authorize action.
143
+ Stop Workflow when a Supported Exit is reached or one owner can continue without an unresolved authority, ownership, checkpoint, or route question. Resume it only when feedback changes one of those boundaries.
@@ -1,57 +1,37 @@
1
1
  # Domain Skill Composition
2
2
 
3
- Read this when specialized engineering guidance must operate inside a Freeflow route.
3
+ Read this when specialized engineering guidance must operate inside the current Workflow owner.
4
4
 
5
- Freeflow chooses **what owns the current action**. Domain guidance supplies **how to perform the specialized engineering safely**. Do not turn a domain skill into a second workflow.
5
+ Freeflow owns authority, ownership, route changes, evidence honesty, checkpoints, and Supported Exit. Domain guidance supplies specialized engineering method. It does not become another workflow or widen authority.
6
6
 
7
- ## Keep Ownership Clear
7
+ ## Compose One Owner
8
8
 
9
- Freeflow owns:
9
+ For the current bounded activity:
10
10
 
11
- - effective mode, authority, and route;
12
- - user decisions and source conflicts;
13
- - discussion, durable artifacts, slices, and route changes;
14
- - verification honesty, review calibration, checkpoints, and exits.
11
+ 1. keep one Freeflow owner;
12
+ 2. add only the domain guidance required by the concrete technology, behavior, or risk;
13
+ 3. use one primary implementation or diagnostic method at a time;
14
+ 4. add Design for Depth only when direction is already design-bearing or evidence establishes structural pressure;
15
+ 5. add independent specialist review only when it materially protects a selected boundary.
15
16
 
16
- Domain guidance may own techniques for frontend, accessibility, browser tools, security, performance, databases, APIs, CI/CD, observability, cloud platforms, migration, release, or deployment.
17
-
18
- Domain guidance never overrides accepted behavior, repository policy, owner decisions, failure contracts, or evidence requirements. When it conflicts with live source truth, inspect the conflict and use [Decision Gate](../../decision-gate/SKILL.md) if resolution changes behavior or material risk.
19
-
20
- ## Compose One Route
17
+ Prefer repository policy and current primary sources over generic examples. Do not load a handbook because one keyword appears.
21
18
 
22
- For one current action:
19
+ ## Preserve Boundaries
23
20
 
24
- 1. Keep one owning Freeflow skill.
25
- 2. Use [Design for Depth](../../design-for-depth/SKILL.md) as a lens only when the direction is already design-bearing or evidence establishes structural pressure.
26
- 3. Use one primary implementation or diagnostic method at a time, such as [TDD](../../tdd/SKILL.md), [Simplify Code](../../simplify-code/SKILL.md), or [Diagnose Failure](../../diagnose-failure/SKILL.md).
27
- 4. Load only the domain guidance needed for the concrete technology or risk.
28
- 5. Add specialist independent review only when its lens materially protects the selected boundary.
29
-
30
- Changing method from evidence does not automatically change the current Track Work slice. Do not load a handbook because one keyword appears. Prefer repository policy and current primary sources over generic examples.
31
-
32
- ## Common Shapes
21
+ Domain guidance may own techniques for frontend, accessibility, browser tools, security, performance, databases, APIs, CI/CD, observability, cloud platforms, migration, release, or deployment.
33
22
 
34
- ```text
35
- UI change:
36
- Workflow -> frontend/accessibility guidance -> TDD when useful
37
- -> browser verification
23
+ It never overrides:
38
24
 
39
- Security- or integrity-sensitive work:
40
- Decision Gate when policy is unsettled -> Design for Depth -> security guidance
41
- -> TDD at the real boundary -> failure-path verification
42
- -> selected security review
25
+ - user-owned product or risk decisions;
26
+ - repository instructions or accepted behavior;
27
+ - the authority envelope;
28
+ - source truth, failure contracts, or evidence requirements;
29
+ - the active owner's stop and return conditions.
43
30
 
44
- Performance regression:
45
- Diagnose Failure -> profiler/query guidance -> bounded correction
46
- -> representative performance verification
31
+ When domain guidance conflicts with live source truth or accepted intent, return the conflict to Workflow. Use Decision Gate when resolving it changes user-owned behavior or material risk.
47
32
 
48
- CI/CD change:
49
- Workflow or Plan -> provider/repository guidance -> pipeline verification
50
- -> Launch Work only for separately authorized production rollout
33
+ ## Return
51
34
 
52
- Migration:
53
- Migration Work -> storage/API guidance -> verify each unit
54
- -> Launch Work for separately authorized production cutover
55
- ```
35
+ Return domain results and evidence to the same owner. A method change does not automatically change durable task state, accepted scope, or the current owner.
56
36
 
57
- If no suitable domain skill exists, inspect current primary sources and repository conventions. State expertise or environment limits rather than inventing a universal checklist.
37
+ If no suitable domain guidance exists, inspect current primary sources and repository conventions. State expertise or environment limits rather than inventing a universal checklist.
@@ -57,7 +57,7 @@ Each slice should produce a coherent result that can be checked. A validation st
57
57
 
58
58
  ## Select Useful Checkpoints
59
59
 
60
- Every meaningful slice is verified and silently self-reviewed during execution; do not restate that default unless its evidence boundary is unusual.
60
+ During execution, every bounded activity is verified and silently self-reviewed before its result is accepted, reused, or claimed complete; do not restate that default unless its evidence boundary is unusual.
61
61
 
62
62
  At meaningful slice, phase, integration, risk, or continuity boundaries, consider independent review, a local commit, a user decision, or a continuity checkpoint. Record only selected checkpoints and their conditions. A slice ending or a fixed count alone does not justify a commit; prefer one when supported work forms a coherent rollback point or the next work may destabilize it.
63
63
 
@@ -69,13 +69,14 @@ Keep examples general enough to transfer beyond one fixture. Do not turn the bod
69
69
 
70
70
  ## Add Resources Only When Needed
71
71
 
72
- Read [progressive disclosure](references/progressive-disclosure.md) before adding or reorganizing references and scripts.
72
+ Before adding or reorganizing references and scripts, read [progressive disclosure](references/progressive-disclosure.md) to classify each read as entry-required, activity-required, or conditional. References do not activate independently: `SKILL.md` directs each read at its first useful point, and required means necessary rather than recommended.
73
73
 
74
74
  Start with one `SKILL.md`. Remove repeated prose and low-value checklists before expanding the file set.
75
75
 
76
- - Add a required reference when normal execution genuinely needs separately owned depth; link it before the dependency is used.
76
+ - Add a required reference when normal execution genuinely needs separately owned depth; state whether it is read at entry or before its normal activity.
77
77
  - Add a conditional reference when a distinct branch needs depth that would obscure the normal route; state the observable condition for reading it.
78
78
  - Add a script for repeated deterministic work or a feature the skill owns when automation is safer, clearer, or materially less wasteful than retyping it.
79
+ - Make the body instruction and reference introduction name the same read condition; neither may silently narrow or widen it.
79
80
  - Link every agent-facing reference, asset, declared dependency, and executable entrypoint from `SKILL.md`; internal implementation modules need not be linked.
80
81
  - Keep owned resources inside the skill package unless a declared package dependency is required.
81
82
  - Treat unlinked-file inspection as factual inventory, not an automatic defect.
@@ -12,10 +12,24 @@ description
12
12
  -> required or conditional reference or script
13
13
  ```
14
14
 
15
- The description routes the first useful read. `SKILL.md` establishes the job, normal method, necessary terms, and stop conditions. A required resource must be linked before the body relies on it. A conditional resource may rely on language already established by the body.
15
+ The description routes the first useful skill read. `SKILL.md` establishes the job, normal method, necessary terms, and stop conditions, then explicitly directs any reference read. References do not activate independently, and an introduction inside an unread reference cannot activate itself.
16
16
 
17
17
  Do not hide a definition, rule, or step needed to recognize the normal route in an unannounced reference. That is progressive reconstruction, not disclosure.
18
18
 
19
+ ## State The Read Point
20
+
21
+ Use one of three explicit read points:
22
+
23
+ - **Entry-required:** read before following the skill's normal route.
24
+ - **Activity-required:** read before performing a named activity on the normal route.
25
+ - **Conditional:** read only when an observable branch occurs.
26
+
27
+ Entry-required and activity-required resources are required references. Conditional resources are conditional references. The word “when” does not determine the class: “When designing a test, read Test Design” is activity-required because test design is normal TDD work.
28
+
29
+ Do not call a required read recommended or optional. If skipping it preserves correct normal execution, it is not required. Avoid “read when unclear” when the reference teaches how to recognize or make the underlying decision; either make the read activity-required or keep enough recognition guidance in `SKILL.md`.
30
+
31
+ The body instruction and reference introduction must describe the same read point. An introduction may explain purpose, but must not narrow or widen the condition established by `SKILL.md`.
32
+
19
33
  ## Add A Required Reference When
20
34
 
21
35
  - normal execution genuinely needs separately owned depth;
@@ -23,7 +37,7 @@ Do not hide a definition, rule, or step needed to recognize the normal route in
23
37
  - keeping the material inline would obscure the skill’s controlling rules;
24
38
  - the dependency is delivered and validated with the skill package.
25
39
 
26
- Required does not mean implicit. The body must say when to read the resource and must not act as if unread content were already known.
40
+ Required does not mean implicit or merely recommended. The body must command the read at entry or before the named normal activity and must not act as if unread content were already known.
27
41
 
28
42
  ## Add A Conditional Reference When
29
43
 
@@ -32,7 +46,7 @@ Required does not mean implicit. The body must say when to read the resource and
32
46
  - the active body can name an observable condition for reading it;
33
47
  - the reference has one clear job and does not restate the full skill or Workflow.
34
48
 
35
- Keep compact examples that teach the normal boundary in `SKILL.md`. Move a larger example set only when it serves a conditional branch and would obscure the normal route.
49
+ The condition must be observable before the read. Keep compact examples that teach the normal boundary in `SKILL.md`. Move a larger example set only when it serves a conditional branch and would obscure the normal route.
36
50
 
37
51
  ## Add A Script When
38
52