@hassangameryt/freeflow 0.5.0 → 0.7.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 (301) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/.codex-plugin/plugin.json +4 -5
  4. package/README.md +141 -163
  5. package/capabilities/cognitive-routing/SKILL.md +387 -0
  6. package/capabilities/context-virtualization/SKILL.md +103 -0
  7. package/capabilities/conversation-history/SKILL.md +53 -0
  8. package/command-surface.json +6 -37
  9. package/hooks/freeflow-runtime-context.mjs +50 -541
  10. package/hooks/hooks.json +1 -26
  11. package/hooks/tests/check-runtime-context-hook.sh +114 -308
  12. package/package.json +27 -17
  13. package/pi-extension/dist/cognitive-routing/commands.js +96 -0
  14. package/pi-extension/dist/cognitive-routing/config.js +232 -0
  15. package/pi-extension/dist/cognitive-routing/controller.js +1292 -0
  16. package/pi-extension/dist/cognitive-routing/history.js +451 -0
  17. package/pi-extension/dist/cognitive-routing/host.js +188 -0
  18. package/pi-extension/dist/cognitive-routing/pi-routing-session.js +414 -0
  19. package/pi-extension/dist/cognitive-routing/pi-session-control.js +320 -0
  20. package/pi-extension/dist/cognitive-routing/runtime.js +43 -0
  21. package/pi-extension/dist/cognitive-routing/tool.js +212 -0
  22. package/pi-extension/dist/cognitive-routing/types.js +6 -0
  23. package/pi-extension/dist/context-virtualization/commands.js +89 -0
  24. package/pi-extension/dist/context-virtualization/projector.js +42 -0
  25. package/pi-extension/dist/context-virtualization/runtime.js +356 -0
  26. package/pi-extension/dist/context-virtualization/state.js +57 -0
  27. package/pi-extension/dist/context-virtualization/types.js +10 -0
  28. package/pi-extension/dist/conversation-history/passages.js +66 -0
  29. package/pi-extension/dist/conversation-history/ranking.js +105 -0
  30. package/pi-extension/dist/conversation-history/runtime.js +226 -0
  31. package/pi-extension/dist/conversation-history/search.js +56 -0
  32. package/pi-extension/dist/conversation-history/types.js +1 -0
  33. package/pi-extension/dist/freeflow-context/resolver.js +120 -0
  34. package/pi-extension/dist/freeflow-context/runtime.js +80 -0
  35. package/pi-extension/dist/freeflow-context/source-projector.js +95 -0
  36. package/pi-extension/dist/freeflow-context/tool.js +308 -0
  37. package/pi-extension/dist/freeflow-context/types.js +12 -0
  38. package/pi-extension/dist/freeflow-context/visibility.js +28 -0
  39. package/pi-extension/dist/index.js +564 -129
  40. package/pi-extension/dist/runtime/runtime-context.js +357 -470
  41. package/pi-extension/dist/runtime/runtime-identity.js +5 -0
  42. package/pi-extension/dist/settings/settings-tui.js +78 -0
  43. package/pi-extension/dist/settings/settings-ui.js +572 -826
  44. package/pi-extension/dist/ui/text-component.js +57 -0
  45. package/pi-extension/src/cognitive-routing/commands.ts +129 -0
  46. package/pi-extension/src/cognitive-routing/config.ts +303 -0
  47. package/pi-extension/src/cognitive-routing/controller.ts +1628 -0
  48. package/pi-extension/src/cognitive-routing/history.ts +650 -0
  49. package/pi-extension/src/cognitive-routing/host.ts +266 -0
  50. package/pi-extension/src/cognitive-routing/pi-routing-session.ts +538 -0
  51. package/pi-extension/src/cognitive-routing/pi-session-control.ts +444 -0
  52. package/pi-extension/src/cognitive-routing/runtime.ts +57 -0
  53. package/pi-extension/src/cognitive-routing/tool.ts +273 -0
  54. package/pi-extension/src/cognitive-routing/types.ts +89 -0
  55. package/pi-extension/src/context-virtualization/commands.ts +111 -0
  56. package/pi-extension/src/context-virtualization/projector.ts +62 -0
  57. package/pi-extension/src/context-virtualization/runtime.ts +406 -0
  58. package/pi-extension/src/context-virtualization/state.ts +79 -0
  59. package/pi-extension/src/context-virtualization/types.ts +92 -0
  60. package/pi-extension/src/conversation-history/passages.ts +81 -0
  61. package/pi-extension/src/conversation-history/ranking.ts +155 -0
  62. package/pi-extension/src/conversation-history/runtime.ts +250 -0
  63. package/pi-extension/src/conversation-history/search.ts +79 -0
  64. package/pi-extension/src/conversation-history/types.ts +31 -0
  65. package/pi-extension/src/freeflow-context/resolver.ts +139 -0
  66. package/pi-extension/src/freeflow-context/runtime.ts +100 -0
  67. package/pi-extension/src/freeflow-context/source-projector.ts +106 -0
  68. package/pi-extension/src/freeflow-context/tool.ts +360 -0
  69. package/pi-extension/src/freeflow-context/types.ts +70 -0
  70. package/pi-extension/src/freeflow-context/visibility.ts +53 -0
  71. package/pi-extension/src/index.ts +597 -135
  72. package/pi-extension/src/runtime/runtime-context.ts +373 -491
  73. package/pi-extension/src/runtime/runtime-identity.ts +8 -0
  74. package/pi-extension/src/settings/settings-tui.ts +93 -0
  75. package/pi-extension/src/settings/settings-ui.ts +679 -910
  76. package/pi-extension/src/ui/text-component.ts +66 -0
  77. package/pi-extension/tests/cognitive-routing/commands.test.js +134 -0
  78. package/pi-extension/tests/cognitive-routing/controller.test.js +1128 -0
  79. package/pi-extension/tests/cognitive-routing/extension-lifecycle.test.js +1142 -0
  80. package/pi-extension/tests/cognitive-routing/history.test.js +274 -0
  81. package/pi-extension/tests/cognitive-routing/host-fixture.js +4 -0
  82. package/pi-extension/tests/cognitive-routing/host-identity.test.js +63 -0
  83. package/pi-extension/tests/cognitive-routing/pi-normal-lifecycle.test.js +434 -0
  84. package/pi-extension/tests/cognitive-routing/pi-session-control.test.js +174 -0
  85. package/pi-extension/tests/cognitive-routing/pi-session-history.test.js +91 -0
  86. package/pi-extension/tests/cognitive-routing/profile-resolution.test.js +279 -0
  87. package/pi-extension/tests/cognitive-routing/tool.test.js +230 -0
  88. package/pi-extension/tests/context-virtualization/extension.test.js +749 -0
  89. package/pi-extension/tests/context-virtualization/projector.test.js +110 -0
  90. package/pi-extension/tests/context-virtualization/runtime.test.js +216 -0
  91. package/pi-extension/tests/conversation-history/runtime.test.js +98 -0
  92. package/pi-extension/tests/conversation-history/search.test.js +97 -0
  93. package/pi-extension/tests/integration/mode-free-core.test.js +218 -0
  94. package/pi-extension/tests/integration/pi-extension.test.js +532 -3701
  95. package/pi-extension/tests/integration/prompt-architecture.test.js +350 -0
  96. package/pi-extension/tests/integration/unaffected-regressions.test.js +411 -0
  97. package/runtime/prompts/cognitive-routing.md +10 -0
  98. package/runtime/prompts/context-virtualization.md +3 -0
  99. package/runtime/prompts/conversation-history.md +3 -0
  100. package/runtime/prompts/core.md +84 -0
  101. package/runtime/prompts/interaction-contract.md +11 -0
  102. package/skills/action-selection/SKILL.md +140 -0
  103. package/skills/action-selection/references/trajectory-stalls.md +71 -0
  104. package/skills/bypass/SKILL.md +109 -38
  105. package/skills/commit-work/SKILL.md +94 -55
  106. package/skills/commit-work/references/git-state-edges.md +94 -0
  107. package/skills/commit-work/references/simple-push.md +92 -0
  108. package/skills/commit-work/references/staging-decisions.md +79 -46
  109. package/skills/decision-gate/SKILL.md +80 -22
  110. package/skills/design-for-depth/SKILL.md +206 -60
  111. package/skills/design-for-depth/references/design-pressure-signals.md +108 -240
  112. package/skills/design-for-depth/references/interface-design-loop.md +77 -97
  113. package/skills/design-for-depth/references/module-and-dependency-design.md +147 -0
  114. package/skills/design-for-depth/references/software-design-philosophy.md +128 -174
  115. package/skills/design-for-depth/references/state-and-failure-boundaries.md +136 -0
  116. package/skills/diagnose-failure/SKILL.md +200 -48
  117. package/skills/diagnose-failure/references/diagnostic-loop-catalog.md +18 -6
  118. package/skills/diagnose-failure/references/{flaky-and-performance.md → flaky-and-performance-diagnosis.md} +13 -5
  119. package/skills/discuss/SKILL.md +119 -65
  120. package/skills/discuss/references/discussion-continuity.md +123 -0
  121. package/skills/evaluate-skill/SKILL.md +166 -52
  122. package/skills/evaluate-skill/references/{definition-schema.md → evaluation-definition-schema.md} +43 -3
  123. package/skills/evaluate-skill/references/evaluation-design.md +56 -30
  124. package/skills/evaluate-skill/references/execution-and-evidence.md +8 -3
  125. package/skills/evaluate-skill/references/review-and-revision.md +62 -21
  126. package/skills/evaluate-skill/scripts/lib/definitions.mjs +114 -3
  127. package/skills/evaluate-skill/scripts/lib/grade-interaction.mjs +156 -1
  128. package/skills/evaluate-skill/scripts/lib/grade.mjs +9 -1
  129. package/skills/evaluate-skill/scripts/lib/pi.mjs +147 -32
  130. package/skills/evaluate-skill/scripts/lib/rpc.mjs +4 -4
  131. package/skills/evaluate-skill/scripts/lib/runner.mjs +36 -14
  132. package/skills/evaluate-skill/scripts/lib/sandbox.mjs +92 -0
  133. package/skills/evaluate-skill/scripts/pi-guard.mjs +1 -1
  134. package/skills/evaluate-skill/scripts/pi-observer.mjs +66 -0
  135. package/skills/evaluate-skill/scripts/skill-eval.mjs +6 -5
  136. package/skills/execute-work/SKILL.md +99 -57
  137. package/skills/execute-work/references/code-practices.md +4 -4
  138. package/skills/execute-work/references/execute-work-edges.md +62 -0
  139. package/skills/finish-branch/SKILL.md +2 -2
  140. package/skills/finish-branch/references/integration-options.md +1 -1
  141. package/skills/handoff/SKILL.md +3 -3
  142. package/skills/launch-work/SKILL.md +1 -1
  143. package/skills/launch-work/references/launch-readiness.md +2 -2
  144. package/skills/migration-work/SKILL.md +2 -2
  145. package/skills/migration-work/references/migration-lifecycle.md +1 -1
  146. package/skills/release-work/SKILL.md +1 -1
  147. package/skills/release-work/references/release-evidence.md +1 -1
  148. package/skills/review-artifact/SKILL.md +129 -66
  149. package/skills/review-artifact/references/adjudicate-artifact-review.md +101 -0
  150. package/skills/review-artifact/references/independent-artifact-reviewer-contract.md +159 -0
  151. package/skills/review-work/SKILL.md +113 -68
  152. package/skills/review-work/references/adjudicate-work-review.md +97 -0
  153. package/skills/review-work/references/independent-work-reviewer-contract.md +139 -0
  154. package/skills/review-work/references/security-risk-lens.md +18 -16
  155. package/skills/setup-freeflow/SKILL.md +16 -17
  156. package/skills/setup-freeflow/references/activation-contract.md +24 -30
  157. package/skills/setup-freeflow/references/host-setup.md +6 -7
  158. package/skills/simplify-code/SKILL.md +97 -39
  159. package/skills/simplify-code/references/simplification-patterns.md +1 -1
  160. package/skills/tdd/SKILL.md +100 -53
  161. package/skills/tdd/references/test-design.md +3 -3
  162. package/skills/track-work/SKILL.md +195 -58
  163. package/skills/track-work/references/working-record-format.md +515 -0
  164. package/skills/track-work/scripts/lib/document.mjs +713 -0
  165. package/skills/track-work/scripts/lib/format.mjs +166 -0
  166. package/skills/track-work/scripts/lib/store.mjs +233 -0
  167. package/skills/track-work/scripts/lib/transitions.mjs +790 -0
  168. package/skills/track-work/scripts/lib/views.mjs +40 -0
  169. package/skills/track-work/scripts/working-record.mjs +316 -0
  170. package/skills/verify-work/SKILL.md +57 -19
  171. package/skills/verify-work/references/browser-runtime-evidence.md +2 -2
  172. package/skills/verify-work/references/integration-evidence.md +1 -7
  173. package/skills/verify-work/references/performance-evidence.md +2 -2
  174. package/skills/workflow/SKILL.md +137 -55
  175. package/skills/workflow/references/domain-skill-composition.md +26 -40
  176. package/skills/write-plan/SKILL.md +1 -1
  177. package/skills/write-skill/SKILL.md +218 -61
  178. package/skills/write-skill/references/activation-boundaries.md +63 -21
  179. package/skills/write-skill/references/agent-first-instructions.md +61 -27
  180. package/skills/write-skill/references/progressive-disclosure.md +97 -33
  181. package/skills/write-skill/references/skill-dependency-graphs.md +190 -0
  182. package/capabilities/output-router/SKILL.md +0 -206
  183. package/capabilities/output-router/references/safety-policy.md +0 -40
  184. package/capabilities/output-router/references/setup.md +0 -110
  185. package/pi-extension/dist/output-router/host-producer-identification.js +0 -232
  186. package/pi-extension/dist/output-router/native-safety-net.js +0 -216
  187. package/pi-extension/dist/output-router/observed-tool-routing.js +0 -122
  188. package/pi-extension/dist/output-router/renderers.js +0 -1023
  189. package/pi-extension/dist/output-router/router-tools.js +0 -554
  190. package/pi-extension/dist/output-router/schemas.js +0 -383
  191. package/pi-extension/dist/output-router/status.js +0 -744
  192. package/pi-extension/dist/output-router/utils.js +0 -502
  193. package/pi-extension/src/output-router/host-producer-identification.ts +0 -256
  194. package/pi-extension/src/output-router/native-safety-net.ts +0 -248
  195. package/pi-extension/src/output-router/observed-tool-routing.ts +0 -134
  196. package/pi-extension/src/output-router/renderers.ts +0 -1108
  197. package/pi-extension/src/output-router/router-tools.ts +0 -579
  198. package/pi-extension/src/output-router/schemas.ts +0 -387
  199. package/pi-extension/src/output-router/status.ts +0 -791
  200. package/pi-extension/src/output-router/utils.ts +0 -554
  201. package/pi-extension/tests/output-router/observed-producers.test.js +0 -132
  202. package/pi-extension/tests/output-router/search.test.js +0 -722
  203. package/router/dist/benchmarks/benchmark-harness.d.ts +0 -35
  204. package/router/dist/benchmarks/benchmark-harness.js +0 -92
  205. package/router/dist/benchmarks/benchmarks.d.ts +0 -109
  206. package/router/dist/benchmarks/benchmarks.js +0 -979
  207. package/router/dist/benchmarks/codex-qa-benchmarks.d.ts +0 -95
  208. package/router/dist/benchmarks/codex-qa-benchmarks.js +0 -500
  209. package/router/dist/benchmarks/command-benchmarks.d.ts +0 -143
  210. package/router/dist/benchmarks/command-benchmarks.js +0 -698
  211. package/router/dist/benchmarks/context-mode-normalized-benchmarks.d.ts +0 -82
  212. package/router/dist/benchmarks/context-mode-normalized-benchmarks.js +0 -773
  213. package/router/dist/benchmarks/context-mode-real-deep-benchmark.d.ts +0 -132
  214. package/router/dist/benchmarks/context-mode-real-deep-benchmark.js +0 -1380
  215. package/router/dist/benchmarks/context-saving-baseline.d.ts +0 -60
  216. package/router/dist/benchmarks/context-saving-baseline.js +0 -470
  217. package/router/dist/benchmarks/index-benchmarks.d.ts +0 -103
  218. package/router/dist/benchmarks/index-benchmarks.js +0 -862
  219. package/router/dist/benchmarks/storage-policy-benchmarks.d.ts +0 -101
  220. package/router/dist/benchmarks/storage-policy-benchmarks.js +0 -618
  221. package/router/dist/benchmarks/vault-index-benchmarks.d.ts +0 -56
  222. package/router/dist/benchmarks/vault-index-benchmarks.js +0 -322
  223. package/router/dist/config/config.d.ts +0 -103
  224. package/router/dist/config/config.js +0 -632
  225. package/router/dist/config/router-contract.d.ts +0 -10
  226. package/router/dist/config/router-contract.js +0 -54
  227. package/router/dist/config/schema.d.ts +0 -27
  228. package/router/dist/config/schema.js +0 -648
  229. package/router/dist/config/types.d.ts +0 -573
  230. package/router/dist/config/types.js +0 -41
  231. package/router/dist/evidence/bounded-evidence.d.ts +0 -40
  232. package/router/dist/evidence/bounded-evidence.js +0 -323
  233. package/router/dist/evidence/evidence-range-selector.d.ts +0 -24
  234. package/router/dist/evidence/evidence-range-selector.js +0 -232
  235. package/router/dist/evidence/evidence-search.d.ts +0 -27
  236. package/router/dist/evidence/evidence-search.js +0 -490
  237. package/router/dist/evidence/evidence.d.ts +0 -38
  238. package/router/dist/evidence/evidence.js +0 -200
  239. package/router/dist/evidence/failure-contracts.d.ts +0 -37
  240. package/router/dist/evidence/failure-contracts.js +0 -166
  241. package/router/dist/evidence/line-ranges.d.ts +0 -24
  242. package/router/dist/evidence/line-ranges.js +0 -22
  243. package/router/dist/experiments/local-index.d.ts +0 -64
  244. package/router/dist/experiments/local-index.js +0 -581
  245. package/router/dist/index.d.ts +0 -30
  246. package/router/dist/index.js +0 -32
  247. package/router/dist/local/local-traversal.d.ts +0 -18
  248. package/router/dist/local/local-traversal.js +0 -334
  249. package/router/dist/processing/engine.d.ts +0 -132
  250. package/router/dist/processing/engine.js +0 -533
  251. package/router/dist/processing/reducers.d.ts +0 -280
  252. package/router/dist/processing/reducers.js +0 -1673
  253. package/router/dist/processing/renderers.d.ts +0 -31
  254. package/router/dist/processing/renderers.js +0 -195
  255. package/router/dist/processing/scripts.d.ts +0 -91
  256. package/router/dist/processing/scripts.js +0 -386
  257. package/router/dist/repo/repo-traversal.d.ts +0 -18
  258. package/router/dist/repo/repo-traversal.js +0 -245
  259. package/router/dist/routing/observed-reducers.d.ts +0 -41
  260. package/router/dist/routing/observed-reducers.js +0 -661
  261. package/router/dist/routing/observed-routing.d.ts +0 -26
  262. package/router/dist/routing/observed-routing.js +0 -378
  263. package/router/dist/routing/parsers.d.ts +0 -16
  264. package/router/dist/routing/parsers.js +0 -521
  265. package/router/dist/routing/run-filters.d.ts +0 -60
  266. package/router/dist/routing/run-filters.js +0 -238
  267. package/router/dist/routing/run-reducers.d.ts +0 -49
  268. package/router/dist/routing/run-reducers.js +0 -122
  269. package/router/dist/sandbox/adapter-roots.d.ts +0 -46
  270. package/router/dist/sandbox/adapter-roots.js +0 -66
  271. package/router/dist/sandbox/eryx-python-adapter.d.ts +0 -13
  272. package/router/dist/sandbox/eryx-python-adapter.js +0 -868
  273. package/router/dist/sandbox/jq-wasm-adapter.d.ts +0 -9
  274. package/router/dist/sandbox/jq-wasm-adapter.js +0 -429
  275. package/router/dist/sandbox/quickjs-wasi-adapter.d.ts +0 -13
  276. package/router/dist/sandbox/quickjs-wasi-adapter.js +0 -384
  277. package/router/dist/sandbox/script-sandbox.d.ts +0 -134
  278. package/router/dist/sandbox/script-sandbox.js +0 -337
  279. package/router/dist/setup/script-transform-adapters.d.ts +0 -32
  280. package/router/dist/setup/script-transform-adapters.js +0 -278
  281. package/router/dist/tools/batch.d.ts +0 -33
  282. package/router/dist/tools/batch.js +0 -586
  283. package/router/dist/tools/run.d.ts +0 -62
  284. package/router/dist/tools/run.js +0 -1304
  285. package/router/dist/tools/search.d.ts +0 -66
  286. package/router/dist/tools/search.js +0 -1364
  287. package/router/dist/transform/engine.d.ts +0 -168
  288. package/router/dist/transform/engine.js +0 -2072
  289. package/router/dist/vault/vault-index.d.ts +0 -125
  290. package/router/dist/vault/vault-index.js +0 -416
  291. package/router/dist/vault/vault.d.ts +0 -138
  292. package/router/dist/vault/vault.js +0 -630
  293. package/runtime/interaction-contract.md +0 -16
  294. package/skills/discuss/references/checkpoints.md +0 -66
  295. package/skills/execute-work/references/execution-loop.md +0 -77
  296. package/skills/mode-contract/SKILL.md +0 -104
  297. package/skills/review-artifact/references/reviewer-prompt.md +0 -148
  298. package/skills/review-work/references/reviewer-prompt.md +0 -134
  299. package/skills/track-work/references/working-record-schema.md +0 -378
  300. package/skills/workflow/references/workflow-loop.md +0 -92
  301. /package/skills/handoff/references/{templates.md → handoff-templates.md} +0 -0
