create-agdf 0.2.3 → 0.2.5

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 (29) hide show
  1. package/bin/create-agdf.js +363 -9
  2. package/generated/.agdf/control/README.md +7 -1
  3. package/generated/.agdf/control/templates/AGDF_RUN.md +25 -1
  4. package/generated/.agdf/control/templates/MASTER_BACKLOG.md +16 -14
  5. package/generated/.agdf/control/templates/artefacts/BROWNFIELD_REVIEW.md +67 -0
  6. package/generated/.agdf/control/templates/artefacts/OR.md +86 -0
  7. package/generated/.agdf/control/templates/artefacts/UR.md +1 -1
  8. package/generated/.github/copilot-instructions.md +3 -0
  9. package/generated/.github/instructions/agdf-governance.instructions.md +1 -0
  10. package/generated/.github/skills/agdf-brownfield-analysis/SKILL.md +35 -17
  11. package/generated/.github/skills/agdf-gate-check/SKILL.md +33 -29
  12. package/generated/.github/skills/agdf-release-or/SKILL.md +17 -10
  13. package/generated/.github/skills/agdf-runtime-contract.md +102 -5
  14. package/generated/AGENTS.md +14 -4
  15. package/generated/plugins/agdf/.codex-plugin/plugin.json +1 -1
  16. package/generated/plugins/agdf/control/README.md +7 -1
  17. package/generated/plugins/agdf/control/templates/AGDF_RUN.md +25 -1
  18. package/generated/plugins/agdf/control/templates/MASTER_BACKLOG.md +16 -14
  19. package/generated/plugins/agdf/control/templates/artefacts/BROWNFIELD_REVIEW.md +67 -0
  20. package/generated/plugins/agdf/control/templates/artefacts/OR.md +86 -0
  21. package/generated/plugins/agdf/control/templates/artefacts/UR.md +1 -1
  22. package/generated/plugins/agdf/meta/agdf-agent-router.md +14 -4
  23. package/generated/plugins/agdf/meta/agdf-constitution.md +13 -4
  24. package/generated/plugins/agdf/meta/agdf-plugin.definition.json +4 -4
  25. package/generated/plugins/agdf/meta/agdf-runtime-contract.md +102 -5
  26. package/generated/plugins/agdf/skills/brownfield-analysis/SKILL.md +35 -17
  27. package/generated/plugins/agdf/skills/gate-check/SKILL.md +33 -29
  28. package/generated/plugins/agdf/skills/release-or/SKILL.md +17 -10
  29. package/package.json +1 -1
