@tenkara/afm-linux-arm64 4.0.0-alpha.8 → 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.
- package/bin/afm +2 -2
- package/content/CHANGELOG.md +22 -0
- package/content/core/afm.md +1 -1
- package/content/ops/evolve.md +61 -9
- package/content/ops/reflect.md +18 -13
- package/content/ops/restructure.md +2 -2
- package/content/ops/update.md +26 -2
- package/content/roles/explorer.md +1 -1
- package/content/roles/reviewer.md +1 -1
- package/content/skills/adr.md +3 -3
- package/content/skills/analyze.md +2 -8
- package/content/skills/clarify.md +2 -8
- package/content/skills/deliver.md +4 -20
- package/content/skills/diagnose.md +3 -11
- package/content/skills/evolve.md +6 -30
- package/content/skills/export-template.md +2 -5
- package/content/skills/generalize.md +6 -22
- package/content/skills/gotcha.md +3 -3
- package/content/skills/init.md +2 -7
- package/content/skills/plan.md +3 -9
- package/content/skills/policy.md +0 -6
- package/content/skills/promote.md +1 -3
- package/content/skills/protocol.md +2 -3
- package/content/skills/reconcile.md +2 -6
- package/content/skills/refactor.md +2 -7
- package/content/skills/reflect.md +7 -17
- package/content/skills/remediate.md +3 -9
- package/content/skills/restructure.md +8 -14
- package/content/skills/rule.md +3 -4
- package/content/skills/specify.md +3 -9
- package/content/skills/tasks.md +4 -14
- package/content/skills/update.md +6 -4
- package/content/skills/verify.md +1 -3
- package/content/templates/evolution-report.template.md +5 -0
- package/package.json +1 -1
- package/plugin/agy/plugin.json +1 -1
- package/plugin/agy/skills/afm-adr/SKILL.md +7 -3
- package/plugin/agy/skills/afm-analyze/SKILL.md +4 -6
- package/plugin/agy/skills/afm-clarify/SKILL.md +4 -6
- package/plugin/agy/skills/afm-deliver/SKILL.md +6 -20
- package/plugin/agy/skills/afm-diagnose/SKILL.md +5 -9
- package/plugin/agy/skills/afm-evolve/SKILL.md +9 -29
- package/plugin/agy/skills/afm-export-template/SKILL.md +6 -5
- package/plugin/agy/skills/afm-generalize/SKILL.md +8 -20
- package/plugin/agy/skills/afm-gotcha/SKILL.md +7 -3
- package/plugin/agy/skills/afm-init/SKILL.md +3 -6
- package/plugin/agy/skills/afm-plan/SKILL.md +5 -7
- package/plugin/agy/skills/afm-policy/SKILL.md +2 -4
- package/plugin/agy/skills/afm-promote/SKILL.md +4 -2
- package/plugin/agy/skills/afm-protocol/SKILL.md +6 -3
- package/plugin/agy/skills/afm-reconcile/SKILL.md +5 -5
- package/plugin/agy/skills/afm-refactor/SKILL.md +3 -6
- package/plugin/agy/skills/afm-reflect/SKILL.md +9 -15
- package/plugin/agy/skills/afm-remediate/SKILL.md +5 -7
- package/plugin/agy/skills/afm-restructure/SKILL.md +10 -12
- package/plugin/agy/skills/afm-rule/SKILL.md +7 -4
- package/plugin/agy/skills/afm-specify/SKILL.md +5 -7
- package/plugin/agy/skills/afm-tasks/SKILL.md +6 -12
- package/plugin/agy/skills/afm-update/SKILL.md +10 -4
- package/plugin/agy/skills/afm-verify/SKILL.md +4 -2
- package/plugin/claude-code/.claude-plugin/plugin.json +1 -1
- package/plugin/claude-code/agents/afm-explorer.md +1 -1
- package/plugin/claude-code/agents/afm-reviewer.md +1 -1
- package/plugin/claude-code/skills/adr/SKILL.md +7 -3
- package/plugin/claude-code/skills/analyze/SKILL.md +4 -6
- package/plugin/claude-code/skills/clarify/SKILL.md +4 -6
- package/plugin/claude-code/skills/deliver/SKILL.md +6 -20
- package/plugin/claude-code/skills/diagnose/SKILL.md +5 -9
- package/plugin/claude-code/skills/evolve/SKILL.md +9 -29
- package/plugin/claude-code/skills/export-template/SKILL.md +6 -5
- package/plugin/claude-code/skills/generalize/SKILL.md +8 -20
- package/plugin/claude-code/skills/gotcha/SKILL.md +7 -3
- package/plugin/claude-code/skills/init/SKILL.md +3 -6
- package/plugin/claude-code/skills/plan/SKILL.md +5 -7
- package/plugin/claude-code/skills/policy/SKILL.md +2 -4
- package/plugin/claude-code/skills/promote/SKILL.md +4 -2
- package/plugin/claude-code/skills/protocol/SKILL.md +6 -3
- package/plugin/claude-code/skills/reconcile/SKILL.md +5 -5
- package/plugin/claude-code/skills/refactor/SKILL.md +3 -6
- package/plugin/claude-code/skills/reflect/SKILL.md +9 -15
- package/plugin/claude-code/skills/remediate/SKILL.md +5 -7
- package/plugin/claude-code/skills/restructure/SKILL.md +10 -12
- package/plugin/claude-code/skills/rule/SKILL.md +7 -4
- package/plugin/claude-code/skills/specify/SKILL.md +5 -7
- package/plugin/claude-code/skills/tasks/SKILL.md +6 -12
- package/plugin/claude-code/skills/update/SKILL.md +10 -4
- package/plugin/claude-code/skills/verify/SKILL.md +4 -2
- package/plugin/opencode/agents/afm-explorer.md +9 -0
- package/plugin/opencode/agents/afm-reviewer.md +9 -0
- package/plugin/opencode/skills/afm-adr/SKILL.md +7 -3
- package/plugin/opencode/skills/afm-analyze/SKILL.md +4 -6
- package/plugin/opencode/skills/afm-clarify/SKILL.md +4 -6
- package/plugin/opencode/skills/afm-deliver/SKILL.md +6 -20
- package/plugin/opencode/skills/afm-diagnose/SKILL.md +5 -9
- package/plugin/opencode/skills/afm-evolve/SKILL.md +9 -29
- package/plugin/opencode/skills/afm-export-template/SKILL.md +6 -5
- package/plugin/opencode/skills/afm-generalize/SKILL.md +8 -20
- package/plugin/opencode/skills/afm-gotcha/SKILL.md +7 -3
- package/plugin/opencode/skills/afm-init/SKILL.md +3 -6
- package/plugin/opencode/skills/afm-plan/SKILL.md +5 -7
- package/plugin/opencode/skills/afm-policy/SKILL.md +2 -4
- package/plugin/opencode/skills/afm-promote/SKILL.md +4 -2
- package/plugin/opencode/skills/afm-protocol/SKILL.md +6 -3
- package/plugin/opencode/skills/afm-reconcile/SKILL.md +5 -5
- package/plugin/opencode/skills/afm-refactor/SKILL.md +3 -6
- package/plugin/opencode/skills/afm-reflect/SKILL.md +9 -15
- package/plugin/opencode/skills/afm-remediate/SKILL.md +5 -7
- package/plugin/opencode/skills/afm-restructure/SKILL.md +10 -12
- package/plugin/opencode/skills/afm-rule/SKILL.md +7 -4
- package/plugin/opencode/skills/afm-specify/SKILL.md +5 -7
- package/plugin/opencode/skills/afm-tasks/SKILL.md +6 -12
- package/plugin/opencode/skills/afm-update/SKILL.md +10 -4
- package/plugin/opencode/skills/afm-verify/SKILL.md +4 -2
|
@@ -9,8 +9,10 @@ description: |
|
|
|
9
9
|
|
|
10
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
11
|
|
|
12
|
-
|
|
13
|
-
|
|
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.
|
|
14
16
|
|
|
15
17
|
## When NOT to activate
|
|
16
18
|
|
|
@@ -37,8 +39,10 @@ project (signal: `afm.md` § 3.1 forward-only exists). A greenfield project forb
|
|
|
37
39
|
|
|
38
40
|
## Invariant principles
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
Additional #9 (a retroactive ADR is
|
|
41
43
|
load-bearing-only) applies ONLY in a refactored project.
|
|
42
44
|
|
|
43
45
|
Passive mode (`afm-reconcile`) is always on and can propose `afm-adr` when it detects a "novel structural
|
|
44
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`.
|
|
@@ -9,7 +9,7 @@ description: |
|
|
|
9
9
|
|
|
10
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
11
|
|
|
12
|
-
|
|
12
|
+
> **Procedure.** Run `afm read ops/analyze.md` and follow it; read an on-demand section when its condition holds.
|
|
13
13
|
|
|
14
14
|
## When NOT to activate
|
|
15
15
|
|
|
@@ -25,12 +25,10 @@ Start from the mechanical findings: `afm feature lint <NNN> --json` covers the p
|
|
|
25
25
|
|
|
26
26
|
## Invariant principles
|
|
27
27
|
|
|
28
|
-
|
|
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
29
|
|
|
30
30
|
## Continuous doctrine
|
|
31
31
|
|
|
32
|
-
Passive mode is
|
|
32
|
+
Passive mode (`afm-reconcile`) is always on. This skill covers only active auditing.
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`afm version`. History: `afm path CHANGELOG.md`.
|
|
34
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -9,7 +9,7 @@ description: |
|
|
|
9
9
|
|
|
10
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
11
|
|
|
12
|
-
|
|
12
|
+
> **Procedure.** Run `afm read ops/clarify.md` and follow it; read an on-demand section when its condition holds.
|
|
13
13
|
|
|
14
14
|
## When NOT to activate
|
|
15
15
|
|
|
@@ -25,12 +25,10 @@ Judgment only: a 9-category scan of the spec, a prioritized queue (at most 5 que
|
|
|
25
25
|
|
|
26
26
|
## Invariant principles
|
|
27
27
|
|
|
28
|
-
|
|
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
29
|
|
|
30
30
|
## Continuous doctrine
|
|
31
31
|
|
|
32
|
-
Passive mode is
|
|
32
|
+
Passive mode (`afm-reconcile`) is always on. This skill covers only the active resolution of ambiguity.
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`afm version`. History: `afm path CHANGELOG.md`.
|
|
34
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -7,9 +7,9 @@ description: |
|
|
|
7
7
|
|
|
8
8
|
# AFM — Deliver (orchestrated autonomous delivery)
|
|
9
9
|
|
|
10
|
-
> **
|
|
10
|
+
> **Procedure.** Run `afm read ops/deliver.md` and follow it; read an on-demand section when its condition holds.
|
|
11
11
|
|
|
12
|
-
The **orchestrator** of the delivery loop. One request takes "build feature X" from discovery to a delivered feature.
|
|
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
13
|
|
|
14
14
|
## When NOT to activate
|
|
15
15
|
|
|
@@ -19,26 +19,12 @@ An isolated step ("just open the spec", "just generate the tasks") is the matchi
|
|
|
19
19
|
|
|
20
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
21
|
|
|
22
|
-
##
|
|
22
|
+
## Most relevant here
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
- **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`).
|
|
27
|
-
- **Draft:** spec, plan and tasks, verified with `afm feature lint <NNN>` plus the judgment passes of `analyze`.
|
|
28
|
-
- **Gate:** the earned questions plus the `outcome` question (`afm ask deliver`), then `afm approve <NNN>`. An explicit "go" skips the questions, never the record.
|
|
29
|
-
- **Execute:** the tasks of the `tasks:` list run in order (`core/afm.md` § 2: a red task, the green task that closes it, an optional refactor), each checked with `afm gate --staged`, then closed with `afm task done <NNN> <Txxx>`. Tasks are added with `afm task add`, never by hand. Halt on the failure of a task that is not `parallel` after the capped retry.
|
|
30
|
-
- **Reconcile:** § 8.5 plus a passive sweep.
|
|
31
|
-
|
|
32
|
-
If artifacts already exist, resume from the correct phase, including "tasks already exist, run from the first task that is not done".
|
|
33
|
-
|
|
34
|
-
## Invariant principles
|
|
35
|
-
|
|
36
|
-
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).
|
|
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).
|
|
37
25
|
|
|
38
26
|
## Continuous doctrine
|
|
39
27
|
|
|
40
|
-
Passive mode is
|
|
41
|
-
|
|
42
|
-
## Version
|
|
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).
|
|
43
29
|
|
|
44
|
-
`afm version
|
|
30
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -8,9 +8,9 @@ description: |
|
|
|
8
8
|
|
|
9
9
|
# AFM — Diagnose (mechanical weakness-mining, read-only)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
> **Procedure.** Run `afm read ops/diagnose.md` and follow it; read an on-demand section when its condition holds.
|
|
12
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.
|
|
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
14
|
|
|
15
15
|
## When NOT to activate
|
|
16
16
|
|
|
@@ -25,8 +25,6 @@ Validation of ONE feature is `afm-analyze`. Behavioral friction, where a doc mis
|
|
|
25
25
|
|
|
26
26
|
## Procedure
|
|
27
27
|
|
|
28
|
-
Read the op (`afm path ops/diagnose.md`) end to end. Follow it literally.
|
|
29
|
-
|
|
30
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.
|
|
31
29
|
|
|
32
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>".
|
|
@@ -35,16 +33,14 @@ Axis A7, cross-doc contradiction, uses a paired read. That read applies an anti-
|
|
|
35
33
|
|
|
36
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.
|
|
37
35
|
|
|
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.
|
|
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.
|
|
39
37
|
|
|
40
38
|
This scan has no cooldown. It is read-only and cheap. The cycle's cooldown belongs to the orchestrator.
|
|
41
39
|
|
|
42
40
|
## Invariant principles
|
|
43
41
|
|
|
44
|
-
|
|
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).
|
|
45
43
|
|
|
46
44
|
**No new principle here.** `diagnose` is a composed materialization. The doctrine lives in the op file.
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
Content version: `afm version` prints it.
|
|
46
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -10,11 +10,11 @@ description: |
|
|
|
10
10
|
|
|
11
11
|
> **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.
|
|
12
12
|
|
|
13
|
+
> **Procedure.** Run `afm read ops/evolve.md` and follow it; read an on-demand section when its condition holds.
|
|
14
|
+
|
|
13
15
|
This is an orchestrator skill of AFM. The canonical procedure is the op file that `afm path ops/evolve.md` prints.
|
|
14
16
|
|
|
15
|
-
> **
|
|
16
|
-
>
|
|
17
|
-
> **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.
|
|
17
|
+
> **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.
|
|
18
18
|
|
|
19
19
|
## When NOT to activate
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ This section helps someone who already activated the skill decide if it fits. It
|
|
|
22
22
|
|
|
23
23
|
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`.
|
|
24
24
|
|
|
25
|
-
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.
|
|
25
|
+
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.
|
|
26
26
|
|
|
27
27
|
A feature-level check is `afm-analyze` or `afm-deliver`. Recording a finding for the plugin is `afm-promote`.
|
|
28
28
|
|
|
@@ -34,36 +34,16 @@ A feature-level check is `afm-analyze` or `afm-deliver`. Recording a finding for
|
|
|
34
34
|
|
|
35
35
|
## Procedure
|
|
36
36
|
|
|
37
|
-
Read the op (`afm path ops/evolve.md`) end to end and follow it exactly. The op has 5 phases
|
|
38
|
-
|
|
39
|
-
**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.
|
|
40
|
-
|
|
41
|
-
**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.
|
|
42
|
-
|
|
43
|
-
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`.
|
|
44
|
-
|
|
45
|
-
**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.
|
|
46
|
-
|
|
47
|
-
**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).
|
|
48
|
-
|
|
49
|
-
**Phase 5 — Log.** Record the cycle in `docs/evolution/NNN-<date>.md`. Suggest `promote` when a finding generalizes beyond this instance.
|
|
37
|
+
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/`.
|
|
50
38
|
|
|
51
39
|
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.
|
|
52
40
|
|
|
53
|
-
##
|
|
54
|
-
|
|
55
|
-
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.
|
|
56
|
-
|
|
57
|
-
#8 (earned questions, recommendation-first) also applies to this skill.
|
|
41
|
+
## Most relevant principles
|
|
58
42
|
|
|
59
|
-
#
|
|
60
|
-
|
|
61
|
-
**No new principle here** — evolve is a composed materialization. The doctrine lives in the op and the rubric.
|
|
43
|
+
#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).
|
|
62
44
|
|
|
63
45
|
## Continuous doctrine
|
|
64
46
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
## Version
|
|
47
|
+
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.
|
|
68
48
|
|
|
69
|
-
|
|
49
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -9,8 +9,9 @@ description: |
|
|
|
9
9
|
|
|
10
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
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
> **Procedure.** Run `afm read ops/export-template.md` and follow it; read an on-demand section when its condition holds.
|
|
13
|
+
|
|
14
|
+
The CLI owns the plan, the diff and the marker. This skill keeps the judgment.
|
|
14
15
|
|
|
15
16
|
## When NOT to activate
|
|
16
17
|
|
|
@@ -34,9 +35,9 @@ stop and suggest `afm-init` (greenfield) or `afm-refactor` (brownfield) first.
|
|
|
34
35
|
|
|
35
36
|
## Invariant principles
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
Especially #5 (do not invent metadata when the operator leaves it blank: use `[TBD]` in the JSON). Also #6
|
|
38
|
+
Most relevant here: #5 (do not invent metadata when the operator leaves it blank: use `[TBD]` in the JSON). Also #6
|
|
40
39
|
(autonomy-first, but deleting files is a bright line): confirm the diff before you delete.
|
|
41
40
|
|
|
42
41
|
Passive mode (`afm-reconcile`) is always on. This skill focuses only on the active conversion to a template.
|
|
42
|
+
|
|
43
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -10,15 +10,15 @@ description: |
|
|
|
10
10
|
|
|
11
11
|
> **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.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
> **Procedure.** Run `afm read ops/generalize.md` and follow it; read an on-demand section when its condition holds.
|
|
14
14
|
|
|
15
|
-
> **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.
|
|
15
|
+
> **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.
|
|
16
16
|
|
|
17
17
|
## When NOT to activate
|
|
18
18
|
|
|
19
19
|
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.
|
|
20
20
|
|
|
21
|
-
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.
|
|
21
|
+
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.
|
|
22
22
|
|
|
23
23
|
## Pre-check
|
|
24
24
|
|
|
@@ -26,24 +26,12 @@ Sending ONE learning to the plugin is `afm-promote`. ADDING a new gotcha or rule
|
|
|
26
26
|
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.
|
|
27
27
|
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).
|
|
28
28
|
|
|
29
|
-
##
|
|
29
|
+
## Gate
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
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.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
## Most relevant here
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
#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.
|
|
36
36
|
|
|
37
|
-
**
|
|
38
|
-
|
|
39
|
-
-> **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.
|
|
40
|
-
|
|
41
|
-
## Invariant principles
|
|
42
|
-
|
|
43
|
-
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.
|
|
44
|
-
|
|
45
|
-
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.
|
|
46
|
-
|
|
47
|
-
## Version
|
|
48
|
-
|
|
49
|
-
Content version: `afm version` prints it.
|
|
37
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -9,8 +9,10 @@ description: |
|
|
|
9
9
|
|
|
10
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
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
> **Procedure.** Run `afm read ops/gotcha.md` and follow it; read an on-demand section when its condition holds.
|
|
13
|
+
|
|
14
|
+
The CLI owns the entry gate, the number, the frontmatter the trigger index reads and the index. This skill
|
|
15
|
+
keeps only the judgment.
|
|
14
16
|
|
|
15
17
|
## When NOT to activate
|
|
16
18
|
|
|
@@ -34,9 +36,11 @@ signal belongs to `afm-remediate`.
|
|
|
34
36
|
|
|
35
37
|
## Invariant principles
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
Most relevant here: #5 (do not
|
|
38
40
|
invent a gotcha without a real case; the 2x entry check is a strong gate) and #6 (autonomy-first: save the
|
|
39
41
|
result and report it).
|
|
40
42
|
|
|
41
43
|
Passive mode (`afm-reconcile`) is always on and can propose `afm-gotcha` when it detects the signal "the
|
|
42
44
|
same runtime surprise blocked work twice." This skill covers only active registration.
|
|
45
|
+
|
|
46
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -71,14 +71,11 @@ procedure is in `afm path interview/bootstrap` § Alternate branch. `.afm-versio
|
|
|
71
71
|
|
|
72
72
|
## Invariant principles
|
|
73
73
|
|
|
74
|
-
|
|
75
|
-
#9 (retroactive ADR, load-bearing) does NOT apply to init. Bootstrap forbids a retroactive ADR.
|
|
74
|
+
For this skill (greenfield), #9 (retroactive ADR, load-bearing) does NOT apply to init. Bootstrap forbids a retroactive ADR.
|
|
76
75
|
|
|
77
76
|
## Continuous doctrine
|
|
78
77
|
|
|
79
|
-
Passive mode (`afm-reconcile`)
|
|
78
|
+
Passive mode (`afm-reconcile`) stays always-on in any AFM
|
|
80
79
|
project session. This skill covers only the active bootstrap procedure.
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
`afm version` prints the version in use. History: `afm path CHANGELOG`.
|
|
81
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -9,11 +9,11 @@ description: |
|
|
|
9
9
|
|
|
10
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
11
|
|
|
12
|
-
|
|
12
|
+
> **Procedure.** Run `afm read ops/plan.md` and follow it; read an on-demand section when its condition holds.
|
|
13
13
|
|
|
14
14
|
## When NOT to activate
|
|
15
15
|
|
|
16
|
-
There is no `spec.md` yet: run `afm-specify` first. An end-to-end delivery is `deliver`, which composes this op.
|
|
16
|
+
There is no `spec.md` yet: run `afm-specify` first. An end-to-end delivery is `afm-deliver`, which composes this op.
|
|
17
17
|
|
|
18
18
|
## Pre-check
|
|
19
19
|
|
|
@@ -25,12 +25,10 @@ Read the stack from `docs/ach.md` and never reopen it. Infer the components, dec
|
|
|
25
25
|
|
|
26
26
|
## Invariant principles
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
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).
|
|
29
29
|
|
|
30
30
|
## Continuous doctrine
|
|
31
31
|
|
|
32
|
-
Passive mode is
|
|
32
|
+
Passive mode (`afm-reconcile`) is always on. This skill covers only the planning.
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
`afm version`. History: `afm path CHANGELOG.md`.
|
|
34
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -7,7 +7,7 @@ description: |
|
|
|
7
7
|
|
|
8
8
|
# AFM — Policy (report the organisation layer)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
> **Procedure.** Run `afm read ops/policy.md` and follow it; read an on-demand section when its condition holds.
|
|
11
11
|
|
|
12
12
|
## When not to activate
|
|
13
13
|
|
|
@@ -26,6 +26,4 @@ Run `afm policy report` and read it by family. Say plainly that a policy bundle
|
|
|
26
26
|
nothing, and name what the reader may not edit here and who owns it. Never report a policy rule as
|
|
27
27
|
enforced.
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
Single canonical source: `afm path PRINCIPLES`. Universals §1-8 apply.
|
|
29
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -7,7 +7,7 @@ description: |
|
|
|
7
7
|
|
|
8
8
|
# AFM — Promote
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
> **Procedure.** Run `afm read ops/promote.md` and follow it; read an on-demand section when its condition holds.
|
|
11
11
|
|
|
12
12
|
## When NOT to activate
|
|
13
13
|
|
|
@@ -31,7 +31,7 @@ bring the plugin INTO the instance (the opposite direction).
|
|
|
31
31
|
|
|
32
32
|
## Invariant principles
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Most relevant here: #5: never record a
|
|
35
35
|
project-specific learning, and never one without a real case; the list grows on demand.
|
|
36
36
|
|
|
37
37
|
It also includes #6/#7: the plugin boundary is **absolute**. This op records a finding and never applies a
|
|
@@ -39,3 +39,5 @@ change.
|
|
|
39
39
|
|
|
40
40
|
Passive mode (`afm-reconcile`) is always on and can propose `afm-promote` when it detects a signal that a
|
|
41
41
|
learning generalizes to any project.
|
|
42
|
+
|
|
43
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -7,8 +7,9 @@ description: |
|
|
|
7
7
|
|
|
8
8
|
# AFM — Protocol (declared autonomy posture)
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
> **Procedure.** Run `afm read ops/protocol.md` and follow it; read an on-demand section when its condition holds.
|
|
11
|
+
|
|
12
|
+
Field and preset definitions are in `afm path core/protocol`.
|
|
12
13
|
|
|
13
14
|
> **A protocol is data, not a new execution path.** It parametrizes operations that already exist. A project
|
|
14
15
|
> with no `protocol:` declared uses the defaults, which reproduce pre-v4 behavior.
|
|
@@ -35,8 +36,10 @@ Outside the three presets, the file must already exist: never invent one.
|
|
|
35
36
|
|
|
36
37
|
## Invariant principles
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
Most relevant here: #4 and #5.
|
|
39
40
|
|
|
40
41
|
#4: `[TBD]` beats invention. An instance with no declared posture does not receive an assumed one.
|
|
41
42
|
|
|
42
43
|
#5: Do not invent a preset without a real case.
|
|
44
|
+
|
|
45
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -6,6 +6,8 @@ description: |
|
|
|
6
6
|
|
|
7
7
|
# AFM — Reconcile (passive mode, always-on)
|
|
8
8
|
|
|
9
|
+
> **Procedure.** Run `afm read ops/reconcile.md` and follow it; read an on-demand section when its condition holds.
|
|
10
|
+
|
|
9
11
|
The always-on skill. It loads the continuous doctrine and the passive-mode procedure, and it is the only skill that activates by default in any AFM project session. Every other skill needs explicit invocation or specific natural language.
|
|
10
12
|
|
|
11
13
|
## When NOT to activate
|
|
@@ -24,7 +26,7 @@ One criterion decides where something belongs (universal principle #1, source in
|
|
|
24
26
|
|
|
25
27
|
`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
28
|
|
|
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`.
|
|
29
|
+
`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
30
|
|
|
29
31
|
## Procedure (always-on)
|
|
30
32
|
|
|
@@ -42,8 +44,6 @@ Never apply an edit without proposing it first, never save a project rule in mem
|
|
|
42
44
|
|
|
43
45
|
## Invariant principles
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
## Version
|
|
47
|
+
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).
|
|
48
48
|
|
|
49
|
-
`afm version
|
|
49
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -72,15 +72,12 @@ For brownfield projects without `docs/.afm-version`:
|
|
|
72
72
|
|
|
73
73
|
## Invariant principles
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
For this skill (brownfield), **all** principles apply: the 8 universals
|
|
76
76
|
§1-8 plus the addition §9 (a retroactive ADR is load-bearing-only). #9 separates refactor from init. Init
|
|
77
77
|
forbids retroactive ADRs.
|
|
78
78
|
|
|
79
79
|
## Continuous doctrine
|
|
80
80
|
|
|
81
|
-
Passive mode (`afm-reconcile`) is
|
|
82
|
-
project session. This skill covers only the active refactor procedure.
|
|
81
|
+
Passive mode (`afm-reconcile`) is always-on in any AFM project session. This skill covers only the active refactor procedure.
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
`afm version` prints the version in use. History: `afm path CHANGELOG`.
|
|
83
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: afm-reflect
|
|
3
3
|
description: |
|
|
4
|
-
Finds where the local docs failed AS A HARNESS in
|
|
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
|
|
|
@@ -10,46 +10,40 @@ description: |
|
|
|
10
10
|
|
|
11
11
|
> **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.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
> **Procedure.** Run `afm read ops/reflect.md` and follow it; read an on-demand section when its condition holds.
|
|
14
14
|
|
|
15
|
-
> **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.
|
|
15
|
+
> **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.
|
|
16
16
|
|
|
17
17
|
## When not to activate
|
|
18
18
|
|
|
19
19
|
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.
|
|
20
20
|
|
|
21
|
-
Learning a new fact, gotcha, or decision belongs to `reconcile
|
|
21
|
+
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`.
|
|
22
22
|
|
|
23
23
|
## Pre-check
|
|
24
24
|
|
|
25
25
|
1. **Does `<consumer>/docs/.afm-version` exist?** If not, stop. Suggest `afm-init` (greenfield) or `afm-refactor` (brownfield) first.
|
|
26
26
|
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.
|
|
27
|
-
3. **Did the session hit a doc-friction event** (or an articulated symptom)? If
|
|
27
|
+
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).
|
|
28
28
|
|
|
29
29
|
## Procedure
|
|
30
30
|
|
|
31
|
-
Read the op (`afm path ops/reflect.md`) end to end. Follow it literally.
|
|
32
|
-
|
|
33
31
|
The steps are:
|
|
34
32
|
|
|
35
|
-
**1. Collection.** Build the behavioral signature φ_b = `(symptom-lived, doc-causal-status, mechanism)`. Cite both the doc passage **and** the session event.
|
|
33
|
+
**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.
|
|
36
34
|
|
|
37
35
|
**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.
|
|
38
36
|
|
|
39
37
|
**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.
|
|
40
38
|
|
|
41
|
-
**4. Own gate.** Ask item by item, earned, with `afm ask reflect --scope <item-slug>`. `evolve` suppresses this gate.
|
|
39
|
+
**4. Own gate.** Ask item by item, earned, with `afm ask reflect --scope <item-slug>`. `afm-evolve` suppresses this gate.
|
|
42
40
|
|
|
43
|
-
**5. Record.** Write to `docs/evolution/NNN-<date>.md`. Add
|
|
41
|
+
**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`).
|
|
44
42
|
|
|
45
43
|
## Invariant principles
|
|
46
44
|
|
|
47
|
-
The single canonical source is `PRINCIPLES.md` (`afm path PRINCIPLES.md`). Universals §1-8 apply.
|
|
48
|
-
|
|
49
45
|
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.
|
|
50
46
|
|
|
51
47
|
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.
|
|
52
48
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
Content version: `afm version` prints it.
|
|
49
|
+
**Principles and version.** `afm path PRINCIPLES.md` (universals §1-8 apply). `afm version` prints the version; history: `afm path CHANGELOG.md`.
|