@@ -5,95 +5,236 @@ description: Use when creating or revising an agent skill.
5
5
 
6
6
  # Write Skill
7
7
 
8
- Write the smallest agent-first skill that changes one named behavior.
8
+ Write the smallest agent-first skill package that changes one coherent behavioral policy.
9
9
 
10
- ## Establish The First Read
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
+
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
+ ## Establish The Behavioral Claim
11
15
 
12
16
  Before writing, identify:
13
17
 
14
- - the behavior and failure the skill must change;
15
- - the earliest natural prompt or situation where its guidance becomes useful;
16
- - the cues an agent can observe before reading the body;
17
- - the context guaranteed to be loaded before this skill;
18
- - a nearby case that should not be hijacked.
18
+ - the behavior the skill should produce;
19
+ - the failure or misclassification it must prevent;
20
+ - the earliest decision where its guidance can change the trajectory;
21
+ - cues visible before the body is read;
22
+ - context guaranteed across every valid activation path;
23
+ - a nearby case that should not be hijacked;
24
+ - how the skill should stop influencing behavior after its method no longer applies;
25
+ - the evidence that could support or contradict the intended effect.
19
26
 
20
- A description cannot rely on terminology or classifications taught only inside the skill. The body must work for an agent reading it for the first time with only declared guaranteed context.
27
+ Do not begin with sections, wording, examples, or file layout. Begin with the behavioral intervention.
21
28
 