@@ -0,0 +1,67 @@
1
+ # Brownfield Review: <Title>
2
+
3
+ Gate: Brownfield Review
4
+ Type: Brownfield Review
5
+ Mode: `post_ur_review`
6
+ Status: `draft | done | not_applicable | superseded`
7
+
8
+ ## Run
9
+
10
+ - run_id:
11
+ - related_ur:
12
+ - current_gate:
13
+ - reviewer:
14
+ - reviewed_at:
15
+
16
+ ## Objective
17
+
18
+ What approved UR scope is being sized and routed?
19
+
20
+ ## Existing-System View
21
+
22
+ | Area | Existing owner or artefact | Evidence | Impact |
23
+ |---|---|---|---|
24
+ | Product semantics | | | `none | low | medium | high` |
25
+ | Source of truth | | | `none | low | medium | high` |
26
+ | Runtime path | | | `none | low | medium | high` |
27
+ | UI / UX | | | `none | low | medium | high` |
28
+ | Persistence / data | | | `none | low | medium | high` |
29
+ | Tests / QA | | | `none | low | medium | high` |
30
+ | Release / operations | | | `none | low | medium | high` |
31
+
32
+ ## Reuse And Parallel-Structure Risk
33
+
34
+ | Finding | Evidence | Risk | Required action |
35
+ |---|---|---|---|
36
+ | | | `none | warn | revise | block` | |
37
+
38
+ ## Mode / Slice Decision
39
+
40
+ - decision: `quick_task | structured_slice | structured_delivery | block`
41
+ - required_next_gate: `none | PRD | SD | TP | Brownfield Analysis`
42
+ - scope_reason:
43
+ - evidence:
44
+ - transparency_note:
45
+
46
+ ## PRD / SD Open Questions
47
+
48
+ | Question | Required gate | Impact |
49
+ |---|---|---|
50
+ | | `none | PRD | SD | TP` | `warn | revise | block` |
51
+
52
+ ## Context Graph Impact
53
+
54
+ - context_graph_impact: `none | link_only | update_existing_node | new_node_required | sot_drift`
55
+ - context_graph_refs:
56
+ - context_graph_required_action: `none | link | update | create | resolve_drift`
57
+ - context_graph_gate_effect: `none | warning | revise | block`
58
+ - context_graph_evidence:
59
+
60
+ ## Next Permissible Step
61
+
62
+ - next_allowed_action:
63
+ - forbidden_until_then:
64
+
65
+ ## Quality Outlook
66
+
67
+ - quality_outlook:
@@ -0,0 +1,86 @@
1
+ # OR: <Title>
2
+
3
+ Gate: OR
4
+ Type: Orchestration Report
5
+ Report mode: `OR-lite | OR-full`
6
+ Status: `draft | done | superseded`
7
+
8
+ ## Run
9
+
10
+ - run_id:
11
+ - related_ur:
12
+ - related_prd:
13
+ - related_sd:
14
+ - related_tp:
15
+ - related_qa_report:
16
+ - mode_slice_decision:
17
+ - current_gate:
18
+ - decision: `pass | revise | block | in_progress`
19
+
20
+ ## Gate State
21
+
22
+ | Gate or step | Status | Evidence |
23
+ |---|---|---|
24
+ | UR | | |
25
+ | Brownfield Review | | |
26
+ | Mode/Slice Decision | | |
27
+ | PRD | | |
28
+ | SD | | |
29
+ | TP | | |
30
+ | Brownfield Analysis | | |
31
+ | CD+Tests | | |
32
+ | CR | | |
33
+ | QA | | |
34
+ | UAT | | |
35
+
36
+ ## Delivered
37
+
38
+ | Item | Evidence |
39
+ |---|---|
40
+ | | |
41
+
42
+ ## Not Delivered / Intentionally Deferred
43
+
44
+ | Item | Reason | Next owner or gate |
45
+ |---|---|---|
46
+ | | | |
47
+
48
+ ## Evidence
49
+
50
+ | Evidence | Source | Covers | Strength |
51
+ |---|---|---|---|
52
+ | | | | `direct | indirect | weak` |
53
+
54
+ ## Missing Evidence
55
+
56
+ | Missing evidence | Impact | Required next step |
57
+ |---|---|---|
58
+ | | `warn | revise | block` | |
59
+
60
+ ## Risks And Open Items
61
+
62
+ | Risk or open item | Impact | Owner or mitigation |
63
+ |---|---|---|
64
+ | | `warn | revise | block` | |
65
+
66
+ ## Context Graph Impact
67
+
68
+ - context_graph_impact: `none | link_only | update_existing_node | new_node_required | sot_drift`
69
+ - context_graph_refs:
70
+ - context_graph_required_action: `none | link | update | create | resolve_drift`
71
+ - context_graph_gate_effect: `none | warning | revise | block`
72
+ - context_graph_evidence:
73
+
74
+ ## Next Permissible Step
75
+
76
+ - next_allowed_action:
77
+ - required_approval:
78
+ - forbidden_until_then:
79
+
80
+ ## Quality Outlook
81
+
82
+ - quality_outlook:
83
+
84
+ ## Approval
85
+
86
+ OR does not approve later gates. It records the next permissible step.
@@ -32,7 +32,7 @@ Which existing repository artefacts, docs, code paths or decisions must be respe
32
32
 
33
33
  ## 7. Risks And Unknowns
34
34
 
35
- Which questions must PRD, SD or Brownfield Analysis clarify later?
35
+ Which questions must Brownfield Review, PRD, SD or later implementation-preparation Brownfield Analysis clarify?
36
36
 
37
37
  ## 8. Next Step
38
38
 
@@ -5,6 +5,9 @@ AGDF is active in this repository.
5
5
  - Treat `AGENTS.md` as the primary repository instruction source.
6
6
  - Use `.github/skills/` for AGDF task workflows instead of inventing parallel process rules.
7
7
  - Use `.agdf/control/` for durable run state, backlog pointers, source-of-truth ownership, Context Graph knowledge and quality contracts.
8
+ - Apply AGDF natively from `AGENTS.md`, repository skills and live `.agdf/control/` state before reaching for helper commands.
8
9
  - Before non-trivial implementation or formal delivery work, determine whether the request is a Quick Task or Structured Delivery.
9
10
  - If approval, evidence, ownership or the next allowed action is unclear, run the AGDF gate-check workflow before creating later artefacts or code.
11
+ - Use machine-readable checks such as `doctor --json`, `gate-check --json` or `delivery-map --json` as validators, not as the primary workflow.
12
+ - Do not infer gate approval from generic consent such as "ok", "go ahead", "do it", "continue", "leg los" or "approved".
10
13
  - Do not treat chat history as the source of truth for gate state, approvals, evidence or delivery status.
@@ -10,4 +10,5 @@ These files are control artefacts, not general documentation.
10
10
  - Do not duplicate the full gate model, Quality Contract table or Context Graph relationship language in new files.
11
11
  - Keep generated AGDF files small, reviewable and linked to the owning source of truth.
12
12
  - Preserve the rule that missing approval, missing evidence or unclear ownership blocks later delivery steps.
