@tenkara/afm-linux-arm64 4.0.0-alpha.7 → 4.0.0-alpha.9

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 (151) hide show
  1. package/bin/afm +2 -2
  2. package/content/CHANGELOG.md +50 -0
  3. package/content/PRINCIPLES.md +0 -2
  4. package/content/README-light.md +0 -2
  5. package/content/README.md +0 -2
  6. package/content/core/ach.md +0 -5
  7. package/content/core/afm.md +24 -6
  8. package/content/core/prd.md +0 -2
  9. package/content/core/protocol.md +1 -3
  10. package/content/hooks/README.md +0 -2
  11. package/content/interview/bootstrap.md +4 -2
  12. package/content/interview/promotion.md +0 -2
  13. package/content/interview/refactor.md +0 -2
  14. package/content/interview/triggers.md +0 -2
  15. package/content/modules/vireya-ui/ach.patch.md +1 -1
  16. package/content/ops/analyze.md +8 -7
  17. package/content/ops/deliver.md +23 -25
  18. package/content/ops/diagnose.md +1 -4
  19. package/content/ops/evolve.md +62 -13
  20. package/content/ops/export-template.md +1 -1
  21. package/content/ops/generalize.md +1 -4
  22. package/content/ops/policy.md +0 -2
  23. package/content/ops/reflect.md +19 -17
  24. package/content/ops/remediate.md +1 -4
  25. package/content/ops/restructure.md +3 -6
  26. package/content/ops/rule.md +0 -2
  27. package/content/ops/tasks.md +18 -18
  28. package/content/ops/update.md +29 -4
  29. package/content/ops/verify.md +0 -2
  30. package/content/questions/init.questions.yaml +13 -0
  31. package/content/roles/explorer.md +1 -1
  32. package/content/roles/reviewer.md +1 -1
  33. package/content/rubrics/failure-classification.md +0 -2
  34. package/content/rubrics/solid-triggers.md +0 -2
  35. package/content/skills/adr.md +3 -3
  36. package/content/skills/analyze.md +3 -9
  37. package/content/skills/clarify.md +2 -8
  38. package/content/skills/deliver.md +4 -20
  39. package/content/skills/diagnose.md +3 -11
  40. package/content/skills/evolve.md +6 -30
  41. package/content/skills/export-template.md +2 -5
  42. package/content/skills/generalize.md +6 -22
  43. package/content/skills/gotcha.md +3 -3
  44. package/content/skills/init.md +2 -7
  45. package/content/skills/plan.md +3 -9
  46. package/content/skills/policy.md +0 -6
  47. package/content/skills/promote.md +1 -3
  48. package/content/skills/protocol.md +2 -3
  49. package/content/skills/reconcile.md +2 -6
  50. package/content/skills/refactor.md +2 -7
  51. package/content/skills/reflect.md +7 -17
  52. package/content/skills/remediate.md +3 -9
  53. package/content/skills/restructure.md +8 -14
  54. package/content/skills/rule.md +3 -4
  55. package/content/skills/specify.md +3 -9
  56. package/content/skills/tasks.md +5 -15
  57. package/content/skills/update.md +6 -4
  58. package/content/skills/verify.md +1 -3
  59. package/content/templates/adr.template.md +1 -1
  60. package/content/templates/evolution-report.template.md +5 -2
  61. package/content/templates/feature-plan.template.md +0 -2
  62. package/content/templates/feature-research.template.md +1 -2
  63. package/content/templates/feature-spec.template.md +1 -1
  64. package/content/templates/feature-tasks.induced.template.md +58 -34
  65. package/content/templates/feature-tasks.template.md +56 -34
  66. package/content/templates/protocols/p1.md +1 -1
  67. package/content/templates/protocols/p2.md +1 -1
  68. package/content/templates/protocols/p3.md +1 -1
  69. package/package.json +1 -1
  70. package/plugin/agy/plugin.json +1 -1
  71. package/plugin/agy/skills/afm-adr/SKILL.md +7 -3
  72. package/plugin/agy/skills/afm-analyze/SKILL.md +5 -7
  73. package/plugin/agy/skills/afm-clarify/SKILL.md +4 -6
  74. package/plugin/agy/skills/afm-deliver/SKILL.md +6 -20
  75. package/plugin/agy/skills/afm-diagnose/SKILL.md +5 -9
  76. package/plugin/agy/skills/afm-evolve/SKILL.md +9 -29
  77. package/plugin/agy/skills/afm-export-template/SKILL.md +6 -5
  78. package/plugin/agy/skills/afm-generalize/SKILL.md +8 -20
  79. package/plugin/agy/skills/afm-gotcha/SKILL.md +7 -3
  80. package/plugin/agy/skills/afm-init/SKILL.md +3 -6
  81. package/plugin/agy/skills/afm-plan/SKILL.md +5 -7
  82. package/plugin/agy/skills/afm-policy/SKILL.md +2 -4
  83. package/plugin/agy/skills/afm-promote/SKILL.md +4 -2
  84. package/plugin/agy/skills/afm-protocol/SKILL.md +6 -3
  85. package/plugin/agy/skills/afm-reconcile/SKILL.md +5 -5
  86. package/plugin/agy/skills/afm-refactor/SKILL.md +3 -6
  87. package/plugin/agy/skills/afm-reflect/SKILL.md +9 -15
  88. package/plugin/agy/skills/afm-remediate/SKILL.md +5 -7
  89. package/plugin/agy/skills/afm-restructure/SKILL.md +10 -12
  90. package/plugin/agy/skills/afm-rule/SKILL.md +7 -4
  91. package/plugin/agy/skills/afm-specify/SKILL.md +5 -7
  92. package/plugin/agy/skills/afm-tasks/SKILL.md +7 -13
  93. package/plugin/agy/skills/afm-update/SKILL.md +10 -4
  94. package/plugin/agy/skills/afm-verify/SKILL.md +4 -2
  95. package/plugin/claude-code/.claude-plugin/plugin.json +1 -1
  96. package/plugin/claude-code/agents/afm-explorer.md +1 -1
  97. package/plugin/claude-code/agents/afm-reviewer.md +1 -1
  98. package/plugin/claude-code/skills/adr/SKILL.md +7 -3
  99. package/plugin/claude-code/skills/analyze/SKILL.md +5 -7
  100. package/plugin/claude-code/skills/clarify/SKILL.md +4 -6
  101. package/plugin/claude-code/skills/deliver/SKILL.md +6 -20
  102. package/plugin/claude-code/skills/diagnose/SKILL.md +5 -9
  103. package/plugin/claude-code/skills/evolve/SKILL.md +9 -29
  104. package/plugin/claude-code/skills/export-template/SKILL.md +6 -5
  105. package/plugin/claude-code/skills/generalize/SKILL.md +8 -20
  106. package/plugin/claude-code/skills/gotcha/SKILL.md +7 -3
  107. package/plugin/claude-code/skills/init/SKILL.md +3 -6
  108. package/plugin/claude-code/skills/plan/SKILL.md +5 -7
  109. package/plugin/claude-code/skills/policy/SKILL.md +2 -4
  110. package/plugin/claude-code/skills/promote/SKILL.md +4 -2
  111. package/plugin/claude-code/skills/protocol/SKILL.md +6 -3
  112. package/plugin/claude-code/skills/reconcile/SKILL.md +5 -5
  113. package/plugin/claude-code/skills/refactor/SKILL.md +3 -6
  114. package/plugin/claude-code/skills/reflect/SKILL.md +9 -15
  115. package/plugin/claude-code/skills/remediate/SKILL.md +5 -7
  116. package/plugin/claude-code/skills/restructure/SKILL.md +10 -12
  117. package/plugin/claude-code/skills/rule/SKILL.md +7 -4
  118. package/plugin/claude-code/skills/specify/SKILL.md +5 -7
  119. package/plugin/claude-code/skills/tasks/SKILL.md +7 -13
  120. package/plugin/claude-code/skills/update/SKILL.md +10 -4
  121. package/plugin/claude-code/skills/verify/SKILL.md +4 -2
  122. package/plugin/opencode/afm/index.js +245 -0
  123. package/plugin/opencode/afm/tui.js +21 -0
  124. package/plugin/opencode/agents/afm-executor.md +22 -14
  125. package/plugin/opencode/agents/afm-explorer.md +73 -28
  126. package/plugin/opencode/agents/afm-reviewer.md +73 -28
  127. package/plugin/opencode/skills/afm-adr/SKILL.md +7 -3
  128. package/plugin/opencode/skills/afm-analyze/SKILL.md +5 -7
  129. package/plugin/opencode/skills/afm-clarify/SKILL.md +4 -6
  130. package/plugin/opencode/skills/afm-deliver/SKILL.md +6 -20
  131. package/plugin/opencode/skills/afm-diagnose/SKILL.md +5 -9
  132. package/plugin/opencode/skills/afm-evolve/SKILL.md +9 -29
  133. package/plugin/opencode/skills/afm-export-template/SKILL.md +6 -5
  134. package/plugin/opencode/skills/afm-generalize/SKILL.md +8 -20
  135. package/plugin/opencode/skills/afm-gotcha/SKILL.md +7 -3
  136. package/plugin/opencode/skills/afm-init/SKILL.md +3 -6
  137. package/plugin/opencode/skills/afm-plan/SKILL.md +5 -7
  138. package/plugin/opencode/skills/afm-policy/SKILL.md +2 -4
  139. package/plugin/opencode/skills/afm-promote/SKILL.md +4 -2
  140. package/plugin/opencode/skills/afm-protocol/SKILL.md +6 -3
  141. package/plugin/opencode/skills/afm-reconcile/SKILL.md +5 -5
  142. package/plugin/opencode/skills/afm-refactor/SKILL.md +3 -6
  143. package/plugin/opencode/skills/afm-reflect/SKILL.md +9 -15
  144. package/plugin/opencode/skills/afm-remediate/SKILL.md +5 -7
  145. package/plugin/opencode/skills/afm-restructure/SKILL.md +10 -12
  146. package/plugin/opencode/skills/afm-rule/SKILL.md +7 -4
  147. package/plugin/opencode/skills/afm-specify/SKILL.md +5 -7
  148. package/plugin/opencode/skills/afm-tasks/SKILL.md +7 -13
  149. package/plugin/opencode/skills/afm-update/SKILL.md +10 -4
  150. package/plugin/opencode/skills/afm-verify/SKILL.md +4 -2
  151. package/plugin/opencode/afm.js +0 -196