22
- If public behavior, dependencies, safety, or compatibility remain unsettled, stop and resolve that boundary before encoding it.
29
+ If accepted behavior, public dependencies, safety, compatibility, or another user-owned boundary remains unsettled, stop and resolve it before encoding a runtime rule.
23
30
 
24
- ## Preserve Before Substantial Revision
31
+ ## Preserve The Exact Baseline
25
32
 
26
- Before rewriting or substantially editing an existing skill, snapshot the complete current package—`SKILL.md`, references, scripts, and other owned resources—and record an exact identity. Use a recoverable Git ref or task evidence outside the active package so the rewrite cannot replace its own baseline.
33
+ Before substantially revising an existing skill, preserve the complete current package:
27
34
 
28
- A small local wording correction does not need an extra snapshot when the exact prior state is already recoverable and the change does not alter behavior, dependencies, or package structure.
35
+ - `SKILL.md`;
36
+ - references;
37
+ - scripts;
38
+ - assets and other owned resources;
39
+ - exact package identity.
29
40
 
30
- ## Write The Description
41
+ Use a recoverable Git ref or task evidence outside the active package so the revision cannot replace its own baseline.
31
42
 
32
- Optimize for the first useful read, not repeated reads.
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.
33
44
 
34
- - State the broad core job in plain language.
35
- - Use cues observable in the user request or immediate task state.
36
- - Prefer broad recall when loading the skill is safe and the body can exit cleanly.
37
- - Do not require the agent to predict an internal classification taught only after activation.
38
- - Do not turn the description into an exhaustive trigger taxonomy or compressed summary of the body.
39
- - Treat “Use when…” as useful advice, not required grammar.
45
+ Preserving a baseline supports recovery and comparison. It does not prove that the baseline or candidate behaves correctly.
46
+
47
+ ## Design The First Read
48
+
49
+ A skill cannot activate itself. Its first read must be caused by context already available to the agent:
50
+
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.
67
+
68
+ Read [Activation Boundaries](references/activation-boundaries.md) when activation is unclear or evidence shows missed, late, early, task-hijacking, or retained-interference behavior.
69
+
70
+ ## Write The Description For Recall
71
+
72
+ Treat the description as a routing interface, not a summary of the body.
40
73
 