13
+ - Preserve the rule that gates cannot be skipped by generic consent, urgency or a request to start.
13
14
  - If changing AGDF bootstrap behaviour, update the generated files, smoke test and affected setup documentation together.
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: agdf-brownfield-analysis
3
- description: Use this skill after gate-check or live AGDF control state confirms that implementation preparation is allowed, and before non-trivial implementation in an existing codebase. It analyzes existing artefacts, current coverage, reuse strategy, risks, and the minimal clean implementation path. Do not use it as the first AGDF skill for a fresh "I want to build/change X" prompt when approval, scope, or next allowed action is unclear.
3
+ description: Use this skill after gate-check or live AGDF control state confirms that Brownfield Review or implementation preparation is allowed. Use it after Approval: UR as the lightweight Brownfield Review after G-00 before PRD when existing systems may be affected, and again before non-trivial implementation after TP. Do not use it as the first AGDF skill for a fresh "I want to build/change X" prompt when approval, scope, or next allowed action is unclear.
4
4
  ---
5
5
 
6
6
  # brownfield-analysis
7
7
 
8
8
  ## Purpose
9
- Ensure implementation in an existing system is Brownfield-oriented, not Greenfield-style.
9
+ Ensure delivery in an existing system is Brownfield-oriented, not Greenfield-style.
10
10
 
11
11
  The skill answers:
12
12
 
@@ -15,30 +15,41 @@ The skill answers:
15
15
  - what can be reused, extended, or refactored
16
16
  - whether new artefacts are really needed
17
17
  - architecture, compatibility, migration, and regression impact
18
- - the minimal clean implementation path
18
+ - the minimal clean next step
19
19
  - whether Context Graph impact exists without automatically creating a node
20
20
 
21
21
  ## Runtime Contract
22
22
  Use `../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
23
23
 
24
24
  Brownfield-specific output must make evidence, missing existing-system view, parallel-structure risk, reuse strategy, and the minimal next step visible.
25
+ When `.agdf/control/` is present, persist or link `post_ur_review` output under `.agdf/control/artefacts/<key>/BROWNFIELD_REVIEW.md`.
26
+
27
+ ## Modes
28
+
29
+ - `post_ur_review`: use after approved durable UR to size and route the work. Output must decide `quick_task`, `structured_slice`, `structured_delivery`, or `block` with scope reason and evidence.
30
+ - `pre_implementation_analysis`: use after approved durable TP to verify the implementation path before `CD+Tests`. Output must focus on reuse path, owners, regression risk, test impact and minimal clean implementation.
31
+
32
+ Do not mix both modes silently. Name the active mode in the output.
25
33
 
26
34
  ## Rules
27
- 1. Brownfield first: understand the existing codebase before implementation.
28
- 2. Reuse-before-create: prefer existing modules, services, components, tables, endpoints, tests, and configuration.
29
- 3. Minimal clean slice: choose the smallest durable intervention, not merely the smallest technical diff.
30
- 4. No silent parallel structures.
31
- 5. Existing architecture, naming, error handling, logging, security, and test conventions are binding unless deviation is justified.
32
- 6. What is not visibly evidenced does not count as existing.
33
- 7. Async execute paths must not become a second product-policy decision point.
34
- 8. Visible state ownership must be checked for chat, rendering, scrolling, recovery, and status problems.
35
- 9. SoT/runtime/product-semantics drift must be named; if official behaviour must be decided first, recommend UR or equivalent product direction.
36
- 10. Large UI surfaces and state hooks must be checked for mixed render, view-model, derived state, orchestration, persistence, and recovery ownership.
37
- 11. Context Graph impact must be curated; it is not a review log or version index.
38
- 12. Specification archive migrations must follow the archive index if present.
35
+ 1. Brownfield first: understand the existing codebase before PRD/SD decisions when existing-system impact is possible, and again before implementation.
36
+ 2. Brownfield Review after `Approval: UR` is a sizing and routing step. It must visibly decide `quick_task`, `structured_slice`, `structured_delivery`, or `block` before PRD depth or implementation is chosen.
37
+ 3. Reuse-before-create: prefer existing modules, services, components, tables, endpoints, tests, and configuration.
38
+ 4. Minimal clean slice: choose the smallest durable intervention, not merely the smallest technical diff.
39
+ 5. No silent parallel structures.
40
+ 6. Existing architecture, naming, error handling, logging, security, and test conventions are binding unless deviation is justified.
41
+ 7. What is not visibly evidenced does not count as existing.
42
+ 8. Async execute paths must not become a second product-policy decision point.
43
+ 9. Visible state ownership must be checked for chat, rendering, scrolling, recovery, and status problems.
44
+ 10. SoT/runtime/product-semantics drift must be named; if official behaviour must be decided first, recommend UR or equivalent product direction.
45
+ 11. Large UI surfaces and state hooks must be checked for mixed render, view-model, derived state, orchestration, persistence, and recovery ownership.
46
+ 12. Context Graph impact must be curated; it is not a review log or version index.
47
+ 13. Specification archive migrations must follow the archive index if present.
39
48
 
40
49
  ## When To Use
50
+ - after `agdf-gate-check` permits `Brownfield Review` or live `.agdf/control/AGDF_RUN.md` names Brownfield Review as the next allowed action
41
51
  - after `agdf-gate-check` permits implementation preparation or live `.agdf/control/AGDF_RUN.md` already names Brownfield Analysis as the next allowed action
52
+ - after `Approval: UR` when existing owners, SoT, contracts, policies, persistence, runtime paths, tests, UI, UX or architecture may affect PRD/SD scope
42
53
  - before `CD+Tests`
43
54
  - before changes to an existing repository
44
55
  - bug fixes in existing modules
@@ -51,7 +62,7 @@ Brownfield-specific output must make evidence, missing existing-system view, par
51
62
  ## Inputs
52
63
  Use what is available:
53
64
 
54
- - Task Plan, `task_id`, `story_id`
65
+ - approved UR, Task Plan, `task_id`, `story_id`
55
66
  - project structure
56
67
  - affected files, modules, services, APIs, data models
57
68
  - existing tests
@@ -59,7 +70,8 @@ Use what is available:
59
70
  - repository conventions
60
71
 
61
72
  If inputs are missing, work only from observable evidence and mark gaps explicitly.
62
- If gate status, approval, scope or next allowed action is unclear, stop and route to `agdf-gate-check` instead of recommending or starting implementation.
73
+ If gate status, approval, scope or next allowed action is unclear, stop and route to `agdf-gate-check` instead of recommending PRD/SD detail or starting implementation.
74
+ When used as Brownfield Review after `Approval: UR`, do not recommend PRD, SD, TP, or implementation until the Mode/Slice Decision is explicit, evidenced and recorded.
63
75
 
64
76
  ## Workflow
65
77
  1. Identify affected tasks and scope.
@@ -92,9 +104,14 @@ Use a concise structure:
92
104
 
93
105
  ```text
