@hassangameryt/freeflow 0.7.3 → 0.8.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 (276) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/.cursor-plugin/plugin.json +1 -1
  5. package/NOTICE +14 -0
  6. package/README.md +26 -31
  7. package/capabilities/cognitive-routing/SKILL.md +106 -161
  8. package/capabilities/cognitive-routing/references/both-mode.md +36 -0
  9. package/capabilities/cognitive-routing/references/executor-mode.md +48 -0
  10. package/capabilities/cognitive-routing/references/helper-mode.md +47 -0
  11. package/capabilities/compaction/SKILL.md +49 -0
  12. package/capabilities/compaction/references/summary-format.md +239 -0
  13. package/command-surface.json +4 -0
  14. package/gemini-extension.json +1 -1
  15. package/hooks/shared/runtime-context.mjs +28 -30
  16. package/licenses/Apache-2.0.txt +55 -0
  17. package/package.json +22 -9
  18. package/pi-extension/README.md +41 -0
  19. package/pi-extension/dist/cognitive-routing/assembler.js +393 -0
  20. package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/config.js +5 -2
  21. package/pi-extension/dist/cognitive-routing/economics.js +45 -0
  22. package/pi-extension/dist/cognitive-routing/event-schema.js +388 -0
  23. package/pi-extension/dist/{session-sources/events.js → cognitive-routing/event-store.js} +103 -40
  24. package/pi-extension/dist/cognitive-routing/gate.js +241 -0
  25. package/pi-extension/dist/cognitive-routing/handlers.js +899 -0
  26. package/pi-extension/dist/cognitive-routing/handoffs.js +350 -0
  27. package/pi-extension/dist/cognitive-routing/model-control.js +467 -0
  28. package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/projection.js +229 -56
  29. package/pi-extension/dist/cognitive-routing/provenance.js +81 -0
  30. package/pi-extension/dist/cognitive-routing/runtime.js +396 -0
  31. package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/schemas.js +43 -7
  32. package/pi-extension/dist/cognitive-routing/session.js +221 -0
  33. package/pi-extension/dist/{session-sources → cognitive-routing}/sources.js +99 -85
  34. package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/state.js +37 -378
  35. package/pi-extension/dist/cognitive-routing/status.js +80 -0
  36. package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/tools.js +12 -12
  37. package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/types.js +5 -11
  38. package/pi-extension/dist/compaction/carry.js +191 -0
  39. package/pi-extension/dist/compaction/config.js +22 -0
  40. package/pi-extension/dist/compaction/controller.js +471 -0
  41. package/pi-extension/dist/compaction/harness.js +77 -0
  42. package/pi-extension/dist/compaction/results.js +158 -0
  43. package/pi-extension/dist/compaction/thresholds.js +35 -0
  44. package/pi-extension/dist/compaction/tool.js +57 -0
  45. package/pi-extension/dist/host/branch.js +13 -0
  46. package/pi-extension/dist/host/canonical.js +12 -0
  47. package/pi-extension/dist/host/catalog.js +77 -0
  48. package/pi-extension/dist/host/config.js +374 -0
  49. package/pi-extension/dist/host/projection-tags.js +60 -0
  50. package/pi-extension/dist/host/prompts.js +82 -0
  51. package/pi-extension/dist/{session-sources → host}/read-only-session.js +112 -1
  52. package/pi-extension/dist/{runtime → host}/request-history.js +121 -39
  53. package/pi-extension/dist/host/runtime-state.js +189 -0
  54. package/pi-extension/dist/{settings/settings-ui.js → host/settings/freeflow-command.js} +620 -410
  55. package/pi-extension/dist/{settings/settings-tui.js → host/settings/settings-view.js} +186 -73
  56. package/pi-extension/dist/host/staging.js +28 -0
  57. package/pi-extension/dist/host/status.js +101 -0
  58. package/pi-extension/dist/index.js +423 -173
  59. package/pi-extension/dist/provider-support/cache/anchor.js +21 -0
  60. package/pi-extension/dist/provider-support/cache/anthropic.js +102 -0
  61. package/pi-extension/dist/provider-support/cache/health.js +73 -0
  62. package/pi-extension/dist/provider-support/cache/index.js +58 -0
  63. package/pi-extension/dist/provider-support/cache/keepalive.js +210 -0
  64. package/pi-extension/dist/provider-support/cache/monitor.js +17 -0
  65. package/pi-extension/dist/provider-support/cache/openai-responses.js +48 -0
  66. package/pi-extension/dist/provider-support/effort.js +13 -0
  67. package/pi-extension/dist/provider-support/index.js +44 -3
  68. package/pi-extension/dist/provider-support/{astra → openai}/adapter.js +46 -29
  69. package/pi-extension/dist/provider-support/{astra → openai}/history.js +10 -8
  70. package/pi-extension/dist/provider-support/{astra → openai}/index.js +8 -4
  71. package/pi-extension/dist/provider-support/{astra → openai}/session-state.js +29 -38
  72. package/pi-extension/dist/provider-support/routes.js +17 -0
  73. package/pi-extension/dist/tool-execution/apply-patch/grammar.js +23 -0
  74. package/pi-extension/dist/tool-execution/apply-patch/match.js +38 -0
  75. package/pi-extension/dist/tool-execution/apply-patch/parser.js +177 -0
  76. package/pi-extension/dist/tool-execution/apply-patch/plan.js +201 -0
  77. package/pi-extension/dist/tool-execution/apply-patch/tool.js +84 -0
  78. package/pi-extension/dist/tool-execution/background.js +238 -0
  79. package/pi-extension/dist/tool-execution/bash-guard.js +23 -0
  80. package/pi-extension/dist/tool-execution/config.js +22 -0
  81. package/pi-extension/dist/tool-execution/edit-messages.js +120 -0
  82. package/pi-extension/dist/tool-execution/file-state.js +138 -0
  83. package/pi-extension/dist/tool-execution/file-tracking.js +143 -0
  84. package/pi-extension/dist/tool-execution/prompt.js +54 -0
  85. package/pi-extension/dist/tool-execution/tools.js +16 -0
  86. package/pi-extension/freeflow/README.md +9 -0
  87. package/plugin.json +1 -1
  88. package/runtime/prompts/cognitive-routing.md +4 -4
  89. package/runtime/prompts/core.md +22 -75
  90. package/runtime/prompts/interaction-contract.md +15 -8
  91. package/runtime/prompts/tool-execution.md +38 -0
  92. package/runtime/prompts/working-method.md +108 -0
  93. package/skills/action-selection/SKILL.md +39 -47
  94. package/skills/action-selection/references/trajectory-stalls.md +2 -0
  95. package/skills/bypass/SKILL.md +2 -2
  96. package/skills/commit-work/SKILL.md +31 -83
  97. package/skills/commit-work/references/git-state-edges.md +1 -1
  98. package/skills/commit-work/references/simple-push.md +2 -0
  99. package/skills/commit-work/references/staging-decisions.md +1 -1
  100. package/skills/decision-gate/SKILL.md +31 -50
  101. package/skills/design-for-depth/SKILL.md +44 -53
  102. package/skills/design-for-depth/references/design-pressure-signals.md +46 -144
  103. package/skills/design-for-depth/references/implementation-decisions.md +1 -1
  104. package/skills/design-for-depth/references/interface-design-loop.md +5 -36
  105. package/skills/design-for-depth/references/module-and-dependency-design.md +2 -32
  106. package/skills/design-for-depth/references/state-and-failure-boundaries.md +2 -13
  107. package/skills/diagnose-failure/SKILL.md +39 -24
  108. package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +2 -0
  109. package/skills/diagnose-failure/references/flaky-and-performance-diagnosis.md +2 -2
  110. package/skills/discuss/SKILL.md +35 -11
  111. package/skills/discuss/references/discussion-continuity.md +7 -27
  112. package/skills/evaluate-skill/SKILL.md +49 -80
  113. package/skills/evaluate-skill/references/evaluation-definition-schema.md +35 -5
  114. package/skills/evaluate-skill/references/evaluation-design.md +14 -14
  115. package/skills/evaluate-skill/references/execution-and-evidence.md +26 -5
  116. package/skills/evaluate-skill/references/review-and-revision.md +3 -1
  117. package/skills/evaluate-skill/scripts/lib/definitions.mjs +49 -8
  118. package/skills/evaluate-skill/scripts/lib/pi.mjs +14 -7
  119. package/skills/evaluate-skill/scripts/lib/review.mjs +196 -0
  120. package/skills/evaluate-skill/scripts/lib/runner.mjs +45 -8
  121. package/skills/evaluate-skill/scripts/lib/sandbox.mjs +2 -0
  122. package/skills/evaluate-skill/scripts/lib/trials.mjs +103 -0
  123. package/skills/evaluate-skill/scripts/lib/view.mjs +67 -1
  124. package/skills/evaluate-skill/scripts/pi-command-tool.mjs +144 -0
  125. package/skills/evaluate-skill/scripts/pi-guard.mjs +30 -13
  126. package/skills/evaluate-skill/scripts/skill-eval.mjs +114 -34
  127. package/skills/execute-work/SKILL.md +41 -9
  128. package/skills/execute-work/references/code-practices.md +2 -0
  129. package/skills/execute-work/references/execute-work-edges.md +11 -1
  130. package/skills/handoff/SKILL.md +1 -1
  131. package/skills/handoff/references/handoff-templates.md +1 -1
  132. package/skills/review-artifact/SKILL.md +42 -41
  133. package/skills/review-artifact/references/adjudicate-artifact-review.md +1 -1
  134. package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +1 -1
  135. package/skills/review-work/SKILL.md +38 -32
  136. package/skills/review-work/references/adjudicate-work-review.md +1 -1
  137. package/skills/review-work/references/independent-work-reviewer-contract.md +1 -1
  138. package/skills/review-work/references/security-risk-lens.md +2 -4
  139. package/skills/setup-freeflow/SKILL.md +3 -1
  140. package/skills/setup-freeflow/references/activation-contract.md +7 -13
  141. package/skills/setup-freeflow/references/host-setup.md +3 -3
  142. package/skills/track-work/SKILL.md +113 -161
  143. package/skills/track-work/references/working-record-format.md +189 -350
  144. package/skills/track-work/scripts/lib/document.mjs +62 -6
  145. package/skills/track-work/scripts/lib/format.mjs +16 -1
  146. package/skills/track-work/scripts/lib/store.mjs +9 -8
  147. package/skills/track-work/scripts/lib/transitions.mjs +79 -4
  148. package/skills/track-work/scripts/working-record.mjs +34 -12
  149. package/skills/verify-work/SKILL.md +29 -20
  150. package/skills/verify-work/references/browser-runtime-evidence.md +1 -5
  151. package/skills/verify-work/references/integration-evidence.md +2 -0
  152. package/skills/verify-work/references/performance-evidence.md +3 -1
  153. package/skills/verify-work/references/test-design.md +3 -1
  154. package/skills/workflow/SKILL.md +65 -21
  155. package/skills/workflow/references/domain-skill-composition.md +5 -3
  156. package/skills/write-docs/SKILL.md +83 -0
  157. package/skills/write-docs/references/documentation-shapes.md +119 -0
  158. package/skills/write-docs/scripts/docs-check.mjs +139 -0
  159. package/skills/write-plan/SKILL.md +40 -40
  160. package/skills/write-plan/references/plan-shapes.md +1 -1
  161. package/skills/write-skill/SKILL.md +107 -147
  162. package/skills/write-skill/references/activation-boundaries.md +2 -0
  163. package/skills/write-skill/references/agent-first-instructions.md +22 -10
  164. package/skills/write-skill/references/progressive-disclosure.md +4 -2
  165. package/skills/write-skill/references/skill-dependency-graphs.md +2 -0
  166. package/skills/write-skill/scripts/lib/similarity.mjs +56 -0
  167. package/skills/write-skill/scripts/skill-author.mjs +18 -2
  168. package/skills/write-spec/SKILL.md +34 -41
  169. package/skills/write-spec/references/artifact-standards.md +1 -1
  170. package/skills/write-spec/references/decision-records.md +2 -0
  171. package/skills/write-spec/references/spec-shapes.md +1 -1
  172. package/capabilities/context-virtualization/SKILL.md +0 -103
  173. package/capabilities/conversation-history/SKILL.md +0 -53
  174. package/hooks/tests/check-host-adapters.test.mjs +0 -82
  175. package/hooks/tests/check-runtime-context-hook.sh +0 -212
  176. package/pi-extension/dist/cognitive-routing-v2/runtime.js +0 -2181
  177. package/pi-extension/dist/context-virtualization/commands.js +0 -89
  178. package/pi-extension/dist/context-virtualization/projector.js +0 -42
  179. package/pi-extension/dist/context-virtualization/runtime.js +0 -378
  180. package/pi-extension/dist/context-virtualization/state.js +0 -57
  181. package/pi-extension/dist/context-virtualization/types.js +0 -10
  182. package/pi-extension/dist/conversation-history/passages.js +0 -66
  183. package/pi-extension/dist/conversation-history/ranking.js +0 -105
  184. package/pi-extension/dist/conversation-history/runtime.js +0 -226
  185. package/pi-extension/dist/conversation-history/search.js +0 -56
  186. package/pi-extension/dist/conversation-history/types.js +0 -1
  187. package/pi-extension/dist/freeflow-context/resolver.js +0 -120
  188. package/pi-extension/dist/freeflow-context/runtime.js +0 -80
  189. package/pi-extension/dist/freeflow-context/source-projector.js +0 -95
  190. package/pi-extension/dist/freeflow-context/tool.js +0 -314
  191. package/pi-extension/dist/freeflow-context/types.js +0 -12
  192. package/pi-extension/dist/freeflow-context/visibility.js +0 -28
  193. package/pi-extension/dist/integrations/mcp-config.js +0 -29
  194. package/pi-extension/dist/runtime/runtime-context.js +0 -754
  195. package/pi-extension/dist/runtime/runtime-identity.js +0 -5
  196. package/pi-extension/dist/session-sources/provenance.js +0 -32
  197. package/pi-extension/dist/ui/text-component.js +0 -57
  198. package/pi-extension/src/cognitive-routing-v2/budget.ts +0 -42
  199. package/pi-extension/src/cognitive-routing-v2/config.ts +0 -173
  200. package/pi-extension/src/cognitive-routing-v2/projection.ts +0 -375
  201. package/pi-extension/src/cognitive-routing-v2/render.ts +0 -277
  202. package/pi-extension/src/cognitive-routing-v2/runtime.ts +0 -2241
  203. package/pi-extension/src/cognitive-routing-v2/schemas.ts +0 -180
  204. package/pi-extension/src/cognitive-routing-v2/state.ts +0 -839
  205. package/pi-extension/src/cognitive-routing-v2/tools.ts +0 -62
  206. package/pi-extension/src/cognitive-routing-v2/types.ts +0 -254
  207. package/pi-extension/src/context-virtualization/commands.ts +0 -111
  208. package/pi-extension/src/context-virtualization/projector.ts +0 -62
  209. package/pi-extension/src/context-virtualization/runtime.ts +0 -428
  210. package/pi-extension/src/context-virtualization/state.ts +0 -79
  211. package/pi-extension/src/context-virtualization/types.ts +0 -92
  212. package/pi-extension/src/conversation-history/passages.ts +0 -81
  213. package/pi-extension/src/conversation-history/ranking.ts +0 -155
  214. package/pi-extension/src/conversation-history/runtime.ts +0 -250
  215. package/pi-extension/src/conversation-history/search.ts +0 -79
  216. package/pi-extension/src/conversation-history/types.ts +0 -31
  217. package/pi-extension/src/freeflow-context/resolver.ts +0 -139
  218. package/pi-extension/src/freeflow-context/runtime.ts +0 -100
  219. package/pi-extension/src/freeflow-context/source-projector.ts +0 -106
  220. package/pi-extension/src/freeflow-context/tool.ts +0 -366
  221. package/pi-extension/src/freeflow-context/types.ts +0 -70
  222. package/pi-extension/src/freeflow-context/visibility.ts +0 -53
  223. package/pi-extension/src/index.ts +0 -390
  224. package/pi-extension/src/integrations/mcp-config.ts +0 -32
  225. package/pi-extension/src/provider-support/astra/adapter.ts +0 -108
  226. package/pi-extension/src/provider-support/astra/history.ts +0 -145
  227. package/pi-extension/src/provider-support/astra/index.ts +0 -12
  228. package/pi-extension/src/provider-support/astra/session-state.ts +0 -113
  229. package/pi-extension/src/provider-support/index.ts +0 -5
  230. package/pi-extension/src/runtime/request-history.ts +0 -243
  231. package/pi-extension/src/runtime/runtime-context.ts +0 -860
  232. package/pi-extension/src/runtime/runtime-identity.ts +0 -8
  233. package/pi-extension/src/session-sources/events.ts +0 -230
  234. package/pi-extension/src/session-sources/provenance.ts +0 -39
  235. package/pi-extension/src/session-sources/read-only-session.ts +0 -170
  236. package/pi-extension/src/session-sources/sources.ts +0 -334
  237. package/pi-extension/src/settings/settings-tui.ts +0 -501
  238. package/pi-extension/src/settings/settings-ui.ts +0 -1652
  239. package/pi-extension/src/ui/text-component.ts +0 -66
  240. package/pi-extension/tests/cache-reuse/history.test.js +0 -117
  241. package/pi-extension/tests/cache-reuse/native.test.js +0 -91
  242. package/pi-extension/tests/cache-reuse/settings.test.js +0 -211
  243. package/pi-extension/tests/cognitive-routing-v2/communication.test.js +0 -577
  244. package/pi-extension/tests/cognitive-routing-v2/compaction-input.test.js +0 -183
  245. package/pi-extension/tests/cognitive-routing-v2/delegation.test.js +0 -557
  246. package/pi-extension/tests/cognitive-routing-v2/native.test.js +0 -474
  247. package/pi-extension/tests/cognitive-routing-v2/performance.test.js +0 -87
  248. package/pi-extension/tests/cognitive-routing-v2/persistence.test.js +0 -300
  249. package/pi-extension/tests/cognitive-routing-v2/projection.test.js +0 -241
  250. package/pi-extension/tests/cognitive-routing-v2/recovery.test.js +0 -1034
  251. package/pi-extension/tests/cognitive-routing-v2/render.test.js +0 -244
  252. package/pi-extension/tests/cognitive-routing-v2/runtime.test.js +0 -423
  253. package/pi-extension/tests/cognitive-routing-v2/stabilization.test.js +0 -521
  254. package/pi-extension/tests/cognitive-routing-v2/state.test.js +0 -586
  255. package/pi-extension/tests/context-virtualization/extension.test.js +0 -775
  256. package/pi-extension/tests/context-virtualization/projector.test.js +0 -110
  257. package/pi-extension/tests/context-virtualization/runtime.test.js +0 -230
  258. package/pi-extension/tests/conversation-history/runtime.test.js +0 -98
  259. package/pi-extension/tests/conversation-history/search.test.js +0 -97
  260. package/pi-extension/tests/fixtures/pi-host.js +0 -4
  261. package/pi-extension/tests/fixtures/routing-native.js +0 -191
  262. package/pi-extension/tests/integration/mode-free-core.test.js +0 -220
  263. package/pi-extension/tests/integration/pi-extension.test.js +0 -1447
  264. package/pi-extension/tests/integration/prompt-architecture.test.js +0 -447
  265. package/pi-extension/tests/integration/unaffected-regressions.test.js +0 -478
  266. package/pi-extension/tests/provider-support/astra-boundaries.test.js +0 -75
  267. package/pi-extension/tests/provider-support/astra.test.js +0 -306
  268. package/pi-extension/tests/provider-support/cli.test.js +0 -92
  269. package/pi-extension/tests/provider-support/native.test.js +0 -183
  270. package/pi-extension/tests/settings/settings-tui.test.js +0 -243
  271. package/pi-extension/tsconfig.json +0 -16
  272. package/runtime/prompts/context-virtualization.md +0 -3
  273. package/runtime/prompts/conversation-history.md +0 -3
  274. package/skills/design-for-depth/references/software-design-philosophy.md +0 -202
  275. /package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/budget.js +0 -0
  276. /package/pi-extension/dist/{cognitive-routing-v2 → cognitive-routing}/render.js +0 -0
