create-agdf 0.8.9 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +4 -0
  2. package/bin/create-agdf.js +43 -2
  3. package/generated/.github/skills/agdf-brownfield-analysis/SKILL.md +6 -2
  4. package/generated/.github/skills/agdf-clean-implementation-review/SKILL.md +4 -1
  5. package/generated/.github/skills/agdf-code-review/SKILL.md +4 -1
  6. package/generated/.github/skills/agdf-delivery-closeout/SKILL.md +5 -1
  7. package/generated/.github/skills/agdf-delivery-path-search/SKILL.md +5 -1
  8. package/generated/.github/skills/agdf-gate-check/SKILL.md +8 -2
  9. package/generated/.github/skills/agdf-qa-gate/SKILL.md +6 -2
  10. package/generated/.github/skills/agdf-release-or/SKILL.md +7 -2
  11. package/generated/.github/skills/agdf-runtime-contract.md +11 -851
  12. package/generated/.github/skills/agdf-task-plan-review/SKILL.md +5 -1
  13. package/generated/.github/skills/contracts/closeout.md +29 -0
  14. package/generated/.github/skills/contracts/context-graph.md +48 -0
  15. package/generated/.github/skills/contracts/control-scaffold.md +109 -0
  16. package/generated/.github/skills/contracts/gate-transition.md +134 -0
  17. package/generated/.github/skills/contracts/interaction.md +370 -0
  18. package/generated/.github/skills/contracts/modes.md +91 -0
  19. package/generated/.github/skills/contracts/quality.md +100 -0
  20. package/generated/.opencode/AGDF.md +9 -1
  21. package/generated/.opencode/agdf-runtime-contract.md +11 -851
  22. package/generated/.opencode/contracts/closeout.md +29 -0
  23. package/generated/.opencode/contracts/context-graph.md +48 -0
  24. package/generated/.opencode/contracts/control-scaffold.md +109 -0
  25. package/generated/.opencode/contracts/gate-transition.md +134 -0
  26. package/generated/.opencode/contracts/interaction.md +370 -0
  27. package/generated/.opencode/contracts/modes.md +91 -0
  28. package/generated/.opencode/contracts/quality.md +100 -0
  29. package/generated/.opencode/skills/agdf-brownfield-analysis/SKILL.md +6 -2
  30. package/generated/.opencode/skills/agdf-clean-implementation-review/SKILL.md +4 -1
  31. package/generated/.opencode/skills/agdf-code-review/SKILL.md +4 -1
  32. package/generated/.opencode/skills/agdf-delivery-closeout/SKILL.md +5 -1
  33. package/generated/.opencode/skills/agdf-delivery-path-search/SKILL.md +5 -1
  34. package/generated/.opencode/skills/agdf-gate-check/SKILL.md +8 -2
  35. package/generated/.opencode/skills/agdf-qa-gate/SKILL.md +6 -2
  36. package/generated/.opencode/skills/agdf-release-or/SKILL.md +7 -2
  37. package/generated/.opencode/skills/agdf-task-plan-review/SKILL.md +5 -1
  38. package/generated/AGENTS.md +9 -1
  39. package/generated/plugins/agdf/.codex-plugin/plugin.json +4 -4
  40. package/generated/plugins/agdf/meta/agdf-agent-router.md +9 -1
  41. package/generated/plugins/agdf/meta/agdf-plugin.definition.json +14 -8
  42. package/generated/plugins/agdf/meta/agdf-runtime-contract.md +11 -851
  43. package/generated/plugins/agdf/meta/contracts/closeout.md +29 -0
  44. package/generated/plugins/agdf/meta/contracts/context-graph.md +48 -0
  45. package/generated/plugins/agdf/meta/contracts/control-scaffold.md +109 -0
  46. package/generated/plugins/agdf/meta/contracts/gate-transition.md +134 -0
  47. package/generated/plugins/agdf/meta/contracts/interaction.md +370 -0
  48. package/generated/plugins/agdf/meta/contracts/modes.md +91 -0
  49. package/generated/plugins/agdf/meta/contracts/quality.md +100 -0
  50. package/generated/plugins/agdf/skills/brownfield-analysis/SKILL.md +6 -2
  51. package/generated/plugins/agdf/skills/clean-implementation-review/SKILL.md +4 -1
  52. package/generated/plugins/agdf/skills/code-review/SKILL.md +4 -1
  53. package/generated/plugins/agdf/skills/delivery-closeout/SKILL.md +5 -1
  54. package/generated/plugins/agdf/skills/delivery-path-search/SKILL.md +5 -1
  55. package/generated/plugins/agdf/skills/gate-check/SKILL.md +8 -2
  56. package/generated/plugins/agdf/skills/qa-gate/SKILL.md +6 -2
  57. package/generated/plugins/agdf/skills/release-or/SKILL.md +7 -2
  58. package/generated/plugins/agdf/skills/task-plan-review/SKILL.md +5 -1
  59. package/lib/skill-evals/artefact-quality.js +36 -0
  60. package/lib/skill-evals/index.js +105 -0
  61. package/lib/skill-evals/live-recorder.js +108 -0
  62. package/lib/skill-evals/workspace.js +97 -0
  63. package/package.json +6 -2