94
106
  ## Brownfield Analysis
107
+ - mode: post_ur_review | pre_implementation_analysis
95
108
  - decision: pass | revise | block | not_applicable
109
+ - mode_slice_decision: quick_task | structured_slice | structured_delivery | block
110
+ - required_next_gate: none | PRD | SD | TP | Brownfield Analysis
111
+ - artefact: .agdf/control/artefacts/<key>/BROWNFIELD_REVIEW.md | none
96
112
  - scope:
97
113
  - evidence:
114
+ - transparency: why later artefacts are skipped, shortened or required
98
115
  - missing_evidence:
99
116
  - current_coverage:
100
117
  - reuse_strategy:
@@ -116,3 +133,4 @@ This skill must not:
116
133
  - convert product-semantics drift into a mere refactor
117
134
  - create Context Graph nodes automatically
118
135
  - treat archive links as active current specification signals
136
+ - recommend broad PRD/SD/TP or implementation by reflex before Mode/Slice Decision is recorded
@@ -19,59 +19,54 @@ This skill must not create later artefacts such as PRD, SD, TP, CD, CR, QA, or U
19
19
 
20
20
  ## Runtime Contract
21
21
  Use `../agdf-runtime-contract.md` for gate terms, closeout discipline, and non-duplication rules.
22
+ The canonical gate order and transition model live only in the Runtime Contract. This skill evaluates the current state against that model; it must not maintain a second complete gate table.
22
23
 
23
- ## Machine-Readable Control Path
24
+ ## Native Control Path
24
25
 
25
- When the target repository contains live AGDF control files, prefer the executable control path before deriving a gate decision manually:
26
+ AGDF is applied natively through this skill, the agent router, and live `.agdf/control/` state.
27
+
28
+ First inspect the durable control state directly:
29
+
30
+ - `.agdf/control/AGDF_RUN.md`
31
+ - `.agdf/control/MASTER_BACKLOG.md`
32
+ - `.agdf/control/SOT_REGISTRY.md`
33
+ - `.agdf/control/CONTEXT_GRAPH.md`
34
+ - `.agdf/control/AGENT_QUALITY_CONTRACTS.json`
35
+
36
+ Use the executable control path when a machine-readable check is requested, when the gate state is ambiguous, or when a repository-local automation needs JSON evidence:
26
37
 
27
38
  ```bash
28
39
  npm create agdf@latest doctor --json
29
40
  npm create agdf@latest gate-check --json
41
+ npm create agdf@latest delivery-map --json
30
42
  ```
31
43
 
32
44
  `doctor` checks whether `.agdf/control/` is actionable. `agdf-gate-check` consumes that result and `AGDF_RUN.md` to report the operative process decision: `open | blocked`, current gate, blocking reason, missing approval, allowed outputs, forbidden outputs, next allowed action and evidence references.