@@ -7,86 +7,86 @@ description: "Use when writing or revising an implementation plan, execution pla
7
7
 
8
8
  Write a supported ordered strategy for an agreed outcome. Make its dependencies, actions, checks, and invalidation conditions clear without inventing requirements or pretending unknown later work is settled.
9
9
 
10
- A Plan describes intended execution. The Working Record preserves actual work, evolving state, and the next useful action. Neither creates authority by existing.
10
+ A Plan describes intended execution. The Working Record preserves actual work, evolving state, and the next useful action.
11
11
 
12
- ## Plan Only What Is Understood Enough To Order
12
+ The **Rules** below are binding; if one cannot be met, stop and say why. Everything else is **judgment**: follow its stated goal, and adapt when a different choice serves that goal better.
13
13
 
14
- Use a durable Plan when the intended outcome and material decisions are settled, the approach and dependencies can be ordered without guessing, and the strategy needs to survive independently.
14
+ ## Rules
15
15
 
16
- Not every task needs one. A small correction can proceed from its request and supported approach. An evolving route with substantial branching belongs in [Track Work](../track-work/SKILL.md) as provisional Slices, not a confident long-form Plan.
16
+ - A Plan creates no authority. Accepting it as a strategy is not permission to execute it. Explicit approval to execute it may cover its listed work, checks, selected reviews, record maintenance, and local commits (still subject to fresh evidence and [Commit Work](../commit-work/SKILL.md) inspection); it never implies push, integration, migration, deprecation, release, or launch.
17
+ - Never invent product behavior, compatibility, public interfaces, failure semantics, sensitive policy, migration, scale, retries, recovery, or extension machinery, and never replace agreed scope with an unapproved MVP or later-version split.
18
+ - Never encode a hoped-for answer or an unsettled owner choice as a planning assumption. Use [Discuss](../discuss/SKILL.md) for unresolved direction or material alternatives, [Decision Gate](../decision-gate/SKILL.md) for a blocking owner choice or source conflict, and [Diagnose Failure](../diagnose-failure/SKILL.md) for a fix whose cause is unsupported.
19
+ - Never let available tests redefine acceptance, or claim whole-system completion from a narrow observer.
20
+ - Writing or revising a Plan does not trigger independent review, and neither self-review nor independent review grants user acceptance or execution authority.
17
21
 
