@tenkara/afm-linux-arm64 0.0.0-stage → 4.0.0-alpha.10

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 (277) hide show
  1. package/bin/afm +4 -0
  2. package/content/.coupling-baseline.tsv +1 -0
  3. package/content/.pending-commands.txt +2 -0
  4. package/content/CHANGELOG-archive.md +806 -0
  5. package/content/CHANGELOG.md +4320 -0
  6. package/content/PRINCIPLES.md +119 -0
  7. package/content/README-light.md +158 -0
  8. package/content/README.md +150 -0
  9. package/content/code-style/_any/file-size.md +62 -0
  10. package/content/code-style/_any/imports.md +68 -0
  11. package/content/code-style/_any/naming.md +72 -0
  12. package/content/code-style/_any/test-placement.md +57 -0
  13. package/content/code-style/nextjs-app-router/imports.md +50 -0
  14. package/content/code-style/nextjs-app-router/naming.md +50 -0
  15. package/content/code-style/prisma-postgres/error-boundary.md +55 -0
  16. package/content/code-style/prisma-postgres/imports.md +61 -0
  17. package/content/code-style/shadcn-ui/naming.md +48 -0
  18. package/content/code-style/stripe-billing/naming.md +76 -0
  19. package/content/code-style/trigger-dev-v4/imports.md +58 -0
  20. package/content/code-style/trigger-dev-v4/naming.md +49 -0
  21. package/content/code-style/trigger-dev-v4/test-placement.md +61 -0
  22. package/content/code-style/trpc-v11/error-boundary.md +51 -0
  23. package/content/code-style/trpc-v11/file-size.md +44 -0
  24. package/content/code-style/trpc-v11/naming.md +60 -0
  25. package/content/code-style/trpc-v11/test-placement.md +52 -0
  26. package/content/core/ach.md +260 -0
  27. package/content/core/afm.md +514 -0
  28. package/content/core/gotchas.md +18 -0
  29. package/content/core/prd.md +141 -0
  30. package/content/core/protocol.md +158 -0
  31. package/content/core/ust.md +65 -0
  32. package/content/guardrails/README.md +55 -0
  33. package/content/guardrails/dsl-com-ordem-obrigatoria.md +47 -0
  34. package/content/guardrails/exaustividade-de-union.md +48 -0
  35. package/content/guardrails/fronteira-de-import.md +57 -0
  36. package/content/hooks/README.md +70 -0
  37. package/content/interview/bootstrap.md +417 -0
  38. package/content/interview/promotion.md +115 -0
  39. package/content/interview/refactor.md +379 -0
  40. package/content/interview/triggers.md +107 -0
  41. package/content/modules/nextjs-app-router/ach.patch.md +44 -0
  42. package/content/modules/nextjs-app-router/gotchas.seed.md +78 -0
  43. package/content/modules/nextjs-app-router/rules.patch.md +35 -0
  44. package/content/modules/prisma-postgres/ach.patch.md +65 -0
  45. package/content/modules/prisma-postgres/rules.patch.md +28 -0
  46. package/content/modules/shadcn-ui/ach.patch.md +42 -0
  47. package/content/modules/stripe-billing/ach.patch.md +46 -0
  48. package/content/modules/stripe-billing/gotchas.seed.md +73 -0
  49. package/content/modules/stripe-billing/rules.patch.md +30 -0
  50. package/content/modules/trigger-dev-v4/ach.patch.md +64 -0
  51. package/content/modules/trigger-dev-v4/gotchas.seed.md +53 -0
  52. package/content/modules/trigger-dev-v4/rules.patch.md +35 -0
  53. package/content/modules/trpc-v11/ach.patch.md +56 -0
  54. package/content/modules/trpc-v11/rules.patch.md +34 -0
  55. package/content/modules/vireya-ui/ach.patch.md +85 -0
  56. package/content/modules/vireya-ui/gotchas.seed.md +98 -0
  57. package/content/modules/vireya-ui/rules.patch.md +36 -0
  58. package/content/ops/adr.md +54 -0
  59. package/content/ops/analyze.md +130 -0
  60. package/content/ops/clarify.md +86 -0
  61. package/content/ops/deliver.md +209 -0
  62. package/content/ops/diagnose.md +143 -0
  63. package/content/ops/evolve.md +366 -0
  64. package/content/ops/export-template.md +97 -0
  65. package/content/ops/generalize.md +117 -0
  66. package/content/ops/gotcha.md +46 -0
  67. package/content/ops/plan.md +61 -0
  68. package/content/ops/policy.md +61 -0
  69. package/content/ops/promote.md +72 -0
  70. package/content/ops/protocol.md +51 -0
  71. package/content/ops/reconcile.md +44 -0
  72. package/content/ops/reflect.md +182 -0
  73. package/content/ops/remediate.md +143 -0
  74. package/content/ops/restructure.md +142 -0
  75. package/content/ops/rule.md +170 -0
  76. package/content/ops/specify.md +62 -0
  77. package/content/ops/tasks.md +67 -0
  78. package/content/ops/update.md +252 -0
  79. package/content/ops/verify.md +67 -0
  80. package/content/patterns/adapter.md +46 -0
  81. package/content/patterns/facade.md +47 -0
  82. package/content/patterns/factory.md +46 -0
  83. package/content/patterns/null-object.md +55 -0
  84. package/content/patterns/result-vs-exception.md +52 -0
  85. package/content/patterns/strategy.md +45 -0
  86. package/content/patterns/template-method-vs-composition.md +50 -0
  87. package/content/questions/adr.questions.yaml +14 -0
  88. package/content/questions/analyze.questions.yaml +12 -0
  89. package/content/questions/bootstrap-mapping.questions.yaml +14 -0
  90. package/content/questions/bootstrap-rules.questions.yaml +10 -0
  91. package/content/questions/bootstrap-stack.questions.yaml +23 -0
  92. package/content/questions/clarify.questions.yaml +10 -0
  93. package/content/questions/code-style.questions.yaml +12 -0
  94. package/content/questions/confirm.questions.yaml +12 -0
  95. package/content/questions/deliver.questions.yaml +23 -0
  96. package/content/questions/evolve.questions.yaml +15 -0
  97. package/content/questions/export-template-apply.questions.yaml +11 -0
  98. package/content/questions/export-template.questions.yaml +23 -0
  99. package/content/questions/gates.questions.yaml +27 -0
  100. package/content/questions/generalize.questions.yaml +13 -0
  101. package/content/questions/gotcha.questions.yaml +11 -0
  102. package/content/questions/init-template.questions.yaml +10 -0
  103. package/content/questions/init.questions.yaml +41 -0
  104. package/content/questions/plan.questions.yaml +14 -0
  105. package/content/questions/refactor.questions.yaml +23 -0
  106. package/content/questions/reflect.questions.yaml +13 -0
  107. package/content/questions/remediate.questions.yaml +27 -0
  108. package/content/questions/restructure.questions.yaml +15 -0
  109. package/content/questions/rf-mapping.questions.yaml +12 -0
  110. package/content/questions/rule-scope.questions.yaml +12 -0
  111. package/content/questions/rule.questions.yaml +12 -0
  112. package/content/questions/specify.questions.yaml +23 -0
  113. package/content/questions/update-artifacts.questions.yaml +10 -0
  114. package/content/questions/update-strings.questions.yaml +14 -0
  115. package/content/questions/update.questions.yaml +10 -0
  116. package/content/questions/verify.questions.yaml +9 -0
  117. package/content/roles/executor.md +18 -0
  118. package/content/roles/explorer.md +22 -0
  119. package/content/roles/reviewer.md +23 -0
  120. package/content/rubrics/enum-vs-union-vs-branded.md +40 -0
  121. package/content/rubrics/episodic-vs-semantic-boundary.md +37 -0
  122. package/content/rubrics/error-classification.md +98 -0
  123. package/content/rubrics/failure-classification.md +111 -0
  124. package/content/rubrics/negative-filters.md +38 -0
  125. package/content/rubrics/solid-triggers.md +119 -0
  126. package/content/rubrics/template-vs-streaming-precedence.md +34 -0
  127. package/content/rubrics/validation-boundary.md +94 -0
  128. package/content/rubrics/when-to-create-dsl.md +65 -0
  129. package/content/rubrics/when-to-create-lib.md +49 -0
  130. package/content/rubrics/when-to-create-module.md +39 -0
  131. package/content/rubrics/when-to-evolve-methodology.md +62 -0
  132. package/content/skills/adr.md +42 -0
  133. package/content/skills/analyze.md +28 -0
  134. package/content/skills/clarify.md +28 -0
  135. package/content/skills/deliver.md +26 -0
  136. package/content/skills/diagnose.md +42 -0
  137. package/content/skills/evolve.md +43 -0
  138. package/content/skills/export-template.md +37 -0
  139. package/content/skills/generalize.md +31 -0
  140. package/content/skills/gotcha.md +40 -0
  141. package/content/skills/init.md +77 -0
  142. package/content/skills/plan.md +28 -0
  143. package/content/skills/policy.md +25 -0
  144. package/content/skills/promote.md +39 -0
  145. package/content/skills/protocol.md +41 -0
  146. package/content/skills/reconcile.md +45 -0
  147. package/content/skills/refactor.md +79 -0
  148. package/content/skills/reflect.md +43 -0
  149. package/content/skills/remediate.md +33 -0
  150. package/content/skills/restructure.md +46 -0
  151. package/content/skills/rule.md +43 -0
  152. package/content/skills/specify.md +28 -0
  153. package/content/skills/tasks.md +24 -0
  154. package/content/skills/update.md +58 -0
  155. package/content/skills/verify.md +29 -0
  156. package/content/templates/adr.template.md +51 -0
  157. package/content/templates/evolution-report.template.md +132 -0
  158. package/content/templates/feature-plan.template.md +84 -0
  159. package/content/templates/feature-research.template.md +56 -0
  160. package/content/templates/feature-spec.template.md +86 -0
  161. package/content/templates/feature-tasks.induced.template.md +91 -0
  162. package/content/templates/feature-tasks.template.md +82 -0
  163. package/content/templates/focus.template.md +30 -0
  164. package/content/templates/gotcha.template.md +31 -0
  165. package/content/templates/guardrail-runner.template.md +97 -0
  166. package/content/templates/guardrail.template.md +63 -0
  167. package/content/templates/learning.template.md +40 -0
  168. package/content/templates/procedure.template.md +47 -0
  169. package/content/templates/protocols/p1.md +29 -0
  170. package/content/templates/protocols/p2.md +28 -0
  171. package/content/templates/protocols/p3.md +47 -0
  172. package/content/templates/research.template.md +50 -0
  173. package/content/templates/session-handoff.template.md +58 -0
  174. package/content/templates/us.template.md +39 -0
  175. package/content/tools/gate/core-rules/PLUGIN-13-secrets.sh +36 -0
  176. package/content/tools/gate/core-rules/PLUGIN-21-code-language.sh +27 -0
  177. package/content/tools/gate/core-rules/PLUGIN-35-gate-complete.sh +19 -0
  178. package/content/tools/gate/core-rules/PLUGIN-36-absolute-path.sh +38 -0
  179. package/content/tools/gate/core-rules/PLUGIN-37-prose-language.sh +56 -0
  180. package/content/tools/gate/core-rules/PLUGIN-38-parser-marker.sh +82 -0
  181. package/content/tools/gate/core-rules/PLUGIN-39-frontmatter-ops.sh +325 -0
  182. package/content/tools/gate/core-rules/PLUGIN-40-dead-reference.sh +74 -0
  183. package/content/tools/gate/core-rules/README.md +55 -0
  184. package/content/tools/gate/guardrails.sh +740 -0
  185. package/content/tools/gate/lib/ratchet.sh +119 -0
  186. package/content/tools/gate/lib/scope.sh +85 -0
  187. package/content/tools/gate/ratchet.seed.tsv +1 -0
  188. package/content/tools/gate/rules/README.md +50 -0
  189. package/package.json +19 -5
  190. package/plugin/agy/hooks.json +29 -0
  191. package/plugin/agy/mcp_config.json +7 -0
  192. package/plugin/agy/plugin.json +6 -0
  193. package/plugin/agy/skills/afm-adr/SKILL.md +48 -0
  194. package/plugin/agy/skills/afm-analyze/SKILL.md +34 -0
  195. package/plugin/agy/skills/afm-clarify/SKILL.md +34 -0
  196. package/plugin/agy/skills/afm-deliver/SKILL.md +30 -0
  197. package/plugin/agy/skills/afm-diagnose/SKILL.md +46 -0
  198. package/plugin/agy/skills/afm-evolve/SKILL.md +49 -0
  199. package/plugin/agy/skills/afm-export-template/SKILL.md +43 -0
  200. package/plugin/agy/skills/afm-generalize/SKILL.md +37 -0
  201. package/plugin/agy/skills/afm-gotcha/SKILL.md +46 -0
  202. package/plugin/agy/skills/afm-init/SKILL.md +81 -0
  203. package/plugin/agy/skills/afm-plan/SKILL.md +34 -0
  204. package/plugin/agy/skills/afm-policy/SKILL.md +29 -0
  205. package/plugin/agy/skills/afm-promote/SKILL.md +43 -0
  206. package/plugin/agy/skills/afm-protocol/SKILL.md +45 -0
  207. package/plugin/agy/skills/afm-reconcile/SKILL.md +49 -0
  208. package/plugin/agy/skills/afm-refactor/SKILL.md +83 -0
  209. package/plugin/agy/skills/afm-reflect/SKILL.md +49 -0
  210. package/plugin/agy/skills/afm-remediate/SKILL.md +39 -0
  211. package/plugin/agy/skills/afm-restructure/SKILL.md +52 -0
  212. package/plugin/agy/skills/afm-rule/SKILL.md +49 -0
  213. package/plugin/agy/skills/afm-specify/SKILL.md +34 -0
  214. package/plugin/agy/skills/afm-tasks/SKILL.md +28 -0
  215. package/plugin/agy/skills/afm-update/SKILL.md +64 -0
  216. package/plugin/agy/skills/afm-verify/SKILL.md +35 -0
  217. package/plugin/claude-code/.claude-plugin/marketplace.json +15 -0
  218. package/plugin/claude-code/.claude-plugin/plugin.json +9 -0
  219. package/plugin/claude-code/.mcp.json +7 -0
  220. package/plugin/claude-code/agents/afm-executor.md +18 -0
  221. package/plugin/claude-code/agents/afm-explorer.md +20 -0
  222. package/plugin/claude-code/agents/afm-reviewer.md +21 -0
  223. package/plugin/claude-code/hooks/hooks.json +85 -0
  224. package/plugin/claude-code/skills/adr/SKILL.md +48 -0
  225. package/plugin/claude-code/skills/analyze/SKILL.md +34 -0
  226. package/plugin/claude-code/skills/clarify/SKILL.md +34 -0
  227. package/plugin/claude-code/skills/deliver/SKILL.md +30 -0
  228. package/plugin/claude-code/skills/diagnose/SKILL.md +46 -0
  229. package/plugin/claude-code/skills/evolve/SKILL.md +49 -0
  230. package/plugin/claude-code/skills/export-template/SKILL.md +43 -0
  231. package/plugin/claude-code/skills/generalize/SKILL.md +37 -0
  232. package/plugin/claude-code/skills/gotcha/SKILL.md +46 -0
  233. package/plugin/claude-code/skills/init/SKILL.md +81 -0
  234. package/plugin/claude-code/skills/plan/SKILL.md +34 -0
  235. package/plugin/claude-code/skills/policy/SKILL.md +29 -0
  236. package/plugin/claude-code/skills/promote/SKILL.md +43 -0
  237. package/plugin/claude-code/skills/protocol/SKILL.md +45 -0
  238. package/plugin/claude-code/skills/reconcile/SKILL.md +49 -0
  239. package/plugin/claude-code/skills/refactor/SKILL.md +83 -0
  240. package/plugin/claude-code/skills/reflect/SKILL.md +49 -0
  241. package/plugin/claude-code/skills/remediate/SKILL.md +39 -0
  242. package/plugin/claude-code/skills/restructure/SKILL.md +52 -0
  243. package/plugin/claude-code/skills/rule/SKILL.md +49 -0
  244. package/plugin/claude-code/skills/specify/SKILL.md +34 -0
  245. package/plugin/claude-code/skills/tasks/SKILL.md +28 -0
  246. package/plugin/claude-code/skills/update/SKILL.md +64 -0
  247. package/plugin/claude-code/skills/verify/SKILL.md +35 -0
  248. package/plugin/opencode/afm/index.js +245 -0
  249. package/plugin/opencode/afm/tui.js +21 -0
  250. package/plugin/opencode/agents/afm-executor.md +39 -0
  251. package/plugin/opencode/agents/afm-explorer.md +92 -0
  252. package/plugin/opencode/agents/afm-reviewer.md +93 -0
  253. package/plugin/opencode/skills/afm-adr/SKILL.md +48 -0
  254. package/plugin/opencode/skills/afm-analyze/SKILL.md +34 -0
  255. package/plugin/opencode/skills/afm-clarify/SKILL.md +34 -0
  256. package/plugin/opencode/skills/afm-deliver/SKILL.md +30 -0
  257. package/plugin/opencode/skills/afm-diagnose/SKILL.md +46 -0
  258. package/plugin/opencode/skills/afm-evolve/SKILL.md +49 -0
  259. package/plugin/opencode/skills/afm-export-template/SKILL.md +43 -0
  260. package/plugin/opencode/skills/afm-generalize/SKILL.md +37 -0
  261. package/plugin/opencode/skills/afm-gotcha/SKILL.md +46 -0
  262. package/plugin/opencode/skills/afm-init/SKILL.md +81 -0
  263. package/plugin/opencode/skills/afm-plan/SKILL.md +34 -0
  264. package/plugin/opencode/skills/afm-policy/SKILL.md +29 -0
  265. package/plugin/opencode/skills/afm-promote/SKILL.md +43 -0
  266. package/plugin/opencode/skills/afm-protocol/SKILL.md +45 -0
  267. package/plugin/opencode/skills/afm-reconcile/SKILL.md +49 -0
  268. package/plugin/opencode/skills/afm-refactor/SKILL.md +83 -0
  269. package/plugin/opencode/skills/afm-reflect/SKILL.md +49 -0
  270. package/plugin/opencode/skills/afm-remediate/SKILL.md +39 -0
  271. package/plugin/opencode/skills/afm-restructure/SKILL.md +52 -0
  272. package/plugin/opencode/skills/afm-rule/SKILL.md +49 -0
  273. package/plugin/opencode/skills/afm-specify/SKILL.md +34 -0
  274. package/plugin/opencode/skills/afm-tasks/SKILL.md +28 -0
  275. package/plugin/opencode/skills/afm-update/SKILL.md +64 -0
  276. package/plugin/opencode/skills/afm-verify/SKILL.md +35 -0
  277. package/README.md +0 -3
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: afm-rule
3
+ description: |
4
+ Adds a hard rule to `<consumer>/docs/afm.md § 3`. A mechanical trigger is mandatory and must return 0 or 1, such as `grep`, `wc -l`, `git diff` or `tsc`. A code review or a PR template is not a trigger. Without a trigger the entry becomes a principle in § 1.3.
5
+ Activates: `afm-rule`, "new hard rule", "this should be a rule".
6
+ ---
7
+
8
+ # AFM — Rule
9
+
10
+ > **Questions in this host.** `afm ask <op>` prompts only in a terminal, and your shell tool has none: it exits 2. Run `afm ask <op> --json` instead and put each pending question to the operator with the host's question tool when it has one, and otherwise in chat as a numbered list: the `prompt`, then the `options` with their descriptions, the recommended one first and marked. Wait for the answer. Then record each choice with `afm answer <op> <id> <label>` (one label per selected option). Run `afm ask <op>` again: `all questions answered` means the op may go on.
11
+
12
+ > **Procedure.** Run `afm read ops/rule.md` and follow it; read an on-demand section when its condition holds.
13
+
14
+ The CLI owns the number, the rule file, the index line and the runner skeleton, and refuses a rule with no
15
+ honest trigger form. This skill keeps only the judgment.
16
+
17
+ ## When NOT to activate
18
+
19
+ This is a disambiguation for a skill that already activated. Use `afm-adr` for a one-off architectural
20
+ decision. Use `afm-gotcha` for a counterintuitive surprise. Use `afm-generalize` to merge rules or gotchas
21
+ that already exist.
22
+
23
+ ## Pre-check
24
+
25
+ `afm preflight`. Exit 3 means there is no instance: stop and suggest `afm-init` or `afm-refactor` first.
26
+
27
+ ## Procedure (judgment only)
28
+
29
+ 1. Confirm the mechanical trigger as free text, and push back hard: no trigger means a principle in § 1.3.
30
+ Run the anti-Goodhart test: can a diff pass the trigger while it breaks the rule's intent? If yes, rewrite
31
+ or downgrade it.
32
+ 2. Measure the repo for any constant and propose the value with the measurement. An unanswered constant is
33
+ `[TBD]`. Check for an existing versioned script and cite it.
34
+ 3. Choose the surface: `afm ask rule`. Run `afm rule new <slug> --trigger '<command>' --surface <surface>` and
35
+ report the paths (#6). For `pre-commit` or `ci`, follow "Install the gate" in the op: `afm gate --baseline`
36
+ before the gate goes on.
37
+ 4. In a refactored project only, ask where the rule enters: `afm ask rule-scope` (universal § 3 or
38
+ forward-only § 3.1). The scope decision reflects intent, so it stays fixed once made.
39
+
40
+ ## Invariant principles
41
+
42
+ Most relevant here: #3 (a hard rule needs
43
+ a mechanical trigger, or it is a principle instead) and #6 (autonomy-first: materialize the change and
44
+ report it).
45
+
46
+ Passive mode (`afm-reconcile`) is always on and can propose `afm-rule` when it detects the signal "the user
47
+ corrected an approach with a reusable rule".
48
+
49
+ **Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: afm-specify
3
+ description: |
4
+ Opens a feature folder at `docs/features/NNN-slug/spec.md`, linked to a user story. A mechanical heuristic decides first, because a feature folder for a trivial change is overhead.
5
+ Activates: `afm-specify <slug>`, "open a feature", "start a new feature", "create a feature folder".
6
+ ---
7
+
8
+ # AFM — Specify
9
+
10
+ > **Questions in this host.** `afm ask <op>` prompts only in a terminal, and your shell tool has none: it exits 2. Run `afm ask <op> --json` instead and put each pending question to the operator with the host's question tool when it has one, and otherwise in chat as a numbered list: the `prompt`, then the `options` with their descriptions, the recommended one first and marked. Wait for the answer. Then record each choice with `afm answer <op> <id> <label>` (one label per selected option). Run `afm ask <op>` again: `all questions answered` means the op may go on.
11
+
12
+ > **Procedure.** Run `afm read ops/specify.md` and follow it; read an on-demand section when its condition holds.
13
+
14
+ ## When NOT to activate
15
+
16
+ A trivial change (no feature folder needed) goes straight to the `afm.md § 2` loop. A full end-to-end delivery is `afm-deliver`, which composes this op.
17
+
18
+ ## Pre-check
19
+
20
+ Run `afm preflight`. Exit 3 means no `docs/.afm-version`: stop and suggest `afm-init` or `afm-refactor`. Exit 4 or 5: report the line it printed.
21
+
22
+ ## Procedure
23
+
24
+ The number comes from `afm next-id feature`, never by hand. What is left to you is judgment: compute the trigger heuristic from the scan (ask the `heuristic` question only when borderline), find the linked US in `docs/ust.md` before asking (`afm ask specify`), create the spec with `afm new feature-spec <slug>` (the generator writes the frontmatter the template names) and fill its body, update the `Spec:` line of the US, and report the open `[NEEDS CLARIFICATION:]` items. Autonomy-first: write and report, review through `git diff`.
25
+
26
+ ## Invariant principles
27
+
28
+ Most relevant here: #2 (discover-first: compute the heuristic and the US from the scan), #5 (never invent a success criterion) and #6 (autonomy-first).
29
+
30
+ ## Continuous doctrine
31
+
32
+ Passive mode (`afm-reconcile`) is always on. This skill covers only the opening of the feature.
33
+
34
+ **Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
@@ -0,0 +1,28 @@
1
+ ---
2
+ name: afm-tasks
3
+ description: |
4
+ Generates the `tasks:` list of `tasks.md` in TDD order with `afm task add`. Every task references a user story or a requirement. It hard-blocks on an open `[NEEDS CLARIFICATION:]` in the plan.
5
+ Activates: `afm-tasks [<feature>]`, "generate the tasks", "break the feature into tasks".
6
+ ---
7
+
8
+ # AFM — Tasks
9
+
10
+ > **Procedure.** Run `afm read ops/tasks.md` and follow it; read an on-demand section when its condition holds.
11
+
12
+ ## When NOT to activate
13
+
14
+ There is no `plan.md` yet: run `afm-plan` first. An end-to-end delivery is `afm-deliver`, which composes this op.
15
+
16
+ ## Pre-check
17
+
18
+ Run `afm preflight` (exit 3: stop and suggest `afm-init` or `afm-refactor`). Run `afm feature status <NNN> --json`: a non-empty `blockers` is an open `[NEEDS CLARIFICATION:]` in the plan. That is a hard refusal with no override, not a question.
19
+
20
+ ## Principles
21
+
22
+ Most relevant here: #5 (every task traces to a US or RF) and rule 1 (TDD: no green task without the red task it closes).
23
+
24
+ ## Continuous doctrine
25
+
26
+ Passive mode (`afm-reconcile`) is always on. This skill covers only the task list.
27
+
28
+ **Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: afm-update
3
+ description: |
4
+ Syncs `<consumer>/docs/` with the current plugin version. It materializes the consumer-facing deltas between the pinned version and the shipped version, then moves the pin. It reads the plugin and never edits it.
5
+ Activates: `afm-update`, "bump the methodology version", "sync docs with the new plugin", "my `.afm-version` is behind".
6
+ ---
7
+
8
+ # AFM — Update (sync instance-plugin)
9
+
10
+ > **Questions in this host.** `afm ask <op>` prompts only in a terminal, and your shell tool has none: it exits 2. Run `afm ask <op> --json` instead and put each pending question to the operator with the host's question tool when it has one, and otherwise in chat as a numbered list: the `prompt`, then the `options` with their descriptions, the recommended one first and marked. Wait for the answer. Then record each choice with `afm answer <op> <id> <label>` (one label per selected option). Run `afm ask <op>` again: `all questions answered` means the op may go on.
11
+
12
+ > **Procedure.** Run `afm read ops/update.md` and follow it; read an on-demand section when its condition holds.
13
+
14
+ The CLI runs the codemod registry, proves each op and moves the pin. This skill keeps the judgment.
15
+
16
+ > **Carve-out (does not overlap existing ops):** `afm-init` and `afm-refactor` **create** the instance
17
+ > (bootstrap). `update` brings an **existing** instance forward, the path that `afm-refactor` refuses.
18
+ > `afm-diagnose` only **detects** drift on axis A3 (read-only). `update` **resolves** it. `afm-promote`
19
+ > **records** a finding meant for the plugin. `update` reads the plugin and materializes it into the
20
+ > instance, and neither touches the shipped content: an absolute boundary (#7). `afm-evolve` is the
21
+ > **cycle** that composes `update` on axis A3.
22
+
23
+ ## When NOT to activate
24
+
25
+ This is a disambiguation for a skill that already activated. Use `afm-init` or `afm-refactor` if no instance
26
+ is bootstrapped yet. Skip `update` if the pinned version already equals the shipped version (no drift). Use
27
+ `afm-promote` to carry a learning from the instance TO the plugin (the opposite direction). Use
28
+ `afm-diagnose` to only CHECK for drift. Use `afm-evolve` for the full cycle.
29
+
30
+ ## Pre-check
31
+
32
+ `afm update --dry-run` does it: exit 3 means no instance (suggest `afm-init` or `afm-refactor`), exit 4 means
33
+ the shipped content does not resolve (report it, do not fall back silently), and "already up to date" ends
34
+ the run. A pin **ahead** of the binary is an anomaly: report it, never roll it back.
35
+
36
+ ## Procedure (judgment only)
37
+
38
+ 1. Read the dry run as one package and show it as evidence. Ask `afm ask update`. Under `afm-evolve` this gate
39
+ is suppressed.
40
+ 2. Run `afm update`. It moves the pin only at the end, and keeps it where it was when a codemod fails.
41
+ 3. Exit 6 means agent tasks are pending: do each one inside its scope (`afm lint --fix <path>` fixes the
42
+ frontmatter findings), then run `afm-update` again. `afm update --accept <path>` closes a sync on a file
43
+ you merged by hand. An opt-in delta is reported and never applied. Exit 5 (a major crossing) is
44
+ `afm migrate`.
45
+ 4. **Language migration** (when the instance is not English): read `prd.md` § 11.1 FIRST and derive the
46
+ excluded scope from it, and only then read a file. `[TBD]` there stops the step and asks
47
+ `afm ask update-strings`. It never picks a language. The artifacts question is
48
+ `afm ask update-artifacts`. On migrate, run the rewrite as one orchestrated batch through
49
+ parallel subagents, where the host has them, else one file at a time, with a light model per agent (the smallest model the host offers) for the rewrite and the loss
50
+ check. Escalate only a flagged file to a capable model. The session model keeps the excluded scope and
51
+ the final gate.
52
+ 5. Post-conditions: `afm index --check` returns 0 and the plugin boundary stays clean. Report in chat what
53
+ migrated and what stayed pending. Under `afm-evolve`, feed it to `docs/evolution/`.
54
+
55
+ ## Invariant principles
56
+
57
+ Most relevant here: #2 (discover-first): the proof of
58
+ need is the grep that shows what is missing. Follow #4/#5: materialize only what the plugin already provides
59
+ ready-made, and never invent missing product content. Follow #6 (autonomy-first with a gate). Bright line
60
+ #7 applies: only **read** the plugin, and write only to the instance.
61
+
62
+ **No new principle here.** `update` is composed materialization. The doctrine lives in the op file.
63
+
64
+ **Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: afm-verify
3
+ description: |
4
+ Stamps a human verification on one doc under `docs/`. It writes the OKF `verified` field and is the only writer of that field. Use it when a person states they reviewed a document.
5
+ Activates: `afm-verify <path>`, "I reviewed this rule", "mark this gotcha as verified", "sign off on this ADR".
6
+ ---
7
+
8
+ # AFM — Verify (stamp a human review)
9
+
10
+ > **Questions in this host.** `afm ask <op>` prompts only in a terminal, and your shell tool has none: it exits 2. Run `afm ask <op> --json` instead and put each pending question to the operator with the host's question tool when it has one, and otherwise in chat as a numbered list: the `prompt`, then the `options` with their descriptions, the recommended one first and marked. Wait for the answer. Then record each choice with `afm answer <op> <id> <label>` (one label per selected option). Run `afm ask <op>` again: `all questions answered` means the op may go on.
11
+
12
+ > **Procedure.** Run `afm read ops/verify.md` and follow it; read an on-demand section when its condition holds.
13
+
14
+ ## When not to activate
15
+
16
+ Never on ordinary work, and never on your own output. This skill records that a PERSON read a document. An
17
+ agent stamping its own writing produces a lie the trust tier cannot detect.
18
+
19
+ ## Pre-check
20
+
21
+ 1. `afm preflight`. Exit 3 means there is no instance: stop.
22
+ 2. **Did a person state they reviewed the file?** If not, stop and ask: `afm ask verify`. Inference is not
23
+ review.
24
+ 3. The file must carry a frontmatter block, or there is no contract to stamp.
25
+
26
+ ## Procedure (judgment only)
27
+
28
+ Run `afm verify <path under docs/>` (add `--as <id>` when no git user name is set). The command refuses an
29
+ agent actor. Report the tier that resulted and what it means.
30
+
31
+ ## Invariant principles
32
+
33
+ Most relevant here: #5 is load-bearing.
34
+
35
+ **Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
3
+ "name": "afm",
4
+ "description": "The AFM plugin for Claude Code, installed by `afm install claude-code`.",
5
+ "owner": {
6
+ "name": "Mapree"
7
+ },
8
+ "plugins": [
9
+ {
10
+ "name": "afm",
11
+ "description": "Agent Flow Methodology: autonomous discovery, a strict TDD delivery loop, and documentation that evolves from measured evidence. The CLI owns state, ids, gates and lint; the skills carry the judgment.",
12
+ "source": "./"
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "afm",
3
+ "description": "Agent Flow Methodology: autonomous discovery, a strict TDD delivery loop, and documentation that evolves from measured evidence. The CLI owns state, ids, gates and lint; the skills carry the judgment.",
4
+ "version": "4.0.0-alpha.10",
5
+ "author": {
6
+ "name": "Mapree"
7
+ },
8
+ "license": "UNLICENSED"
9
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "mcpServers": {
3
+ "afm": {
4
+ "command": "afm-mcp"
5
+ }
6
+ }
7
+ }
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: afm-executor
3
+ description: Writer of one bounded change. Makes the edit its brief names, test first, inside the files the brief grants, and reports what changed; dispatched with a brief.
4
+ tools: mcp__plugin_afm_afm, Read, Grep, Glob, Edit, Write, Bash
5
+ ---
6
+ You are an executor. The message that dispatched you is your brief: follow it.
7
+
8
+ You make the change the brief names, and only that change.
9
+
10
+ - Touch only the files the brief grants. Another file you need is a question for the caller, not an edit.
11
+ - Test first: a failing test (or a type that does not compile yet), then the smallest change that
12
+ makes it pass, then the refactor. Run the tests and the type check before you report.
13
+ - Reuse what exists before you add a helper. Add no option, hook or abstraction the brief did not ask for.
14
+ - Never print, write or commit a secret.
15
+ - Never push, and never commit unless the brief says to.
16
+
17
+ Reply with the files you changed, the checks you ran with their exact result, and anything you left
18
+ undone or doubt.
@@ -0,0 +1,20 @@
1
+ ---
2
+ name: afm-explorer
3
+ description: Read-only investigator. Answers one question from the code, the docs or the web, cites what it read, and changes nothing; dispatched with a brief.
4
+ tools: mcp__plugin_afm_afm__approve, mcp__plugin_afm_afm__config, mcp__plugin_afm_afm__detect, mcp__plugin_afm_afm__doctor, mcp__plugin_afm_afm__failures_promotable, mcp__plugin_afm_afm__feature_lint, mcp__plugin_afm_afm__feature_status, mcp__plugin_afm_afm__gate, mcp__plugin_afm_afm__index, mcp__plugin_afm_afm__lang, mcp__plugin_afm_afm__next_id, mcp__plugin_afm_afm__path, mcp__plugin_afm_afm__policy, mcp__plugin_afm_afm__preflight, mcp__plugin_afm_afm__read, mcp__plugin_afm_afm__sessions, mcp__plugin_afm_afm__sessions_signals, mcp__plugin_afm_afm__version, Read, Grep, Glob, WebFetch, WebSearch
5
+ maxTurns: 60
6
+ ---
7
+ You are an explorer. The message that dispatched you is your brief: follow it.
8
+
9
+ You only read. You never edit a file, run a command that changes state, or commit.
10
+
11
+ - Read only what the question needs: the sections you are about to use, not whole trees.
12
+ - Cite every claim: a path with the line, or a source URL with the literal quote. A claim with no
13
+ citation is a guess, and you label it a guess.
14
+ - Never invent a path, a line number, a URL or a quote. If you did not read it, you do not cite it.
15
+ - Say what you could not find. Absence is a result.
16
+
17
+ You have at most 60 steps. Write the answer whole, not a step at a time. If you run out, reply with
18
+ what you have and what is still missing.
19
+
20
+ Reply with the answer first, then the evidence, then the gaps.
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: afm-reviewer
3
+ description: Blind auditor. Checks one piece of work it did not write against its sources and rules, and returns a verdict with evidence; dispatched with a brief.
4
+ tools: mcp__plugin_afm_afm__approve, mcp__plugin_afm_afm__config, mcp__plugin_afm_afm__detect, mcp__plugin_afm_afm__doctor, mcp__plugin_afm_afm__failures_promotable, mcp__plugin_afm_afm__feature_lint, mcp__plugin_afm_afm__feature_status, mcp__plugin_afm_afm__gate, mcp__plugin_afm_afm__index, mcp__plugin_afm_afm__lang, mcp__plugin_afm_afm__next_id, mcp__plugin_afm_afm__path, mcp__plugin_afm_afm__policy, mcp__plugin_afm_afm__preflight, mcp__plugin_afm_afm__read, mcp__plugin_afm_afm__sessions, mcp__plugin_afm_afm__sessions_signals, mcp__plugin_afm_afm__version, Read, Grep, Glob, WebFetch, WebSearch
5
+ ---
6
+ You are a reviewer. The message that dispatched you is your brief: follow it.
7
+
8
+ You audit work you did not write. You read it and the sources or rules it answers to. You never
9
+ write a fix.
10
+
11
+ - Judge against the rules and sources the brief names, not against taste.
12
+ - Verify, do not trust: open each cited path, line or quote and confirm it says what the work claims.
13
+ - Run the checks the brief lists that the `afm` tools offer (the gate, the doctor, the index), alone and one
14
+ at a time, and report their exact output. You have no shell: a check that needs one is a check you did
15
+ not run, and you say so.
16
+ - Report a finding only with its evidence: the path and line, the rule it breaks, and the concrete
17
+ input or state that fails. A suspicion with no evidence is not a finding.
18
+ - Say what you did not check.
19
+
20
+ End with one verdict line: PASS when no finding stands, FAIL otherwise, followed by the findings
21
+ most severe first.
@@ -0,0 +1,85 @@
1
+ {
2
+ "description": "AFM: injects the rules, gotchas and doctrine of /docs into the session, gates a commit and a doc edit before they run, and records the work. Silent outside an AFM project; a bug in a hook never stops the session.",
3
+ "hooks": {
4
+ "SessionStart": [
5
+ {
6
+ "matcher": "startup|clear|compact",
7
+ "hooks": [
8
+ {
9
+ "type": "command",
10
+ "command": "afm hook SessionStart",
11
+ "timeout": 10
12
+ }
13
+ ]
14
+ }
15
+ ],
16
+ "PreToolUse": [
17
+ {
18
+ "matcher": "Write|Edit|MultiEdit",
19
+ "hooks": [
20
+ {
21
+ "type": "command",
22
+ "command": "afm hook PreToolUse",
23
+ "timeout": 5
24
+ }
25
+ ]
26
+ },
27
+ {
28
+ "matcher": "Bash",
29
+ "hooks": [
30
+ {
31
+ "type": "command",
32
+ "command": "afm hook PreToolUse",
33
+ "timeout": 20
34
+ }
35
+ ]
36
+ }
37
+ ],
38
+ "PostToolUse": [
39
+ {
40
+ "matcher": "Write|Edit|MultiEdit|Bash|Skill",
41
+ "hooks": [
42
+ {
43
+ "type": "command",
44
+ "command": "afm hook PostToolUse",
45
+ "timeout": 5
46
+ }
47
+ ]
48
+ }
49
+ ],
50
+ "PostToolUseFailure": [
51
+ {
52
+ "matcher": "Bash",
53
+ "hooks": [
54
+ {
55
+ "type": "command",
56
+ "command": "afm hook PostToolUseFailure",
57
+ "timeout": 5
58
+ }
59
+ ]
60
+ }
61
+ ],
62
+ "SubagentStart": [
63
+ {
64
+ "hooks": [
65
+ {
66
+ "type": "command",
67
+ "command": "afm hook SubagentStart",
68
+ "timeout": 5
69
+ }
70
+ ]
71
+ }
72
+ ],
73
+ "Stop": [
74
+ {
75
+ "hooks": [
76
+ {
77
+ "type": "command",
78
+ "command": "afm hook Stop",
79
+ "timeout": 10
80
+ }
81
+ ]
82
+ }
83
+ ]
84
+ }
85
+ }
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: adr
3
+ description: |
4
+ Writes an Architecture Decision Record to `<consumer>/docs/adr/NNNN-slug.md`. It records context, decision, alternatives and consequence. In a refactored project, write a retroactive ADR only when it is load-bearing.
5
+ Activates: `/afm:adr`, "create ADR", "architectural decision", "record this architecture choice".
6
+ ---
7
+
8
+ # AFM — ADR
9
+
10
+ > **Questions in this host.** `afm ask <op>` prompts only in a terminal, and the Bash tool has none: it exits 2. Run `afm ask <op> --json` instead and put each pending question to the operator with `AskUserQuestion`: its `header`, `prompt` and `options` as they come, the recommended option first, `multiSelect` as given. Then record each choice with `afm answer <op> <id> <label>` (one label per selected option). Run `afm ask <op>` again: `all questions answered` means the op may go on.
11
+
12
+ > **Procedure.** Run `afm read ops/adr.md` and follow it; read an on-demand section when its condition holds.
13
+
14
+ The CLI owns the number, the template, the frontmatter, the supersede link and the index. This skill keeps
15
+ only the judgment.
16
+
17
+ ## When NOT to activate
18
+
19
+ This is a disambiguation for a skill that already activated. It does not control activation itself. A
20
+ counterintuitive surprise belongs in `/afm:gotcha`. A rule with an executable trigger belongs in `/afm:rule`.
21
+
22
+ ## Pre-check
23
+
24
+ `afm preflight`. Exit 3 means there is no instance: stop and suggest `/afm:init` (greenfield) or
25
+ `/afm:refactor` (brownfield) first. Exit 4 means the shipped content does not resolve: report it, do not
26
+ fall back silently.
27
+
28
+ ## Procedure (judgment only)
29
+
30
+ 1. Ask the status: `afm ask adr`. Collect the title, context, decision, alternatives, consequence and refs
31
+ as free text, because these fields carry intent.
32
+ 2. Run `afm adr new <slug> --title "<title>" --description "<one sentence>"`, with `--supersedes N` when
33
+ the decision replaces ADR N.
34
+ 3. Fill the sections of the printed file with what the operator said, and leave the rest `[TBD]`. Report the
35
+ path (#6).
36
+
37
+ The "Additional step in a refactored project" in the op applies ONLY when `/afm:refactor` adopted the
38
+ project (signal: `afm.md` § 3.1 forward-only exists). A greenfield project forbids a retroactive ADR.
39
+
40
+ ## Invariant principles
41
+
42
+ Additional #9 (a retroactive ADR is
43
+ load-bearing-only) applies ONLY in a refactored project.
44
+
45
+ Passive mode (`/afm:reconcile`) is always on and can propose `/afm:adr` when it detects a "novel structural
46
+ decision" signal. This skill covers only the active creation.
47
+
48
+ **Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: analyze
3
+ description: |
4
+ Cross-checks one feature against the instance. It compares `docs/features/NNN-*/{spec,plan,tasks}.md` with prd, ust, ach, afm § 3 and PRINCIPLES. It reports findings by severity in chat and writes no file.
5
+ Activates: `/afm:analyze [<feature>]`, "audit feature", "check coverage", "validate consistency before implementation".
6
+ ---
7
+
8
+ # AFM — Analyze
9
+
10
+ > **Questions in this host.** `afm ask <op>` prompts only in a terminal, and the Bash tool has none: it exits 2. Run `afm ask <op> --json` instead and put each pending question to the operator with `AskUserQuestion`: its `header`, `prompt` and `options` as they come, the recommended option first, `multiSelect` as given. Then record each choice with `afm answer <op> <id> <label>` (one label per selected option). Run `afm ask <op>` again: `all questions answered` means the op may go on.
11
+
12
+ > **Procedure.** Run `afm read ops/analyze.md` and follow it; read an on-demand section when its condition holds.
13
+
14
+ ## When NOT to activate
15
+
16
+ Use `/afm:clarify` to resolve markers interactively. Use `/afm:deliver` for end-to-end delivery: it runs analyze underneath, in gating mode. Use `/afm:diagnose` for the health of the whole doc set.
17
+
18
+ ## Pre-check
19
+
20
+ Run `afm preflight` (exit 3: no `docs/.afm-version`, stop and suggest `/afm:init` or `/afm:refactor`).
21
+
22
+ ## Procedure
23
+
24
+ Start from the mechanical findings: `afm feature lint <NNN> --json` covers the passes A, C, D, E and the structure of `tasks.md`. Add the judgment on top (constitution violations, duplication, the semantic side of inconsistency and ambiguity), build the coverage table, assign severities by the matrix, and report in chat with metrics. Close with the `remediation` question (`afm ask analyze`); a remediation that adds a task runs `afm task add`, never a hand edit of the `tasks:` list, and a task is closed only with `afm task done`. Gating mode sorts findings into buckets instead of reporting.
25
+
26
+ ## Invariant principles
27
+
28
+ Most relevant here: #2 (detection is an autonomous scan, not a question), #5 (no finding without evidence) and #6 (analyze is read-only: it reports in chat, writes no file, and remediates only on request).
29
+
30
+ ## Continuous doctrine
31
+
32
+ Passive mode (`/afm:reconcile`) is always on. This skill covers only active auditing.
33
+
34
+ **Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
@@ -0,0 +1,34 @@
1
+ ---
2
+ name: clarify
3
+ description: |
4
+ Scans one feature for ambiguity. It asks the irreducible questions, recommendation first, and writes the answers to `spec.md § 7 Clarifications`.
5
+ Activates: `/afm:clarify [<feature>]`, "resolve markers", "clear up ambiguity in feature X", "clarify the spec".
6
+ ---
7
+
8
+ # AFM — Clarify
9
+
10
+ > **Questions in this host.** `afm ask <op>` prompts only in a terminal, and the Bash tool has none: it exits 2. Run `afm ask <op> --json` instead and put each pending question to the operator with `AskUserQuestion`: its `header`, `prompt` and `options` as they come, the recommended option first, `multiSelect` as given. Then record each choice with `afm answer <op> <id> <label>` (one label per selected option). Run `afm ask <op>` again: `all questions answered` means the op may go on.
11
+
12
+ > **Procedure.** Run `afm read ops/clarify.md` and follow it; read an on-demand section when its condition holds.
13
+
14
+ ## When NOT to activate
15
+
16
+ Use `/afm:analyze` for a read-only, multi-artifact validation that does not resolve markers. Use `/afm:deliver` for end-to-end delivery: it calls clarify underneath when needed.
17
+
18
+ ## Pre-check
19
+
20
+ Run `afm preflight` (exit 3: no `docs/.afm-version`, stop and suggest `/afm:init` or `/afm:refactor`). `afm feature status <NNN> --json` lists the open markers of a feature in `blockers`.
21
+
22
+ ## Procedure
23
+
24
+ Judgment only: a 9-category scan of the spec, a prioritized queue (at most 5 questions), auto-resolution from the code and docs before any question, then one recommendation-first question per turn. The questions come from the spec, so they are dynamic; the one fixed decision (`underspecified`) is in `afm ask clarify`. Integrate each answer into `spec.md` at once, remove the marker, and finish with the coverage summary.
25
+
26
+ ## Invariant principles
27
+
28
+ Most relevant here: #2 is discover-first: resolve each question yourself through the scan or the docs, then ask. #4 says `[TBD]` beats invention, and a recommendation is a rejectable hypothesis, not a guess. #6 is autonomy-first: write the integration into spec § 7 and report. #8 is recommendation-first questions.
29
+
30
+ ## Continuous doctrine
31
+
32
+ Passive mode (`/afm:reconcile`) is always on. This skill covers only the active resolution of ambiguity.
33
+
34
+ **Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: deliver
3
+ description: |
4
+ Delivers one feature from discovery to reconciliation. It takes one recorded approval (`afm approve`), writes spec, plan and tasks, then runs each task as RED, GREEN, REFACTOR, COMMIT. It resumes from the correct phase when those files exist. Orchestrator: it composes specify, plan, tasks, clarify, analyze and reconcile. External research is not an AFM op; it routes to nasca.
5
+ Activates: `/afm:deliver [<feature>]`, "build feature X", "implement X end to end", "the tasks already exist, run them", "continue the delivery of feature N".
6
+ ---
7
+
8
+ # AFM — Deliver (orchestrated autonomous delivery)
9
+
10
+ > **Procedure.** Run `afm read ops/deliver.md` and follow it; read an on-demand section when its condition holds.
11
+
12
+ The **orchestrator** of the delivery loop. One request takes "build feature X" from discovery to a delivered feature. It does not duplicate the sub-steps: it reads and follows `/afm:specify`, `/afm:plan`, `/afm:tasks`, `/afm:clarify`, `/afm:analyze` and `/afm:reconcile` through a suppression contract. External unknowns go through `/nasca:research`, or `/nasca:campaign` for a deep study; ask the operator if nasca is missing.
13
+
14
+ ## When NOT to activate
15
+
16
+ An isolated step ("just open the spec", "just generate the tasks") is the matching atomic skill. A trivial change goes straight to the `afm.md § 2` loop.
17
+
18
+ ## Pre-check
19
+
20
+ Run `afm preflight`. Exit 0 continues. Exit 3 means no `docs/.afm-version`: stop and suggest `/afm:init` (greenfield) or `/afm:refactor` (brownfield). Exit 4 or 5: report the line it printed. Do not fall back silently.
21
+
22
+ ## Most relevant here
23
+
24
+ **#2** (discover-first: resolve unknowns by scan and research, ask only the irreducible part, never guess product or criteria) and **#6** (autonomy-first: approval at checkpoint granularity, the consolidated plan IS the proposal).
25
+
26
+ ## Continuous doctrine
27
+
28
+ Passive mode (`/afm:reconcile`) is always on. It runs in parallel with `/afm:deliver` and takes the closing turn of Phase 4 (`core/afm.md` § 8.5 plus a passive sweep).
29
+
30
+ **Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: diagnose
3
+ description: |
4
+ Scans the health of the local docs on 7 axes. The axes are dead reference, stale marker, instance-to-plugin drift, broken ADR chain, dead rule trigger, inflation or orphan, and cross-doc contradiction. It reads only `<consumer>/docs/` and returns evidence as `command + file:line`. It proposes no edit.
5
+ Activates: `/afm:diagnose`, "diagnose the methodology", "what is broken in the docs?", "run the AFM health check".
6
+ ---
7
+
8
+
9
+ # AFM — Diagnose (mechanical weakness-mining, read-only)
10
+
11
+ > **Procedure.** Run `afm read ops/diagnose.md` and follow it; read an on-demand section when its condition holds.
12
+
13
+ > **Carve-out (does not overlap existing ops):** `/afm:analyze` audits **one feature**. `diagnose` audits the **whole instance** of `/docs/`. `/afm:reflect` uses **behavioral** evidence, where the agent stumbled. `diagnose` is **static**, based on filesystem and git. `/afm:evolve` is the **orchestrator**. It combines `diagnose` (mechanical evidence) with `/afm:reflect` (behavioral evidence) into one proposal and one gate. `diagnose` is **read-only**. It never proposes an edit or opens a gate.
14
+
15
+ ## When NOT to activate
16
+
17
+ This section disambiguates for a skill that already activated. It does not define activation, so it stays in the body, not in the resident listing.
18
+
19
+ Validation of ONE feature is `/afm:analyze`. Behavioral friction, where a doc misguided the agent at apply time, is `/afm:reflect`. Proposing or applying a fix is `/afm:evolve` (the full cycle, which includes diagnose).
20
+
21
+ ## Pre-check
22
+
23
+ 1. **Does `<consumer>/docs/.afm-version` exist?** If not, stop. Suggest `/afm:init` (greenfield) or `/afm:refactor` (brownfield) first.
24
+ 2. **Does `afm preflight` exit 0?** A non-zero exit says why (docs not bootstrapped, content unresolved, pin mismatch). Report it to the user. Do not fall back silently.
25
+
26
+ ## Procedure
27
+
28
+ The procedure has two phases. **Phase 0 — Scan** is gap-driven. Run `afm doctor --json`: it checks A1-A6, staleness and dead gotchas mechanically, and every finding carries a command plus `file:line`. You add A7 yourself. All 7 axes are checked, every time.
29
+
30
+ Axis A7, cross-doc contradiction, uses a paired read. That read applies an anti-false-positive layer test. An axis that cannot be covered becomes "not-covered: <reason>".
31
+
32
+ **Phase 1 — Diagnosis** has the ANALYZER role. **It must not propose an edit.** The signature is φ = `(symptom, causal-status-of-behavior, mechanism)`.
33
+
34
+ Phase 1 requires rival mechanisms, for example "agent non-compliant" versus "target legitimately removed". It applies an addressability filter and a self-sufficient severity matrix.
35
+
36
+ **Output** is an evidence bundle ordered by severity. Run à la carte, the skill prints the report to chat. It does not write to disk. It opens no gate. Under `/afm:evolve`, it feeds the proposal instead.
37
+
38
+ This scan has no cooldown. It is read-only and cheap. The cycle's cooldown belongs to the orchestrator.
39
+
40
+ ## Invariant principles
41
+
42
+ Most relevant here: #2 (discover-first — diagnose with evidence before any proposal). Also #3 (mechanize-or-demote — the checks must pass the test they audit). Also #5 (no finding without evidence external to the text).
43
+
44
+ **No new principle here.** `diagnose` is a composed materialization. The doctrine lives in the op file.
45
+
46
+ **Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.