41
- A nearby case may pass by not loading the skill or by loading it and exiting without changing the task incorrectly. Do not narrow a description solely to prevent harmless reads, and do not broaden it until the skill routinely overrides the actual owning job.
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.
42
81
 
43
- Read [activation boundaries](references/activation-boundaries.md) when the boundary is unclear or evidence shows missed, late, early, or task-hijacking activation.
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.
44
83
 
45
84
  ## Write For The Executing Agent
46
85
 
47
- 1. Establish the skill’s job immediately.
48
- 2. Define necessary terms before relying on them.
49
- 3. Put rules where the agent first makes the affected choice.
50
- 4. Keep the normal route understandable from `SKILL.md`; when it requires another resource, name that dependency and its read condition before relying on it.
51
- 5. Say what to do, what not to do, and when to stop, exit, or route.
52
- 6. Lead with required behavior. Use a negative instruction only to block a plausible or observed failure, and pair it with the positive action, exit, or route.
53
- 7. Use direct instructions that change action or judgment.
54
- 8. Include why only when it helps the agent generalize, choose correctly in an unseen case, or avoid a harmful literal reading.
55
- 9. Repeat a shared rule only when a local reminder prevents a real failure; do not copy the owning workflow.
56
- 10. Keep authoring status, evaluation summaries, evidence gaps, changelog notes, and readiness prose out of the executing skill.
86
+ Write for an agent seeing the skill for the first time with only guaranteed context.
87
+
88
+ 1. Establish the job immediately.
89
+ 2. Define necessary terms before using them.
90
+ 3. Put each rule where the agent first makes the affected choice.
91
+ 4. Keep the normal route understandable from `SKILL.md`.
92
+ 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.
57
98
 