18
- Use [Discuss](../discuss/SKILL.md) for unresolved direction or material alternatives, [Decision Gate](../decision-gate/SKILL.md) for a blocking owner choice or source conflict, and [Diagnose Failure](../diagnose-failure/SKILL.md) for a fix whose cause is unsupported. Do not encode the hoped-for answer as a planning assumption.
22
+ ## Plan Only What Is Understood Enough To Order
19
23
 
20
- If the user asks about a Plan, answer rather than write one. If execution of the task is already authorized and a Plan is useful preparation, writing it need not create another approval stop. Preserve any review or user-return boundary actually selected.
24
+ Goal: write a durable Plan only when the strategy can be ordered honestly and needs to survive on its own.
21
25
 
22
- ## Establish The Current Basis
26
+ Use a durable Plan when the intended outcome and material decisions are settled, the approach and dependencies can be ordered without guessing, and the strategy needs to survive independently. Not every task needs one: a small correction can proceed from its request and supported approach, and an evolving route with substantial branching belongs in [Track Work](../track-work/SKILL.md) as provisional Slices, not a confident long-form Plan.
23
27
 
24
- A separate Spec is not required when the request and accepted understanding are sufficiently clear. Otherwise consume the relevant Spec, issue, design, diagnosis, decision, or requirements, together with current code, tests, policies, ADRs, and external constraints where needed.
28
+ If the user asks about a Plan, answer rather than write one. If execution is already authorized and a Plan is useful preparation, writing it need not create another approval stop; preserve any review or user-return boundary actually selected.
29
+
30
+ ## Establish The Current Basis
25
31
 