@@ -3,7 +3,7 @@ role: explorer
3
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
4
  steps: 60
5
5
  capabilities: read, search, web
6
- mcpTools: approve, config, detect, doctor, failures_promotable, feature_lint, feature_status, gate, index, lang, next_id, path, policy, preflight, version
6
+ mcpTools: approve, config, detect, doctor, failures_promotable, feature_lint, feature_status, gate, index, lang, next_id, path, policy, preflight, read, sessions, sessions_signals, version
7
7
  cliDoor: false
8
8
  ---
9
9
  You are an explorer. The message that dispatched you is your brief: follow it.
@@ -2,7 +2,7 @@
2
2
  role: reviewer
3
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
4
  capabilities: read, search, web
5
- mcpTools: approve, config, detect, doctor, failures_promotable, feature_lint, feature_status, gate, index, lang, next_id, path, policy, preflight, version
5
+ mcpTools: approve, config, detect, doctor, failures_promotable, feature_lint, feature_status, gate, index, lang, next_id, path, policy, preflight, read, sessions, sessions_signals, version
6
6
  cliDoor: false
7
7
  ---
8
8
  You are a reviewer. The message that dispatched you is your brief: follow it.
@@ -9,8 +9,6 @@ fires_when: 'a failure was recognized by an external signal and needs a destinat
9
9
 
10
10
  # Rubric — failure classification (mechanizable → guardrail | mechanical → procedure | conceptual → learning | transient → nothing)
11
11
 