58
- Use discussion, research, and author reasoning to understand the target behavior. Do not copy conversation history, author debate, iteration notes, rejected drafts, or explanation written for collaborators into the skill. Translate that context into only the instructions, definitions, boundaries, and examples a first-time executing agent needs.
99
+ A useful rule normally identifies:
59
100
 
60
- A skill may rely on guaranteed base context. Do not assume an optional sibling skill, reference, or accidental earlier read. Link dependencies and state when to read them.
101
+ ```text
102
+ observable pressure
103
+ -> required or forbidden action
104
+ -> evidence, return, or stop condition
105
+ ```
61
106
 
62
- Read [agent-first instructions](references/agent-first-instructions.md) when wording, placement, undeclared context, or author explanation is obscuring execution.
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.
108
+
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.
110
+
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.
63
112
 
64
113
  ## Use Examples Deliberately
65
114
 
66
- Add a compact behavioral example when prose alone leaves a likely misclassification. Show the observable situation and the required action, stop, exit, or route.
115
+ Add a compact example when prose alone leaves a likely behavioral misclassification.
116
+
117
+ Show:
118
+
119
+ - the observable situation;
120
+ - the required action or judgment;
121
+ - the relevant stop, exit, or return.
122
+
123
+ Keep examples transferable. Do not turn the body into a transcript, fixture library, or scenario catalog.
124
+
125
+ Inline examples teach the subject and are part of the candidate intervention. They are not independent evidence that the skill works.
126
+
127
+ ## Plan Terminology And Dependencies
128
+
129
+ For one self-contained skill, declare only the dependencies its normal and conditional routes need.
130
+
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).
132
+
133
+ For every skill:
67
134
 
68
- Keep examples general enough to transfer beyond one fixture. Do not turn the body into a transcript, test suite, or scenario catalog. Inline examples teach; behavioral evals test whether the skill changes behavior under pressure.
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.
69
142
 