26
- Identify which accepted source version or amendment the Plan implements. A Working Record can locate those sources but cannot override them. Do not use an older experimental or design baseline merely because a prior Plan was reviewed.
32
+ Goal: the Plan implements current accepted sources, not an older baseline.
27
33
 
28
- Separate:
34
+ A separate Spec is not required when the request and accepted understanding are clear enough. Otherwise consume the relevant Spec, issue, design, diagnosis, decision, or requirements, together with current code, tests, policies, ADRs, and external constraints where needed.
29
35
 
30
- - the required outcome and non-goals;
31
- - accepted design choices and constraints;
32
- - the supported implementation approach;
33
- - assumptions whose failure would invalidate dependent work;
34
- - unresolved or intentionally deferred work outside this Plan's promise.
36
+ Identify which accepted source version or amendment the Plan implements. A Working Record can locate those sources but cannot override them, and a previously reviewed baseline does not excuse ignoring a later accepted change.
35
37
 
36
- An experiment produces evidence, not an automatic requirement. Include its consequences only where selected for this outcome; do not omit consequences the user subsequently accepted.
38
+ Separate the required outcome and non-goals, accepted design choices and constraints, the supported implementation approach, assumptions whose failure would invalidate dependent work, and unresolved or deferred work outside the Plan's promise. An experiment produces evidence, not an automatic requirement: include its consequences only where selected for this outcome, and do not omit consequences the user later accepted.
37
39
 
38
40
  ## Write The Smallest Useful Strategy
39
41
 
42
+ Goal: enough to inspect and execute the strategy, and no more.
43
+
40
44
  Read [Plan Shapes](references/plan-shapes.md) before choosing the artifact shape.
41
45
 
42
- Include relevant goal, sources, scope, decisions, assumptions, dependencies, ordered coherent outcomes, focused checks, integration, completion conditions, and what would invalidate the strategy. Use exact paths and commands when known and useful; do not invent them to make the Plan look executable.
46
+ Include the relevant goal, sources, scope, decisions, assumptions, dependencies, ordered coherent outcomes, focused checks, integration, completion conditions, and what would invalidate the strategy. Use exact paths and commands when known and useful; do not invent them to make the Plan look executable.
43
47
 
44
- Size outcomes for manageable working context, dependencies, uncertainty, and checking. Do not divide mechanically by file, bug count, test, or method. The complete task may require several Slices, but each should have a coherent result and a clear dependency on earlier work where one exists.
48
+ Size outcomes for manageable working context, dependencies, uncertainty, and checking, not mechanically by file, bug count, test, or method. Each Slice should have a coherent result and a clear dependency on earlier work where one exists.
45
49
 
46
- A validation step may stop the Plan if a bounded assumption fails. If its result is expected to select among materially different strategies, keep dependent work provisional in the Working Record rather than presenting the later sequence as decided.
50
+ A validation step may stop the Plan if a bounded assumption fails. If its result would select among materially different strategies, keep dependent work provisional in the Working Record rather than presenting the later sequence as decided.
47
51
 
48
- The Plan is not a context inventory. Specify only the sources and relationships needed to explain or execute its steps, leaving ordinary local choices to the executing agent.
52
+ The Plan is not a context inventory: specify only the sources and relationships needed to explain or execute its steps, and leave ordinary local choices to the executing agent.
49
53
 
50
54
  ## Preserve Acceptance And Return Conditions
51
55
 
52
- Tie each material outcome and final check to the accepted behavior it serves. Do not let available tests redefine acceptance or claim whole-system completion from a narrow observer.
53
-
54
- Keep the agreed user-facing return condition visible: return a proposed strategy, implement one Slice, finish the described task, or stop at a specified boundary. Internal delegation handbacks and context cycles are not automatic user checkpoints.
55
-
56
- A Plan must not invent product behavior, compatibility, public interfaces, failure semantics, sensitive policy, migration, scale, retries, recovery, or extension machinery. Do not replace agreed scope with an unapproved MVP or later-version split.
56
+ Goal: every planned outcome traces to accepted behavior, and the user-facing return point stays visible.
57
57
 
58
- Before a new prerequisite becomes a planned obligation, determine whether it serves an accepted requirement or only preserves a particular approach. Resolve consequential alternatives instead of hiding them in confident steps.
58
+ Tie each material outcome and final check to the accepted behavior it serves. Keep the agreed return condition visible: return a proposed strategy, implement one Slice, finish the task, or stop at a specified boundary. Internal delegation handbacks and context cycles are not user checkpoints.
59
59
 
60
- ## Select Checkpoints Without Making A Schedule Of Ceremonies
60
+ Before a new prerequisite becomes a planned obligation, determine whether it serves an accepted requirement or only preserves a particular approach, and resolve consequential alternatives instead of hiding them in confident steps.
61
61
 
62
- Ordinary verification and silent self-review belong to producing each supported result. Do not restate them as independent gates unless a particular evidence boundary needs explanation.
62
+ ## Select Checkpoints Without A Schedule Of Ceremonies
63
63
 
64
- Include independent review, a local commit, a user decision, or continuity transfer only when selected to protect a concrete dependency, risk, rollback, or delivery boundary. A Slice ending or a fixed count is insufficient.
64
+ Goal: checkpoints protect real boundaries, not a routine.
65
65
 
66
- Accepting a Plan as a strategy is not permission to execute it. Explicit approval to execute the Plan may cover its listed work, checks, selected reviews, record maintenance, and local commits. It does not imply push, integration, migration, deprecation, release, or launch. Planned commits remain conditional on fresh evidence and [Commit Work](../commit-work/SKILL.md) inspection.
66
+ Ordinary verification and silent self-review belong to producing each result; do not restate them as gates unless a particular evidence boundary needs explanation. Include independent review, a local commit, a user decision, or a continuity transfer only when selected to protect a concrete dependency, risk, rollback, or delivery boundary; a Slice ending or a fixed count is not enough.
67
67
 