45
+ `delivery-map` reports the durable delivery picture: active artefacts, approvals, Artefact Chain relationships, evidence refs, missing evidence, risks, Context Graph gate effect and machine-readable findings.
33
46
 
34
- The CLI report is evidence for this skill, not a second rule system. If the report says `blocked`, do not continue with later-gate artefacts until the reported blocker is resolved.
47
+ The CLI reports are validators and JSON evidence, not the primary user experience and not a second rule system. If a report says `blocked`, do not continue with later-gate artefacts until the reported blocker is resolved.
35
48
 
36
49
  ## Rules
37
50
  1. Fail closed when a required approval or artefact status is missing.
38
51
  2. The earliest blocking gate wins.
39
52
  3. A user approval is valid only as `Approval: <GateName>`.
40
53
  4. Treat `Freigabe: <GateName>` as a legacy alias only when reviewing older German runs.
41
- 5. Implicit consent is not approval.
54
+ 5. Implicit consent is not approval. "ok", "go ahead", "do it", "approved", "continue", "leg los" and similar phrases do not unlock gates.
42
55
  6. Do not preview later artefacts while a gate blocks.
43
56
  7. Internal process steps are not user approval gates.
44
57
  8. OR-lite is allowed if it does not leak blocked content.
45
58
  9. SoT/runtime/product-semantics drift can trigger an early product gate, usually `UR`.
46
- 10. Approval of one user gate permits work on the next gate artefact only; it never skips directly to implementation.
47
- 11. New product semantics, functional change or user-visible behaviour change requires a durable UR in `.agdf/control/` or a linked authoritative repository SoT before PRD, SD, TP, Brownfield Analysis or implementation.
59
+ 10. Approval of one user gate permits work on the next allowed gate artefact or required internal step only; it never skips directly to implementation.
60
+ 11. New product semantics, functional change or user-visible behaviour change requires a durable UR in `.agdf/control/` or a linked authoritative repository SoT before Brownfield Review, PRD, SD, TP, Brownfield Analysis or implementation.
48
61
  12. Approval text and durable artefact presence are separate requirements for UR, PRD, SD, TP and QA report decisions. Approval text without the corresponding persisted or linked artefact keeps the current gate at that gate.
62
+ 13. After Brownfield Review, decide the process size before drafting PRD or implementing: `quick_task | structured_slice | structured_delivery | block`.
63
+ 14. The Mode/Slice Decision must be visible and evidenced before any Quick Task execution, PRD shortcut or implementation. A decision value without scope reason and evidence is still missing.
49
64
 
50
- ## Gate Order
51
- User gates:
52
-
53
- `UR -> PRD -> SD -> TP -> QA -> UAT`
54
-
55
- Internal mandatory steps:
56
-
57
- `Brownfield Analysis -> CD+Tests -> CR -> OR`
58
-
59
- ## Gate Transitions
60
-
61
- Use this transition model for Structured Delivery:
62
-
63
- | State | Current gate or step | Allowed | Forbidden | Missing approval |
64
- |---|---|---|---|---|
65
- | No approved UR | `UR` | clarify user need, formulate and persist UR, request `Approval: UR` | PRD, SD, TP, Brownfield Analysis, implementation, QA, release | `Approval: UR` |
66
- | `UR` approved and UR artefact persisted or linked, PRD missing or draft | `PRD` | draft/refine PRD, define scope, acceptance criteria and non-goals, persist/link PRD, request `Approval: PRD` | SD, TP, Brownfield Analysis, implementation, QA, release | `Approval: PRD` |
67
- | `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` |
68
- | `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` |
69
- | `TP` approved and TP artefact persisted or linked, Brownfield missing | `Brownfield Analysis` | run Brownfield Analysis for approved TP scope | implementation, QA, release | none |
70
- | Brownfield passed for approved TP | `CD+Tests` | implement approved TP tasks and run tests | QA pass, UAT, release | none |
71
- | `QA` approved but QA report missing or not pass | `QA` | persist/link QA report with `pass` decision or revise/block evidence | UAT, release | none |
65
+ ## Gate Evaluation
72
66
 
73
67
  If `Approval: UR` is present, do not say implementation is the next step.
74
- The next step is PRD work unless the run is explicitly classified as a Quick Task with no new product semantics and no formal artefact requirement.
68
+ The next step is Brownfield Review when Brownfield, ownership, runtime, policy, persistence, architecture, UI or UX impact is possible; after that, the next step is a Mode/Slice Decision. Do not assume the full PRD/SD/TP chain before the existing-system impact is understood.
69
+ Use the Runtime Contract's Gate Transition Model to derive the current gate, allowed outputs, forbidden outputs and missing approval.
75
70
 
76
71
  ## When To Use
77
72
  - new user intent to build, add, change, extend, refactor or deliver something
@@ -93,6 +88,8 @@ Use what is available:
93
88
  - current user request
94
89
  - existing exact approvals
95
90
  - status of UR, PRD, SD, TP