70
- ## Add Resources Only When Needed
143
+ A Markdown link declares a package dependency. It does not automatically select the target owner or execute the linked skill.
71
144
 
72
- Read [progressive disclosure](references/progressive-disclosure.md) before adding or reorganizing references and scripts.
145
+ ## Compact Without Erasing Behavior
73
146
 
74
- Start with one `SKILL.md`. Remove repeated prose and low-value checklists before expanding the file set.
147
+ Compact after the behavioral policy, dependencies, and failure boundaries are understood.
75
148
 
76
- - Add a required reference when normal execution genuinely needs separately owned depth; link it before the dependency is used.
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
- - 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
- - Link every agent-facing reference, asset, declared dependency, and executable entrypoint from `SKILL.md`; internal implementation modules need not be linked.
80
- - Keep owned resources inside the skill package unless a declared package dependency is required.
81
- - Treat unlinked-file inspection as factual inventory, not an automatic defect.
82
- - Do not add resources merely to make the package look complete.
149
+ For each instruction, ask:
83
150
 
84
- There is no universal body template, section inventory, wording rule, file-count target, or requirement that a script follow an earlier failure.
151
+ > Can this be removed without losing required behavior, introducing ambiguity, obscuring a dependency, or reintroducing a previously observed failure?
152
+
153
+ If yes, remove or merge it. If uncertain, preserve it until evidence distinguishes the variants.
154
+
155
+ Do not compact by:
156
+
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.
163
+
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.
165
+
166
+ ## Repeat Rules Deliberately
167
+
168
+ Repetition is justified when local presence protects:
169
+
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.
176
+
177
+ Use one canonical owner for the full definition or method. Repeat only the compact local guard needed at the affected choice.
178
+
179
+ > Repeat the behavioral invariant, not the owning skill’s entire explanation.
180
+
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.
184
+
185
+ ## Add Resources Only When They Change Loading Or Ownership
186
+
187
+ Before adding or reorganizing references, assets, or scripts, read [Progressive Disclosure](references/progressive-disclosure.md).
188
+
189
+ Start with one `SKILL.md`. Remove accidental complexity before splitting files.
190
+
191
+ - 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.
196
+ - 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
+ - Keep owned resources inside the package unless canonical cross-package ownership is required.
199
+
200
+ The body and reference must name the same read condition. A reference cannot activate itself.
201
+
202
+ There is no universal body template, line limit, reference count, or requirement that a script follow an earlier failure.
85
203
 
86
204
  ## Evaluate The Behavioral Claim
87
205
 
88
- Static validation proves structure, not activation or behavior. Name the exact claim being tested: description activation, first-read body behavior, nearby behavior, dependency composition, retained use, or artifact outcome.
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.
89
221
 
90
- Use [Evaluate Skill](../evaluate-skill/SKILL.md) to compare exact baseline and candidate environments under fixed declared inputs. Preserve adequate existing evidence, revise one measured pressure point at a time, and rerun the complete fixed group after a behavioral change.
222
+ Do not claim:
91
223
 
92
- Do not claim activation from body injection, retained use from one turn, or dependency behavior from ambient context. Keep behavior conclusions and missing evidence in the owning evaluation, Working Record, or delivery response rather than annotating the executing skill.
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.
230
+
231
+ Small wording, ordering, vocabulary, repetition, and structural changes may alter model behavior. Human review can establish intended meaning; behavioral evidence establishes observed effect.
232
+
233
+ Keep evaluation conclusions and missing evidence in the evaluation artifact, task record, or delivery report—not in the executing skill.
93
234
 
94
235
  ## Check The Package
95
236
 
96
- Use the bundled [skill author](scripts/skill-author.mjs) for deterministic structure work:
237
+ Use the bundled [skill author](scripts/skill-author.mjs) for deterministic package work:
97
238
 
98
239
  ```text
99
240
  node <write-skill-directory>/scripts/skill-author.mjs init <directory> --name <name> --description <text>
@@ -101,19 +242,35 @@ node <write-skill-directory>/scripts/skill-author.mjs validate <directory> [--pa
101
242
  node <write-skill-directory>/scripts/skill-author.mjs inspect <directory> [--package-root <directory>]
102
243
  ```
103
244
 