68
68
  When an existing agreement already covers the work, preserve that source instead of asking the user to approve the same scope again because it is now written down.
69
69
 
70
70
  ## Revise Only The Affected Strategy
71
71
 
72
- Do not update a Plan for completed steps, ordinary local choices, test counts, or routine status. Record material actual state through Track Work when present.
72
+ Goal: the Plan changes when its strategy changes, not when work progresses.
73
73
 
74
- Revise or supersede the affected strategy when accepted intent or supported evidence changes its scope, design, ordering, dependencies, checks, or mechanism. Preserve valid earlier work and rationale. A clerical correction does not reopen the strategy, and reaching a review cap is not evidence that the Plan needs rewriting.
74
+ Do not update a Plan for completed steps, ordinary local choices, test counts, or routine status; record actual state through Track Work. Revise or supersede the affected strategy when accepted intent or supported evidence changes its scope, design, ordering, dependencies, checks, or mechanism, preserving valid earlier work and rationale. A clerical correction does not reopen the strategy, and reaching a review cap is not evidence the Plan needs rewriting.
75
75
 
76
- Identify affected upstream and downstream artifacts. Revise only content whose owned meaning changed and whose mutation is authorized. If an upstream contract remains unresolved, mark dependent steps contingent before they are used. Do not repair consistency by silently changing the required outcome.
76
+ Identify affected upstream and downstream artifacts and revise only content whose owned meaning changed and whose mutation is authorized. If an upstream contract remains unresolved, mark dependent steps contingent before they are used. Do not repair consistency by silently changing the required outcome.
77
77
 
78
78
  ## Self-Review Before Treating The Plan As Usable
79
79
 
80
- After factual source checks, use [Review Artifact](../review-artifact/SKILL.md) for one silent author self-review of the complete Plan, accepted sources, and intended execution boundary.
80
+ Goal: the Plan can achieve the accepted outcome before anyone relies on it.
81
81
 
82
- Check whether the ordered work can achieve the accepted outcome, dependencies are supported, later uncertainty is honest, final checks match acceptance, and selected checkpoints are proportionate. Correct clear covered defects and recheck affected facts and lenses.
82
+ After factual source checks, use [Review Artifact](../review-artifact/SKILL.md) for one silent author self-review of the complete Plan, its accepted sources, and the intended execution boundary. Check that the ordered work can achieve the accepted outcome, dependencies are supported, later uncertainty is honest, final checks match acceptance, and selected checkpoints are proportionate. Correct clear covered defects and recheck affected facts and lenses.
83
83
 
84
- Do not automatically dispatch an independent reviewer after writing or revising a Plan. Use Review Artifact's independent route only when separately selected and authorized to protect a concrete boundary. Supply complete sources, dependencies, and limits; adjudicate the returned report before acting on its findings.
85
-
86
- Neither self-review nor independent review grants user acceptance or execution authority. Conversely, an already-covered execution agreement does not need another approval turn solely because planning produced an artifact.
84
+ Use Review Artifact's independent route only when separately selected and authorized to protect a concrete boundary; supply complete sources, dependencies, and limits, and adjudicate the returned report before acting on it.
87
85
 
88
86
  ## Report And Return
89
87
 
90
- Report the Plan path and intended use, source basis, material assumptions or contingent work, invalidation conditions, selected checkpoints, and actual review/acceptance/execution-authority status.
88
+ Report the Plan path and intended use, source basis, material assumptions or contingent work, invalidation conditions, selected checkpoints, and actual review, acceptance, and execution-authority status.
89
+
90
+ When a Working Record exists and the Plan is accepted for its task, list it under the record's `What defines this task` through Track Work so every recovery reads it.
91
91
 
92
- Return the supported strategy to the requesting activity. If the agreement covers implementation, the agent can continue through the normal execution route; if it asks for a Plan first, stop there. Do not begin work outside that agreement or claim an unresolved strategy is ready.
92
+ Return the supported strategy to the requesting activity. If the agreement covers implementation, continue through the normal execution route; if it asks for a Plan first, stop there. Do not begin work outside that agreement or claim an unresolved strategy is ready.
@@ -1,6 +1,6 @@
1
1
  # Plan Shapes
2
2
 
3
- Read this when choosing the structure, destination, identity, or revision shape of an ordered Plan. Use only the sections the Plan needs.
3
+ Read this when choosing the structure, destination, identity, or revision shape of an ordered Plan. This reference is judgment: use only the sections the Plan needs.
4
4
 
5
5
  ## Destination And Durable Identity
6
6
 
@@ -9,10 +9,25 @@ Write the smallest agent-first skill package that changes one coherent behaviora
9
9
 
10
10
  A skill is a prompt intervention, not merely a document. A host may read its body once and retain it across later messages and tool interactions until context projection or loss. Design the first useful read, retained influence, dependencies, and recovery paths; do not assume the body will be reread before every use.
11
11
 
12
- Smallest means behaviorally minimal—not shortest. A detailed skill is justified when each instruction changes action or judgment, makes a dependency executable, protects a behavioral boundary whose failure is supported by evidence, or establishes an evidence, return, or stop condition.
12
+ Smallest means behaviorally minimal, not shortest. A detailed skill is justified when each instruction changes action or judgment, makes a dependency executable, protects a behavioral boundary whose failure is supported by evidence, or establishes an evidence, return, or stop condition.
13
+
14
+ The **Rules** below are binding; if one cannot be met, stop and say why. Everything else is **judgment**: follow its stated goal, and adapt when a different choice serves that goal better.
15
+
16
+ ## Rules
17
+
18
+ - Before substantially revising an existing skill, preserve the complete current package (`SKILL.md`, references, scripts, assets) in a recoverable Git ref or in task evidence outside the package. A small correction needs no new snapshot when the exact previous state is already recoverable and behavior, activation, dependencies, and resources are unchanged. A baseline supports recovery and comparison; it does not show that either version behaves correctly.
19
+ - If accepted behavior, public dependencies, safety, compatibility, or another user-owned boundary is unsettled, stop and resolve it before encoding it.
20
+ - Never rely on an unread skill or reference to cause its own read. The first read must come from context the agent already has: a description, guaranteed base guidance, an already-loaded skill, a capability cue, or another declared route.
21
+ - Rely only on context guaranteed on every valid activation path, never on an optional sibling, a common but unguaranteed route, or an accidental earlier read.
22
+ - Link every agent-facing reference, asset, script, and package dependency from the body, with the condition that requires it. The body and the resource state the same read condition.
23
+ - Keep authoring status, evaluation summaries, evidence gaps, changelog notes, readiness claims, and author debate out of the executing package; they belong in the evaluation artifact, task record, or delivery report.
24
+ - Claim only what the evidence observed. Structural checks prove structure. Explicit body delivery does not prove activation, one turn does not prove retained use, ambient context does not prove dependency behavior, prose review does not prove unchanged behavior, and one favorable example does not prove readiness.
25
+ - Run `validate` after any structural or dependency change and before claiming the package is valid. Never use deprecated authoring tooling.
13
26
 
14
27
  ## Establish The Behavioral Claim
15
28
 
29
+ Goal: know what the skill must change before deciding how it reads.
30
+
16
31
  Before writing, identify:
17
32
 
18
33
  - the behavior the skill should produce;
@@ -24,62 +39,26 @@ Before writing, identify:
24
39
  - how the skill should stop influencing behavior after its method no longer applies;
25
40
  - the evidence that could support or contradict the intended effect.
26
41
 
