@tenkara/afm-linux-arm64 0.0.0-stage → 4.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/afm +4 -0
- package/content/.coupling-baseline.tsv +1 -0
- package/content/.pending-commands.txt +2 -0
- package/content/CHANGELOG-archive.md +806 -0
- package/content/CHANGELOG.md +4320 -0
- package/content/PRINCIPLES.md +119 -0
- package/content/README-light.md +158 -0
- package/content/README.md +150 -0
- package/content/code-style/_any/file-size.md +62 -0
- package/content/code-style/_any/imports.md +68 -0
- package/content/code-style/_any/naming.md +72 -0
- package/content/code-style/_any/test-placement.md +57 -0
- package/content/code-style/nextjs-app-router/imports.md +50 -0
- package/content/code-style/nextjs-app-router/naming.md +50 -0
- package/content/code-style/prisma-postgres/error-boundary.md +55 -0
- package/content/code-style/prisma-postgres/imports.md +61 -0
- package/content/code-style/shadcn-ui/naming.md +48 -0
- package/content/code-style/stripe-billing/naming.md +76 -0
- package/content/code-style/trigger-dev-v4/imports.md +58 -0
- package/content/code-style/trigger-dev-v4/naming.md +49 -0
- package/content/code-style/trigger-dev-v4/test-placement.md +61 -0
- package/content/code-style/trpc-v11/error-boundary.md +51 -0
- package/content/code-style/trpc-v11/file-size.md +44 -0
- package/content/code-style/trpc-v11/naming.md +60 -0
- package/content/code-style/trpc-v11/test-placement.md +52 -0
- package/content/core/ach.md +260 -0
- package/content/core/afm.md +514 -0
- package/content/core/gotchas.md +18 -0
- package/content/core/prd.md +141 -0
- package/content/core/protocol.md +158 -0
- package/content/core/ust.md +65 -0
- package/content/guardrails/README.md +55 -0
- package/content/guardrails/dsl-com-ordem-obrigatoria.md +47 -0
- package/content/guardrails/exaustividade-de-union.md +48 -0
- package/content/guardrails/fronteira-de-import.md +57 -0
- package/content/hooks/README.md +70 -0
- package/content/interview/bootstrap.md +417 -0
- package/content/interview/promotion.md +115 -0
- package/content/interview/refactor.md +379 -0
- package/content/interview/triggers.md +107 -0
- package/content/modules/nextjs-app-router/ach.patch.md +44 -0
- package/content/modules/nextjs-app-router/gotchas.seed.md +78 -0
- package/content/modules/nextjs-app-router/rules.patch.md +35 -0
- package/content/modules/prisma-postgres/ach.patch.md +65 -0
- package/content/modules/prisma-postgres/rules.patch.md +28 -0
- package/content/modules/shadcn-ui/ach.patch.md +42 -0
- package/content/modules/stripe-billing/ach.patch.md +46 -0
- package/content/modules/stripe-billing/gotchas.seed.md +73 -0
- package/content/modules/stripe-billing/rules.patch.md +30 -0
- package/content/modules/trigger-dev-v4/ach.patch.md +64 -0
- package/content/modules/trigger-dev-v4/gotchas.seed.md +53 -0
- package/content/modules/trigger-dev-v4/rules.patch.md +35 -0
- package/content/modules/trpc-v11/ach.patch.md +56 -0
- package/content/modules/trpc-v11/rules.patch.md +34 -0
- package/content/modules/vireya-ui/ach.patch.md +85 -0
- package/content/modules/vireya-ui/gotchas.seed.md +98 -0
- package/content/modules/vireya-ui/rules.patch.md +36 -0
- package/content/ops/adr.md +54 -0
- package/content/ops/analyze.md +130 -0
- package/content/ops/clarify.md +86 -0
- package/content/ops/deliver.md +209 -0
- package/content/ops/diagnose.md +143 -0
- package/content/ops/evolve.md +366 -0
- package/content/ops/export-template.md +97 -0
- package/content/ops/generalize.md +117 -0
- package/content/ops/gotcha.md +46 -0
- package/content/ops/plan.md +61 -0
- package/content/ops/policy.md +61 -0
- package/content/ops/promote.md +72 -0
- package/content/ops/protocol.md +51 -0
- package/content/ops/reconcile.md +44 -0
- package/content/ops/reflect.md +182 -0
- package/content/ops/remediate.md +143 -0
- package/content/ops/restructure.md +142 -0
- package/content/ops/rule.md +170 -0
- package/content/ops/specify.md +62 -0
- package/content/ops/tasks.md +67 -0
- package/content/ops/update.md +252 -0
- package/content/ops/verify.md +67 -0
- package/content/patterns/adapter.md +46 -0
- package/content/patterns/facade.md +47 -0
- package/content/patterns/factory.md +46 -0
- package/content/patterns/null-object.md +55 -0
- package/content/patterns/result-vs-exception.md +52 -0
- package/content/patterns/strategy.md +45 -0
- package/content/patterns/template-method-vs-composition.md +50 -0
- package/content/questions/adr.questions.yaml +14 -0
- package/content/questions/analyze.questions.yaml +12 -0
- package/content/questions/bootstrap-mapping.questions.yaml +14 -0
- package/content/questions/bootstrap-rules.questions.yaml +10 -0
- package/content/questions/bootstrap-stack.questions.yaml +23 -0
- package/content/questions/clarify.questions.yaml +10 -0
- package/content/questions/code-style.questions.yaml +12 -0
- package/content/questions/confirm.questions.yaml +12 -0
- package/content/questions/deliver.questions.yaml +23 -0
- package/content/questions/evolve.questions.yaml +15 -0
- package/content/questions/export-template-apply.questions.yaml +11 -0
- package/content/questions/export-template.questions.yaml +23 -0
- package/content/questions/gates.questions.yaml +27 -0
- package/content/questions/generalize.questions.yaml +13 -0
- package/content/questions/gotcha.questions.yaml +11 -0
- package/content/questions/init-template.questions.yaml +10 -0
- package/content/questions/init.questions.yaml +41 -0
- package/content/questions/plan.questions.yaml +14 -0
- package/content/questions/refactor.questions.yaml +23 -0
- package/content/questions/reflect.questions.yaml +13 -0
- package/content/questions/remediate.questions.yaml +27 -0
- package/content/questions/restructure.questions.yaml +15 -0
- package/content/questions/rf-mapping.questions.yaml +12 -0
- package/content/questions/rule-scope.questions.yaml +12 -0
- package/content/questions/rule.questions.yaml +12 -0
- package/content/questions/specify.questions.yaml +23 -0
- package/content/questions/update-artifacts.questions.yaml +10 -0
- package/content/questions/update-strings.questions.yaml +14 -0
- package/content/questions/update.questions.yaml +10 -0
- package/content/questions/verify.questions.yaml +9 -0
- package/content/roles/executor.md +18 -0
- package/content/roles/explorer.md +22 -0
- package/content/roles/reviewer.md +23 -0
- package/content/rubrics/enum-vs-union-vs-branded.md +40 -0
- package/content/rubrics/episodic-vs-semantic-boundary.md +37 -0
- package/content/rubrics/error-classification.md +98 -0
- package/content/rubrics/failure-classification.md +111 -0
- package/content/rubrics/negative-filters.md +38 -0
- package/content/rubrics/solid-triggers.md +119 -0
- package/content/rubrics/template-vs-streaming-precedence.md +34 -0
- package/content/rubrics/validation-boundary.md +94 -0
- package/content/rubrics/when-to-create-dsl.md +65 -0
- package/content/rubrics/when-to-create-lib.md +49 -0
- package/content/rubrics/when-to-create-module.md +39 -0
- package/content/rubrics/when-to-evolve-methodology.md +62 -0
- package/content/skills/adr.md +42 -0
- package/content/skills/analyze.md +28 -0
- package/content/skills/clarify.md +28 -0
- package/content/skills/deliver.md +26 -0
- package/content/skills/diagnose.md +42 -0
- package/content/skills/evolve.md +43 -0
- package/content/skills/export-template.md +37 -0
- package/content/skills/generalize.md +31 -0
- package/content/skills/gotcha.md +40 -0
- package/content/skills/init.md +77 -0
- package/content/skills/plan.md +28 -0
- package/content/skills/policy.md +25 -0
- package/content/skills/promote.md +39 -0
- package/content/skills/protocol.md +41 -0
- package/content/skills/reconcile.md +45 -0
- package/content/skills/refactor.md +79 -0
- package/content/skills/reflect.md +43 -0
- package/content/skills/remediate.md +33 -0
- package/content/skills/restructure.md +46 -0
- package/content/skills/rule.md +43 -0
- package/content/skills/specify.md +28 -0
- package/content/skills/tasks.md +24 -0
- package/content/skills/update.md +58 -0
- package/content/skills/verify.md +29 -0
- package/content/templates/adr.template.md +51 -0
- package/content/templates/evolution-report.template.md +132 -0
- package/content/templates/feature-plan.template.md +84 -0
- package/content/templates/feature-research.template.md +56 -0
- package/content/templates/feature-spec.template.md +86 -0
- package/content/templates/feature-tasks.induced.template.md +91 -0
- package/content/templates/feature-tasks.template.md +82 -0
- package/content/templates/focus.template.md +30 -0
- package/content/templates/gotcha.template.md +31 -0
- package/content/templates/guardrail-runner.template.md +97 -0
- package/content/templates/guardrail.template.md +63 -0
- package/content/templates/learning.template.md +40 -0
- package/content/templates/procedure.template.md +47 -0
- package/content/templates/protocols/p1.md +29 -0
- package/content/templates/protocols/p2.md +28 -0
- package/content/templates/protocols/p3.md +47 -0
- package/content/templates/research.template.md +50 -0
- package/content/templates/session-handoff.template.md +58 -0
- package/content/templates/us.template.md +39 -0
- package/content/tools/gate/core-rules/PLUGIN-13-secrets.sh +36 -0
- package/content/tools/gate/core-rules/PLUGIN-21-code-language.sh +27 -0
- package/content/tools/gate/core-rules/PLUGIN-35-gate-complete.sh +19 -0
- package/content/tools/gate/core-rules/PLUGIN-36-absolute-path.sh +38 -0
- package/content/tools/gate/core-rules/PLUGIN-37-prose-language.sh +56 -0
- package/content/tools/gate/core-rules/PLUGIN-38-parser-marker.sh +82 -0
- package/content/tools/gate/core-rules/PLUGIN-39-frontmatter-ops.sh +325 -0
- package/content/tools/gate/core-rules/PLUGIN-40-dead-reference.sh +74 -0
- package/content/tools/gate/core-rules/README.md +55 -0
- package/content/tools/gate/guardrails.sh +740 -0
- package/content/tools/gate/lib/ratchet.sh +119 -0
- package/content/tools/gate/lib/scope.sh +85 -0
- package/content/tools/gate/ratchet.seed.tsv +1 -0
- package/content/tools/gate/rules/README.md +50 -0
- package/package.json +19 -5
- package/plugin/agy/hooks.json +29 -0
- package/plugin/agy/mcp_config.json +7 -0
- package/plugin/agy/plugin.json +6 -0
- package/plugin/agy/skills/afm-adr/SKILL.md +48 -0
- package/plugin/agy/skills/afm-analyze/SKILL.md +34 -0
- package/plugin/agy/skills/afm-clarify/SKILL.md +34 -0
- package/plugin/agy/skills/afm-deliver/SKILL.md +30 -0
- package/plugin/agy/skills/afm-diagnose/SKILL.md +46 -0
- package/plugin/agy/skills/afm-evolve/SKILL.md +49 -0
- package/plugin/agy/skills/afm-export-template/SKILL.md +43 -0
- package/plugin/agy/skills/afm-generalize/SKILL.md +37 -0
- package/plugin/agy/skills/afm-gotcha/SKILL.md +46 -0
- package/plugin/agy/skills/afm-init/SKILL.md +81 -0
- package/plugin/agy/skills/afm-plan/SKILL.md +34 -0
- package/plugin/agy/skills/afm-policy/SKILL.md +29 -0
- package/plugin/agy/skills/afm-promote/SKILL.md +43 -0
- package/plugin/agy/skills/afm-protocol/SKILL.md +45 -0
- package/plugin/agy/skills/afm-reconcile/SKILL.md +49 -0
- package/plugin/agy/skills/afm-refactor/SKILL.md +83 -0
- package/plugin/agy/skills/afm-reflect/SKILL.md +49 -0
- package/plugin/agy/skills/afm-remediate/SKILL.md +39 -0
- package/plugin/agy/skills/afm-restructure/SKILL.md +52 -0
- package/plugin/agy/skills/afm-rule/SKILL.md +49 -0
- package/plugin/agy/skills/afm-specify/SKILL.md +34 -0
- package/plugin/agy/skills/afm-tasks/SKILL.md +28 -0
- package/plugin/agy/skills/afm-update/SKILL.md +64 -0
- package/plugin/agy/skills/afm-verify/SKILL.md +35 -0
- package/plugin/claude-code/.claude-plugin/marketplace.json +15 -0
- package/plugin/claude-code/.claude-plugin/plugin.json +9 -0
- package/plugin/claude-code/.mcp.json +7 -0
- package/plugin/claude-code/agents/afm-executor.md +18 -0
- package/plugin/claude-code/agents/afm-explorer.md +20 -0
- package/plugin/claude-code/agents/afm-reviewer.md +21 -0
- package/plugin/claude-code/hooks/hooks.json +85 -0
- package/plugin/claude-code/skills/adr/SKILL.md +48 -0
- package/plugin/claude-code/skills/analyze/SKILL.md +34 -0
- package/plugin/claude-code/skills/clarify/SKILL.md +34 -0
- package/plugin/claude-code/skills/deliver/SKILL.md +30 -0
- package/plugin/claude-code/skills/diagnose/SKILL.md +46 -0
- package/plugin/claude-code/skills/evolve/SKILL.md +49 -0
- package/plugin/claude-code/skills/export-template/SKILL.md +43 -0
- package/plugin/claude-code/skills/generalize/SKILL.md +37 -0
- package/plugin/claude-code/skills/gotcha/SKILL.md +46 -0
- package/plugin/claude-code/skills/init/SKILL.md +81 -0
- package/plugin/claude-code/skills/plan/SKILL.md +34 -0
- package/plugin/claude-code/skills/policy/SKILL.md +29 -0
- package/plugin/claude-code/skills/promote/SKILL.md +43 -0
- package/plugin/claude-code/skills/protocol/SKILL.md +45 -0
- package/plugin/claude-code/skills/reconcile/SKILL.md +49 -0
- package/plugin/claude-code/skills/refactor/SKILL.md +83 -0
- package/plugin/claude-code/skills/reflect/SKILL.md +49 -0
- package/plugin/claude-code/skills/remediate/SKILL.md +39 -0
- package/plugin/claude-code/skills/restructure/SKILL.md +52 -0
- package/plugin/claude-code/skills/rule/SKILL.md +49 -0
- package/plugin/claude-code/skills/specify/SKILL.md +34 -0
- package/plugin/claude-code/skills/tasks/SKILL.md +28 -0
- package/plugin/claude-code/skills/update/SKILL.md +64 -0
- package/plugin/claude-code/skills/verify/SKILL.md +35 -0
- package/plugin/opencode/afm/index.js +245 -0
- package/plugin/opencode/afm/tui.js +21 -0
- package/plugin/opencode/agents/afm-executor.md +39 -0
- package/plugin/opencode/agents/afm-explorer.md +92 -0
- package/plugin/opencode/agents/afm-reviewer.md +93 -0
- package/plugin/opencode/skills/afm-adr/SKILL.md +48 -0
- package/plugin/opencode/skills/afm-analyze/SKILL.md +34 -0
- package/plugin/opencode/skills/afm-clarify/SKILL.md +34 -0
- package/plugin/opencode/skills/afm-deliver/SKILL.md +30 -0
- package/plugin/opencode/skills/afm-diagnose/SKILL.md +46 -0
- package/plugin/opencode/skills/afm-evolve/SKILL.md +49 -0
- package/plugin/opencode/skills/afm-export-template/SKILL.md +43 -0
- package/plugin/opencode/skills/afm-generalize/SKILL.md +37 -0
- package/plugin/opencode/skills/afm-gotcha/SKILL.md +46 -0
- package/plugin/opencode/skills/afm-init/SKILL.md +81 -0
- package/plugin/opencode/skills/afm-plan/SKILL.md +34 -0
- package/plugin/opencode/skills/afm-policy/SKILL.md +29 -0
- package/plugin/opencode/skills/afm-promote/SKILL.md +43 -0
- package/plugin/opencode/skills/afm-protocol/SKILL.md +45 -0
- package/plugin/opencode/skills/afm-reconcile/SKILL.md +49 -0
- package/plugin/opencode/skills/afm-refactor/SKILL.md +83 -0
- package/plugin/opencode/skills/afm-reflect/SKILL.md +49 -0
- package/plugin/opencode/skills/afm-remediate/SKILL.md +39 -0
- package/plugin/opencode/skills/afm-restructure/SKILL.md +52 -0
- package/plugin/opencode/skills/afm-rule/SKILL.md +49 -0
- package/plugin/opencode/skills/afm-specify/SKILL.md +34 -0
- package/plugin/opencode/skills/afm-tasks/SKILL.md +28 -0
- package/plugin/opencode/skills/afm-update/SKILL.md +64 -0
- package/plugin/opencode/skills/afm-verify/SKILL.md +35 -0
- package/README.md +0 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: promote
|
|
3
|
+
description: |
|
|
4
|
+
Records an instance learning that applies to every AFM project. It stores the finding in the project's machine state, classifies the target, and formats it as an issue body. It needs reproducible mechanical evidence. It never edits the plugin.
|
|
5
|
+
Activates: `afm promote`, "this applies to any project", "this rule should be in the template", "this gotcha should be in the template".
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AFM — Promote
|
|
9
|
+
|
|
10
|
+
## When NOT to activate
|
|
11
|
+
|
|
12
|
+
This disambiguation applies once this skill has already activated. Project-specific learning stays in
|
|
13
|
+
`<consumer>/docs/`. Use `afm generalize` to consolidate gotchas INSIDE the instance. Use `afm update` to
|
|
14
|
+
bring the plugin INTO the instance (the opposite direction).
|
|
15
|
+
|
|
16
|
+
## Pre-check
|
|
17
|
+
|
|
18
|
+
`afm preflight`. Exit 3 means there is no instance: stop and suggest `afm init` or `afm refactor` first.
|
|
19
|
+
|
|
20
|
+
## Procedure (judgment only)
|
|
21
|
+
|
|
22
|
+
1. Read `afm path interview/promotion` and apply the gate for reproducible mechanical evidence: the command
|
|
23
|
+
that proves the defect or the learning, with its output before and expected after. No command means an
|
|
24
|
+
observation in the report, not a finding.
|
|
25
|
+
2. Walk the classification (project entity, one stack, a convention, a pattern, or universal) to set the
|
|
26
|
+
`target`. A learning that names a project entity stays in `docs/`.
|
|
27
|
+
3. Record it: `afm findings record --target <target> --title "<title>" --evidence "<command> → <output>"
|
|
28
|
+
--note "<why it applies to any instance>"`. Report and stop.
|
|
29
|
+
|
|
30
|
+
## Invariant principles
|
|
31
|
+
|
|
32
|
+
Most relevant here: #5: never record a
|
|
33
|
+
project-specific learning, and never one without a real case; the list grows on demand.
|
|
34
|
+
|
|
35
|
+
It also includes #6/#7: the plugin boundary is **absolute**. This op records a finding and never applies a
|
|
36
|
+
change.
|
|
37
|
+
|
|
38
|
+
Passive mode (`afm reconcile`) is always on and can propose `afm promote` when it detects a signal that a
|
|
39
|
+
learning generalizes to any project.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: protocol
|
|
3
|
+
description: |
|
|
4
|
+
Declares or reports the autonomy protocol of the project. The protocol parametrizes the PLAN threshold, the retry cap and the learning cadence. Three presets exist: p1 autonomous, p2 assisted, p3 planned-autonomous. It writes `protocol:` to `docs/_focus.md`, and with no argument it only reports.
|
|
5
|
+
Activates: `afm protocol [<name>]`, "what protocol am I using", "switch to assisted", "decide on your own for this delivery", "stop asking me so much".
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AFM — Protocol (declared autonomy posture)
|
|
9
|
+
|
|
10
|
+
Field and preset definitions are in `afm path core/protocol`.
|
|
11
|
+
|
|
12
|
+
> **A protocol is data, not a new execution path.** It parametrizes operations that already exist. A project
|
|
13
|
+
> with no `protocol:` declared uses the defaults, which reproduce pre-v4 behavior.
|
|
14
|
+
|
|
15
|
+
## When NOT to activate
|
|
16
|
+
|
|
17
|
+
This is a disambiguation for a skill that already activated. Running a delivery is `afm deliver` (it
|
|
18
|
+
**reads** the current protocol, it does not set it). Changing a hard rule is `afm rule`. Adjusting the work
|
|
19
|
+
focus without touching posture is a direct edit to `docs/_focus.md`. A mid-delivery "go ahead" is an
|
|
20
|
+
**ephemeral gate override**, not a protocol change, and it does not activate this skill.
|
|
21
|
+
|
|
22
|
+
## Pre-check
|
|
23
|
+
|
|
24
|
+
1. `afm preflight`. Exit 3 means there is no instance: stop and suggest `afm init` or `afm refactor`.
|
|
25
|
+
2. **`p1` becomes current only through explicit invocation in this session.** Never infer it from natural
|
|
26
|
+
language and never inherit it from `git pull`. Granting the loosest posture is a human act, not a
|
|
27
|
+
repository act: a person runs `afm protocol p1 --i-mean-it`.
|
|
28
|
+
|
|
29
|
+
## Procedure (judgment only)
|
|
30
|
+
|
|
31
|
+
Run `afm protocol` to report, or `afm protocol <p1|p2|p3>` to switch. Then explain the **behavior delta** the
|
|
32
|
+
command printed, because switching protocols without knowing what changes means switching contracts blind.
|
|
33
|
+
Outside the three presets, the file must already exist: never invent one.
|
|
34
|
+
|
|
35
|
+
## Invariant principles
|
|
36
|
+
|
|
37
|
+
Most relevant here: #4 and #5.
|
|
38
|
+
|
|
39
|
+
#4: `[TBD]` beats invention. An instance with no declared posture does not receive an assumed one.
|
|
40
|
+
|
|
41
|
+
#5: Do not invent a preset without a real case.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reconcile
|
|
3
|
+
description: |
|
|
4
|
+
Always-on passive mode. It watches the signals in `interview/triggers.md` and proposes one edit to `docs/` at the end of the turn. It never applies the edit on its own and needs no command. It stays active in any project with `docs/.afm-version`, next to any other skill and to normal code work.
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AFM — Reconcile (passive mode, always-on)
|
|
8
|
+
|
|
9
|
+
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
|
+
|
|
11
|
+
## When NOT to activate
|
|
12
|
+
|
|
13
|
+
A project without `docs/.afm-version`: stay silent until bootstrap. Do not interfere with a bootstrap session (`afm init`) or a refactor session (`afm refactor`); they create `.afm-version`, and reconcile starts after that.
|
|
14
|
+
|
|
15
|
+
## Pre-check
|
|
16
|
+
|
|
17
|
+
`afm preflight` exits 0 when the project is bootstrapped: reconcile is active, so load the signal table and the procedure and watch the whole session. Exit 3 means it is not: stay silent and propose nothing.
|
|
18
|
+
|
|
19
|
+
## Doctrine
|
|
20
|
+
|
|
21
|
+
One criterion decides where something belongs (universal principle #1, source in `afm path PRINCIPLES.md`):
|
|
22
|
+
|
|
23
|
+
> *"If another developer, or another agent without my memory, needs to know this to avoid breaking something, it is a doc, not memory."*
|
|
24
|
+
|
|
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
|
+
|
|
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
|
+
|
|
29
|
+
## Procedure (always-on)
|
|
30
|
+
|
|
31
|
+
In any session of a project with `docs/.afm-version`:
|
|
32
|
+
|
|
33
|
+
1. Load `afm path interview/triggers.md`: the signals, the affected docs and the ready-made phrasing.
|
|
34
|
+
2. Load the op `afm path ops/reconcile.md`: the literal passive-mode procedure.
|
|
35
|
+
3. Monitor the work in progress (code, debugging, refactor, feature, doc edit). When a signal fires (a new structural decision, a runtime surprise twice, a correction with a reusable rule, a new component), **propose an edit** to the right `docs/` file at the end of the turn.
|
|
36
|
+
4. **Never auto-apply** (principle #6: autonomy-first applies inside an invoked op or an approved feature; a passive signal is not approved scope).
|
|
37
|
+
5. When a proposal becomes a concrete action, suggest the matching op: `afm adr`, `afm gotcha`, `afm rule`, `afm promote`, `afm specify`, and more.
|
|
38
|
+
|
|
39
|
+
## Critical anti-patterns
|
|
40
|
+
|
|
41
|
+
Never apply an edit without proposing it first, never save a project rule in memory, never invent a gotcha without a 2x trigger, never promote to the template before the operator confirms, and never interrupt code work with a long proposal: use one short line at the end of the turn. The full list is in the op.
|
|
42
|
+
|
|
43
|
+
## Invariant principles
|
|
44
|
+
|
|
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).
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refactor
|
|
3
|
+
description: |
|
|
4
|
+
Adopts AFM retroactively in a brownfield codebase. The CLI reads the code, the git log and the existing rules and materializes `<consumer>/docs/` with `[TBD]` in the gaps; the skill then asks the gap questions through `afm ask`. New rules are forward-only in `afm.md § 3.1`. It activates ONLY on explicit invocation and never from project state.
|
|
5
|
+
Activates: `afm refactor`, "adopt AFM here", "build the doc retroactively", "infer docs from the code".
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AFM — Refactor (brownfield retroactive)
|
|
9
|
+
|
|
10
|
+
This skill of `afm` handles **retroactive AFM adoption in a brownfield codebase**. Single responsibility. It
|
|
11
|
+
does not route ops (each op is its own skill).
|
|
12
|
+
|
|
13
|
+
The roadmap is `afm path interview/refactor`. This skill is a router. It **never invents procedure and always
|
|
14
|
+
reads the source first**. The layout of the shipped content is `afm path README`.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## When NOT to activate
|
|
19
|
+
|
|
20
|
+
This is a disambiguation check for a skill already active. It is not an activation trigger.
|
|
21
|
+
|
|
22
|
+
The project already has `docs/.afm-version`: use `afm update` to raise the version, refactor refuses. A
|
|
23
|
+
project with `docs/.template` needs `afm init` (from-template branch).
|
|
24
|
+
|
|
25
|
+
## Pre-check (before any action)
|
|
26
|
+
|
|
27
|
+
1. **`afm preflight`.** Exit 3 means there is no `docs/.afm-version`: continue. Any other exit means the
|
|
28
|
+
project is already bootstrapped: **refactor does not run.** The atomic skills stay available (`afm gotcha`,
|
|
29
|
+
`afm adr`, `afm rule`, `afm promote`, `afm specify`, `afm plan`, `afm tasks`, `afm clarify`, `afm analyze`,
|
|
30
|
+
`afm export-template`), and passive mode (`afm reconcile`) is already always-on. **If the
|
|
31
|
+
goal was to raise the instance to a newer version** (`.afm-version` drift), use `afm update`: refactor
|
|
32
|
+
creates an instance, update updates an existing one.
|
|
33
|
+
2. **Does `docs/.template` exist?** Yes means the project comes from a template, and refactor is not the right
|
|
34
|
+
path. Suggest `afm init` (it detects the marker and branches to the from-template flow).
|
|
35
|
+
3. **Is this real brownfield?** `afm refactor --mechanical --dry-run` checks it and states the reasons: a
|
|
36
|
+
manifest with real dependencies, a populated source root, a git history of more than 20 commits. Any
|
|
37
|
+
false means this is not brownfield: suggest `afm init` (*"This project does not yet seem to have a relevant
|
|
38
|
+
codebase. `afm init` does the greenfield bootstrap. Want to run that?"*).
|
|
39
|
+
4. **Is the shipped content resolved?** `afm preflight` exit 4 means it is not. Report it. Do not guess the
|
|
40
|
+
content and do not fall back silently.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Procedure (brownfield refactor)
|
|
45
|
+
|
|
46
|
+
For brownfield projects without `docs/.afm-version`:
|
|
47
|
+
|
|
48
|
+
1. Read `afm path interview/refactor` end to end.
|
|
49
|
+
2. Ask the closed decisions the mechanical pass needs (`afm ask init`), announce the plan in one line and
|
|
50
|
+
proceed directly: **no gate** (invoking `afm refactor` already approves this, per invariant principle #6).
|
|
51
|
+
3. **Run the 4 parts literally:**
|
|
52
|
+
- **Part A**: `afm refactor --mechanical` runs the autonomous code archaeology (stack scan, folder tree,
|
|
53
|
+
entity scan, CI and hooks scan, hard-rule audit, retroactive ADR candidates) and prints the report. No
|
|
54
|
+
turns with the operator. Read the README and the history yourself for the prose-only facts.
|
|
55
|
+
- **Part B**: the same command materialized the skeleton of `docs/{prd,ach,afm,ust,gotchas}`; fill the
|
|
56
|
+
drafts from the report with `[TBD]` in the gaps and report a summary plus paths. Review happens through
|
|
57
|
+
`git diff`. No review gate applies.
|
|
58
|
+
- **Part C**: run a short interview, one question per turn, closed ones through `afm ask <op>`
|
|
59
|
+
recommendation-first (invariant principle #8). Cover the pain point, the persona and the README summary
|
|
60
|
+
validation, retroactive ADRs (with a load-bearing guardrail, invariant principle #9), confirmed gotchas,
|
|
61
|
+
DoD + pre-push and code-style seeds.
|
|
62
|
+
- **Part D**: write `afm.md § 3.1` with forward-only rules based on the audit. Check `docs/.afm-version` and
|
|
63
|
+
`AGENTS.md`.
|
|
64
|
+
4. Apply the opt-in modules detected in A.1. For each stack, merge `afm path modules/<stack>/ach.patch` and
|
|
65
|
+
`afm path modules/<stack>/rules.patch` into the draft. A `gotchas.seed` becomes a commented block in the
|
|
66
|
+
gotchas doc. Only the entries the operator confirms in C.9.5 become active.
|
|
67
|
+
5. Print a closing summary plus a suggested commit (see the roadmap § Closing).
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Invariant principles
|
|
72
|
+
|
|
73
|
+
For this skill (brownfield), **all** principles apply: the 8 universals
|
|
74
|
+
§1-8 plus the addition §9 (a retroactive ADR is load-bearing-only). #9 separates refactor from init. Init
|
|
75
|
+
forbids retroactive ADRs.
|
|
76
|
+
|
|
77
|
+
## Continuous doctrine
|
|
78
|
+
|
|
79
|
+
Passive mode (`afm reconcile`) is always-on in any AFM project session. This skill covers only the active refactor procedure.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: reflect
|
|
3
|
+
description: |
|
|
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
|
+
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
|
+
---
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# AFM — Reflect (behavioral self-reflection on the docs)
|
|
10
|
+
|
|
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.
|
|
12
|
+
|
|
13
|
+
## When not to activate
|
|
14
|
+
|
|
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.
|
|
16
|
+
|
|
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`.
|
|
18
|
+
|
|
19
|
+
## Pre-check
|
|
20
|
+
|
|
21
|
+
1. **Does `<consumer>/docs/.afm-version` exist?** If not, stop. Suggest `afm init` (greenfield) or `afm refactor` (brownfield) first.
|
|
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.
|
|
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).
|
|
24
|
+
|
|
25
|
+
## Procedure
|
|
26
|
+
|
|
27
|
+
The steps are:
|
|
28
|
+
|
|
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.
|
|
30
|
+
|
|
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.
|
|
32
|
+
|
|
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.
|
|
34
|
+
|
|
35
|
+
**4. Own gate.** Ask item by item, earned, with `afm ask reflect --scope <item-slug>`. `afm evolve` suppresses this gate.
|
|
36
|
+
|
|
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`).
|
|
38
|
+
|
|
39
|
+
## Invariant principles
|
|
40
|
+
|
|
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.
|
|
42
|
+
|
|
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.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: remediate
|
|
3
|
+
description: |
|
|
4
|
+
Reads the open failures of the state store (`afm failures promotable`) and proposes the durable artifact: a procedure when the fix is mechanical, a learning when it is conceptual. A failure enters by external signal, never by self-judgment.
|
|
5
|
+
Activates: `afm remediate`, "this failed again, fix it for real", "create a runbook for this", "record this lesson for the next agent sessions".
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# AFM — Remediate (CRITIC loop)
|
|
10
|
+
|
|
11
|
+
## When NOT to activate
|
|
12
|
+
|
|
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.
|
|
14
|
+
|
|
15
|
+
Use `afm.md § 5.1` for an in-task retry at the moment of the error. Use `afm gotcha` for an SDK surprise with no failure of its own. Do not invent a failure. Only act on a recorded failure that `afm failures promotable` lists, or on an explicit user correction.
|
|
16
|
+
|
|
17
|
+
## Pre-check
|
|
18
|
+
|
|
19
|
+
1. **Does `<consumer>/docs/.afm-version` exist?** If not, stop. Suggest `afm init` for a greenfield project or `afm refactor` for a brownfield project.
|
|
20
|
+
2. **Is there an open failure?** Run `afm failures promotable`. With `no failure is promotable` and no explicit user correction, report "nothing to remediate" and stop. An empty diagnosis is a valid result.
|
|
21
|
+
3. **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.
|
|
22
|
+
|
|
23
|
+
## Procedure
|
|
24
|
+
|
|
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).
|
|
26
|
+
|
|
27
|
+
## Invariant principles
|
|
28
|
+
|
|
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).
|
|
30
|
+
|
|
31
|
+
## Continuous doctrine
|
|
32
|
+
|
|
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.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: restructure
|
|
3
|
+
description: |
|
|
4
|
+
Checks the context architecture of the local docs. It looks at staleness against the code, findability across layers, and the hot versus on-demand partition. It relocates content that already exists and writes no new content.
|
|
5
|
+
Activates: `afm restructure`, "the doc is stale versus the code", "this should load only on demand", "the guidance exists but I cannot find it in the doc".
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# AFM — Restructure (context architecture health)
|
|
10
|
+
|
|
11
|
+
> **Carve-out (does not overlap existing ops):** `afm diagnose` A1 finds a **dead reference** (the path does not exist). `restructure` staleness finds a path that **exists but changed** while the doc did not. `afm reconcile` adds **missing** information. `restructure` relocates information that **exists but sits in the wrong place**. `afm reflect` targets **clarity**. `restructure` targets **location and freshness**. `afm evolve` is the **orchestrator** that composes this skill when `afm diagnose` flags staleness or bloat.
|
|
12
|
+
>
|
|
13
|
+
> **Maturity (honest YAGNI):** the actionable core today is **staleness** (from git) plus **findability**. **Temperature tiering** (always-hot vs on-demand) is an **opt-in** ADR proposal, only for a doc that has actually outgrown its size. Small docs do not need it.
|
|
14
|
+
|
|
15
|
+
## When NOT to activate
|
|
16
|
+
|
|
17
|
+
This is a disambiguation guide for a skill that has already activated. It does not gate activation, so it stays in the body, not in the resident listing.
|
|
18
|
+
|
|
19
|
+
A path that does not exist belongs to `afm diagnose` (A1). Staleness means the path exists but changed. Information never documented belongs to passive mode (`afm reconcile`) → `afm gotcha` or `afm rule`. An ambiguous doc belongs to `afm reflect`. Merging gotchas belongs to `afm generalize`. The full cycle belongs to `afm evolve`.
|
|
20
|
+
|
|
21
|
+
## Pre-check
|
|
22
|
+
|
|
23
|
+
1. **Does `<consumer>/docs/.afm-version` exist?** If not, stop. Suggest `afm init` (greenfield) or `afm refactor` (brownfield) first.
|
|
24
|
+
2. **Does `afm preflight` exit 0?** A non-zero exit says why (docs not bootstrapped, content unresolved, pin mismatch). Report it to the user. Do not fall back silently.
|
|
25
|
+
3. **Is git available?** The staleness scan needs the git history. Without git, `afm doctor` marks this axis "not covered: no git". Never omit it.
|
|
26
|
+
|
|
27
|
+
## Procedure
|
|
28
|
+
|
|
29
|
+
Use these five steps.
|
|
30
|
+
|
|
31
|
+
1. **Staleness scan.** `afm doctor --json` runs it (findings with axis `staleness` and `dead-gotcha`); read them. The git trigger fires in two cases. First case: a path cited in the doc has a later last commit than the doc. Second case: the doc has been stale for more than N commits. A hit is a candidate, not a verdict. The scan never rewrites the doc on its own.
|
|
32
|
+
2. **Findability.** Relocate or cross-reference information that exists but sits buried or in the wrong doc. Cite both locations. Route information that is genuinely missing to passive mode (`afm reconcile`).
|
|
33
|
+
3. **Temperature partition.** Propose a hot/on-demand loading strategy as an opt-in ADR. Do this only when a doc has outgrown its size. Preserve 100% of the content.
|
|
34
|
+
4. **Its own gate.** This gate is load-bearing and earned, one `afm ask restructure --scope <item-slug>` per finding. It follows the **shared-proposal discipline** in `evolve.md` (`afm path ops/evolve.md`), instead of a duplicate copy of that discipline. `afm evolve` suppresses this gate when it runs.
|
|
35
|
+
5. **Record.** Write the result to `docs/evolution/NNN-<date>.md`. Suggest `afm promote` if the finding generalizes.
|
|
36
|
+
|
|
37
|
+
## Invariant principles
|
|
38
|
+
|
|
39
|
+
Most relevant here:
|
|
40
|
+
|
|
41
|
+
- #2: get git evidence before you propose a change.
|
|
42
|
+
- #3: staleness needs an executable git trigger.
|
|
43
|
+
- #4/#5: missing product content becomes `[TBD]` or goes to passive mode (`afm reconcile`). Never invent it.
|
|
44
|
+
- #6/#8: self-check the work, then pass an earned gate.
|
|
45
|
+
|
|
46
|
+
**No new principle here.** `restructure` is a composed materialization. The doctrine lives in the op file.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rule
|
|
3
|
+
description: |
|
|
4
|
+
Adds a hard rule to `<consumer>/docs/afm.md § 3`. A mechanical trigger is mandatory and must return 0 or 1, such as `grep`, `wc -l`, `git diff` or `tsc`. A code review or a PR template is not a trigger. Without a trigger the entry becomes a principle in § 1.3.
|
|
5
|
+
Activates: `afm rule`, "new hard rule", "this should be a rule".
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AFM — Rule
|
|
9
|
+
|
|
10
|
+
The CLI owns the number, the rule file, the index line and the runner skeleton, and refuses a rule with no
|
|
11
|
+
honest trigger form. This skill keeps only the judgment.
|
|
12
|
+
|
|
13
|
+
## When NOT to activate
|
|
14
|
+
|
|
15
|
+
This is a disambiguation for a skill that already activated. Use `afm adr` for a one-off architectural
|
|
16
|
+
decision. Use `afm gotcha` for a counterintuitive surprise. Use `afm generalize` to merge rules or gotchas
|
|
17
|
+
that already exist.
|
|
18
|
+
|
|
19
|
+
## Pre-check
|
|
20
|
+
|
|
21
|
+
`afm preflight`. Exit 3 means there is no instance: stop and suggest `afm init` or `afm refactor` first.
|
|
22
|
+
|
|
23
|
+
## Procedure (judgment only)
|
|
24
|
+
|
|
25
|
+
1. Confirm the mechanical trigger as free text, and push back hard: no trigger means a principle in § 1.3.
|
|
26
|
+
Run the anti-Goodhart test: can a diff pass the trigger while it breaks the rule's intent? If yes, rewrite
|
|
27
|
+
or downgrade it.
|
|
28
|
+
2. Measure the repo for any constant and propose the value with the measurement. An unanswered constant is
|
|
29
|
+
`[TBD]`. Check for an existing versioned script and cite it.
|
|
30
|
+
3. Choose the surface: `afm ask rule`. Run `afm rule new <slug> --trigger '<command>' --surface <surface>` and
|
|
31
|
+
report the paths (#6). For `pre-commit` or `ci`, follow "Install the gate" in the op: `afm gate --baseline`
|
|
32
|
+
before the gate goes on.
|
|
33
|
+
4. In a refactored project only, ask where the rule enters: `afm ask rule-scope` (universal § 3 or
|
|
34
|
+
forward-only § 3.1). The scope decision reflects intent, so it stays fixed once made.
|
|
35
|
+
|
|
36
|
+
## Invariant principles
|
|
37
|
+
|
|
38
|
+
Most relevant here: #3 (a hard rule needs
|
|
39
|
+
a mechanical trigger, or it is a principle instead) and #6 (autonomy-first: materialize the change and
|
|
40
|
+
report it).
|
|
41
|
+
|
|
42
|
+
Passive mode (`afm reconcile`) is always on and can propose `afm rule` when it detects the signal "the user
|
|
43
|
+
corrected an approach with a reusable rule".
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: specify
|
|
3
|
+
description: |
|
|
4
|
+
Opens a feature folder at `docs/features/NNN-slug/spec.md`, linked to a user story. A mechanical heuristic decides first, because a feature folder for a trivial change is overhead.
|
|
5
|
+
Activates: `afm specify <slug>`, "open a feature", "start a new feature", "create a feature folder".
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AFM — Specify
|
|
9
|
+
|
|
10
|
+
## When NOT to activate
|
|
11
|
+
|
|
12
|
+
A trivial change (no feature folder needed) goes straight to the `afm.md § 2` loop. A full end-to-end delivery is `afm deliver`, which composes this op.
|
|
13
|
+
|
|
14
|
+
## Pre-check
|
|
15
|
+
|
|
16
|
+
Run `afm preflight`. Exit 3 means no `docs/.afm-version`: stop and suggest `afm init` or `afm refactor`. Exit 4 or 5: report the line it printed.
|
|
17
|
+
|
|
18
|
+
## Procedure
|
|
19
|
+
|
|
20
|
+
The number comes from `afm next-id feature`, never by hand. What is left to you is judgment: compute the trigger heuristic from the scan (ask the `heuristic` question only when borderline), find the linked US in `docs/ust.md` before asking (`afm ask specify`), create the spec with `afm new feature-spec <slug>` (the generator writes the frontmatter the template names) and fill its body, update the `Spec:` line of the US, and report the open `[NEEDS CLARIFICATION:]` items. Autonomy-first: write and report, review through `git diff`.
|
|
21
|
+
|
|
22
|
+
## Invariant principles
|
|
23
|
+
|
|
24
|
+
Most relevant here: #2 (discover-first: compute the heuristic and the US from the scan), #5 (never invent a success criterion) and #6 (autonomy-first).
|
|
25
|
+
|
|
26
|
+
## Continuous doctrine
|
|
27
|
+
|
|
28
|
+
Passive mode (`afm reconcile`) is always on. This skill covers only the opening of the feature.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tasks
|
|
3
|
+
description: |
|
|
4
|
+
Generates the `tasks:` list of `tasks.md` in TDD order with `afm task add`. Every task references a user story or a requirement. It hard-blocks on an open `[NEEDS CLARIFICATION:]` in the plan.
|
|
5
|
+
Activates: `afm tasks [<feature>]`, "generate the tasks", "break the feature into tasks".
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AFM — Tasks
|
|
9
|
+
|
|
10
|
+
## When NOT to activate
|
|
11
|
+
|
|
12
|
+
There is no `plan.md` yet: run `afm plan` first. An end-to-end delivery is `afm deliver`, which composes this op.
|
|
13
|
+
|
|
14
|
+
## Pre-check
|
|
15
|
+
|
|
16
|
+
Run `afm preflight` (exit 3: stop and suggest `afm init` or `afm refactor`). Run `afm feature status <NNN> --json`: a non-empty `blockers` is an open `[NEEDS CLARIFICATION:]` in the plan. That is a hard refusal with no override, not a question.
|
|
17
|
+
|
|
18
|
+
## Principles
|
|
19
|
+
|
|
20
|
+
Most relevant here: #5 (every task traces to a US or RF) and rule 1 (TDD: no green task without the red task it closes).
|
|
21
|
+
|
|
22
|
+
## Continuous doctrine
|
|
23
|
+
|
|
24
|
+
Passive mode (`afm reconcile`) is always on. This skill covers only the task list.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: update
|
|
3
|
+
description: |
|
|
4
|
+
Syncs `<consumer>/docs/` with the current plugin version. It materializes the consumer-facing deltas between the pinned version and the shipped version, then moves the pin. It reads the plugin and never edits it.
|
|
5
|
+
Activates: `afm update`, "bump the methodology version", "sync docs with the new plugin", "my `.afm-version` is behind".
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AFM — Update (sync instance-plugin)
|
|
9
|
+
|
|
10
|
+
The CLI runs the codemod registry, proves each op and moves the pin. This skill keeps the judgment.
|
|
11
|
+
|
|
12
|
+
> **Carve-out (does not overlap existing ops):** `afm init` and `afm refactor` **create** the instance
|
|
13
|
+
> (bootstrap). `update` brings an **existing** instance forward, the path that `afm refactor` refuses.
|
|
14
|
+
> `afm diagnose` only **detects** drift on axis A3 (read-only). `update` **resolves** it. `afm promote`
|
|
15
|
+
> **records** a finding meant for the plugin. `update` reads the plugin and materializes it into the
|
|
16
|
+
> instance, and neither touches the shipped content: an absolute boundary (#7). `afm evolve` is the
|
|
17
|
+
> **cycle** that composes `update` on axis A3.
|
|
18
|
+
|
|
19
|
+
## When NOT to activate
|
|
20
|
+
|
|
21
|
+
This is a disambiguation for a skill that already activated. Use `afm init` or `afm refactor` if no instance
|
|
22
|
+
is bootstrapped yet. Skip `update` if the pinned version already equals the shipped version (no drift). Use
|
|
23
|
+
`afm promote` to carry a learning from the instance TO the plugin (the opposite direction). Use
|
|
24
|
+
`afm diagnose` to only CHECK for drift. Use `afm evolve` for the full cycle.
|
|
25
|
+
|
|
26
|
+
## Pre-check
|
|
27
|
+
|
|
28
|
+
`afm update --dry-run` does it: exit 3 means no instance (suggest `afm init` or `afm refactor`), exit 4 means
|
|
29
|
+
the shipped content does not resolve (report it, do not fall back silently), and "already up to date" ends
|
|
30
|
+
the run. A pin **ahead** of the binary is an anomaly: report it, never roll it back.
|
|
31
|
+
|
|
32
|
+
## Procedure (judgment only)
|
|
33
|
+
|
|
34
|
+
1. Read the dry run as one package and show it as evidence. Ask `afm ask update`. Under `afm evolve` this gate
|
|
35
|
+
is suppressed.
|
|
36
|
+
2. Run `afm update`. It moves the pin only at the end, and keeps it where it was when a codemod fails.
|
|
37
|
+
3. Exit 6 means agent tasks are pending: do each one inside its scope (`afm lint --fix <path>` fixes the
|
|
38
|
+
frontmatter findings), then run `afm update` again. `afm update --accept <path>` closes a sync on a file
|
|
39
|
+
you merged by hand. An opt-in delta is reported and never applied. Exit 5 (a major crossing) is
|
|
40
|
+
`afm migrate`.
|
|
41
|
+
4. **Language migration** (when the instance is not English): read `prd.md` § 11.1 FIRST and derive the
|
|
42
|
+
excluded scope from it, and only then read a file. `[TBD]` there stops the step and asks
|
|
43
|
+
`afm ask update-strings`. It never picks a language. The artifacts question is
|
|
44
|
+
`afm ask update-artifacts`. On migrate, run the rewrite as one orchestrated batch through
|
|
45
|
+
{{host:workflow}}, with a light model per agent ({{host:light-model}}) for the rewrite and the loss
|
|
46
|
+
check. Escalate only a flagged file to a capable model. The session model keeps the excluded scope and
|
|
47
|
+
the final gate.
|
|
48
|
+
5. Post-conditions: `afm index --check` returns 0 and the plugin boundary stays clean. Report in chat what
|
|
49
|
+
migrated and what stayed pending. Under `afm evolve`, feed it to `docs/evolution/`.
|
|
50
|
+
|
|
51
|
+
## Invariant principles
|
|
52
|
+
|
|
53
|
+
Most relevant here: #2 (discover-first): the proof of
|
|
54
|
+
need is the grep that shows what is missing. Follow #4/#5: materialize only what the plugin already provides
|
|
55
|
+
ready-made, and never invent missing product content. Follow #6 (autonomy-first with a gate). Bright line
|
|
56
|
+
#7 applies: only **read** the plugin, and write only to the instance.
|
|
57
|
+
|
|
58
|
+
**No new principle here.** `update` is composed materialization. The doctrine lives in the op file.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verify
|
|
3
|
+
description: |
|
|
4
|
+
Stamps a human verification on one doc under `docs/`. It writes the OKF `verified` field and is the only writer of that field. Use it when a person states they reviewed a document.
|
|
5
|
+
Activates: `afm verify <path>`, "I reviewed this rule", "mark this gotcha as verified", "sign off on this ADR".
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# AFM — Verify (stamp a human review)
|
|
9
|
+
|
|
10
|
+
## When not to activate
|
|
11
|
+
|
|
12
|
+
Never on ordinary work, and never on your own output. This skill records that a PERSON read a document. An
|
|
13
|
+
agent stamping its own writing produces a lie the trust tier cannot detect.
|
|
14
|
+
|
|
15
|
+
## Pre-check
|
|
16
|
+
|
|
17
|
+
1. `afm preflight`. Exit 3 means there is no instance: stop.
|
|
18
|
+
2. **Did a person state they reviewed the file?** If not, stop and ask: `afm ask verify`. Inference is not
|
|
19
|
+
review.
|
|
20
|
+
3. The file must carry a frontmatter block, or there is no contract to stamp.
|
|
21
|
+
|
|
22
|
+
## Procedure (judgment only)
|
|
23
|
+
|
|
24
|
+
Run `afm verify <path under docs/>` (add `--as <id>` when no git user name is set). The command refuses an
|
|
25
|
+
agent actor. Report the tier that resulted and what it means.
|
|
26
|
+
|
|
27
|
+
## Invariant principles
|
|
28
|
+
|
|
29
|
+
Most relevant here: #5 is load-bearing.
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: template
|
|
3
|
+
description: 'Template rendered during materialization: ADR-NNNN — {{short title on the decision, not on the problem}}.'
|
|
4
|
+
load: cold
|
|
5
|
+
renders_to: 'docs/adr/*.md'
|
|
6
|
+
frontmatter_for_output: |
|
|
7
|
+
type: adr
|
|
8
|
+
description: '<one sentence: the decision and why it matters>'
|
|
9
|
+
load: warm
|
|
10
|
+
status: proposed # proposed | accepted | superseded | deprecated. Set from step 2's
|
|
11
|
+
# `afm ask adr` answer; `afm adr --supersedes` sets superseded.
|
|
12
|
+
date: YYYY-MM-DD # The day the decision was written down.
|
|
13
|
+
decided_by: '<who>' # `[TBD]` when nobody said.
|
|
14
|
+
supersedes: ADR-NNNN # ONLY when this decision replaces an earlier one. Omit otherwise.
|
|
15
|
+
superseded_by: ADR-NNNN # ONLY when status is superseded by a later decision. Omit otherwise.
|
|
16
|
+
relates_to: [ADR-NNNN] # ONLY when it depends on or refines other ADRs. Omit otherwise.
|
|
17
|
+
trigger_path: '{{glob}}' # ONLY when this decision constrains one path or family of paths.
|
|
18
|
+
# Most decisions bind none: omit the key rather than guess one.
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# ADR-NNNN — {{short title on the decision, not on the problem}}
|
|
22
|
+
|
|
23
|
+
## Context
|
|
24
|
+
|
|
25
|
+
{{What was happening, what problem appeared, which constraints (time, scope, security, cost) limit the decision. 3-5 sentences. Cite the concrete symptom that forced the decision. Do not invent a retroactive motivation.}}
|
|
26
|
+
|
|
27
|
+
## Decision
|
|
28
|
+
|
|
29
|
+
{{What was decided, in one header sentence.}}
|
|
30
|
+
|
|
31
|
+
{{Operational details. What changes in the code, in which file, with which contract. Use a concrete, absolute path and a snippet when useful.}}
|
|
32
|
+
|
|
33
|
+
## Alternatives considered
|
|
34
|
+
|
|
35
|
+
- **{{alternative A}}** — why it was NOT chosen (cost / risk / simplicity).
|
|
36
|
+
- **{{alternative B}}** — why it was NOT chosen.
|
|
37
|
+
|
|
38
|
+
<!-- guidance -->
|
|
39
|
+
(List 1-3 alternatives. If you considered none, write "Direct decision — no alternatives evaluated because {{reason}}".)
|
|
40
|
+
<!-- /guidance -->
|
|
41
|
+
|
|
42
|
+
## Consequence
|
|
43
|
+
|
|
44
|
+
{{What becomes easy now. What becomes hard now. Accepted technical debt. A gotcha other developers will hit (link to `gotchas.md` if it applies).}}
|
|
45
|
+
|
|
46
|
+
## References
|
|
47
|
+
|
|
48
|
+
- Commit: `{{sha}}`
|
|
49
|
+
- Related US/RF: US-NNN / RF-NN
|
|
50
|
+
- Canonical doc: `/docs/{{file}}.md` §X
|
|
51
|
+
- External issue / PR: {{link}}
|