12
- > **In this file:** Entry gate (common to all three) · The four destinations · Decision flow · Anti-patterns
13
-
14
12
  > The CRITIC loop (`ops/remediate.md`) uses this rubric to remediate a failure recognized and recorded in the state store (`afm failures record`). The discriminator is **executable**. It is not a "feeling". Ancestor: CRITIC (arXiv 2305.11738) — recognize a failure only by external signal. Self-criticism without a tool degrades (PRINCIPLES #3).
15
13
 
16
14
  ## Entry gate (common to all three)
@@ -11,8 +11,6 @@ fires_when: 'a file name collects unrelated responsibilities, or a provider `swi
11
11
 
12
12
  # Rubric — SOLID as a concrete trigger (not folklore)
13
13
 
14
- > **In this file:** SRP — Single Responsibility · OCP — Open/Closed: extend without modifying · LSP — Liskov Substitution: interchangeable implementations · ISP — Interface Segregation: minimal port · DIP — Dependency Inversion: domain does not know infra · Summary — what to ask when
15
-
16
14
 
17
15
  SOLID is easy to use as an argument and hard to use as a trigger. This rubric converts each principle into a **mechanical trigger** — when to apply it, the anti-pattern, an example.
18
16
 
@@ -7,8 +7,8 @@ description: |
7
7
 
8
8
  # AFM — ADR
9
9
 
10
- Atomic skill of `afm`. The canonical procedure is the op `afm path ops/adr`. The CLI owns the number, the
11
- template, the frontmatter, the supersede link and the index. This skill keeps only the judgment.
10
+ The CLI owns the number, the template, the frontmatter, the supersede link and the index. This skill keeps
11
+ only the judgment.
12
12
 
13
13
  ## When NOT to activate
14
14
 
@@ -35,7 +35,7 @@ project (signal: `afm.md` § 3.1 forward-only exists). A greenfield project forb
35
35
 
36
36
  ## Invariant principles
37
37
 
38
- Single canonical source: `afm path PRINCIPLES`. Universals §1-8 apply. Additional #9 (a retroactive ADR is
38
+ Additional #9 (a retroactive ADR is
39
39
  load-bearing-only) applies ONLY in a refactored project.
40
40
 
41
41
  Passive mode (`afm reconcile`) is always on and can propose `afm adr` when it detects a "novel structural
@@ -7,8 +7,6 @@ description: |
7
7
 
8
8
  # AFM — Analyze
9
9
 
10
- An atomic skill. The procedure lives in the op: read it with `afm path ops/analyze.md`, end to end, and follow it exactly.
11
-
12
10
  ## When NOT to activate
13
11
 
14
12
  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.