27
- Do not begin with sections, wording, examples, or file layout. Begin with the behavioral intervention.
28
-
29
- If accepted behavior, public dependencies, safety, compatibility, or another user-owned boundary remains unsettled, stop and resolve it before encoding a runtime rule.
30
-
31
- ## Preserve The Exact Baseline
32
-
33
- Before substantially revising an existing skill, preserve the complete current package:
34
-
35
- - `SKILL.md`;
36
- - references;
37
- - scripts;
38
- - assets and other owned resources;
39
- - exact package identity.
40
-
41
- Use a recoverable Git ref or task evidence outside the active package so the revision cannot replace its own baseline.
42
-
43
- A small local correction does not require another snapshot when the exact previous state is already recoverable and the change does not alter behavior, activation, dependencies, resource structure, or compatibility.
44
-
45
- Preserving a baseline supports recovery and comparison. It does not prove that the baseline or candidate behaves correctly.
42
+ Begin with the behavioral intervention, not with sections, wording, examples, or file layout.
46
43
 
47
44
  ## Design The First Read
48
45
 
49
- A skill cannot activate itself. Its first read must be caused by context already available to the agent:
46
+ Goal: the skill is read at the earliest decision it can improve, and reading it on a nearby case does no harm.
50
47
 
51
- - an observable skill description;
52
- - guaranteed base or system guidance;
53
- - an already-loaded owner or sibling;
54
- - an effective capability cue;
55
- - another declared upstream route.
56
-
57
- Do not rely on an instruction inside the unread skill to cause that skill to be read.
58
-
59
- Optimize activation for the earliest useful decision. Missing that decision may be much more harmful than a harmless early read.
60
-
61
- A nearby case can pass by:
62
-
63
- - not loading the skill; or
64
- - loading it safely, recognizing that its method does not apply, and exiting without later hijacking retained behavior.
65
-
66
- False-positive activation is cheap only when the body remains safe after retention. A skill that exits on the first turn but continues distorting later work is not a safe read.
48
+ Missing that decision is usually far more harmful than an unnecessary early read. A nearby case can pass by not loading the skill, or by loading it, recognizing that its method does not apply, and exiting without distorting later work. An early read is cheap only when the retained body stays safe; a skill that exits on the first turn but keeps distorting later work is not a safe read.
67
49
 
68
50
  Read [Activation Boundaries](references/activation-boundaries.md) when activation is unclear or evidence shows missed, late, early, task-hijacking, or retained-interference behavior.
69
51
 
70
52
  ## Write The Description For Recall
71
53
 
72
- Treat the description as a routing interface, not a summary of the body.
54
+ The description is a routing interface, not a summary of the body.
73
55
 
74
- - State the broad core job in plain language.
75
- - Use natural user verbs or task conditions visible before activation.
76
- - Prefer recall when nearby reads are safe and missed activation is materially worse.
77
- - Do not require terminology or classifications introduced only inside the skill or an optional dependency.
78
- - Do not encode future-duration guesses, named internal phases, exhaustive trigger catalogs, or marketing claims.
79
- - Do not compress the body into the description.
80
- - Treat “Use when…” as useful wording, not mandatory grammar.
56
+ - State the broad core job in plain language, with natural user verbs or task conditions visible before activation.
57
+ - Avoid terminology or classifications introduced only inside the skill or an optional dependency.
58
+ - Avoid future-duration guesses, named internal phases, exhaustive trigger catalogs, marketing claims, and compressed copies of the body.
59
+ - "Use when…" is useful wording, not mandatory grammar.
81
60
 
82
- Optimize for the first useful read, not repeated reads. Do not narrow a description solely to prevent harmless activation. Do not broaden it when retained guidance routinely overrides another owner or method.
61
+ Favor recall when nearby reads are safe and a missed read is materially worse. Narrow the description when retained guidance routinely overrides another owner or method, not merely to prevent harmless reads.
83
62
 
84
63
  ## Write For The Executing Agent
85
64
 
@@ -87,16 +66,34 @@ Write for an agent seeing the skill for the first time with only guaranteed cont
87
66
 
88
67
  1. Establish the job immediately.
89
68
  2. Define necessary terms before using them.
90
- 3. Put each rule where the agent first makes the affected choice.
69
+ 3. Put each instruction where the agent first makes the affected choice.
91
70
  4. Keep the normal route understandable from `SKILL.md`.
92
71
  5. State what to do, what not to do, and when to stop, return, or route.
93
- 6. Prefer a positive route; use negative instructions to block plausible or observed failure.
94
- 7. Pair a negative rule with the correct action or owner whenever possible.
95
- 8. State why only when it helps the agent generalize or avoid a harmful literal reading.
96
- 9. Keep the skill focused on one coherent job. Do not copy the surrounding workflow’s authority, routing, continuity, review, or completion method into a focused skill; repeat only the local guard needed at the affected choice.
97
- 10. Keep authoring status, evaluation summaries, evidence gaps, changelog notes, and readiness prose out of the executing package.
72
+ 6. Prefer a positive route; use negative instructions to block plausible or observed failure, paired with the correct action or owner.
73
+ 7. State why only when it helps the agent generalize or avoid a harmful literal reading.
74
+ 8. Keep the skill to one coherent job. Repeat only the local guard needed from the surrounding workflow's authority, routing, continuity, review, or completion method, not the method itself.
75
+ 9. Use plain words. Every coined term is something the agent must decode before it can act, so coin one only when it marks a distinction the agent has to act on, define it once, and use it the same way throughout.
76
+
77
+ Use discussion, research, and author reasoning to understand the behavior, then compile that understanding into runtime instructions. The conversation, rejected drafts, fixture narration, and any explanation whose only reader is the author stay out.
78
+
79
+ Read [Agent-First Instructions](references/agent-first-instructions.md) when a concrete first-read or retained-use failure involves wording, placement, undeclared context, author explanation, or competing instructions.
80
+
81
+ ## Separate Rules From Judgment
82
+
83
+ A skill gives two kinds of instruction, and agents need to tell them apart.
84
+
85
+ - **Rules** are binding. Breaking one is wrong in every situation: authority, safety, evidence honesty, data integrity, or an invariant that a tool or another skill depends on.
86
+ - **Judgment** guides the choice among allowed actions: placement, granularity, timing, effort, what to record, how much to delegate. A better choice sometimes means departing from the default.
98
87
 
99
- A useful rule normally identifies:
88
+ Classify each instruction with one question:
89
+
90
+ > If an agent pursued the goal well but broke this sentence, would the outcome be wrong in every case?
91
+
92
+ If yes, it is a Rule. If the agent would sometimes do better, it is judgment.
93
+
94
+ Agents follow imperative lists literally. A judgment written as an imperative becomes a Rule by accident: "Delegate routine record maintenance to Helper" makes an agent hand off a two-line update and then do the rest itself.
95
+
96
+ Write a Rule as a short imperative that names its trigger and its stop:
100
97
 
101
98
  ```text
102
99
  observable pressure
@@ -104,133 +101,103 @@ observable pressure
104
101
  -> evidence, return, or stop condition
105
102
  ```
106
103
 
107
- Use discussion, research, and author reasoning to understand the behavior. Compile that understanding into runtime instructions. Do not copy conversation history, rejected drafts, author debate, fixture narration, or explanation whose only reader is the author.
104
+ Keep Rules few, testable, and together near the top, and say what to do when one cannot be met.
108
105
 
109
- A skill may rely on guaranteed base context and dependencies explicitly required before use. It may not rely on an unread optional sibling or reference, a common-but-unguaranteed route, or an accidental earlier read.
106
+ Write judgment as a trade-off the agent can reason from:
110
107
 