@@ -0,0 +1,29 @@
1
+ # AGDF Runtime Contract — Closeout
2
+
3
+ ## Support Answer Bridge
4
+
5
+ When the user asks about a concrete ticket, issue, incident or support question, end with exactly one smallest useful next step.
6
+ Do not treat that next step as approval.
7
+ When the next step is gated, name the required approval or AGDF skill instead of implying work may proceed.
8
+
9
+
10
+ ## Relevant Run
11
+
12
+ A relevant run is any run that changes durable state, creates or updates an AGDF artefact, changes code or runtime behaviour, performs a gate decision, blocks on a governance condition, produces QA/UAT/release evidence, or closes a delivery slice.
13
+
14
+ OR is not mandatory for a pure explanation, read-only inspection, small review, or local debugging step that produces no durable state change and no gate consequence.
15
+ When in doubt, use a short OR-lite only if it clarifies gate state, evidence, risk, or the next permissible step.
16
+
17
+ A `quick_task` fully inside the Non-Normative Trivial Change Boundary above stays exempt from the full
18
+ selected-run ceremony even when it is otherwise a relevant run. If a selected canonical
19
+ `RUN_STATE.md` currently reflects another scope, append exactly one line to that run's
20
+ `Prior Run Pointers` section noting what changed and that it is unrelated; do not edit any other
21
+ section or any other existing line.
22
+
23
+
24
+ ## Do Not Duplicate
25
+
26
+ The explanatory framework lives in `docs/`.
27
+ The operating philosophy lives in `plugin/meta/agdf-constitution.md`.
28
+ The principles live in `plugin/meta/agdf-tenets.md`.
29
+ This contract is only the compact runtime interface for skills.
@@ -0,0 +1,48 @@
1
+ # AGDF Runtime Contract — Context Graph
2
+
3
+ ## Knowledge Persistence Decision
4
+
5
+ Every relevant run should decide what happens to new durable knowledge.
6
+ The decision is not a memory dump; it routes only reusable, evidenced information to the right owner.
7
+
8
+ Use:
9
+
10
+ - `memory_target: context_graph | sot_registry | scope_artifact | open_questions | none`
11
+ - `memory_reason`: short reason for the target
12
+ - `memory_refs`: paths or nodes affected
13
+
14
+ Guidance:
15
+
16
+ - Use `context_graph` for reusable Brownfield findings, decisions, risks, invariants and exit criteria.
17
+ - Use `sot_registry` when source-of-truth ownership changes or drift is found.
18
+ - Use `scope_artifact` for run-specific evidence, ticket details, screenshots, logs or local reproduction data.
19
+ - Use `open_questions` when a durable question should survive the run but no answer is evidenced yet.
20
+ - Use `none` for one-off observations without future decision value.
21
+
22
+
23
+ ## Context Graph Output
24
+
25
+ When a run affects project memory or a Context Graph, use:
26
+
27
+ - `Situation:` short plain-language summary when the impact is non-trivial
28
+ - `context_graph_impact`: `none | link_only | update_existing_node | new_node_required | sot_drift`
29
+ - `context_graph_refs`
30
+ - `context_graph_reconciliation`: `resolved | not_applicable | open_gap`
31
+ - `context_graph_required_action`: `none | link | update | create | resolve_drift`
32
+ - `context_graph_gate_effect`: `none | warning | revise | block`
33
+ - `context_graph_evidence`
34
+
35
+ Do not create a new node for a mere version, a general chat summary, or a local observation without a concrete next clean step.
36
+ `sot_drift` must not pass silently as a warning.
37
+
38
+ ### Context Graph Reconciliation
39
+
40
+ Relevant-run closeout must reconcile Context Graph impact before presenting a clean delivery handoff.
41
+
42
+ - Use `not_applicable` only when `context_graph_impact: none` and no durable graph knowledge is claimed.
43
+ - Use `resolved` when required graph work is complete and concrete refs are present.
44
+ - Use `open_gap` when graph work remains pending, refs are missing, or a node/update must still be curated.
45
+ - `link`, `update`, `create` and `resolve_drift` require either `resolved` evidence or an explicit `open_gap`.
46
+ - Resolved `link_only`, `update_existing_node` and `new_node_required` states require concrete `context_graph_refs`; `none`, empty refs or vague future-action language are not enough.
47
+ - OR and delivery-closeout must not present commit-ready, release-ready or otherwise clean handoff while `context_graph_reconciliation: open_gap` remains.
48
+
@@ -0,0 +1,109 @@
1
+ # AGDF Runtime Contract — Control Scaffold
2
+
3
+ ## Delivery Path Search
4
+
5
+ Delivery Path Search is an optional read-only planning step for high-impact decisions with several materially different next actions.
6
+
7
+ - It consumes current AGDF state and must reject gate-illegal candidates before model evaluation.
8
+ - It returns one advisory recommendation or `no_safe_recommendation`.
9
+ - It must report budgets, stopping reason and `full | tool_enforced | instruction_only` enforcement.
10
+ - Model scores are judgements, not measurements.
11
+ - Search output is evidence only. Canonical `agdf-gate-check` independently decides what may proceed.
12
+ - The bounded first-release algorithm must not be labelled MCTS.
13
+ - Surface adapters may translate transport and presentation, but must not fork scoring, search or gate semantics.
14
+ - Optional AI-native candidate generation supplements the deterministic candidate baseline; it never replaces it.
15
+ - Generated proposals are untrusted. The core must validate schema, exact canonical gate action, scope, duplicates and material diversity before evaluation.
16
+ - Generation is opt-in and bounded to one call, five proposals, 30 seconds and five abstract cost units by default, within whole-run budgets.
17
+ - External generation receives only bounded normalized control summaries and references, never secrets, full artefacts, raw prompts, hidden reasoning or source snapshots.
18
+ - Generator status, provenance, accepted/rejected counts, separate budget use and typed failure must remain visible. Failure retains the deterministic baseline; automatic provider fallback is forbidden.
19
+ - Codex and Claude Code may provide tool-enforced generator transports. Copilot, OpenCode and generic surfaces remain instruction-only without conforming evidence.
20
+
21
+ The field names above are the stable machine-readable contract used by JSON
22
+ reports and automation. Human-facing Markdown must present the same projection
23
+ with readable labels such as `Current gate`, `Allowed now`, `Blocked by`,
24
+ `Next step` and `Quality outlook`; do not expose snake_case keys as the visible
25
+ Run Status Card. Keep that card compact: show `Status`, `Current gate`,
26
+ `Allowed now`, `Blocked by`, `Missing approval`, `Next gate after approval`
27
+ and `Allowed after approval` when a missing approval exists, `Next step` and
28
+ `Quality outlook`. Keep mode, forbidden actions, evidence and next-skill detail
29
+ in the surrounding control artefact when they are relevant.
30
+
31
+
32
+ ## Control Scaffold
33
+
34
+ ### Run-Scoped Control State
35
+
36
+ Canonical mutable run state lives at `.agdf/control/runs/<run_id>/RUN_STATE.md`, one file per run.
37
+ Repository-level discovery is derived; do not maintain a writable active-run dashboard. Select with
38
+ `--run`, then `AGDF_RUN_ID`, or automatically only when exactly one run is active. Ambiguity fails
39
+ closed. Legacy `AGDF_RUN.md` is migration input or an explicitly rendered non-authoritative projection,
40
+ never a second writable owner. Read-only commands must not migrate state.
41
+
42
+ When a repository needs durable AGDF state, use the plugin-local `control/` scaffold as the starting point.
43
+
44
+ - `config.json` stores project language preferences. Use `artifact_language` for generated AGDF artefacts and `chat_language` for user-facing responses unless the user explicitly asks otherwise. Runtime rules remain English.
45
+ - `.agdf/control/runs/<run_id>/RUN_STATE.md` is the canonical current-run dashboard; legacy `AGDF_RUN.md` is migration input or an explicit non-authoritative projection.
46
+ - `MASTER_BACKLOG.md` is the living pointer for active delivery work.
47
+ - `BROWNFIELD_REVIEW.md` records the post-UR existing-system view and Mode/Slice Decision before PRD depth or Quick Task execution is chosen.
48
+ - `SOT_REGISTRY.md` prevents parallel sources of truth.
49
+ - `CONTEXT_GRAPH.md` stores durable Brownfield findings, decisions, risks, evidence and exit criteria.
50
+ - `AGENT_QUALITY_CONTRACTS.json` stores reusable block, revise and warning conditions.
51
+ - `memory_target`, `multi_scope_state` and branch/workspace evidence fields make ambiguity and persistence decisions visible without turning chat history into the source of truth.
52
+ - OR reports live under `.agdf/control/artefacts/<key>/OR.md` when a run closeout is steering-relevant or should be auditable beyond the chat.
53
+
54
+ ### Human-readable Master Backlog
55
+
56
+ The Markdown backlog is a human steering view; CLI reports are its normalized
57
+ machine projection.
58
+
59
+ - Use readable status labels such as `In progress`, `Awaiting UAT` and
60
+ `Completed` in Markdown.
61
+ - Use links relative to `MASTER_BACKLOG.md`, such as
62
+ `[UR](artefacts/<key>/UR.md)`, instead of exposing long raw paths.
63
+ - Keep `Priority`, `Key`, `Work item`, `Status`, `Artefacts`, `Current spec`
64
+ and `Next step` visible for active and planned work.
65
+ - Keep one canonical template. Generated surface copies remain derived output.
66
+ - Normalize human labels and link targets only at the CLI parser boundary.
67
+ - Existing wide rows, raw paths and snake_case statuses remain supported for
68
+ backward compatibility.
69
+
70
+ The scaffold is not a second documentation site. Link to authoritative artefacts instead of copying them.
71
+
72
+ ## Agent-Native Runtime And CLI Verification
73
+
74
+ AGDF is agent-native first and CLI-verifiable by design.
75
+
76
+ The primary operating path is the active skill plus the live `.agdf/control/` artefacts.
77
+ Agents should read the repository state, apply this Runtime Contract, create or update only the currently allowed artefact, and make the next permissible step explicit.
78
+ When control state is missing for a fresh request, keep the first step lightweight: draft the minimal UR in the response and request `Approval: UR`.
79
+ Initialize a control scaffold only when durable AGDF control state is explicitly requested, already used by the repository, or required by a deterministic CLI/CI setup path.
80
+
81
+ Helper commands are deterministic proof and automation interfaces, not the normal-work ritual:
82
+
83
+ - `init` creates the machine-readable control scaffold.
84
+ - `doctor --json` checks whether `.agdf/control/` is consistent and actionable; it is not the reviewer.
85
+ - `gate-check --json` reports reproducible gate state; it does not replace the gate-check skill judgement.
86
+ - `delivery-map --json` reports the delivery picture for CI, PRs, regression checks and audit trails.
87
+
88
+ Machine-readable outputs should stay agent-friendly: stable decisions, blocking gate or current gate, missing approval, allowed outputs, forbidden outputs, next step, evidence and findings.
89
+ They make the repository state checkable, but they do not replace the native skill workflow or the durable control artefacts.
90
+
91
+ ## Delivery Map
92
+
93
+ `delivery-map --json` is the machine-readable delivery picture for the selected canonical control state.
94
+ It derives, but does not replace, the selected `RUN_STATE.md` and `MASTER_BACKLOG.md` state.
95
+
96
+ It must expose:
97
+
98
+ - approved or active artefacts and approvals
99
+ - `UR -> PRD -> SD -> TP -> QA_REPORT` relationships
100
+ - evidence refs, missing evidence and declared risks
101
+ - multi-scope ambiguity and branch/workspace evidence limits when present
102
+ - memory persistence target, reason and references when present
103
+ - Context Graph impact and gate effect
104
+ - the Run Status Card as a compact projection of current gate, next step and quality outlook
105
+ - findings that explain why the delivery picture is `pass | warn | revise | block`
106
+
107
+ Missing relationship evidence in the Artefact Chain is at least `revise` once the related gate artefact is approved or passed.
108
+ Declared missing evidence, declared risk or Context Graph gate effect may escalate the delivery map to `warn`, `revise` or `block`.
109
+
@@ -0,0 +1,134 @@
1
+ # AGDF Runtime Contract — Gate Transition
2
+
3
+ ## Source Precedence
4
+
5
+ Every governed repository should make the normative instruction source visible.
6
+ When several instruction files, generated copies, submodule rules, branch names, worktree diffs or chat summaries point in different directions, fail closed instead of inventing a primary authority.
7
+
8
+ Default precedence:
9
+
10
+ 1. safety, security and compliance instructions
11
+ 2. repository-declared normative agent instructions
12
+ 3. live `.agdf/control/` state or a linked authoritative repository SoT
13
+ 4. approved gate artefacts
14
+ 5. source code and verified runtime evidence
15
+ 6. branch names, workspace deltas, chat history and model memory
16
+
17
+ A branch name or uncommitted workspace delta is never sufficient scope proof by itself.
18
+ It may support a scope only when it does not conflict with durable artefacts, approvals or source-of-truth records.
19
+
20
+
21
+ ## Workstate And Scope Ambiguity
22
+
23
+ If a repository contains multiple plausible active work lines, the agent must not silently choose one.
24
+ List the evidenced competing lines with their latest known gate, artefact pointers, approvals and missing evidence.
25
+ The next permissible step is scope clarification or the earliest common safe gate.
26
+
27
+ Use `multi_scope_state: clear | ambiguous | blocked` when the control state needs to make this visible.
28
+ `ambiguous` is at least a revise condition for delivery-map style reporting.
29
+ `blocked` applies when continuing would produce later-gate artefacts, implementation or release claims for the wrong scope.
30
+
31
+
32
+ ## Domain Guardrail Packs
33
+
34
+ Repositories may define domain guardrail packs for recurring high-risk surfaces such as UI, persistence, integration, financial calculations, policy, security, migration or release operations.
35
+ A pack should define:
36
+
37
+ - trigger patterns
38
+ - required Brownfield touchpoints
39
+ - protected invariants
40
+ - required evidence
41
+ - review or QA escalation conditions
42
+
43
+ Domain guardrails are project-specific extensions.
44
+ They must not override AGDF gates, approvals or the Runtime Contract.
45
+
46
+
47
+ ## Gate Rules
48
+
49
+ - User gates: `UR -> PRD -> SD -> TP -> QA -> UAT`
50
+ - Internal mandatory steps: `Brownfield Review -> Mode/Slice Decision -> Verified Change Execution | Brownfield Analysis -> CD+Tests -> CR -> OR`
51
+ - On the approved-TP path, `CD+Tests` and `CR` are satisfied only by `done`; `not_applicable` may satisfy Brownfield Review or Brownfield Analysis, but it must not bypass implementation/test evidence or mandatory Code Review.
52
+ - Exact approval formula: `Approval: <GateName>`
53
+ - Legacy alias: `Freigabe: <GateName>` may be accepted when reviewing older German runs, but all new outputs must use `Approval: <GateName>`.
54
+ - Implicit consent is not approval. Phrases such as "ok", "go ahead", "do it", "approved", "continue", "leg los" or "looks good" are work intent, not gate approval.
55
+ - The earliest blocking gate wins.
56
+ - For UR, PRD, SD, TP and QA, approval and durable artefact presence are separate requirements. A gate is not satisfied by approval text alone when its artefact is missing from `.agdf/control/` or not linked to the authoritative repository SoT.
57
+ - Approval of one user gate permits work on the next allowed gate artefact or required internal step only. It does not permit implementation unless the approved gate is `TP` and required internal implementation prerequisites are satisfied.
58
+ - Gates must never be skipped or inferred from urgency, tone, chat history, task wording or an instruction to "start". The next allowed action is always the next unsatisfied gate or internal mandatory step.
59
+ - Missing control files or missing current-state fields do not forbid the agent from preparing the current allowed artefact. They forbid later-gate work and implementation. For a fresh request, the default allowed work is to draft a minimal UR in the response and request `Approval: UR`. Initialize or write `.agdf/control/` only when the user explicitly asks for durable AGDF control state, the repository already uses `.agdf/control/` as its live working state, or a deterministic CLI/CI setup path is being executed.
60
+ - `Approval: UR` permits Brownfield Review after G-00 first, then a Mode/Slice Decision. It never permits implementation by itself.
61
+ - PRD, SD and TP depth is chosen after Brownfield Review through the Mode/Slice Decision, not before existing-system impact is understood.
62
+ - The Mode/Slice Decision must be visible before any PRD shortcut, Quick Task execution or implementation: record the decision, required next gate, scope reason and evidence in the selected canonical `RUN_STATE.md` or an equivalent linked control artefact.
63
+ - `Approval: PRD` permits Solution Design drafting, not implementation.
64
+ - `Approval: SD` permits Task/Test Plan drafting, not implementation.
65
+ - `Approval: TP` permits implementation-preparation Brownfield Analysis and then CD+Tests when Brownfield evidence supports it.
66
+ - `CD+Tests` is implementation and test status only, not a delivery signal.
67
+ - `agdf-code-review` standardizes the mandatory `CR` step, but does not replace QA.
68
+ - `agdf-qa-gate` decides final `pass | revise | block`.
69
+ - `agdf-release-or` reports the run, but does not replace QA or produce the operative commit/PR handoff.
70
+ - `agdf-delivery-closeout` owns the operative Git handoff text when QA/OR/UAT state allows it.
71
+
72
+
73
+ ## Brownfield Review After G-00
74
+
75
+ After an approved and durable UR, perform a lightweight `Brownfield Review` before PRD when Brownfield, UI, UX, admin, runtime, policy, persistence, architecture, ownership or source-of-truth impact is possible.
76
+
77
+ This review is not a new user approval gate, not PRD, not SD, not TP and not implementation permission.
78
+ It is the sizing and routing step that decides how much later gate discipline is actually needed.
79
+
80
+ Its output is limited to:
81
+
82
+ - workstream or follow-up-slice classification
83
+ - `Mode/Slice Decision`: `quick_task | verified_change | structured_slice | structured_delivery | block`
84
+ - affected existing owners, source-of-truth artefacts, contracts, policies, runtime paths or tests
85
+ - reuse-before-create risks and parallel-structure risks
86
+ - open questions that PRD or SD must resolve
87
+ - whether implementation-preparation Brownfield Analysis will also be needed after TP
88
+
89
+ Mode/Slice Decision rules:
90
+
91
+ - `quick_task`: use only when Brownfield Review shows a narrow local change, no new product semantics beyond the approved UR, no architecture/policy/persistence/contract expansion, and evidence is sufficient to proceed with a small implementation plus relevant checks.
92
+ - `verified_change`: use only when the compact record can prove one canonical owner, bounded clean-at-baseline paths, no prohibited impact, deterministic propagation/validation and a structured escalation target. It skips later approvals only after every condition is evidenced and machine-validated.
93
+ - `structured_slice`: use when some formal artefacts are needed, but they can stay intentionally small and scoped to the approved slice.
94
+ - `structured_delivery`: use when the change has broad product, architecture, runtime, policy, persistence, release or cross-owner impact.
95
+ - `block`: use when ownership, SoT, impact, evidence or product direction is not clear enough to choose a safe path.
96
+
97
+ A Mode/Slice Decision without scope reason and evidence is not recorded. Treat it as missing and keep the next step at `Mode/Slice Decision`.
98
+
99
+
100
+ ## Gate Transition Model
101
+
102
+ This table is the canonical transition model. Skills may reference it, but must not carry a second complete copy.
103
+
104
+ | State | Current gate or step | Allowed | Forbidden | Missing approval |
105
+ |---|---|---|---|---|
106
+ | No approved UR | `UR` | clarify user need, formulate and persist UR, request `Approval: UR` | PRD, SD, TP, Brownfield Analysis, implementation, QA, release | `Approval: UR` |
107
+ | `UR` approved and UR artefact persisted or linked, Brownfield Review missing | `Brownfield Review` | classify workstream, existing owners, SoT, reuse risks, change size and PRD/SD open questions; mark review done or not_applicable | PRD, SD, TP, implementation, QA, release | none |
108
+ | Brownfield Review done or not_applicable, Mode/Slice Decision missing or incomplete | `Mode/Slice Decision` | decide `quick_task`, `verified_change`, `structured_slice`, `structured_delivery` or `block`; record scope reason, evidence and required next gate depth | PRD, SD, TP, implementation, QA, release | none |
109
+ | Mode/Slice Decision is `quick_task` | `Quick Task Execution` | implement only the narrow approved UR scope, run relevant checks, record evidence and OR-lite when the run is relevant | broad PRD/SD/TP by ritual, scope expansion, QA or release claims without evidence | none |
110
+ | Mode/Slice Decision is `verified_change`, record missing/draft/invalid | `Verified Change Execution` | create or repair compact record, capture baseline and prove eligibility with doctor/agdf-gate-check | implementation, QA, UAT, release | none |
111
+ | Verified Change record is `eligible` | `Verified Change Execution` | implement only declared paths, run declared propagation/validation, record mini-closeout | unlisted paths, prohibited impacts, QA/UAT/release claims | none |
112
+ | Verified Change record is `executed` | `OR` | use mini-closeout and offer delivery closeout when requested | PRD/SD/TP/QA/UAT by ritual; automatic VCS actions | none |
113
+ | Verified Change record is `escalated` | `PRD` | draft the PRD for declared `structured_slice` or `structured_delivery` escalation target | implementation through Verified Change | `Approval: PRD` |
114
+ | Mode/Slice Decision is `structured_slice` or `structured_delivery`, PRD missing or draft | `PRD` | draft/refine PRD at the smallest justified depth, define scope, acceptance criteria and non-goals, persist/link PRD, request `Approval: PRD` | SD, TP, implementation-preparation Brownfield Analysis, implementation, QA, release | `Approval: PRD` |
115
+ | `PRD` approved and PRD artefact persisted or linked, SD missing or draft | `SD` | draft/refine Solution Design, ownership and architecture, persist/link SD, request `Approval: SD` | TP, implementation, QA, release | `Approval: SD` |
116
+ | `SD` approved and SD artefact persisted or linked, TP missing or draft | `TP` | draft/refine Task/Test Plan, task IDs, evidence plan, persist/link TP, request `Approval: TP` | implementation, QA, release | `Approval: TP` |
117
+ | `TP` approved and TP artefact persisted or linked, Brownfield Analysis missing | `Brownfield Analysis` | run Brownfield Analysis for approved TP scope | implementation, QA, release | none |
118
+ | Brownfield Analysis passed for approved TP | `CD+Tests` | implement approved TP tasks and run tests | QA pass, UAT, release | none |
119
+ | `CD+Tests` done for approved TP, CR missing | `CR` | run mandatory Code Review and resolve blocking findings | QA pass, UAT, release | none |
120
+ | `CR` done, QA not approved | `QA` | run QA gate, persist/refine QA report, request `Approval: QA` | UAT, release | `Approval: QA` |
121
+ | `QA` approved but QA report missing or not pass | `QA` | persist/link QA report with `pass` decision or revise/block evidence | UAT, release | none |
122
+ | QA approved and QA report is `pass` or `passed`, UAT not approved | `UAT` | request `Approval: UAT`, prepare non-operative delivery summary | release and automatic VCS actions | `Approval: UAT` |
123
+ | UAT approved | `OR` | produce OR or delivery closeout; prepare VCS handoff only when requested | automatic commit, push, PR or release | none |
124
+
125
+
126
+ ## Brownfield Modes
127
+
128
+ The `agdf-brownfield-analysis` skill has two explicit modes:
129
+
130
+ - `post_ur_review`: lightweight sizing and routing after approved durable UR; decides Mode/Slice Decision before PRD depth or implementation is chosen.
131
+ - `pre_implementation_analysis`: implementation-preparation analysis after approved durable TP; verifies reuse path, owners, regression risk and fit before `CD+Tests`.
132
+
133
+ Do not mix the modes silently. Name the active mode in Brownfield output.
134
+