@@ -19,16 +17,12 @@ Run `afm preflight` (exit 3: no `docs/.afm-version`, stop and suggest `afm init`
19
17
 
20
18
  ## Procedure
21
19
 
22
- 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`). Gating mode sorts findings into buckets instead of reporting.
20
+ 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.
23
21
 
24
22
  ## Invariant principles
25
23
 
26
- Single canonical source: `afm path PRINCIPLES.md`. Universals §1-8 apply, especially #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).
24
+ 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).
27
25
 
28
26
  ## Continuous doctrine
29
27
 
30
- Passive mode is the always-on `reconcile` skill. This skill covers only active auditing.
31
-
32
- ## Version
33
-
34
- `afm version`. History: `afm path CHANGELOG.md`.
28
+ Passive mode (`afm reconcile`) is always on. This skill covers only active auditing.
@@ -7,8 +7,6 @@ description: |
7
7
 
8
8
  # AFM — Clarify
9
9
 
10
- An atomic skill. The procedure lives in the op: read it with `afm path ops/clarify.md`, end to end, and follow it literally.
11
-
12
10
  ## When NOT to activate
13
11
 
14
12
  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.
@@ -23,12 +21,8 @@ Judgment only: a 9-category scan of the spec, a prioritized queue (at most 5 que
23
21
 
24
22
  ## Invariant principles
25
23
 
26
- Single canonical source: `afm path PRINCIPLES.md`. Universals §1-8 apply. #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.
24
+ 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.
27
25
 
28
26
  ## Continuous doctrine
29
27
 
30
- Passive mode is the always-on `reconcile` skill. This skill covers only the active resolution of ambiguity.
31
-
32
- ## Version
33
-
34
- `afm version`. History: `afm path CHANGELOG.md`.
28
+ Passive mode (`afm reconcile`) is always on. This skill covers only the active resolution of ambiguity.
@@ -7,7 +7,7 @@ description: |
7
7
 
8
8
  # AFM — Deliver (orchestrated autonomous delivery)
9
9
 
10
- The **orchestrator** of the delivery loop. One request takes "build feature X" from discovery to a delivered feature. The procedure lives in the op: read it with `afm path ops/deliver.md`, end to end, and follow it literally. It does not duplicate the sub-steps: it reads and follows `specify`, `plan`, `tasks`, `clarify`, `analyze` and `reconcile` through a suppression contract.
10
+ 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 {{host:nasca-research}}, or {{host:nasca-campaign}} for a deep study; ask the operator if nasca is missing.
11
11
 
12
12
  ## When NOT to activate
13
13
 
@@ -17,26 +17,10 @@ An isolated step ("just open the spec", "just generate the tasks") is the matchi
17
17
 
18
18
  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.
19
19
 
20
- ## Procedure
20
+ ## Most relevant here
21
21
 
22
- The CLI holds the state; the skill keeps only the judgment. Drive the loop with `afm feature status <NNN> --json`, which returns the phase to resume at, the next task and the blockers.
23
-
24
- - **Discovery:** scan scoped to the feature, external unknowns through the nasca research flow (`nasca-research`, or `nasca-campaign` for a deep study; ask the operator if nasca is missing), unknowns sorted into resolved-by-scan, researchable and irreducible. One batched, recommendation-first round, capped by the protocol (`afm protocol`).
25
- - **Draft:** spec, plan and tasks, verified with `afm feature lint <NNN>` plus the judgment passes of `analyze`.
26
- - **Gate:** the earned questions plus the `outcome` question (`afm ask deliver`), then `afm approve <NNN>`. An explicit "go" skips the questions, never the record.
27
- - **Execute:** each task is one `core/afm.md` § 2 cycle, checked with `afm gate --staged`, then `afm task done <NNN> <Txxx>`. Halt on a non-`[P]` failure after the capped retry.
28
- - **Reconcile:** § 8.5 plus a passive sweep.
29
-
30
- If artifacts already exist, resume from the correct phase, including "tasks already exist, run from the first `[ ]`".
31
-
32
- ## Invariant principles
33
-
34
- Single canonical source: `afm path PRINCIPLES.md`. Universals §1-8 apply. The backbone is **#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).
22
+ **#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).
35
23
 
36
24
  ## Continuous doctrine
37
25
 
38
- Passive mode is the always-on `reconcile` skill. It runs in parallel with `deliver` and takes the closing turn of Phase 4.
39
-
40
- ## Version
41
-
42
- `afm version`. History: `afm path CHANGELOG.md`.
26
+ 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).
@@ -8,9 +8,7 @@ description: |
8
8
 
9
9
  # AFM — Diagnose (mechanical weakness-mining, read-only)
10
10
 
11
- This is a mechanism skill of AFM. The canonical procedure is the op file that `afm path ops/diagnose.md` prints.
12
-
13
- > **Carve-out (does not overlap existing ops):** `analyze` audits **one feature**. `diagnose` audits the **whole instance** of `/docs/`. `reflect` uses **behavioral** evidence, where the agent stumbled. `diagnose` is **static**, based on filesystem and git. `evolve` is the **orchestrator**. It combines `diagnose` (mechanical evidence) with `reflect` (behavioral evidence) into one proposal and one gate. `diagnose` is **read-only**. It never proposes an edit or opens a gate.
11
+ > **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
12
 
15
13
  ## When NOT to activate
16
14
 
@@ -25,8 +23,6 @@ Validation of ONE feature is `afm analyze`. Behavioral friction, where a doc mis
25
23
 
26
24
  ## Procedure
27
25
 
28
- Read the op (`afm path ops/diagnose.md`) end to end. Follow it literally.
29
-
30
26
  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.
31
27
 
32
28
  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>".
@@ -35,16 +31,12 @@ Axis A7, cross-doc contradiction, uses a paired read. That read applies an anti-
35
31
 
36
32
  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.
37
33
 
38
- **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 `evolve`, it feeds the proposal instead.
34
+ **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.
39
35
 
40
36
  This scan has no cooldown. It is read-only and cheap. The cycle's cooldown belongs to the orchestrator.
41
37
 
42
38
  ## Invariant principles
43
39
 
44
- Single canonical source: `PRINCIPLES.md` (`afm path PRINCIPLES.md`). Universals §1-8 apply. Especially relevant: #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).
40
+ 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).
45
41
 
46
42
  **No new principle here.** `diagnose` is a composed materialization. The doctrine lives in the op file.
47
-
48
- ## Version
49
-
50
- Content version: `afm version` prints it.
@@ -10,9 +10,7 @@ description: |
10
10
 
11
11
  This is an orchestrator skill of AFM. The canonical procedure is the op file that `afm path ops/evolve.md` prints.
12
12
 
13
- > **Conductor, not executor** (same pattern as `deliver`). `evolve` owns 3 things that no mechanism owns alone: (1) the evidence-collection driver for the whole instance (combines `diagnose` + `reflect`), (2) the split into buckets plus the single gate, (3) the apply driver, post-conditions, and the log/lineage record. It reads and follows everything else from the mechanisms, through a suppression contract.
14
- >
15
- > **Carve-outs (it does not override existing ops):** `diagnose`/`reflect`/`generalize`/`restructure` are the **mechanisms** (each runs à la carte). `analyze` audits **one feature** (read-only). `reconcile` proposes **one single edit** at the end of a turn. `promote` **records** a finding meant for the plugin (it does not edit the plugin). `evolve` is the **cycle** that chains the mechanisms with one gate and one log — the level no other op covers.
13
+ > **Carve-outs (it does not override existing ops):** `afm diagnose`, `afm reflect`, `afm generalize` and `afm restructure` are the **mechanisms** (each runs à la carte). `afm analyze` audits **one feature** (read-only). Passive mode (`afm reconcile`) proposes **one single edit** at the end of a turn. `afm promote` **records** a finding meant for the plugin (it does not edit the plugin). `evolve` is the **cycle** that chains the mechanisms with one gate and one log — the level no other op covers.
16
14
 
17
15
  ## When NOT to activate
18
16
 
@@ -20,7 +18,7 @@ This section helps someone who already activated the skill decide if it fits. It
20
18
 
21
19
  Use a single mechanism instead when the need is narrow. A report is `afm diagnose`. Refining a doc that misled you is `afm reflect`. Merging gotchas is `afm generalize`.
22
20
 
23
- A structure or staleness check is `afm restructure`. A version bump is `afm update`. `reconcile` proposes a one-off additive signal (new gotcha, rule, or ADR) directly.
21
+ A structure or staleness check is `afm restructure`. A version bump is `afm update`. Passive mode (`afm reconcile`) proposes a one-off additive signal (new gotcha, rule, or ADR) directly.
24
22
 
25
23
  A feature-level check is `afm analyze` or `afm deliver`. Recording a finding for the plugin is `afm promote`.
26
24
 
@@ -32,36 +30,14 @@ A feature-level check is `afm analyze` or `afm deliver`. Recording a finding for
32
30
 
33
31
  ## Procedure
34
32
 
35
- Read the op (`afm path ops/evolve.md`) end to end and follow it exactly. The op has 5 phases.
36
-
37
- **Phase 1 — Evidence collection.** Combine two sources through the suppression contract. `diagnose` is the mechanical scan of the 7 axes (`afm doctor --json` plus the A7 reading), read-only. `reflect` is behavioral evidence of docs that misled the agent. Run `generalize`/`restructure` on demand, when their own trigger signal fires. An empty diagnosis counts as a valid result.
38
-
39
- **Phase 2 — Proposal.** This phase plays the IMPROVER role. Apply the op's **shared proposal discipline**: retrieval before create, then a dry run before the gate. Split the proposals into 3 buckets.
40
-
41
- A non-restorable change always goes through the gate. It never invents its own target. Decide here whether to downgrade, archive, or merge an artifact. Cap bucket (b) at 8 items per cycle (`afm evolve gate-check --critical <n> --high <n> --medium <n> --low <n>` computes what to ask and what to stage). Recurring failures come from `afm failures promotable`.
42
-
43
- **Phase 3 — Single gate.** Ask item by item with `afm ask evolve --scope <item-slug>`, at most 4 questions per call. This gate is never skippable — there is no "go" shortcut.
44
-
45
- **Phase 4 — Apply and post-conditions.** Re-run `afm doctor --json`, `afm index --check` and `afm detect --for <file>` over the touched docs, and confirm the content root is clean (`git status`, or a timestamp check with no git).
46
-
47
- **Phase 5 — Log.** Record the cycle in `docs/evolution/NNN-<date>.md`. Suggest `promote` when a finding generalizes beyond this instance.
33
+ Read the op (`afm path ops/evolve.md`) end to end and follow it exactly. The op has 5 phases: evidence collection (diagnose plus reflect), proposal in 3 buckets, a single gate (`afm ask evolve`), apply with post-conditions, and the log in `docs/evolution/`.
48
34
 
49
35
  Consult the rubric `rubrics/when-to-evolve-methodology.md` (`afm path rubrics/when-to-evolve-methodology.md`) to decide between a full cycle, a single mechanism, or a one-off fix.
50
36
 
51
- ## Invariant principles
37
+ ## Most relevant principles
52
38
 
53
- The single canonical source is `PRINCIPLES.md` (`afm path PRINCIPLES.md`). Universals §1-8 apply. #2 (discover-first) applies: diagnose with evidence before you propose. #3 (mechanize-or-downgrade) applies too: evolve's own signals must pass the same test evolve applies to others.
54
-
55
- #8 (earned questions, recommendation-first) also applies to this skill.
56
-
57
- #6 (autonomy-first with self-check) follows the pattern *produce → self-check → report*. The gate is the load-bearing residue. Bright lines for #7 plugin, deletion, and push still apply.
58
-
59
- **No new principle here** — evolve is a composed materialization. The doctrine lives in the op and the rubric.
39
+ #2 (discover-first): diagnose with evidence before you propose. #3 (mechanize-or-downgrade): evolve's own signals must pass the same test evolve applies to others. #6 (autonomy-first with self-check): the gate is the load-bearing residue, and the bright lines for #7 plugin, deletion, and push still apply. #8 (earned questions, recommendation-first).
60
40
 
61
41
  ## Continuous doctrine
62
42
 
63
- The `reconcile` skill owns passive mode, and it is always on. Reconcile may **suggest** `afm evolve` when it detects a Class B signal. That signal is a lived contradiction between docs, or perceived inflation at apply time. Only the user can invoke the full cycle.
64
-
65
- ## Version
66
-
67
- Content version: `afm version` prints it.
43
+ Passive mode (`afm reconcile`) is always on. It may **suggest** `afm evolve` when it detects a Class B signal. That signal is a lived contradiction between docs, or perceived inflation at apply time. Only the user can invoke the full cycle.
@@ -7,8 +7,7 @@ description: |
7
7
 
8
8
  # AFM — Export-template
9
9
 
10
- Atomic skill of `afm`. The canonical procedure is the op `afm path ops/export-template`. The CLI owns the plan,
11
- the diff and the marker. This skill keeps the judgment.
10
+ The CLI owns the plan, the diff and the marker. This skill keeps the judgment.
12
11
 
13
12
  ## When NOT to activate
14
13
 
@@ -32,9 +31,7 @@ stop and suggest `afm init` (greenfield) or `afm refactor` (brownfield) first.
32
31
 
33
32
  ## Invariant principles
34
33
 
35
- Single canonical source: `afm path PRINCIPLES`. Universals §1-8 apply.
36
-
37
- Especially #5 (do not invent metadata when the operator leaves it blank: use `[TBD]` in the JSON). Also #6
34
+ Most relevant here: #5 (do not invent metadata when the operator leaves it blank: use `[TBD]` in the JSON). Also #6
38
35
  (autonomy-first, but deleting files is a bright line): confirm the diff before you delete.
39
36
 
40
37
  Passive mode (`afm reconcile`) is always on. This skill focuses only on the active conversion to a template.
@@ -8,15 +8,13 @@ description: |
8
8
 
9
9
  # AFM — Generalize (semantic consolidation of gotchas)
10
10
 
11
- Mechanism skill of AFM. The canonical procedure is the op file that `afm path ops/generalize.md` prints.
12
-
13
- > **Carve-out (does not overlap existing ops):** `promote` **registers** a finding meant for the plugin. It does not write to the plugin. `generalize` merges **inside the instance** (N gotchas become 1 rule in the same `/docs/`). `reconcile` **adds** a new gotcha. `generalize` **merges** gotchas that already exist. `reflect` refines **one** doc. `generalize` consolidates **many**. `evolve` is the **orchestrator** and it composes this skill when `diagnose` flags inflation from redundant gotchas.
11
+ > **Carve-out (does not overlap existing ops):** `afm promote` **registers** a finding meant for the plugin. It does not write to the plugin. `afm generalize` merges **inside the instance** (N gotchas become 1 rule in the same `/docs/`). `afm reconcile` **adds** a new gotcha. `afm generalize` **merges** gotchas that already exist. `afm reflect` refines **one** doc. `afm generalize` consolidates **many**. `afm evolve` is the **orchestrator** and it composes this skill when `afm diagnose` flags inflation from redundant gotchas.
14
12
 
15
13
  ## When NOT to activate
16
14
 
17
15
  This is a disambiguation criterion for someone who already activated the skill, not an activation trigger. That is why it lives in the body, not in the resident listing.
18
16
 
19
- Sending ONE learning to the plugin is `afm promote`. ADDING a new gotcha or rule is `reconcile` -> `afm gotcha`/`afm rule` (`generalize` only merges what already exists). Refining the clarity of ONE doc is `afm reflect`. With fewer than 2 similar candidates, there is no generalization to do.
17
+ Sending ONE learning to the plugin is `afm promote`. ADDING a new gotcha or rule is `afm reconcile` -> `afm gotcha`/`afm rule` (`afm generalize` only merges what already exists). Refining the clarity of ONE doc is `afm reflect`. With fewer than 2 similar candidates, there is no generalization to do.
20
18
 
21
19
  ## Pre-check
22
20
 
@@ -24,24 +22,10 @@ Sending ONE learning to the plugin is `afm promote`. ADDING a new gotcha or rule
24
22
  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
23
  3. **Is there a batch of >=2** similar gotchas/reflections? If not, report "nothing to generalize (no batch)" and stop. Generalizing from 1 case is forbidden (#5).
26
24
 
27
- ## Procedure
28
-
29
- Read the op (`afm path ops/generalize.md`) end to end. Follow it literally.
30
-
31
- **1. Identify the batch:** cluster by shared abstract cause, >=2 cases. Ask "would one more general instruction have prevented all N?" A larger batch yields a more abstract rule.
32
-
33
- **2. MetaReflect:** draft the generalized, non-case-specific rule. The original cases become examples. Follow the **shared proposal discipline** from `evolve.md` (`afm path ops/evolve.md`) instead of duplicating it. Reduce, do not create a parallel path.
34
-
35
- **3. ShowsImprovement + backtracking:** check if the rule covers all N cases. A hard rule needs an executable 0/1 trigger. Otherwise it becomes a § 1.3 principle. If it cannot cover all cases without turning vague, back out and keep the cases separate.
36
-
37
- -> **4. Own gate** (item (b), unavoidable and earned, through `afm ask generalize`; suppressed under `evolve`. On approval: write the rule via `rule.md` (`afm rule new <slug>`) and **archive the merged entries as tombstones**. Never delete) -> **5. Record** the result in `docs/evolution/NNN-<date>.md`. Suggest `promote` if the finding matters beyond this instance.
38
-
39
- ## Invariant principles
40
-
41
- Single canonical source: `PRINCIPLES.md` (`afm path PRINCIPLES.md`). Universals §1-8 apply here, especially #1 (episodic `gotchas.md` -> semantic `afm.md`). Also #3: a merged rule becomes hard only with an executable 0/1 trigger, the ShowsImprovement step of MetaReflection. Also #5: do not invent an abstraction without a real batch.
25
+ ## Gate
42
26
 
43
- Also #6/#8: self-verify before an earned gate. Deletion is a bright line. Use tombstones instead. **No new principle here** — `generalize` is a composed materialization. The doctrine lives in the op file.
27
+ The merge is load-bearing and goes through its own earned gate, `afm ask generalize` (suppressed under `afm evolve`). Merged entries become tombstones; never delete.
44
28
 
45
- ## Version
29
+ ## Most relevant here
46
30
 
47
- Content version: `afm version` prints it.
31
+ #1 (episodic `gotchas.md` -> semantic `afm.md`), #3 (a merged rule becomes hard only with an executable 0/1 trigger), #5 (no abstraction without a real batch), #6/#8 (self-verify before an earned gate; deletion is a bright line, so archive as tombstones). No new principle here: the doctrine lives in the op.
@@ -7,8 +7,8 @@ description: |
7
7
 
8
8
  # AFM — Gotcha
9
9
 
10
- Atomic skill of `afm`. The canonical procedure is the op `afm path ops/gotcha`. The CLI owns the entry
11
- gate, the number, the frontmatter the trigger index reads and the index. This skill keeps only the judgment.
10
+ The CLI owns the entry gate, the number, the frontmatter the trigger index reads and the index. This skill
11
+ keeps only the judgment.
12
12
 
13
13
  ## When NOT to activate
14
14
 
@@ -32,7 +32,7 @@ signal belongs to `afm remediate`.
32
32
 
33
33
  ## Invariant principles
34
34
 
35
- Single canonical source: `afm path PRINCIPLES`. Universals §1-8 apply. Two matter most here: #5 (do not
35
+ Most relevant here: #5 (do not
36
36
  invent a gotcha without a real case; the 2x entry check is a strong gate) and #6 (autonomy-first: save the
37
37
  result and report it).
38
38
 
@@ -69,14 +69,9 @@ procedure is in `afm path interview/bootstrap` § Alternate branch. `.afm-versio
69
69
 
70
70
  ## Invariant principles
71
71
 
72
- Single canonical source: `afm path PRINCIPLES`. For this skill (greenfield), the 8 universals apply (§1-8).
73
- #9 (retroactive ADR, load-bearing) does NOT apply to init. Bootstrap forbids a retroactive ADR.
72
+ For this skill (greenfield), #9 (retroactive ADR, load-bearing) does NOT apply to init. Bootstrap forbids a retroactive ADR.
74
73
 
75
74
  ## Continuous doctrine
76
75
 
77
- Passive mode (`afm reconcile`) is the responsibility of the `reconcile` skill. It stays always-on in any AFM
76
+ Passive mode (`afm reconcile`) stays always-on in any AFM
78
77
  project session. This skill covers only the active bootstrap procedure.
79
-
80
- ## Version
81
-
82
- `afm version` prints the version in use. History: `afm path CHANGELOG`.
@@ -7,11 +7,9 @@ description: |
7
7
 
8
8
  # AFM — Plan
9
9
 
10
- An atomic skill. The procedure lives in the op: read it with `afm path ops/plan.md`, end to end, and follow it literally.
11
-
12
10
  ## When NOT to activate
13
11
 
14
- There is no `spec.md` yet: run `afm specify` first. An end-to-end delivery is `deliver`, which composes this op.
12
+ There is no `spec.md` yet: run `afm specify` first. An end-to-end delivery is `afm deliver`, which composes this op.
15
13
 
16
14
  ## Pre-check
17
15
 
@@ -23,12 +21,8 @@ Read the stack from `docs/ach.md` and never reopen it. Infer the components, dec
23
21
 
24
22
  ## Invariant principles
25
23
 
26
- Single canonical source: `afm path PRINCIPLES.md`. Universals §1-8 apply. In particular #2 (discover-first: scan before you ask), #5 (do not invent contracts or a stack) and #8 (a question carries a recommendation).
24
+ Most relevant here: #2 (discover-first: scan before you ask), #5 (do not invent contracts or a stack) and #8 (a question carries a recommendation).
27
25
 
28
26
  ## Continuous doctrine
29
27
 
30
- Passive mode is the always-on `reconcile` skill. This skill covers only the planning.
31
-
32
- ## Version
33
-
34
- `afm version`. History: `afm path CHANGELOG.md`.
28
+ Passive mode (`afm reconcile`) is always on. This skill covers only the planning.
@@ -7,8 +7,6 @@ description: |
7
7
 
8
8
  # AFM — Policy (report the organisation layer)
9
9
 
10
- Atomic skill of `afm`. The canonical procedure is the op `afm path ops/policy`.
11
-
12
10
  ## When not to activate
13
11
 
14
12
  Never to CHANGE the policy. This skill reads. The organisation bundle belongs to whoever owns it, and no
@@ -25,7 +23,3 @@ and stop.
25
23
  Run `afm policy report` and read it by family. Say plainly that a policy bundle injects context and blocks
26
24
  nothing, and name what the reader may not edit here and who owns it. Never report a policy rule as
27
25
  enforced.
28
-
29
- ## Invariant principles
30
-
31
- Single canonical source: `afm path PRINCIPLES`. Universals §1-8 apply.
@@ -7,8 +7,6 @@ description: |
7
7
 
8
8
  # AFM — Promote
9
9
 
10
- Atomic skill of `afm`. The canonical procedure is the op `afm path ops/promote`.
11
-
12
10
  ## When NOT to activate
13
11
 
14
12
  This disambiguation applies once this skill has already activated. Project-specific learning stays in
@@ -31,7 +29,7 @@ bring the plugin INTO the instance (the opposite direction).
31
29
 
32
30
  ## Invariant principles
33
31
 
34
- Single canonical source: `afm path PRINCIPLES`. Universals §1-8 apply. That includes #5: never record a
32
+ Most relevant here: #5: never record a
35
33
  project-specific learning, and never one without a real case; the list grows on demand.
36
34
 
37
35
  It also includes #6/#7: the plugin boundary is **absolute**. This op records a finding and never applies a
@@ -7,8 +7,7 @@ description: |
7
7
 
8
8
  # AFM — Protocol (declared autonomy posture)
9
9
 
10
- Skill of `afm`. The canonical procedure is the op `afm path ops/protocol`. Field and preset definitions are
11
- in `afm path core/protocol`.
10
+ Field and preset definitions are in `afm path core/protocol`.
12
11
 
13
12
  > **A protocol is data, not a new execution path.** It parametrizes operations that already exist. A project
14
13
  > with no `protocol:` declared uses the defaults, which reproduce pre-v4 behavior.
@@ -35,7 +34,7 @@ Outside the three presets, the file must already exist: never invent one.
35
34
 
36
35
  ## Invariant principles
37
36
 
38
- Single canonical source: `afm path PRINCIPLES`. See especially #4 and #5.
37
+ Most relevant here: #4 and #5.
39
38
 
40
39
  #4: `[TBD]` beats invention. An instance with no declared posture does not receive an assumed one.
41
40
 
@@ -24,7 +24,7 @@ One criterion decides where something belongs (universal principle #1, source in
24
24
 
25
25
  `docs/` holds rules, decisions, gotchas, architecture, persona, flows and cross-module contracts. The agent's memory holds only the user's style and durable preferences ("small PRs, not big bundles") and personal context (role, years of experience, current focus).
26
26
 
27
- `docs/` is a living source, **not a frozen bootstrap artifact**: it evolves through the whole session by passive reconcile. The signal table is `afm path interview/triggers.md`. The procedure is the op: read it with `afm path ops/reconcile.md`.
27
+ `docs/` is a living source, **not a frozen bootstrap artifact**: it evolves through the whole session by passive reconcile. The signal table is `afm path interview/triggers.md`.
28
28
 
29
29
  ## Procedure (always-on)
30
30
 
@@ -42,8 +42,4 @@ Never apply an edit without proposing it first, never save a project rule in mem
42
42
 
43
43
  ## Invariant principles
44
44
 
45
- Single canonical source: `afm path PRINCIPLES.md`. Universals §1-8 apply, in particular #1 (the one criterion for memory against doc), #5 (no gotcha or rule without a case) and #6 (reconcile PROPOSES at the end of the turn).
46
-
47
- ## Version
48
-
49
- `afm version`. History: `afm path CHANGELOG.md`.
45
+ Most relevant here: #1 (the one criterion for memory against doc), #5 (no gotcha or rule without a case) and #6 (reconcile PROPOSES at the end of the turn).
@@ -70,15 +70,10 @@ For brownfield projects without `docs/.afm-version`:
70
70
 
71
71
  ## Invariant principles
72
72
 
73
- Single canonical source: `afm path PRINCIPLES`. For this skill (brownfield), **all** apply: the 8 universals
73
+ For this skill (brownfield), **all** principles apply: the 8 universals
74
74
  §1-8 plus the addition §9 (a retroactive ADR is load-bearing-only). #9 separates refactor from init. Init
75
75
  forbids retroactive ADRs.
76
76
 
77
77
  ## Continuous doctrine
78
78
 
79
- Passive mode (`afm reconcile`) is the responsibility of the `reconcile` skill. It is always-on in any AFM
80
- project session. This skill covers only the active refactor procedure.
81
-
82
- ## Version
83
-
84
- `afm version` prints the version in use. History: `afm path CHANGELOG`.
79
+ Passive mode (`afm reconcile`) is always-on in any AFM project session. This skill covers only the active refactor procedure.
@@ -1,53 +1,43 @@
1
1
  ---
2
2
  name: reflect
3
3
  description: |
4
- Finds where the local docs failed AS A HARNESS in this session. Examples are an ambiguous rule applied wrong, a doc that misled, and a user correction against the doc. The evidence is the session trajectory, never a static scan. It proposes edits that make the docs more assertive.
4
+ Finds where the local docs failed AS A HARNESS in the live session and the project's sessions since the last cycle. Examples are an ambiguous rule applied wrong, a doc that misled, and a user correction against the doc. The evidence is the session trajectory, never a static scan. It proposes edits that make the docs more assertive.
5
5
  Activates: `afm reflect`, "this rule is ambiguous", "the doc sent me the wrong way", "why do I keep getting this wrong when the doc covers it?".
6
6
  ---
7
7
 
8
8
 
9
9
  # AFM — Reflect (behavioral self-reflection on the docs)
10
10
 
11
- Mechanism skill of AFM. The canonical procedure is the op file that `afm path ops/reflect.md` prints.
12
-
13
- > **Carve-out (does not overlap existing ops):** `reconcile` works **code to docs, and is additive**. It learns a new fact and proposes adding it. `reflect` works **docs to docs, and refines**. An existing doc guided the agent wrong, so `reflect` proposes a clearer version. `diagnose` runs a **static** scan. `reflect` uses **behavioral** evidence from the session trajectory. Only the agent sees its own stumble. `evolve` is the **orchestrator**. It composes `reflect` and `diagnose` into one cycle with a single gate.
11
+ > **Carve-out (does not overlap existing ops):** `afm reconcile` works **code to docs, and is additive**. It learns a new fact and proposes adding it. `reflect` works **docs to docs, and refines**. An existing doc guided the agent wrong, so `reflect` proposes a clearer version. `afm diagnose` runs a **static** scan. `reflect` uses **behavioral** evidence from the session trajectory. Only the agent sees its own stumble. `afm evolve` is the **orchestrator**. It composes `reflect` and `afm diagnose` into one cycle with a single gate.
14
12
 
15
13
  ## When not to activate
16
14
 
17
15
  This is a disambiguation criterion for a skill already active, not an activation criterion. That is why it lives in the body, not in the resident listing.
18
16
 
19
- Learning a new fact, gotcha, or decision belongs to `reconcile`. Route it to `afm gotcha`, `afm rule`, or `afm adr`. A static mechanical scan belongs to `afm diagnose`. Merging N gotchas belongs to `afm generalize`. A failure with an external signal belongs to `afm remediate`. The full cycle belongs to `afm evolve`.
17
+ Learning a new fact, gotcha, or decision belongs to passive mode (`afm reconcile`). Route it to `afm gotcha`, `afm rule`, or `afm adr`. A static mechanical scan belongs to `afm diagnose`. Merging N gotchas belongs to `afm generalize`. A failure with an external signal belongs to `afm remediate`. The full cycle belongs to `afm evolve`.
20
18
 
21
19
  ## Pre-check
22
20
 
23
21
  1. **Does `<consumer>/docs/.afm-version` exist?** If not, stop. Suggest `afm init` (greenfield) or `afm refactor` (brownfield) first.
24
22
  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
- 3. **Did the session hit a doc-friction event** (or an articulated symptom)? If not, report "no doc friction observed" and stop. Reflection without behavioral evidence is forbidden (#5).
23
+ 3. **Did the live session or the project's sessions since the last cycle hit a doc-friction event** (or an articulated symptom)? Read the window with `afm sessions --since reflect --json` and `afm sessions signals --since reflect --json`. If the whole window has no signal, report "no doc friction observed" and stop. Reflection without behavioral evidence is forbidden (#5).
26
24
 
27
25
  ## Procedure
28
26
 
29
- Read the op (`afm path ops/reflect.md`) end to end. Follow it literally.
30
-
31
27
  The steps are:
32
28
 
33
- **1. Collection.** Build the behavioral signature φ_b = `(symptom-lived, doc-causal-status, mechanism)`. Cite both the doc passage **and** the session event.
29
+ **1. Collection.** Build the behavioral signature φ_b = `(symptom-lived, doc-causal-status, mechanism)`. Cite both the doc passage **and** the session event (`session:<id>@<ts>`). Weight: one signal in the live session suffices; a past-session signal needs 2 or more sessions, an explicit correction, or `regressed`, and `regressed` comes first. A repeated prompt is a finding: propose the artifact that stops the retyping.
34
30
 
35
31
  **2. Self-critique.** Consider a rival hypothesis: it was me, not the doc. Apply the guardrail: a violated rule is not a wrong rule. Apply an addressability filter.
36
32
 
37
33
  **3. Proposal.** Refine instructiveness: rewrite the ambiguous part, add an executable trigger, and remove ambiguity. Add suggestions for the human. This step follows the **shared proposal discipline** in `evolve.md` (`afm path ops/evolve.md`) and does not duplicate it.
38
34
 
39
- **4. Own gate.** Ask item by item, earned, with `afm ask reflect --scope <item-slug>`. `evolve` suppresses this gate.
35
+ **4. Own gate.** Ask item by item, earned, with `afm ask reflect --scope <item-slug>`. `afm evolve` suppresses this gate.
40
36
 
41
- **5. Record.** Write to `docs/evolution/NNN-<date>.md`. Add a `promote` suggestion when the finding generalizes. Hand off to `reconcile`.
37
+ **5. Record.** Write to `docs/evolution/NNN-<date>.md`. Add an `afm promote` suggestion when the finding generalizes. Hand off to passive mode (`afm reconcile`).
42
38
 
43
39
  ## Invariant principles
44
40
 
45
- The single canonical source is `PRINCIPLES.md` (`afm path PRINCIPLES.md`). Universals §1-8 apply.
46
-
47
41
  Rule #1 applies: refine the doc's instructiveness, not the agent's memory. Rule #5 applies: no lived event, no finding. Rule #6 applies: self-verify, then report. The gate is a load-bearing residue. Bright lines #7 for plugin, deletion, and push apply.
48
42
 
49
43
  Rule #8 applies: a suggestion or question must be earned, recommendation-first. **No new principle here.** `reflect` is a composed materialization. The doctrine lives in the op file.
50
-
51
- ## Version
52
-
53
- Content version: `afm version` prints it.
@@ -8,8 +8,6 @@ description: |
8
8
 
9
9
  # AFM — Remediate (CRITIC loop)
10
10
 
11
- Atomic skill of AFM. The canonical procedure is the op file that `afm path ops/remediate.md` prints.
12
-
13
11
  ## When NOT to activate
14
12
 
15
13
  This is a disambiguation for a skill that already activated. It is not an activation trigger. That is why it lives in the body and not in the resident listing.
@@ -24,16 +22,12 @@ Use `afm.md § 5.1` for an in-task retry at the moment of the error. Use `afm go
24
22
 
25
23
  ## Procedure
26
24
 
27
- Read the op (`afm path ops/remediate.md`) end to end and follow it literally. It includes the promotion gate (#5): 1 user correction OR at least 2 mechanical occurrences promote a failure. A transient failure does not promote. It also includes classification through the rubric `rubrics/failure-classification.md` (`afm path rubrics/failure-classification.md`). For each delta, propose the artifact (procedure or learning) and cite the source `sig=` (hard rule 19). Ask the artifact question with `afm ask remediate --scope <sig>`, materialize the result, close the signature with `afm failures close --sig <sig> --as remediated`, and report it (#6).
25
+ The op includes the promotion gate (#5): 1 user correction OR at least 2 mechanical occurrences promote a failure. A transient failure does not promote. It also includes classification through the rubric `rubrics/failure-classification.md` (`afm path rubrics/failure-classification.md`). For each delta, propose the artifact (procedure or learning) and cite the source `sig=` (hard rule 19). Ask the artifact question with `afm ask remediate --scope <sig>`, materialize the result, close the signature with `afm failures close --sig <sig> --as remediated`, and report it (#6).
28
26
 
29
27
  ## Invariant principles
30
28
 
31
- The single canonical source is `PRINCIPLES.md` (`afm path PRINCIPLES.md`). See in particular #3 (CRITIC corollary — recognition by tool, not self-judgment). See also #5 (do not promote a failure without recurrence or an oracle) and #6 (propose only, the human approves).
29
+ Most relevant here: #3 (CRITIC corollary — recognition by tool, not self-judgment). See also #5 (do not promote a failure without recurrence or an oracle) and #6 (propose only, the human approves).
32
30
 
33
31
  ## Continuous doctrine
34
32
 
35
- The `reconcile` skill owns passive mode, and it is always on. It reads `afm failures promotable` at the end of the turn and can propose remediation with no explicit command. The `evolve` cycle uses the failure events as evidence for `reflect`, toward a final remediation. This skill is the active record of the loop.
36
-
37
- ## Version
38
-
39
- Content version: `afm version` prints it.
33
+ Passive mode (`afm reconcile`) is always on. It reads `afm failures promotable` at the end of the turn and can propose remediation with no explicit command. The `afm evolve` cycle uses the failure events as evidence for `afm reflect`, toward a final remediation. This skill is the active record of the loop.