111
- Read [Agent-First Instructions](references/agent-first-instructions.md) when a concrete first-read or retained-use failure involves wording, placement, undeclared context, author explanation, or competing instructions.
108
+ ```text
109
+ goal
110
+ -> default and why it usually serves the goal
111
+ -> signals that a different choice serves it better
112
+ ```
112
113
 
113
- ## Use Examples Deliberately
114
+ Examples inside judgment are illustrations, not triggers:
114
115
 
115
- Add a compact example when prose alone leaves a likely behavioral misclassification.
116
+ > Delegate a unit when a cheaper profile can do it without significant quality loss and the handoff costs less than it saves. A separate record update across several entries often qualifies; a one-line update in the middle of your own work does not.
116
117
 
117
- Show:
118
+ When a skill contains both kinds, say so once near the top: which instructions are binding, and that everything else is judgment the agent may adapt to its goal. A skill may be mostly Rules, like a release protocol, or mostly judgment, like work placement; the label keeps each one from being read as the other.
118
119
 
119
- - the observable situation;
120
- - the required action or judgment;
121
- - the relevant stop, exit, or return.
120
+ References follow the same split. A reference that defines a contract, such as a file format, schema, command interface, or protocol, is binding as written. A reference that deepens a method is judgment. A reference that is mostly one kind says so in its opening line, and states any Rule it adds; one that only restates a skill Rule as a local guard needs no label.
122
121
 
123
- Keep examples transferable. Do not turn the body into a transcript, fixture library, or scenario catalog.
122
+ ## Use Examples Deliberately
124
123
 
125
- Inline examples teach the subject and are part of the candidate intervention. They are not independent evidence that the skill works.
124
+ Add a compact example when prose alone leaves a likely misclassification. Show the observable situation, the required action or judgment, and the relevant stop, exit, or return.
126
125
 
127
- ## Plan Terminology And Dependencies
126
+ Keep examples transferable; the body is not a transcript, fixture library, or scenario catalog. Inline examples teach the subject and are part of the candidate intervention, not independent evidence that the skill works.
128
127
 
129
- For one self-contained skill, declare only the dependencies its normal and conditional routes need.
128
+ ## Plan Terminology And Dependencies
130
129
 
131
- Before creating or revising multiple related skills, shared terminology, cross-skill links, capability activation, direct or routed entry paths, or context-loss recovery, read [Skill Dependency Graphs](references/skill-dependency-graphs.md).
130
+ Goal: every term and dependency is available on every path that reaches the skill.
132
131
 
133
- For every skill:
132
+ For one self-contained skill, declare only the dependencies its normal and conditional routes need. Before creating or revising several related skills, shared terminology, cross-skill links, capability activation, direct or routed entry paths, or context-loss recovery, read [Skill Dependency Graphs](references/skill-dependency-graphs.md).
134
133
 
135
- - identify every valid direct and routed activation path;
136
- - rely only on context guaranteed across all valid paths;
137
- - place shared vocabulary in the nearest upstream context guaranteed before every consumer;
138
- - keep leaf-specific terms local;
139
- - distinguish owner routes, method composition, environment interactions, references, capability cues, and retained context;
140
- - ensure critical skills have an upstream activation or recovery edge;
141
- - do not assume a commonly preceding skill is guaranteed.
134
+ - Identify every valid direct and routed activation path.
135
+ - Place shared vocabulary in the nearest upstream context guaranteed before every consumer; keep leaf-specific terms local.
136
+ - Distinguish owner routes, method composition, environment interactions, references, capability cues, and retained context.
137
+ - Give critical skills an upstream activation or recovery edge.
142
138
 
143
- A Markdown link declares a package dependency. It does not automatically select the target owner or execute the linked skill.
139
+ A Markdown link declares a package dependency. It does not select the target owner or execute the linked skill.
144
140
 
145
141
  ## Compact Without Erasing Behavior
146
142
 
147
- Compact after the behavioral policy, dependencies, and failure boundaries are understood.
143
+ Goal: remove what does not change behavior, and nothing that does.
148
144
 
149
- For each instruction, ask:
145
+ Compact after the behavioral policy, dependencies, and failure boundaries are understood. For each instruction, ask:
150
146
 
151
147
  > Can this be removed without losing required behavior, introducing ambiguity, obscuring a dependency, or reintroducing a previously observed failure?
152
148
 
153
- If yes, remove or merge it. If uncertain, preserve it until evidence distinguishes the variants.
149
+ If yes, remove or merge it.
154
150
 
155
- Do not compact by:
151
+ Keep an instruction because it protects measured behavior or prevents a specific failure you can name, not because it might help. An instruction with neither is a candidate for removal: remove it, or test whether it changes behavior, rather than keeping it by default. Skills otherwise only grow, as each incident adds instructions and none is ever shown safe to remove.
156
152
 
157
- - deleting the positive route while retaining only prohibitions;
158
- - moving normal required behavior into an always-read reference;
159
- - merging rules whose triggers or stop conditions differ;
160
- - replacing a concrete instruction with generic quality language;
161
- - removing terminology required by a direct activation path;
162
- - deleting repetition that protects a distinct decision or recovery boundary.
153
+ Compaction goes wrong when it:
163
154
 
164
- Length is a diagnostic fact, not a quality verdict. A long skill may be minimal. A short skill may force the agent to reconstruct missing judgment through reasoning or environment interactions.
155
+ - deletes the positive route while keeping only prohibitions;
156
+ - reduces a judgment to a bare imperative by dropping its goal or its signals for deviating;
157
+ - moves normal required behavior into an always-read reference;
158
+ - merges instructions whose triggers or stop conditions differ;
159
+ - replaces a concrete instruction with generic quality language;
160
+ - removes terminology a direct activation path needs;
161
+ - deletes repetition that protects a distinct decision or recovery boundary.
165
162
 
166
- ## Repeat Rules Deliberately
163
+ Length is a diagnostic fact, not a quality verdict. A long skill may be minimal; a short one may force the agent to reconstruct missing judgment.
167
164
 
168
- Repetition is justified when local presence protects:
165
+ ## Repeat Instructions Deliberately
169
166
 
170
- - an independently activated skill;
171
- - a distinct decision point;
172
- - a context-loss or host path;
173
- - a dangerous literal interpretation;
174
- - a previously observed failure;
175
- - a required body-to-reference read condition.
167
+ Goal: each behavior has one owner, with a local guard wherever an agent could otherwise act without it.
176
168
 
177
- Use one canonical owner for the full definition or method. Repeat only the compact local guard needed at the affected choice.
169
+ Repetition earns its place when local presence protects an independently activated skill, a distinct decision point, a context-loss or host path, a dangerous literal reading, a previously observed failure, or a required read condition. Keep the full definition or method with one canonical owner and repeat only the compact guard at the affected choice.
178
170
 
179
- > Repeat the behavioral invariant, not the owning skill’s entire explanation.
171
+ > Repeat the behavioral invariant, not the owning skill's entire explanation.
180
172
 
181
- Do not repeat rules merely for emphasis, author reassurance, or stylistic consistency. Check that repeated wording preserves the same meaning and route.
182
-
183
- When removing, merging, moving, or rewording a rule that protects measured behavior, treat the candidate as a behavioral change and evaluate the affected boundary.
173
+ Repetition for emphasis, author reassurance, or stylistic consistency does not earn its place. Check that repeated wording keeps the same meaning and route. Removing, merging, moving, or rewording an instruction that protects measured behavior is a behavioral change; evaluate the affected boundary.
184
174
 
185
175
  ## Add Resources Only When They Change Loading Or Ownership
186
176
 