91
+ - Brownfield Review status
92
+ - Mode/Slice Decision
96
93
  - Brownfield Analysis status
97
94
  - CD+Tests, CR, QA, UAT status
98
95
  - signs of documentation/runtime/product-semantics drift
@@ -107,6 +104,9 @@ If a status is not explicit, do not assume it is satisfied.
107
104
  5. Name the exact missing approval, if any.
108
105
  6. If consent was only implicit, say it is not yet approval and provide the exact formula.
109
106
  7. Ensure the next step follows the gate transition table. In particular, never jump from `Approval: UR` to implementation.
107
+ 8. Treat a generic "start", "continue" or "leg los" request as a request to perform only the current next allowed action.
108
+ 9. After Brownfield Review, choose the smallest safe process path before creating later artefacts.
109
+ 10. If the selected path is not visibly recorded with scope reason and evidence, keep the run at `Mode/Slice Decision`.
110
110
 
111
111
  ## Output
112
112
  Keep the result short and operational:
@@ -122,11 +122,15 @@ Keep the result short and operational:
122
122
  This skill must not:
123
123
 
124
124
  - create PRD before UR approval
125
+ - create PRD before required Brownfield Review is done or explicitly not_applicable
126
+ - create PRD before Mode/Slice Decision is recorded
125
127
  - create SD before PRD approval
126
128
  - create TP while earlier gates block
127
129
  - suggest implementation immediately after `Approval: UR`
130
+ - suggest implementation before Brownfield Review has explicitly selected `quick_task`
128
131
  - suggest implementation immediately after `Approval: PRD`
129
132
  - suggest implementation immediately after `Approval: SD`
133
+ - treat "ok", "leg los", "go ahead", "approved" or similar wording as gate approval
130
134
  - perform full Brownfield Analysis unless explicitly requested
131
135
  - provide implementation snippets while implementation is gated
132
136
  - present QA or UAT as passed without evidence
@@ -28,9 +28,11 @@ It reports:
28
28
  Use `../agdf-runtime-contract.md` for Quality Contract output, Context Graph fields, gate terms, and non-duplication rules.
29
29
 
30
30
  OR-specific output must make gate status, delivered and intentionally not delivered content, missing approvals, missing evidence, risks, retained fallbacks, and the next permissible step visible.
31
+ When `.agdf/control/` is present, persist or link the OR under `.agdf/control/artefacts/<key>/OR.md` and reference it from `AGDF_RUN.md` or `MASTER_BACKLOG.md` when it is steering-relevant.
32
+ Use the Runtime Contract definition of `Relevant Run` to decide whether OR is mandatory or whether a Quick Task mini-closeout is enough.
31
33
 
32
34
  ## Rules
33
- 1. OR is always allowed and mandatory for relevant runs.
35
+ 1. OR is always allowed and mandatory for relevant runs as defined in the Runtime Contract.
34
36
  2. OR is an audit report, not a blocking gate.
35
37
  3. Do not leak artefacts from blocked later gates.
36
38
  4. Use OR-lite when early gates block.
@@ -51,6 +53,8 @@ OR-specific output must make gate status, delivered and intentionally not delive
51
53
  - after UAT
52
54
  - whenever a compact audit closeout is needed
53
55
 
56
+ Do not force OR onto a pure explanation, read-only inspection, small review, or local debugging step that produces no durable state change and no gate consequence.
57
+
54
58
  ## Inputs
55
59
  Use what is available:
56
60
 
@@ -77,15 +81,16 @@ If information is missing, state the gap instead of guessing.
77
81
  2. Determine report depth:
78
82
  - `OR-lite`: gate status, allowed/forbidden outputs, missing approval, next step
79
83
  - `OR-full`: also delivered artefacts, TP coverage, Brownfield fit, solution integrity, risks, fallbacks, QA/UAT status
80
- 3. Record delivered vs intentionally not delivered content.
81
- 4. Summarize TP coverage if a TP exists.
82
- 5. Summarize Brownfield fit and solution integrity if reviewed.
83
- 6. Summarize tests and verification.
84
- 7. Summarize documentation and Context Graph impact if relevant.
85
- 8. Name retained fallbacks and exit criteria.
86
- 9. Set exactly one next permissible step.
87
- 10. Set exactly one quality outlook.
88
- 11. State whether `agdf-delivery-closeout` is the next operational handoff step when code changes exist and the delivery state allows it.
84
+ 3. Record the selected `Report mode` and durable OR target or link when `.agdf/control/` exists.
85
+ 4. Record delivered vs intentionally not delivered content.
86
+ 5. Summarize TP coverage if a TP exists.
87
+ 6. Summarize Brownfield fit and solution integrity if reviewed.
88
+ 7. Summarize tests and verification.
89
+ 8. Summarize documentation and Context Graph impact if relevant.
90
+ 9. Name retained fallbacks and exit criteria.
91
+ 10. Set exactly one next permissible step.
92
+ 11. Set exactly one quality outlook.
93
+ 12. State whether `agdf-delivery-closeout` is the next operational handoff step when code changes exist and the delivery state allows it.
89
94
 