104
- Choose the command by job:
245
+ Choose the operation by its evidence:
246
+
247
+ - `init`: create a new minimal package; never overwrite an existing one.
248
+ - `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.
105
252
 
106
- - `init`: use only for a new package. It creates the directory and minimal `SKILL.md` and refuses to overwrite an existing one.
107
- - `validate`: use after structural or resource changes and before claiming structural validity. It checks frontmatter, the top-level heading, recursive links, package dependencies, cycles, and containment.
108
- - `inspect`: use when body sizes, resource classes, scripts, unlinked files, and validation findings are needed. It reports facts rather than quality.
253
+ Commands emit JSON. Invalid structure still emits a report and exits nonzero; command errors emit structured error JSON.
109
254
 
110
- Commands emit JSON. Invalid structure still emits its report and exits nonzero; command errors emit structured error JSON.
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.
111
256
 
112
- - Package root defaults to the nearest `package.json` ancestor, falling back to the skill directory’s parent. Use `--package-root` to set it explicitly.
113
- - Frontmatter accepts flat plain strings or JSON-compatible double-quoted strings. Double-quote values when there is any ambiguity, especially punctuation, numbers, booleans, or null-like text.
257
+ Frontmatter accepts flat plain strings or JSON-compatible double-quoted strings. Quote ambiguous punctuation, number-like, boolean-like, or null-like values.
114
258
 
115
- Never import or invoke deprecated tooling.
259
+ Package validity does not prove behavioral quality. Never use deprecated authoring tooling.
116
260
 
117
261
  ## Stop
118
262
 
119
- Stop when the requested skill is minimal, executable on first read, honest about its dependencies, and free of author-facing status. Stop and ask when public behavior, activation boundaries, dependencies, safety, or compatibility cannot be settled from evidence. Do not add resources or procedure merely to make the package look complete.
263
+ Stop when the requested package:
264
+
265
+ - expresses one coherent behavioral policy;
266
+ - activates at the earliest useful boundary;
267
+ - remains safe on nearby and retained use;
268
+ - works from guaranteed context on every valid path;
269
+ - keeps its normal route executable on first read;
270
+ - declares dependencies and resource conditions honestly;
271
+ - contains no unsupported author-facing residue;
272
+ - passes required structural checks.
273
+
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.
@@ -1,51 +1,79 @@
1
1
  # Activation Boundaries
2
2
 
3
- Read this when an activation boundary is unclear or evidence shows missed, late, early, or task-hijacking activation.
3
+ Read this when activation is unclear or evidence shows missed, late, early, task-hijacking, or retained-interference behavior.
4
4
 
5
- A description should make the skill available at the earliest useful moment without requiring language introduced by the skill itself.
5
+ A description should make the skill available at the earliest useful decision without requiring language introduced by the skill itself.
6
6
 
7
7
  ## Diagnose The First Read
8
8
 
9
9
  Identify:
10
10
 
11
- - the earliest natural prompt or state where the method can change behavior;
11
+ - the earliest natural prompt or task state where the skill can change behavior;
12
12
  - cues visible before the body is read;
13
13
  - context guaranteed before activation;
14
- - the consequence of missing that read;
15
- - the consequence if a nearby prompt also loads the skill.
14
+ - the consequence of missing or delaying the read;
15
+ - the consequence if a nearby prompt also loads the skill;
16
+ - how retained guidance should behave after the immediate method ends.
16
17
 
17
- Do not optimize for repeated reads. Diagnose the first decision the skill should influence.
18
+ Do not optimize for repeated reads. A body may enter context once and continue influencing later messages and tool interactions until context projection or loss.
19
+
20
+ ## Compare Activation Costs
21
+
22
+ False-positive and false-negative activation have different costs.
23
+
24
+ A false-positive read may be acceptable when:
25
+
26
+ - loading cost is proportionate;
27
+ - the body identifies that its method does not apply;
28
+ - it exits without changing ownership or route;
29
+ - retained instructions do not hijack later work.
30
+
31
+ A false negative is material when missing the first useful read causes:
32
+
33
+ - an irreversible or expensive action;
34
+ - a wrong owner or method;
35
+ - repeated low-value environment interactions;
36
+ - missing safety or evidence boundaries;
37
+ - later work that the skill cannot reliably undo.
38
+
39
+ Prefer recall when nearby reads are demonstrably safe and missed activation is materially worse. Tighten activation when early or retained guidance can distort ordinary work.
18
40
 
19
41
  ## Check The Cues
20
42
 
21
- Useful cues include the skill’s job, natural user verbs, visible task situations, and distinctions from neighboring jobs.
43
+ Useful cues include:
44
+
45
+ - the skill’s core job;
46
+ - natural user verbs;
47
+ - visible task situations;
48
+ - observable distinctions from neighboring jobs.
22
49
 
23
50
  Reject cues that depend on:
24
51
 
25
52
  - vocabulary defined only in the body or an optional sibling;
26
53
  - future-duration guesses;
27
- - unexplained classifications or named phases;
54
+ - unexplained internal classifications or named phases;
28
55
  - generic “help with” or “improve” language;
29
- - marketing claims or exhaustive trigger catalogs.
56
+ - marketing claims;
57
+ - exhaustive trigger catalogs.
30
58
 
31
59
  Guaranteed base context may define a term. Otherwise use plain observable language.
32
60
 
33
- ## Test Nearby Behavior
61
+ ## Test Nearby And Retained Behavior
34
62
 
35
- A nearby case can pass in two ways:
63
+ A nearby case can pass through:
36
64
 
37
- - **Non-trigger:** the skill should not load.
38
- - **Safe read:** loading is acceptable, but the body exits or defers without applying the wrong method.
65
+ - **Non-trigger:** the skill is not read.
66
+ - **Safe read:** the body loads, exits or defers correctly, and does not interfere later.
39
67
 
40
- Do not narrow a description solely to prevent harmless reads. Do not broaden it until the skill routinely overrides the actual owning job.
68
+ Test both the immediate response and later declared turns when retained influence matters.
41
69
 
42
- ## Examples
70
+ Examples:
43
71
 
44
- Broad core trigger:
72
+ Broad useful trigger:
45
73
 
46
74
  > Use when committing work.
47
75
 
48
- Over-specified trigger that hides the job behind later workflow details:
76
+ Over-specified trigger that hides the job:
49
77
 
50
78
  > Use after final verification when a planned checkpoint requires a locally reviewable commit.
51
79
 
@@ -53,10 +81,24 @@ Broad safe-read trigger:
53
81
 
54
82
  > Use when working with software design—especially boundaries, interfaces, ownership, state, and failure behavior.
55
83
 
56
- The body can exit when the local interface remains sound; the description need not encode every structural-pressure case.
84
+ The body must exit when the local interface remains sound and avoid turning later local choices into architecture work.
85
+
86
+ ## Preserve The Evidence Boundary
87
+
88
+ Natural activation proves the host read the exact skill snapshot from a natural prompt.
89
+
90
+ Explicit body delivery tests first-read instructions, not activation.
91
+
92
+ Dependency composition tests exact declared skill and context order.
93
+
94
+ Multi-turn evidence tests retained use.
95
+
96
+ Artifact and transcript evidence show whether activation helped, exited safely, or hijacked behavior.
57
97
 
58
- ## Evidence Boundary
98
+ Preserve:
59
99
 
60
- Natural activation proves the host read the exact skill snapshot from a natural prompt. Explicit body delivery tests first-read instructions, not activation. Composition tests declared dependencies. Multi-turn evidence tests later use. Artifact or transcript evidence shows whether the loaded skill helped or hijacked behavior.
100
+ - the earliest useful positive prompt;
101
+ - at least one close nearby case;
102
+ - later-turn evidence when retained influence is part of the claim.
61
103
 
62
- Preserve the earliest useful positive prompt and at least one close nearby case before making a broad activation claim.
104
+ Do not infer one evidence class from another.
@@ -1,6 +1,6 @@
1
1
  # Agent-First Instructions
2
2
 
3
- Read this when a concrete first-read failure involves wording, placement, undeclared context, or author explanation.
3
+ Read this when a concrete first-read or retained-use failure involves wording, placement, undeclared context, author explanation, or competing instructions.
4
4
 
5
5
  ## Reconstruct The Reader’s Context
6
6
 
@@ -9,8 +9,9 @@ Assume the agent is seeing the skill for the first time.
9
9
  - State the job before local vocabulary.
10
10
  - Define terms before relying on them.
11
11
  - Assume only guaranteed runtime or declared base context.
12
- - Do not rely on an optional sibling, reference, or accidental earlier read.
12
+ - Do not rely on an optional sibling, reference, common route, or accidental earlier read.
13
13
  - Make required reads explicit before their content is used.
14
+ - Do not assume the skill will be reread before later use.
14
15
 
15
16
  Dependency direction remains:
16
17
 
@@ -29,19 +30,28 @@ Keep a sentence only when it:
29
30
 
30
31
  - changes an action or judgment;
31
32
  - defines required language;
32
- - protects a likely failure boundary;
33
- - states an evidence, exit, or stop condition;
34
- - provides a compact example that resolves a likely misclassification.
33
+ - protects a likely or observed failure boundary;
34
+ - states an evidence, return, or stop condition;
35
+ - makes a dependency executable;
36
+ - provides a compact example resolving likely misclassification.
35
37
 
36
- Translate rationale into a direct rule plus only the why needed to generalize. Translate debate into the selected boundary and stop condition. Omit rejected drafts, conversation history, and explanation whose only audience is the author.
38
+ Translate rationale into a direct rule plus only the why needed to generalize.
39
+
40
+ Translate debate into the selected boundary and stop condition.
41
+
42
+ Translate a measured failure into the smallest transferable guard that prevents it.
43
+
44
+ Omit rejected drafts, conversation history, fixture narration, evaluation status, and explanation whose only audience is the author.
37
45
 
38
46
  ## Strengthen Rules
39
47
 
40
48
  A useful rule names:
41
49
 
42
- - the observable trigger or pressure;
43
- - the required or forbidden action;
44
- - the evidence, exit, or stop condition.
50
+ ```text
51
+ observable trigger or pressure
52
+ -> required or forbidden action
53
+ -> evidence, return, or stop condition
54
+ ```
45
55
 
46
56
  Prefer:
47
57
 
@@ -51,37 +61,61 @@ Over:
51
61
 
52
62
  > Keep evaluation efficient and aligned with best practices.
53
63
 
64
+ Concrete rules reduce the judgment the agent must reconstruct.
65
+
54
66
  ## Pair Negative Rules With The Route
55
67
 
56
- ```text
57
68
  Bad:
58
- Do not recreate the old worker/verifier architecture.
69
+
70
+ > Do not recreate the old worker/verifier architecture.
59
71
 
60
72
  Better:
61
- The active agent owns implementation and verification.
62
- Workflow selects optional independent review.
63
- ```
64
73
 
65
- ```text
74
+ > The producing activity handles implementation and verification. The surrounding workflow may select independent review.
75
+
66
76
  Bad:
67
- Do not implement the recommendation.
77
+
78
+ > Do not implement the recommendation.
68
79
 
69
80
  Better:
70
- Return the recommendation to Workflow.
71
- Implementation requires authorized execution.
72
- ```
73
81
 
74
- A negative rule may preserve an invariant directly:
82
+ > Return the recommendation to the owning workflow. Implementation requires separate authorization.
75
83
 
76
- ```text
77
- Preserve the accepted scope.
78
- Do not split it into MVP or roadmap phases without approval.
79
- ```
84
+ A negative rule may preserve an invariant directly when the positive route is already clear:
85
+
86
+ > Preserve the accepted scope. Do not split it into MVP or roadmap phases without approval.
80
87
 
81
88
  ## Fix Placement Before Adding Prose
82
89
 
83
- Put a rule where the agent first makes the affected choice. A late caveat rarely defeats an early command. Move or sharpen the controlling sentence before adding another section.
90
+ Put a rule where the agent first makes the affected choice.
91
+
92
+ A late caveat rarely defeats an early command. Move or sharpen the controlling sentence before adding another section.
93
+
94
+ When an early rule and later exception conflict, restructure the route rather than adding another disclaimer.
95
+
96
+ ## Repeat Local Guards Deliberately
97
+
98
+ Repeat a shared rule only when local presence protects:
99
+
100
+ - an independently activated path;
101
+ - a distinct decision point;
102
+ - retained behavior;
103
+ - context-loss recovery;
104
+ - a dangerous literal interpretation;
105
+ - a measured failure.
106
+
107
+ Keep one canonical owner for the full definition or method. Repeat only the compact local guard needed at the choice.
108
+
109
+ > Repeat the behavioral invariant, not the owning method.
110
+
111
+ Do not copy complete orchestration, authority, review, or task-memory sections into every consumer.
112
+
113
+ ## End The Skill’s Influence
114
+
115
+ A skill body may remain in context after its immediate method ends.
116
+
117
+ State stop, return, or exit conditions clearly enough that retained instructions do not continue claiming ownership or broadening later work.
84
118
 
85
- Repeat shared policy only where a short local reminder prevents a real failure. Do not copy an owning workflow into a method skill.
119
+ A first-turn exit is insufficient when later turns still show method hijacking.
86
120
 
87
- After editing, rerun the same first-read pressure while keeping unrelated rules stable.
121
+ After editing, rerun the same first-read and retained-use pressure while keeping unrelated rules stable.