187
177
  Before adding or reorganizing references, assets, or scripts, read [Progressive Disclosure](references/progressive-disclosure.md).
188
178
 
189
- Start with one `SKILL.md`. Remove accidental complexity before splitting files.
179
+ Start with one `SKILL.md` and remove accidental complexity before splitting files.
190
180
 
191
181
  - Keep normal first-read behavior inline.
192
- - Add an activity-required reference when one named normal activity genuinely needs separately owned depth but the skill may exit before that activity.
193
- - Add a conditional reference when an observable branch requires depth that would obscure the normal route.
194
- - Use an entry-required reference only when separation has independent value, such as canonical reuse, separate ownership or lifecycle, generated contracts, compatibility, or host constraints.
195
- - Inline entry-required content when every useful activation reads it and separation provides no distinct value.
182
+ - Add an activity-required reference when one named normal activity needs separately owned depth but the skill may exit before that activity.
183
+ - Add a conditional reference when an observable branch needs depth that would obscure the normal route.
184
+ - Use an entry-required reference only when separation has independent value, such as canonical reuse, separate ownership or lifecycle, generated contracts, compatibility, or host constraints; otherwise inline it.
196
185
  - Add a script when deterministic repeated work owned by the skill is safer, clearer, or materially less wasteful than model-generated operations.
197
- - Link every agent-facing resource, package dependency, and executable entrypoint from the body at its first useful decision.
198
186
  - Keep owned resources inside the package unless canonical cross-package ownership is required.
199
187
 
200
- The body and reference must name the same read condition. A reference cannot activate itself.
201
-
202
188
  There is no universal body template, line limit, reference count, or requirement that a script follow an earlier failure.
203
189
 
204
190
  ## Evaluate The Behavioral Claim
205
191
 
206
- Static inspection and package validation prove structure, not behavior.
207
-
208
- Name the exact claim being tested:
209
-
210
- - description activation;
211
- - first-read body behavior;
212
- - nearby behavior;
213
- - dependency composition;
214
- - retained use;
215
- - artifact outcome;
216
- - cross-host behavior.
217
-
218
- Use [Evaluate Skill](../evaluate-skill/SKILL.md) to compare exact baseline and candidate environments under fixed declared inputs.
219
-
220
- Preserve adequate existing evidence. Revise one measured pressure point at a time. After a behavior-sensitive change, rerun the complete fixed group with both variants.
192
+ Goal: evidence that the skill changes behavior as intended, at the boundary being claimed.
221
193
 
222
- Do not claim:
194
+ Name the exact claim: description activation, first-read body behavior, nearby behavior, dependency composition, retained use, artifact outcome, or cross-host behavior. Use [Evaluate Skill](../evaluate-skill/SKILL.md) to compare exact baseline and candidate environments under fixed declared inputs.
223
195
 
224
- - activation from explicit body injection;
225
- - retained use from one turn;
226
- - dependency behavior from ambient context;
227
- - unchanged behavior from prose review;
228
- - improvement from structural validation;
229
- - readiness from one favorable example.
196
+ Evaluate the two kinds differently. A Rule passes when it is never broken, including under pressure to break it. Judgment passes on outcome, and its evidence should include a case where following the default literally is the worse choice, so a candidate that only obeys cannot pass.
230
197
 
231
- Small wording, ordering, vocabulary, repetition, and structural changes may alter model behavior. Human review can establish intended meaning; behavioral evidence establishes observed effect.
198
+ Preserve adequate existing evidence. Revise one measured pressure point at a time, and after a behavior-sensitive change rerun the complete fixed group with both variants.
232
199
 
233
- Keep evaluation conclusions and missing evidence in the evaluation artifact, task record, or delivery report—not in the executing skill.
200
+ Small wording, ordering, vocabulary, repetition, and structural changes can alter model behavior. Human review establishes intended meaning; behavioral evidence establishes observed effect.
234
201
 
235
202
  ## Check The Package
236
203
 
@@ -240,37 +207,30 @@ Use the bundled [skill author](scripts/skill-author.mjs) for deterministic packa
240
207
  node <write-skill-directory>/scripts/skill-author.mjs init <directory> --name <name> --description <text>
241
208
  node <write-skill-directory>/scripts/skill-author.mjs validate <directory> [--package-root <directory>]
242
209
  node <write-skill-directory>/scripts/skill-author.mjs inspect <directory> [--package-root <directory>]
210
+ node <write-skill-directory>/scripts/skill-author.mjs similarity <directory> [--threshold <0-1>]
243
211
  ```
244
212
 
245
- Choose the operation by its evidence:
246
-
247
- - `init`: create a new minimal package; never overwrite an existing one.
213
+ - `init`: create a new minimal package; it never overwrites an existing one.
248
214
  - `validate`: check frontmatter, heading shape, recursive links, declared package dependencies, and containment.
249
- - `inspect`: report body sizes, resource classes, scripts, unlinked files, and validation findings.
250
-
251
- Run `validate` after structural or dependency changes and before claiming package validity. Use `inspect` when factual inventory or package composition matters.
252
-
253
- Commands emit JSON. Invalid structure still emits a report and exits nonzero; command errors emit structured error JSON.
215
+ - `inspect`: report body sizes, resource classes, scripts, unlinked files, and validation findings, when factual inventory matters.
216
+ - `similarity`: report Markdown files under a directory that share copied or lightly edited passages. Run it across related skills before keeping repetition; it cannot detect paraphrase, so a clean report does not prove an instruction is stated once.
254
217
 
255
- Package root defaults to the nearest `package.json` ancestor, then the skill directory’s parent. Use `--package-root` when validating a candidate in an overlay or another package context.
218
+ Commands emit JSON. Invalid structure still emits a report and exits nonzero; command errors emit structured error JSON. Package root defaults to the nearest `package.json` ancestor, then the skill directory's parent; use `--package-root` for a candidate in an overlay or another package context.
256
219
 
257
220
  Frontmatter accepts flat plain strings or JSON-compatible double-quoted strings. Quote ambiguous punctuation, number-like, boolean-like, or null-like values.
258
221
 
259
- Package validity does not prove behavioral quality. Never use deprecated authoring tooling.
260
-
261
222
  ## Stop
262
223
 
263
224
  Stop when the requested package:
264
225
 
265
226
  - expresses one coherent behavioral policy;
227
+ - separates binding Rules from judgment;
266
228
  - activates at the earliest useful boundary;
267
229
  - remains safe on nearby and retained use;
268
230
  - works from guaranteed context on every valid path;
269
231
  - keeps its normal route executable on first read;
270
232
  - declares dependencies and resource conditions honestly;
271
- - contains no unsupported author-facing residue;
233
+ - contains no author-facing residue;
272
234
  - passes required structural checks.
273
235
 
274
- Stop and ask when accepted behavior, activation, dependencies, safety, compatibility, or another user-owned boundary cannot be settled from evidence.
275
-
276
- Do not add sections, references, examples, scripts, or procedure merely to make the package look complete.
236
+ Stop and ask when accepted behavior, activation, dependencies, safety, compatibility, or another user-owned boundary cannot be settled from evidence. Do not add sections, references, examples, scripts, or procedure merely to make the package look complete.
@@ -2,6 +2,8 @@
2
2
 
3
3
  Read this when activation is unclear or evidence shows missed, late, early, task-hijacking, or retained-interference behavior.
4
4
 
5
+ This reference is judgment: adapt it to the skill's goal. Its binding statements restate [Write Skill](../SKILL.md) Rules.
6
+
5
7
  A description should make the skill available at the earliest useful decision without requiring language introduced by the skill itself.
6
8
 
7
9
  ## Diagnose The First Read