90
95
  ## Output
91
96
  Use a compact structure:
@@ -93,6 +98,8 @@ Use a compact structure:
93
98
  ```text
94
99
  ## OR
95
100
  - gate:
101
+ - report_mode:
102
+ - artefact:
96
103
  - status:
97
104
  - delivered:
98
105
  - intentionally_not_delivered:
@@ -15,26 +15,97 @@ Structured Delivery must not bypass missing approvals.
15
15
  New product semantics, functional change, user-visible behaviour, policy, persistence, architecture or release-critical work requires a durable UR in `.agdf/control/` or a linked authoritative repository SoT before later artefacts or implementation.
16
16
  UR, PRD, SD, TP and QA report approvals require durable artefacts or linked authoritative repository SoT entries before the next gate can open.
17
17
 
18
+ ## Quick Task Output
19
+
20
+ Quick Tasks are intentionally lightweight, but they must not become invisible.
21
+ Use this compact output shape when no formal gate artefact is required:
22
+
23
+ - `result`: what changed or was concluded
24
+ - `evidence`: files, commands, observations, or reasoning that support the result
25
+ - `risk`: remaining risk or `none`
26
+ - `next_step`: the single next useful action or `none`
27
+
28
+ ## Relevant Run
29
+
30
+ 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.
31
+
32
+ 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.
33
+ When in doubt, use a short OR-lite only if it clarifies gate state, evidence, risk, or the next permissible step.
34
+
18
35
  ## Gate Rules
19
36
 
20
37
  - User gates: `UR -> PRD -> SD -> TP -> QA -> UAT`
21
- - Internal mandatory steps: `Brownfield Analysis -> CD+Tests -> CR -> OR`
38
+ - Internal mandatory steps: `Brownfield Review -> Mode/Slice Decision -> Brownfield Analysis -> CD+Tests -> CR -> OR`
22
39
  - Exact approval formula: `Approval: <GateName>`
23
40
  - Legacy alias: `Freigabe: <GateName>` may be accepted when reviewing older German runs, but all new outputs must use `Approval: <GateName>`.
24
- - Implicit consent is not approval.
41
+ - 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.
25
42
  - The earliest blocking gate wins.
26
43
  - 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.
27
- - Approval of one user gate permits work on the next gate artefact only. It does not permit implementation unless the approved gate is `TP` and required internal implementation prerequisites are satisfied.
28
- - `Approval: UR` permits PRD drafting, not implementation.
44
+ - 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.
45
+ - 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.
46
+ - `Approval: UR` permits Brownfield Review after G-00 first, then a Mode/Slice Decision. It never permits implementation by itself.
47
+ - PRD, SD and TP depth is chosen after Brownfield Review through the Mode/Slice Decision, not before existing-system impact is understood.
48
+ - 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 `AGDF_RUN.md` or an equivalent linked control artefact.
29
49
  - `Approval: PRD` permits Solution Design drafting, not implementation.
30
50
  - `Approval: SD` permits Task/Test Plan drafting, not implementation.
31
- - `Approval: TP` permits Brownfield Analysis and then CD+Tests when Brownfield evidence supports it.
51
+ - `Approval: TP` permits implementation-preparation Brownfield Analysis and then CD+Tests when Brownfield evidence supports it.
32
52
  - `CD+Tests` is implementation and test status only, not a delivery signal.
33
53
  - `agdf-code-review` standardizes the mandatory `CR` step, but does not replace QA.
34
54
  - `agdf-qa-gate` decides final `pass | revise | block`.
35
55
  - `agdf-release-or` reports the run, but does not replace QA or produce the operative commit/PR handoff.
36
56
  - `agdf-delivery-closeout` owns the operative Git handoff text when QA/OR/UAT state allows it.
37
57
 
58
+ ## Brownfield Review After G-00
59
+
60
+ 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.
61
+
62
+ This review is not a new user approval gate, not PRD, not SD, not TP and not implementation permission.
63
+ It is the sizing and routing step that decides how much later gate discipline is actually needed.
64
+
65
+ Its output is limited to:
66
+
67
+ - workstream or follow-up-slice classification
68
+ - `Mode/Slice Decision`: `quick_task | structured_slice | structured_delivery | block`
69
+ - affected existing owners, source-of-truth artefacts, contracts, policies, runtime paths or tests
70
+ - reuse-before-create risks and parallel-structure risks
71
+ - open questions that PRD or SD must resolve
72
+ - whether implementation-preparation Brownfield Analysis will also be needed after TP
73
+
74
+ Mode/Slice Decision rules:
75
+
76
+ - `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.
77
+ - `structured_slice`: use when some formal artefacts are needed, but they can stay intentionally small and scoped to the approved slice.
78
+ - `structured_delivery`: use when the change has broad product, architecture, runtime, policy, persistence, release or cross-owner impact.
79
+ - `block`: use when ownership, SoT, impact, evidence or product direction is not clear enough to choose a safe path.
80
+
81
+ 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`.
82
+
83
+ ## Gate Transition Model
84
+
85
+ This table is the canonical transition model. Skills may reference it, but must not carry a second complete copy.
86
+
87
+ | State | Current gate or step | Allowed | Forbidden | Missing approval |
88
+ |---|---|---|---|---|
89
+ | No approved UR | `UR` | clarify user need, formulate and persist UR, request `Approval: UR` | PRD, SD, TP, Brownfield Analysis, implementation, QA, release | `Approval: UR` |
90
+ | `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 |
91
+ | Brownfield Review done or not_applicable, Mode/Slice Decision missing or incomplete | `Mode/Slice Decision` | decide `quick_task`, `structured_slice`, `structured_delivery` or `block`; record scope reason, evidence and required next gate depth | PRD, SD, TP, implementation, QA, release | none |
92
+ | 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 |
93
+ | 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` |
94
+ | `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` |
95
+ | `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` |
96
+ | `TP` approved and TP artefact persisted or linked, Brownfield Analysis missing | `Brownfield Analysis` | run Brownfield Analysis for approved TP scope | implementation, QA, release | none |
97
+ | Brownfield Analysis passed for approved TP | `CD+Tests` | implement approved TP tasks and run tests | QA pass, UAT, release | none |
98
+ | `QA` approved but QA report missing or not pass | `QA` | persist/link QA report with `pass` decision or revise/block evidence | UAT, release | none |
99
+
100
+ ## Brownfield Modes
101
+
102
+ The `agdf-brownfield-analysis` skill has two explicit modes:
103
+
104
+ - `post_ur_review`: lightweight sizing and routing after approved durable UR; decides Mode/Slice Decision before PRD depth or implementation is chosen.
105
+ - `pre_implementation_analysis`: implementation-preparation analysis after approved durable TP; verifies reuse path, owners, regression risk and fit before `CD+Tests`.
106
+
107
+ Do not mix the modes silently. Name the active mode in Brownfield output.
108
+
38
109
  ## Quality Contract Output
39
110
 
40
111
  Structured Delivery skills use this shape when relevant:
@@ -68,12 +139,38 @@ When a repository needs durable AGDF state, use the plugin-local `control/` scaf
68
139
 
69
140
  - `AGDF_RUN.md` is the current run dashboard.
70
141
  - `MASTER_BACKLOG.md` is the living pointer for active delivery work.
142
+ - `BROWNFIELD_REVIEW.md` records the post-UR existing-system view and Mode/Slice Decision before PRD depth or Quick Task execution is chosen.
71
143
  - `SOT_REGISTRY.md` prevents parallel sources of truth.
72
144
  - `CONTEXT_GRAPH.md` stores durable Brownfield findings, decisions, risks, evidence and exit criteria.
73
145
  - `AGENT_QUALITY_CONTRACTS.json` stores reusable block, revise and warning conditions.
146
+ - OR reports live under `.agdf/control/artefacts/<key>/OR.md` when a run closeout is steering-relevant or should be auditable beyond the chat.
74
147
 
75
148
  The scaffold is not a second documentation site. Link to authoritative artefacts instead of copying them.
76
149
 
150
+ ## Native Runtime
151
+
152
+ AGDF must work natively through the plugin router, skills and live `.agdf/control/` artefacts.
153
+ Agents should read the live control state and apply the gate model directly before reaching for helper commands.
154
+
155
+ Machine-readable commands such as `doctor --json`, `gate-check --json` and `delivery-map --json` are validators and automation interfaces.
156
+ They make the repository state checkable, but they do not replace the native skill workflow or the durable control artefacts.
157
+
158
+ ## Delivery Map
159
+
160
+ `delivery-map --json` is the machine-readable delivery picture for the active control state.
161
+ It derives, but does not replace, the live `.agdf/control/AGDF_RUN.md` and `MASTER_BACKLOG.md` state.
162
+
163
+ It must expose:
164
+
165
+ - approved or active artefacts and approvals
166
+ - `UR -> PRD -> SD -> TP -> QA_REPORT` relationships
167
+ - evidence refs, missing evidence and declared risks
168
+ - Context Graph impact and gate effect
169
+ - findings that explain why the delivery picture is `pass | warn | revise | block`
170
+
171
+ Missing relationship evidence in the Artefact Chain is at least `revise` once the related gate artefact is approved or passed.
172
+ Declared missing evidence, declared risk or Context Graph gate effect may escalate the delivery map to `warn`, `revise` or `block`.
173
+
77
174
  ## Skill Output
78
175
 
79
176
  Every skill output should be as short as possible and as concrete as needed.