@damphuquy/agent-init 2.0.0 → 2.1.0
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/package.json +1 -1
- package/templates/en/.agents/behavior.md +34 -2
- package/templates/en/.agents/guardrails.md +2 -1
- package/templates/en/AGENTS.md +15 -8
- package/templates/en/process/README.md +10 -10
- package/templates/en/process/_seeds/_GUIDE.md +6 -6
- package/templates/en/process/_seeds/decision-template.md.seed +7 -6
- package/templates/en/process/_seeds/plan-template.md.seed +2 -2
- package/templates/en/process/_seeds/review-template.md.seed +1 -1
- package/templates/en/process/_seeds/task-template.md.seed +9 -8
- package/templates/vi/.agents/behavior.md +34 -2
- package/templates/vi/.agents/guardrails.md +2 -1
- package/templates/vi/AGENTS.md +15 -8
- package/templates/vi/process/README.md +10 -10
- package/templates/vi/process/_seeds/_GUIDE.md +6 -6
- package/templates/vi/process/_seeds/decision-template.md.seed +7 -6
- package/templates/vi/process/_seeds/plan-template.md.seed +2 -2
- package/templates/vi/process/_seeds/review-template.md.seed +1 -1
- package/templates/vi/process/_seeds/task-template.md.seed +9 -8
package/package.json
CHANGED
|
@@ -25,9 +25,41 @@ first line. The declared mode must match the current phase recorded in `task.md`
|
|
|
25
25
|
Omit the mode declaration only for pure conversational exchanges that do not
|
|
26
26
|
advance a task (e.g., answering a factual question, clarifying scope).
|
|
27
27
|
|
|
28
|
+
In continuous autonomous execution (DELEGATED / Fast-Track), the agent opens with the starting phase's mode. When transitioning across phases within a single turn, emit an explicit transition marker:
|
|
29
|
+
`>>> [PHASE TRANSITION: <OLD_PHASE> -> <NEW_PHASE>]` and proceed under the new mode immediately without pausing.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 2. Working Modes & Phase Transition Protocol
|
|
34
|
+
|
|
35
|
+
<working_modes_protocol>
|
|
36
|
+
Execution posture is determined by `<working_mode>` in `task.md` or user prompt instruction:
|
|
37
|
+
|
|
38
|
+
### PAIR Mode (Default — Step-by-Step Collaboration):
|
|
39
|
+
- The agent works on one phase at a time.
|
|
40
|
+
- Upon completing a phase, it updates the corresponding artifact and **HALTS** to let the human engineer inspect, discuss, and sign off the Gate (G1, G2, G3).
|
|
41
|
+
- Waits for user prompt (e.g., "Start next phase") before updating `<current_phase>` in `task.md` and continuing.
|
|
42
|
+
|
|
43
|
+
### DELEGATED Mode (Autonomous / Fast-Track / Skip Permissions):
|
|
44
|
+
- **Activation:** `<working_mode>DELEGATED</working_mode>` in `task.md` OR explicit prompt directive ("fast-track", "skip permissions", "run automatically", "auto-advance", "autonomous").
|
|
45
|
+
- **Core Rule:** **DO NOT HALT AFTER EACH PHASE TO WAIT FOR USER PROMPT "NEXT".**
|
|
46
|
+
- **Continuous Transition Workflow:**
|
|
47
|
+
1. When the current phase meets its exit criteria/checklist, the agent checks `- [x]`.
|
|
48
|
+
2. Populates auto-approval into the artifact: `approved_by: [AUTO: DELEGATED]` with timestamp and technical rationale (in INNOVATE: adopts the optimal Recommendation; in PLAN: locks the scope contract).
|
|
49
|
+
3. Immediately updates `<current_phase>` in `task.md` to the next phase (`RESEARCH` → `INNOVATE` → `PLAN` → `EXECUTE` → `REVIEW`).
|
|
50
|
+
4. Instantiates the next phase seed artifact (Copy-On-Demand) and **CONTINUES EXECUTION IMMEDIATELY** within the same session/turn.
|
|
51
|
+
- **Sole Stop Conditions in DELEGATED:**
|
|
52
|
+
- Task is 100% COMPLETE (Gate 3 PASS, housekeeping cleaned, `handoff.md` generated, moved to `completed/`).
|
|
53
|
+
- OR a true Escalation Trigger is tripped (retry budget exhausted after 3 attempts, destructive command, or unresolvable invariant conflict).
|
|
54
|
+
|
|
55
|
+
### MANUAL & DIAGNOSE-ONLY Modes:
|
|
56
|
+
- `MANUAL`: Human leads command-by-command; agent provides scoped assistance.
|
|
57
|
+
- `DIAGNOSE-ONLY`: Runs Research & Review for root-cause audit without mutating source code.
|
|
58
|
+
</working_modes_protocol>
|
|
59
|
+
|
|
28
60
|
---
|
|
29
61
|
|
|
30
|
-
##
|
|
62
|
+
## 3. Session Startup Protocol
|
|
31
63
|
|
|
32
64
|
Before continuing any in-progress task, reload persistent state in this order:
|
|
33
65
|
|
|
@@ -45,7 +77,7 @@ file-based artifacts listed above.
|
|
|
45
77
|
|
|
46
78
|
---
|
|
47
79
|
|
|
48
|
-
##
|
|
80
|
+
## 4. Context Navigation Rules
|
|
49
81
|
|
|
50
82
|
<context_rules>
|
|
51
83
|
<rule id="minimum_context">
|
|
@@ -39,10 +39,11 @@
|
|
|
39
39
|
not declared in the approved plan.
|
|
40
40
|
3. Required change touches a file outside the scope defined in `plan.md`.
|
|
41
41
|
4. A business or policy decision is needed that is not in `<approved_decisions>`.
|
|
42
|
+
(Exception: Under DELEGATED / Fast-Track mode, the agent is authorized to select the recommended technical option evaluated in `decision.md` without triggering escalation, provided it preserves `<invariants>` and `<out_of_scope>`).
|
|
42
43
|
5. Scope expansion is needed beyond `<out_of_scope>` in `task.md`.
|
|
43
44
|
|
|
44
45
|
Exception: Do NOT halt if the change was explicitly authorized by the user
|
|
45
|
-
in the prompt/spec, or if it is a mandatory accompanying test or import update.
|
|
46
|
+
in the prompt/spec (under DELEGATED, fast-track, or skip permissions), or if it is a mandatory accompanying test or import update.
|
|
46
47
|
</escalation_triggers>
|
|
47
48
|
|
|
48
49
|
---
|
package/templates/en/AGENTS.md
CHANGED
|
@@ -69,6 +69,12 @@
|
|
|
69
69
|
|
|
70
70
|
<riper5_protocol>
|
|
71
71
|
|
|
72
|
+
<!-- ─────────────────── WORKING MODES ─────────────────── -->
|
|
73
|
+
<working_modes>
|
|
74
|
+
<mode id="PAIR" default="true">Step-by-step collaboration. Halts after each phase for human engineer review and gate sign-off.</mode>
|
|
75
|
+
<mode id="DELEGATED" alias="fast-track,autonomous,skip-permissions">Autonomous delegation. When task.md has working_mode=DELEGATED or the user specifies fast-track / skip permissions, the agent auto-certifies qualifying gates ([AUTO: DELEGATED]), advances task.md current_phase, and executes continuously without pausing for "next phase" prompts.</mode>
|
|
76
|
+
</working_modes>
|
|
77
|
+
|
|
72
78
|
<!-- ─────────────────── PHASE CONSTRAINTS ─────────────────── -->
|
|
73
79
|
|
|
74
80
|
<phase name="RESEARCH" order="1">
|
|
@@ -76,15 +82,16 @@
|
|
|
76
82
|
<constraint>No implementation decisions.</constraint>
|
|
77
83
|
<constraint>No architectural choices.</constraint>
|
|
78
84
|
<output>Produce/update `research.md`. Classify evidence as Confirmed / Observed / Hypothesized.</output>
|
|
79
|
-
<gate id="G0">All Research Exit Criteria in `research.md` checked before advancing.</gate>
|
|
85
|
+
<gate id="G0">All Research Exit Criteria in `research.md` checked before advancing. In DELEGATED / Fast-Track, the agent auto-certifies and advances to INNOVATE immediately.</gate>
|
|
80
86
|
</phase>
|
|
81
87
|
|
|
82
88
|
<phase name="INNOVATE" order="2">
|
|
83
89
|
<constraint>READ-ONLY. No source-code modifications.</constraint>
|
|
84
|
-
<constraint>Present 2–3 viable options with trade-off matrix
|
|
85
|
-
<constraint>
|
|
86
|
-
<
|
|
87
|
-
<
|
|
90
|
+
<constraint>Present 2–3 viable options with trade-off matrix.</constraint>
|
|
91
|
+
<constraint>PAIR mode: Leave `<engineer_decision>` blank for the human engineer to review and complete.</constraint>
|
|
92
|
+
<constraint>DELEGATED / Fast-Track mode: Automatically adopt the optimal Recommendation, record rationale with `[AUTO: DELEGATED]`, sign Gate 1, and immediately advance to PLAN.</constraint>
|
|
93
|
+
<output>Produce `decision.md`.</output>
|
|
94
|
+
<gate id="G1">Gate 1 in `decision.md` signed by engineer (PAIR) or auto-certified by agent with `[AUTO: DELEGATED]` (DELEGATED/Fast-Track) before advancing to Plan.</gate>
|
|
88
95
|
</phase>
|
|
89
96
|
|
|
90
97
|
<phase name="PLAN" order="3">
|
|
@@ -92,7 +99,7 @@
|
|
|
92
99
|
<constraint>Every slice must have a defined verifier, expected evidence, and rollback point.</constraint>
|
|
93
100
|
<constraint>Scope contract (allowed / forbidden files) must be explicit.</constraint>
|
|
94
101
|
<output>Produce `plan.md`. Populate Verification Matrix headers.</output>
|
|
95
|
-
<gate id="G2">Gate 2 in `plan.md`
|
|
102
|
+
<gate id="G2">Gate 2 in `plan.md` signed by engineer (PAIR) or auto-certified by agent with `[AUTO: DELEGATED]` (DELEGATED/Fast-Track) before advancing to Execute.</gate>
|
|
96
103
|
</phase>
|
|
97
104
|
|
|
98
105
|
<phase name="EXECUTE" order="4">
|
|
@@ -100,7 +107,7 @@
|
|
|
100
107
|
<constraint>One slice at a time. Run verifier after each slice. Inspect diff after each slice.</constraint>
|
|
101
108
|
<constraint>No unrelated refactoring. No changes to forbidden files.</constraint>
|
|
102
109
|
<constraint>Update `state.md` after every slice.</constraint>
|
|
103
|
-
<output>Source code + tests + updated `state.md` with verification evidence.</output>
|
|
110
|
+
<output>Source code + tests + updated `state.md` with verification evidence. When all slices pass, advance directly to REVIEW.</output>
|
|
104
111
|
</phase>
|
|
105
112
|
|
|
106
113
|
<phase name="REVIEW" order="5">
|
|
@@ -108,7 +115,7 @@
|
|
|
108
115
|
<constraint>No code fixes during review. Log findings in `review.md` instead.</constraint>
|
|
109
116
|
<constraint>Cover: behavior, architecture, data, security, regression.</constraint>
|
|
110
117
|
<output>Produce `review.md` with findings classified by category/severity/type and Gate 3 checklist.</output>
|
|
111
|
-
<gate id="G3">Gate 3 in `review.md`
|
|
118
|
+
<gate id="G3">Gate 3 in `review.md` must PASS before handoff. In DELEGATED mode, the agent performs full audit, creates `handoff.md`, moves task to `completed/`, and reports completion.</gate>
|
|
112
119
|
</phase>
|
|
113
120
|
|
|
114
121
|
<!-- Behavior rules (mode declaration, retry, escalation, completion gate) →
|
|
@@ -71,16 +71,16 @@ flowchart TD
|
|
|
71
71
|
Task --> Res["research.md"] --> G0{"Gate G0 (Auto)"}
|
|
72
72
|
end
|
|
73
73
|
subgraph I2["2. INNOVATE (Read-Only)"]
|
|
74
|
-
G0 --> Dec["decision.md (2-3 Options)"] --> G1{"Gate G1 (
|
|
74
|
+
G0 --> Dec["decision.md (2-3 Options)"] --> G1{"Gate G1 (Engineer or Auto-DELEGATED)"}
|
|
75
75
|
end
|
|
76
76
|
subgraph P3["3. PLAN (Plan-Only)"]
|
|
77
|
-
G1 --> Plan["plan.md (Vertical Slices)"] --> G2{"Gate G2 (
|
|
77
|
+
G1 --> Plan["plan.md (Vertical Slices)"] --> G2{"Gate G2 (Engineer or Auto-DELEGATED)"}
|
|
78
78
|
end
|
|
79
79
|
subgraph E4["4. EXECUTE (Scoped R/W)"]
|
|
80
80
|
G2 --> Code["Implement Slice"] --> Test["Run Verifiers"] --> State["state.md (Memory)"]
|
|
81
81
|
end
|
|
82
82
|
subgraph R5["5. REVIEW (Read-Only)"]
|
|
83
|
-
State --> Rev["review.md (Audit)"] --> G3{"Gate G3 (
|
|
83
|
+
State --> Rev["review.md (Audit)"] --> G3{"Gate G3 (Engineer or Auto-DELEGATED)"}
|
|
84
84
|
end
|
|
85
85
|
subgraph Done["6. COMPLETE"]
|
|
86
86
|
G3 --> Arch["Move to completed/"] --> Handoff["handoff.md"]
|
|
@@ -90,10 +90,10 @@ flowchart TD
|
|
|
90
90
|
```text
|
|
91
91
|
task.md ← (always) Master contract, RIPER phase/gate state, AC, decisions
|
|
92
92
|
research.md ← (Research) Execution flow, evidence, boundaries
|
|
93
|
-
decision.md ← (Innovate) Options, trade-offs, Gate 1
|
|
94
|
-
plan.md ← (Plan) Slices, verifiers, scope contract, Gate 2
|
|
93
|
+
decision.md ← (Innovate) Options, trade-offs, Gate 1 (Engineer approval or Auto-DELEGATED)
|
|
94
|
+
plan.md ← (Plan) Slices, verifiers, scope contract, Gate 2 (Engineer sign-off or Auto-DELEGATED)
|
|
95
95
|
state.md ← (Execute) Per-slice progress, failure memory, retry budget
|
|
96
|
-
review.md ← (Review) Findings, verification matrix, Gate 3
|
|
96
|
+
review.md ← (Review) Findings, verification matrix, Gate 3 (PASS)
|
|
97
97
|
handoff.md ← (Complete) Short final projection
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -130,14 +130,14 @@ handoff.md ← (Complete) Short final projection
|
|
|
130
130
|
</phase>
|
|
131
131
|
|
|
132
132
|
<phase order="2" name="Innovate">
|
|
133
|
-
READ-ONLY. Present 2–3 options with trade-off matrix.
|
|
134
|
-
Produce `decision.md`. Engineer approves
|
|
133
|
+
READ-ONLY. Present 2–3 options with trade-off matrix.
|
|
134
|
+
Produce `decision.md`. Gate 1: Engineer approves (PAIR mode) or Agent auto-certifies optimal recommendation [AUTO: DELEGATED] (DELEGATED/Fast-Track mode).
|
|
135
135
|
</phase>
|
|
136
136
|
|
|
137
137
|
<phase order="3" name="Plan">
|
|
138
138
|
Plan artifacts only — no source changes.
|
|
139
139
|
Decompose into vertical slices with verifiers, rollback points, and scope contract.
|
|
140
|
-
Produce `plan.md`. Engineer approves
|
|
140
|
+
Produce `plan.md`. Gate 2: Engineer approves (PAIR mode) or Agent auto-certifies scope contract [AUTO: DELEGATED] (DELEGATED/Fast-Track mode).
|
|
141
141
|
</phase>
|
|
142
142
|
|
|
143
143
|
<phase order="4" name="Execute">
|
|
@@ -147,7 +147,7 @@ handoff.md ← (Complete) Short final projection
|
|
|
147
147
|
|
|
148
148
|
<phase order="5" name="Review">
|
|
149
149
|
READ-ONLY. May run verification commands. No code fixes.
|
|
150
|
-
Produce `review.md` with findings. Gate 3 must pass before handoff.
|
|
150
|
+
Produce `review.md` with findings. Gate 3 must pass before handoff. Under DELEGATED mode, Agent auto-completes housekeeping and creates `handoff.md`.
|
|
151
151
|
</phase>
|
|
152
152
|
</operational_phases>
|
|
153
153
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
### Seeds Architectural Rationale: Understanding "Why" & "How"
|
|
13
13
|
* **Why the `.seed` extension? (Why):** The `.seed` suffix acts as an immutable boundary. It prevents automated AI discovery tools (`find`, `grep`) from confusing archetype templates with active `*.md` task files. This guarantees agents will never accidentally overwrite master blueprints during execution.
|
|
14
14
|
* **Why separate seeds per phase? (Why):** Each phase of RIPER-5 requires a distinct cognitive posture and permission boundary (Research vs Innovate vs Plan vs Execute vs Review). Splitting archetypes prevents context window bloat (Anti-Context Saturation), avoids hallucinations, and anchors each Quality Gate (G1–G3) to an auditable physical artifact.
|
|
15
|
-
* **Copy-On-Demand Protocol (How):** Never bulk-copy all seeds into a task directory. Start exclusively with `task.md`. Sequentially instantiate subsequent artifacts (`research.md` $\rightarrow$ `decision.md` $\rightarrow$ `plan.md` $\rightarrow$ `state.md` $\rightarrow$ `review.md` $\rightarrow$ `handoff.md`) only as the task progresses into each phase.
|
|
15
|
+
* **Copy-On-Demand Protocol (How):** Never bulk-copy all seeds into a task directory. Start exclusively with `task.md`. Sequentially instantiate subsequent artifacts (`research.md` $\rightarrow$ `decision.md` $\rightarrow$ `plan.md` $\rightarrow$ `state.md` $\rightarrow$ `review.md` $\rightarrow$ `handoff.md`) only as the task progresses into each phase. In PAIR mode, the agent pauses for human gate approvals; in DELEGATED / Fast-Track mode, the agent auto-instantiates subsequent seeds, auto-certifies gates, and executes continuously without interruptions.
|
|
16
16
|
</architectural_rationale>
|
|
17
17
|
|
|
18
18
|
---
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
<seed type="task" path="task-template.md.seed">
|
|
25
25
|
Master contract and state record for the full RIPER-5 lifecycle.
|
|
26
|
-
Contains: Task Control metadata, Spec, Context Boundaries, Verification Strategy,
|
|
26
|
+
Contains: Task Control metadata (working_mode PAIR/DELEGATED), Spec, Context Boundaries, Verification Strategy,
|
|
27
27
|
Decisions, RIPER-5 Execution Plan (with Gates G0–G3), and Guardrails.
|
|
28
28
|
</seed>
|
|
29
29
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<seed type="decision" path="decision-template.md.seed">
|
|
39
39
|
Innovate phase artifact. Gate 1 memory.
|
|
40
40
|
Contains: Decision question, Options (A/B/C) with trade-off matrix,
|
|
41
|
-
Recommendation,
|
|
41
|
+
Recommendation, Implementation Decision (filled by engineer in PAIR, or auto-selected in DELEGATED), Constraints Created,
|
|
42
42
|
Evidence Still Required, and Gate 1 checklist.
|
|
43
43
|
</seed>
|
|
44
44
|
|
|
@@ -125,9 +125,9 @@ handoff.md ← Final projection (short)
|
|
|
125
125
|
| Cancellation | `cancelled.md` (knowledge preservation upon abort) |
|
|
126
126
|
| Benchmark / Metrics | `results.tsv` (performance and eval metrics) |
|
|
127
127
|
| Program | `program.md` (multi-phase umbrella epic blueprint) |
|
|
128
|
-
| Gate 1 | `decision.md` approval |
|
|
129
|
-
| Gate 2 | `plan.md` approval |
|
|
130
|
-
| Gate 3 | `review.md` approval |
|
|
128
|
+
| Gate 1 | `decision.md` approval (Engineer or Auto-DELEGATED) |
|
|
129
|
+
| Gate 2 | `plan.md` approval (Engineer or Auto-DELEGATED) |
|
|
130
|
+
| Gate 3 | `review.md` approval (Engineer or Auto-DELEGATED) |
|
|
131
131
|
|
|
132
132
|
---
|
|
133
133
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<technical_decision task_id="[TASK-ID]" dec_id="[DEC-ID]" version="1.0" framework="RIPER-5">
|
|
4
4
|
|
|
5
|
-
<!-- READ-ONLY PHASE. Present options.
|
|
5
|
+
<!-- READ-ONLY PHASE. Present options. PAIR: engineer decides. DELEGATED: agent auto-selects optimal recommendation and advances. -->
|
|
6
6
|
<decision_status>
|
|
7
7
|
<phase>INNOVATE</phase>
|
|
8
8
|
<mode>READ-ONLY</mode>
|
|
@@ -98,9 +98,11 @@
|
|
|
98
98
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
|
-
## 6.
|
|
101
|
+
## 6. Implementation Decision
|
|
102
102
|
|
|
103
|
-
<!--
|
|
103
|
+
<!-- PAIR mode: Completed by engineer before Gate 1 passes.
|
|
104
|
+
DELEGATED / Fast-Track mode: Agent automatically populates Recommendation
|
|
105
|
+
into <selected_option>, documents rationale, signs Gate 1 with [AUTO: DELEGATED], and proceeds. -->
|
|
104
106
|
<engineer_decision>
|
|
105
107
|
<selected_option></selected_option>
|
|
106
108
|
<rationale></rationale>
|
|
@@ -133,10 +135,9 @@
|
|
|
133
135
|
|
|
134
136
|
<gate id="G1">
|
|
135
137
|
- [ ] All options presented and trade-offs analyzed.
|
|
136
|
-
- [ ]
|
|
137
|
-
- [ ] Engineer selected option recorded above.
|
|
138
|
+
- [ ] Selected option recorded above.
|
|
138
139
|
- [ ] No blocking business / schema / security decision remains open.
|
|
139
|
-
<approved_by></approved_by>
|
|
140
|
+
<approved_by></approved_by> <!-- Engineer name (PAIR) or [AUTO: DELEGATED] (DELEGATED/Fast-Track) -->
|
|
140
141
|
<approved_date></approved_date>
|
|
141
142
|
</gate>
|
|
142
143
|
|
|
@@ -127,8 +127,8 @@
|
|
|
127
127
|
- [ ] Stop conditions defined per slice.
|
|
128
128
|
- [ ] Rollback point defined per slice.
|
|
129
129
|
- [ ] Allowed commands listed.
|
|
130
|
-
- [ ]
|
|
131
|
-
<approved_by></approved_by>
|
|
130
|
+
- [ ] Plan approved.
|
|
131
|
+
<approved_by></approved_by> <!-- Engineer name (PAIR) or [AUTO: DELEGATED] (DELEGATED/Fast-Track) -->
|
|
132
132
|
<approved_date></approved_date>
|
|
133
133
|
</gate>
|
|
134
134
|
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
- [ ] Residual risk explicitly accepted.
|
|
143
143
|
- [ ] Review decision: PASS.
|
|
144
144
|
- [ ] Ready for handoff.
|
|
145
|
-
<approved_by></approved_by>
|
|
145
|
+
<approved_by></approved_by> <!-- Engineer name (PAIR) or [AUTO: DELEGATED] (DELEGATED/Fast-Track) -->
|
|
146
146
|
<approved_date></approved_date>
|
|
147
147
|
</gate>
|
|
148
148
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<priority>P2</priority> <!-- P0=urgent | P1=high | P2=normal | P3=low -->
|
|
12
12
|
<risk>MEDIUM</risk> <!-- LOW | MEDIUM | HIGH -->
|
|
13
13
|
<estimated_story_points>2</estimated_story_points> <!-- 1 SP ≈ 2-4 focused engineering hours -->
|
|
14
|
-
<working_mode>PAIR</working_mode> <!--
|
|
14
|
+
<working_mode>PAIR</working_mode> <!-- PAIR (default: halts at each gate for review) | DELEGATED (fast-track: continuous autonomous run) | MANUAL | DIAGNOSE-ONLY -->
|
|
15
15
|
<current_phase>RESEARCH</current_phase> <!-- RESEARCH | INNOVATE | PLAN | EXECUTE | REVIEW -->
|
|
16
16
|
<owner>@engineer</owner>
|
|
17
17
|
<decision_owner>@engineer</decision_owner>
|
|
@@ -124,18 +124,19 @@
|
|
|
124
124
|
- [ ] Current behavior understood and documented.
|
|
125
125
|
- [ ] Execution flow traced.
|
|
126
126
|
- [ ] No unresolved research blocker.
|
|
127
|
+
<!-- In DELEGATED / Fast-Track mode: Agent auto-certifies and advances to Innovate immediately -->
|
|
127
128
|
</gate>
|
|
128
129
|
</phase>
|
|
129
130
|
|
|
130
131
|
<phase name="Innovate" order="2">
|
|
131
|
-
<!-- READ-ONLY. Present 2-3 viable options.
|
|
132
|
+
<!-- READ-ONLY. Present 2-3 viable options. PAIR: engineer selects. DELEGATED: agent auto-selects optimal option. -->
|
|
132
133
|
- [ ] Generate 2–3 alternative approaches with trade-off matrix.
|
|
133
134
|
- [ ] Produce `decision.md` artifact.
|
|
134
135
|
<gate id="G1" label="Gate 1 — Decision Approved">
|
|
135
|
-
- [ ] Options reviewed
|
|
136
|
+
- [ ] Options reviewed and trade-offs analyzed.
|
|
136
137
|
- [ ] Selected option recorded in `decision.md`.
|
|
137
138
|
- [ ] No blocking business/schema/security decision remains open.
|
|
138
|
-
<approved_by></approved_by>
|
|
139
|
+
<approved_by></approved_by> <!-- Engineer name (PAIR) or [AUTO: DELEGATED] (DELEGATED/Fast-Track) -->
|
|
139
140
|
<approved_date></approved_date>
|
|
140
141
|
</gate>
|
|
141
142
|
</phase>
|
|
@@ -149,8 +150,8 @@
|
|
|
149
150
|
- [ ] Allowed/forbidden file scope is defined.
|
|
150
151
|
- [ ] Rollback point defined per slice.
|
|
151
152
|
- [ ] Stop conditions defined.
|
|
152
|
-
- [ ]
|
|
153
|
-
<approved_by></approved_by>
|
|
153
|
+
- [ ] Plan approved.
|
|
154
|
+
<approved_by></approved_by> <!-- Engineer name (PAIR) or [AUTO: DELEGATED] (DELEGATED/Fast-Track) -->
|
|
154
155
|
<approved_date></approved_date>
|
|
155
156
|
</gate>
|
|
156
157
|
</phase>
|
|
@@ -171,9 +172,9 @@
|
|
|
171
172
|
<gate id="G3" label="Gate 3 — Review Passed">
|
|
172
173
|
- [ ] All AC verified with evidence.
|
|
173
174
|
- [ ] Residual risk accepted.
|
|
174
|
-
- [ ] Review decision: PASS
|
|
175
|
+
- [ ] Review decision: PASS.
|
|
175
176
|
- [ ] Ready for handoff.
|
|
176
|
-
<approved_by></approved_by>
|
|
177
|
+
<approved_by></approved_by> <!-- Engineer name (PAIR) or [AUTO: DELEGATED] (DELEGATED/Fast-Track) -->
|
|
177
178
|
<approved_date></approved_date>
|
|
178
179
|
</gate>
|
|
179
180
|
</phase>
|
|
@@ -25,9 +25,41 @@ Mọi phản hồi thúc đẩy tiến độ task BẮT BUỘC phải mở đầ
|
|
|
25
25
|
Chỉ lược bỏ khai báo mode đối với các trao đổi mang tính đàm thoại thuần túy không
|
|
26
26
|
làm thay đổi tiến độ task (ví dụ: giải đáp câu hỏi kỹ thuật, làm rõ phạm vi yêu cầu).
|
|
27
27
|
|
|
28
|
+
Trong chế độ chạy liên tục (DELEGATED / Fast-Track), Agent mở đầu bằng mode của phase khởi động. Khi hoàn tất một phase và tự động chuyển sang phase tiếp theo trong cùng lượt phản hồi, Agent chèn phân cách chuyển mode rõ ràng:
|
|
29
|
+
`>>> [PHASE TRANSITION: <PHASE_CŨ> -> <PHASE_MỚI>]` và tiếp tục thực thi dưới mode mới ngay lập tức mà không dừng lại.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 2. Chế Độ Làm Việc & Giao Thức Chuyển Giai Đoạn (Working Modes & Transitions)
|
|
34
|
+
|
|
35
|
+
<working_modes_protocol>
|
|
36
|
+
Phương thức làm việc được quy định tại thẻ `<working_mode>` trong `task.md` hoặc qua chỉ thị của người dùng trong prompt:
|
|
37
|
+
|
|
38
|
+
### Chế độ PAIR (Mặc định — Hợp tác từng bước):
|
|
39
|
+
- Agent thực hiện từng phase một.
|
|
40
|
+
- Khi hoàn thành phase, cập nhật artifact tương ứng và **DỪNG LẠI** để kỹ sư con người kiểm tra, thảo luận và ký duyệt Gate (G1, G2, G3).
|
|
41
|
+
- Chờ người dùng ra lệnh "Bắt đầu phase tiếp theo" mới chuyển `<current_phase>` trong `task.md` và tiếp tục.
|
|
42
|
+
|
|
43
|
+
### Chế độ DELEGATED (Tự trị / Fast-Track / Skip Permissions):
|
|
44
|
+
- **Điều kiện kích hoạt:** `<working_mode>DELEGATED</working_mode>` trong `task.md` HOẶC người dùng chỉ thị rõ: "fast-track", "skip permissions", "tự động chạy", "chạy hết các phase", "autonomous".
|
|
45
|
+
- **Quy tắc vàng:** **TUYỆT ĐỐI KHÔNG DỪNG LẠI GIỮA CÁC PHASE ĐỂ ĐỢI PROMPT "TIẾP THEO".**
|
|
46
|
+
- **Quy trình tự động chuyển tiếp liên tục:**
|
|
47
|
+
1. Khi phase hiện tại hoàn thành đủ tiêu chuẩn thoát (exit criteria/checklist), Agent tự động tích chọn `- [x]`.
|
|
48
|
+
2. Điền thông tin tự động phê duyệt vào artifact: `approved_by: [AUTO: DELEGATED]` kèm ngày giờ và căn cứ kỹ thuật (ở INNOVATE: tự chọn phương án Recommendation tối ưu; ở PLAN: tự khóa hợp đồng phạm vi file).
|
|
49
|
+
3. Cập nhật ngay `<current_phase>` trong `task.md` sang phase kế tiếp (`RESEARCH` → `INNOVATE` → `PLAN` → `EXECUTE` → `REVIEW`).
|
|
50
|
+
4. Khởi tạo artifact seed của phase kế tiếp (Copy-On-Demand) và **TIẾP TỤC THỰC THI NGAY LẬP TỨC** trong cùng phiên làm việc.
|
|
51
|
+
- **Điều kiện dừng duy nhất trong DELEGATED:**
|
|
52
|
+
- Task đã hoàn thành 100% (Gate 3 PASS, dọn dẹp housekeeping sạch sẽ, tạo `handoff.md`, chuyển sang `completed/`).
|
|
53
|
+
- HOẶC chạm một trong các Điều Kiện Dừng Khẩn Cấp thực sự (Escalation Triggers trong `guardrails.md`: hết retry budget 3 lần cho cùng 1 lỗi, lệnh phá hủy nguy hiểm, hoặc mâu thuẫn trực tiếp ngoài phạm vi task).
|
|
54
|
+
|
|
55
|
+
### Chế độ MANUAL & DIAGNOSE-ONLY:
|
|
56
|
+
- `MANUAL`: Người dùng trực tiếp dẫn dắt từng lệnh, Agent chỉ đóng vai trò hỗ trợ cục bộ.
|
|
57
|
+
- `DIAGNOSE-ONLY`: Chỉ chạy Research & Review để chẩn đoán/kiểm toán lỗi mà không chỉnh sửa mã nguồn.
|
|
58
|
+
</working_modes_protocol>
|
|
59
|
+
|
|
28
60
|
---
|
|
29
61
|
|
|
30
|
-
##
|
|
62
|
+
## 3. Giao Thức Khởi Động Session (Session Startup Protocol)
|
|
31
63
|
|
|
32
64
|
Trước khi tiếp tục bất kỳ task đang dang dở nào, nạp lại trạng thái bền vững theo đúng thứ tự sau:
|
|
33
65
|
|
|
@@ -45,7 +77,7 @@ dựa trên các tệp artifact được liệt kê ở trên.
|
|
|
45
77
|
|
|
46
78
|
---
|
|
47
79
|
|
|
48
|
-
##
|
|
80
|
+
## 4. Quy Tắc Điều Hướng Ngữ Cảnh (Context Navigation Rules)
|
|
49
81
|
|
|
50
82
|
<context_rules>
|
|
51
83
|
<rule id="minimum_context">
|
|
@@ -39,10 +39,11 @@
|
|
|
39
39
|
chưa được khai báo trong kế hoạch đã duyệt.
|
|
40
40
|
3. Thay đổi cần thiết chạm vào tệp nằm ngoài phạm vi được định nghĩa trong `plan.md`.
|
|
41
41
|
4. Cần một quyết định nghiệp vụ hoặc chính sách chưa có trong `<approved_decisions>`.
|
|
42
|
+
(Ngoại lệ: Trong chế độ DELEGATED / Fast-Track, Agent được phép tự chọn phương án kỹ thuật được khuyến nghị trong `decision.md` miễn là không vi phạm `<invariants>` hay `<out_of_scope>`).
|
|
42
43
|
5. Cần mở rộng phạm vi ra ngoài mục `<out_of_scope>` trong `task.md`.
|
|
43
44
|
|
|
44
45
|
Ngoại lệ: KHÔNG dừng nếu thay đổi đã được người dùng ủy quyền rõ ràng
|
|
45
|
-
trong prompt/spec, hoặc nếu đó là tệp test đi kèm bắt buộc hay cập nhật import.
|
|
46
|
+
trong prompt/spec (chế độ DELEGATED, fast-track, skip permissions), hoặc nếu đó là tệp test đi kèm bắt buộc hay cập nhật import.
|
|
46
47
|
</escalation_triggers>
|
|
47
48
|
|
|
48
49
|
---
|
package/templates/vi/AGENTS.md
CHANGED
|
@@ -69,6 +69,12 @@
|
|
|
69
69
|
|
|
70
70
|
<riper5_protocol>
|
|
71
71
|
|
|
72
|
+
<!-- ─────────────────── CHẾ ĐỘ VẬN HÀNH (WORKING MODES) ─────────────────── -->
|
|
73
|
+
<working_modes>
|
|
74
|
+
<mode id="PAIR" default="true">Hợp tác từng bước. Dừng lại sau mỗi phase để kỹ sư kiểm tra và ký duyệt Gate tương ứng.</mode>
|
|
75
|
+
<mode id="DELEGATED" alias="fast-track,autonomous,skip-permissions">Ủy quyền tự trị. Khi task.md có working_mode=DELEGATED hoặc người dùng chỉ thị fast-track / skip permissions, Agent tự động nghiệm thu các Gate đạt chuẩn ([AUTO: DELEGATED]), tự động chuyển phase trong task.md và thực thi liên tục qua toàn bộ chu trình RIPER-5 mà KHÔNG dừng lại chờ lệnh "tiếp theo".</mode>
|
|
76
|
+
</working_modes>
|
|
77
|
+
|
|
72
78
|
<!-- ─────────────────── RÀNG BUỘC TỪNG GIAI ĐOẠN ─────────────────── -->
|
|
73
79
|
|
|
74
80
|
<phase name="RESEARCH" order="1">
|
|
@@ -76,15 +82,16 @@
|
|
|
76
82
|
<constraint>Không tự ý ra quyết định triển khai.</constraint>
|
|
77
83
|
<constraint>Không tự ý chọn lựa kiến trúc.</constraint>
|
|
78
84
|
<output>Tạo/cập nhật `research.md`. Phân loại bằng chứng thành Đã xác nhận (Confirmed) / Quan sát thấy (Observed) / Giả thuyết (Hypothesized).</output>
|
|
79
|
-
<gate id="G0">Đánh dấu đạt tất cả Tiêu chí rời khỏi Khảo sát (Research Exit Criteria) trong `research.md` trước khi chuyển tiếp.</gate>
|
|
85
|
+
<gate id="G0">Đánh dấu đạt tất cả Tiêu chí rời khỏi Khảo sát (Research Exit Criteria) trong `research.md` trước khi chuyển tiếp. Ở chế độ DELEGATED / Fast-Track, Agent tự động đánh giá và chuyển sang INNOVATE ngay lập tức.</gate>
|
|
80
86
|
</phase>
|
|
81
87
|
|
|
82
88
|
<phase name="INNOVATE" order="2">
|
|
83
89
|
<constraint>CHỈ ĐỌC (READ-ONLY). Không chỉnh sửa mã nguồn.</constraint>
|
|
84
|
-
<constraint>Đề xuất 2–3 phương án khả thi kèm ma trận đánh đổi (Trade-off)
|
|
85
|
-
<constraint>
|
|
86
|
-
<
|
|
87
|
-
<
|
|
90
|
+
<constraint>Đề xuất 2–3 phương án khả thi kèm ma trận đánh đổi (Trade-off).</constraint>
|
|
91
|
+
<constraint>Chế độ PAIR: Để trống phần `<engineer_decision>` — kỹ sư sẽ kiểm tra và điền phần này.</constraint>
|
|
92
|
+
<constraint>Chế độ DELEGATED / Fast-Track: Tự động chọn phương án khuyến nghị (Recommendation), ghi rõ rationale với `[AUTO: DELEGATED]`, tự ký duyệt Gate 1 và chuyển tiếp ngay sang PLAN.</constraint>
|
|
93
|
+
<output>Tạo `decision.md`.</output>
|
|
94
|
+
<gate id="G1">Gate 1 trong `decision.md` được kỹ sư ký duyệt (chế độ PAIR) hoặc tự động ký duyệt bởi Agent với `[AUTO: DELEGATED]` (chế độ DELEGATED / Fast-Track) trước khi chuyển sang Plan.</gate>
|
|
88
95
|
</phase>
|
|
89
96
|
|
|
90
97
|
<phase name="PLAN" order="3">
|
|
@@ -92,7 +99,7 @@
|
|
|
92
99
|
<constraint>Mỗi lát cắt (slice) phải có công cụ kiểm chứng (verifier), bằng chứng kỳ vọng và điểm hoàn nguyên (rollback point).</constraint>
|
|
93
100
|
<constraint>Hợp đồng phạm vi (danh sách file được phép / cấm sửa) phải tường minh.</constraint>
|
|
94
101
|
<output>Tạo `plan.md`. Điền sẵn các tiêu đề của Ma trận Kiểm chứng (Verification Matrix).</output>
|
|
95
|
-
<gate id="G2">Gate 2 trong `plan.md`
|
|
102
|
+
<gate id="G2">Gate 2 trong `plan.md` được kỹ sư ký duyệt (chế độ PAIR) hoặc tự động ký duyệt bởi Agent với `[AUTO: DELEGATED]` (chế độ DELEGATED / Fast-Track) trước khi chuyển sang Execute.</gate>
|
|
96
103
|
</phase>
|
|
97
104
|
|
|
98
105
|
<phase name="EXECUTE" order="4">
|
|
@@ -100,7 +107,7 @@
|
|
|
100
107
|
<constraint>Thực hiện từng lát cắt một. Chạy verifier sau mỗi slice. Kiểm tra diff sau mỗi slice.</constraint>
|
|
101
108
|
<constraint>Không refactor lan man. Không sửa các file bị cấm.</constraint>
|
|
102
109
|
<constraint>Cập nhật `state.md` ngay sau mỗi slice hoàn thành.</constraint>
|
|
103
|
-
<output>Mã nguồn + kiểm thử + cập nhật `state.md` kèm bằng chứng kiểm chứng.</output>
|
|
110
|
+
<output>Mã nguồn + kiểm thử + cập nhật `state.md` kèm bằng chứng kiểm chứng. Khi hoàn tất toàn bộ lát cắt, tự động chuyển ngay sang REVIEW.</output>
|
|
104
111
|
</phase>
|
|
105
112
|
|
|
106
113
|
<phase name="REVIEW" order="5">
|
|
@@ -108,7 +115,7 @@
|
|
|
108
115
|
<constraint>Không sửa mã nguồn trong lúc review. Ghi nhận các phát hiện vào `review.md`.</constraint>
|
|
109
116
|
<constraint>Bao quát: hành vi (behavior), kiến trúc (architecture), dữ liệu (data), bảo mật (security), hồi quy (regression).</constraint>
|
|
110
117
|
<output>Tạo `review.md` với các phát hiện được phân loại theo danh mục/mức độ/loại và checklist Gate 3.</output>
|
|
111
|
-
<gate id="G3">Gate 3 trong `review.md` phải được ký duyệt trước khi bàn giao. Quyết định review phải là PASS.</gate>
|
|
118
|
+
<gate id="G3">Gate 3 trong `review.md` phải được ký duyệt trước khi bàn giao. Quyết định review phải là PASS. Ở chế độ DELEGATED, Agent tự động kiểm toán toàn diện, tạo `handoff.md`, chuyển task sang `completed/` và báo cáo hoàn thành.</gate>
|
|
112
119
|
</phase>
|
|
113
120
|
|
|
114
121
|
<!-- Quy tắc hành vi (khai báo mode, retry, escalation, cổng hoàn thành) →
|
|
@@ -71,16 +71,16 @@ flowchart TD
|
|
|
71
71
|
Task --> Res["research.md"] --> G0{"Gate G0 (Tự động)"}
|
|
72
72
|
end
|
|
73
73
|
subgraph I2["2. INNOVATE (Chỉ đọc)"]
|
|
74
|
-
G0 --> Dec["decision.md (2-3 Phương án)"] --> G1{"Gate G1 (Kỹ sư
|
|
74
|
+
G0 --> Dec["decision.md (2-3 Phương án)"] --> G1{"Gate G1 (Kỹ sư hoặc Auto-DELEGATED)"}
|
|
75
75
|
end
|
|
76
76
|
subgraph P3["3. PLAN (Chỉ lập kế hoạch)"]
|
|
77
|
-
G1 --> Plan["plan.md (Lát cắt dọc)"] --> G2{"Gate G2 (Kỹ sư
|
|
77
|
+
G1 --> Plan["plan.md (Lát cắt dọc)"] --> G2{"Gate G2 (Kỹ sư hoặc Auto-DELEGATED)"}
|
|
78
78
|
end
|
|
79
79
|
subgraph E4["4. EXECUTE (Đọc/Ghi theo phạm vi)"]
|
|
80
80
|
G2 --> Code["Thực thi từng Slice"] --> Test["Chạy Verifiers"] --> State["state.md (Bộ nhớ)"]
|
|
81
81
|
end
|
|
82
82
|
subgraph R5["5. REVIEW (Chỉ đọc)"]
|
|
83
|
-
State --> Rev["review.md (Kiểm toán diff)"] --> G3{"Gate G3 (Kỹ sư
|
|
83
|
+
State --> Rev["review.md (Kiểm toán diff)"] --> G3{"Gate G3 (Kỹ sư hoặc Auto-DELEGATED)"}
|
|
84
84
|
end
|
|
85
85
|
subgraph Done["6. HOÀN THÀNH"]
|
|
86
86
|
G3 --> Arch["Chuyển sang completed/"] --> Handoff["handoff.md"]
|
|
@@ -90,10 +90,10 @@ flowchart TD
|
|
|
90
90
|
```text
|
|
91
91
|
task.md ← (luôn có) Hợp đồng master, trạng thái RIPER phase/gate, AC, decisions
|
|
92
92
|
research.md ← (Research) Luồng thực thi, bằng chứng, ranh giới hệ thống
|
|
93
|
-
decision.md ← (Innovate) Các phương án, bảng đánh đổi, Gate 1
|
|
94
|
-
plan.md ← (Plan) Các lát cắt, verifiers, hợp đồng phạm vi, Gate 2
|
|
93
|
+
decision.md ← (Innovate) Các phương án, bảng đánh đổi, Gate 1 (Kỹ sư duyệt hoặc Auto-DELEGATED)
|
|
94
|
+
plan.md ← (Plan) Các lát cắt, verifiers, hợp đồng phạm vi, Gate 2 (Kỹ sư duyệt hoặc Auto-DELEGATED)
|
|
95
95
|
state.md ← (Execute) Tiến độ từng slice, bộ nhớ lỗi, ngân sách thử lại
|
|
96
|
-
review.md ← (Review) Phát hiện kiểm toán, ma trận kiểm chứng, Gate 3
|
|
96
|
+
review.md ← (Review) Phát hiện kiểm toán, ma trận kiểm chứng, Gate 3 (PASS)
|
|
97
97
|
handoff.md ← (Complete) Tóm tắt bàn giao ngắn gọn
|
|
98
98
|
```
|
|
99
99
|
|
|
@@ -130,14 +130,14 @@ handoff.md ← (Complete) Tóm tắt bàn giao ngắn gọn
|
|
|
130
130
|
</phase>
|
|
131
131
|
|
|
132
132
|
<phase order="2" name="Innovate">
|
|
133
|
-
CHỈ ĐỌC. Đề xuất 2–3 phương án kèm ma trận đánh đổi.
|
|
134
|
-
Tạo `decision.md`. Kỹ sư phê duyệt
|
|
133
|
+
CHỈ ĐỌC. Đề xuất 2–3 phương án kèm ma trận đánh đổi.
|
|
134
|
+
Tạo `decision.md`. Gate 1: Kỹ sư phê duyệt (chế độ PAIR) hoặc Agent tự chọn phương án tối ưu [AUTO: DELEGATED] (chế độ DELEGATED/Fast-Track).
|
|
135
135
|
</phase>
|
|
136
136
|
|
|
137
137
|
<phase order="3" name="Plan">
|
|
138
138
|
Chỉ tạo/sửa artifact kế hoạch — không sửa mã nguồn.
|
|
139
139
|
Phân rã thành các lát cắt dọc (vertical slices) kèm verifiers, điểm hoàn nguyên và hợp đồng phạm vi.
|
|
140
|
-
Tạo `plan.md`. Kỹ sư phê duyệt
|
|
140
|
+
Tạo `plan.md`. Gate 2: Kỹ sư phê duyệt (chế độ PAIR) hoặc Agent tự động khóa hợp đồng lát cắt [AUTO: DELEGATED] (chế độ DELEGATED/Fast-Track).
|
|
141
141
|
</phase>
|
|
142
142
|
|
|
143
143
|
<phase order="4" name="Execute">
|
|
@@ -147,7 +147,7 @@ handoff.md ← (Complete) Tóm tắt bàn giao ngắn gọn
|
|
|
147
147
|
|
|
148
148
|
<phase order="5" name="Review">
|
|
149
149
|
CHỈ ĐỌC. Có thể chạy các lệnh kiểm thử xác minh. Không sửa mã nguồn.
|
|
150
|
-
Tạo `review.md` kèm các phát hiện. Gate 3
|
|
150
|
+
Tạo `review.md` kèm các phát hiện. Gate 3: Phải PASS trước khi bàn giao. Ở chế độ DELEGATED, Agent tự động hoàn tất dọn dẹp housekeeping và tạo `handoff.md`.
|
|
151
151
|
</phase>
|
|
152
152
|
</operational_phases>
|
|
153
153
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
### Triết Lý Thiết Kế Seeds: Bản Chất "Why" & "How"
|
|
13
13
|
* **Tại sao là đuôi `.seed`? (Why):** Đuôi `.seed` đóng vai trò ranh giới bất biến (Blueprint Immutability). Nó giúp phân biệt rõ ràng giữa "khuôn mẫu phôi" và "tài liệu markdown đang làm việc" (`*.md`). Khi AI quét repo bằng các công cụ tìm kiếm, hậu tố `.seed` bảo vệ các file này không bao giờ bị AI sửa đè vào làm hỏng template gốc của cả dự án.
|
|
14
14
|
* **Tại sao tách riêng từng seed theo phase? (Why):** Mỗi giai đoạn trong chu trình RIPER-5 đòi hỏi một kiểu tư duy và ranh giới quyền hạn khác biệt (Khảo sát vs Đề xuất vs Lập kế hoạch vs Thực thi vs Nghiệm thu). Việc tách rời giúp AI chỉ nạp đúng artifact cần thiết, chống phình to context window (Anti-Context Saturation) và gắn chặt với từng Cổng kiểm soát (Gates G1–G3).
|
|
15
|
-
* **Quy tắc Copy-On-Demand (How):** Tuyệt đối không copy hàng loạt tất cả seed vào thư mục task. Bắt đầu duy nhất với `task.md`. Khi task tiến vào phase nào, mới lần lượt khởi tạo artifact của phase đó (`research.md` $\rightarrow$ `decision.md` $\rightarrow$ `plan.md` $\rightarrow$ `state.md` $\rightarrow$ `review.md` $\rightarrow$ `handoff.md`).
|
|
15
|
+
* **Quy tắc Copy-On-Demand (How):** Tuyệt đối không copy hàng loạt tất cả seed vào thư mục task. Bắt đầu duy nhất với `task.md`. Khi task tiến vào phase nào, mới lần lượt khởi tạo artifact của phase đó (`research.md` $\rightarrow$ `decision.md` $\rightarrow$ `plan.md` $\rightarrow$ `state.md` $\rightarrow$ `review.md` $\rightarrow$ `handoff.md`). Ở chế độ PAIR, Agent dừng lại chờ người dùng duyệt cổng. Ở chế độ DELEGATED / Fast-Track, Agent tự động khởi tạo seed kế tiếp, tự động duyệt cổng và chạy liên tục không gián đoạn.
|
|
16
16
|
</architectural_rationale>
|
|
17
17
|
|
|
18
18
|
---
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
|
|
24
24
|
<seed type="task" path="task-template.md.seed">
|
|
25
25
|
Hợp đồng master và bản lưu vết trạng thái xuyên suốt toàn bộ vòng đời RIPER-5.
|
|
26
|
-
Bao gồm: Metadata kiểm soát task, Đặc tả (Spec), Ranh giới ngữ cảnh, Chiến lược kiểm chứng,
|
|
26
|
+
Bao gồm: Metadata kiểm soát task (working_mode PAIR/DELEGATED), Đặc tả (Spec), Ranh giới ngữ cảnh, Chiến lược kiểm chứng,
|
|
27
27
|
Quyết định kỹ thuật, Kế hoạch thực thi RIPER-5 (kèm Gates G0–G3), và Ranh giới an toàn (Guardrails).
|
|
28
28
|
</seed>
|
|
29
29
|
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<seed type="decision" path="decision-template.md.seed">
|
|
39
39
|
Artifact của giai đoạn Đề xuất giải pháp (Innovate). Bộ nhớ lưu vết Gate 1.
|
|
40
40
|
Bao gồm: Câu hỏi quyết định, Các phương án (A/B/C) kèm ma trận đánh đổi (Trade-off),
|
|
41
|
-
Khuyến nghị của Agent, Quyết định
|
|
41
|
+
Khuyến nghị của Agent, Quyết định Triển khai (Kỹ sư điền ở PAIR, hoặc Agent tự động chọn ở DELEGATED), Ràng buộc phái sinh,
|
|
42
42
|
Bằng chứng còn cần xác minh, và Checklist Gate 1.
|
|
43
43
|
</seed>
|
|
44
44
|
|
|
@@ -125,9 +125,9 @@ handoff.md ← Tóm tắt bàn giao cuối cùng (ngắn gọn)
|
|
|
125
125
|
| Hủy task | `cancelled.md` (lưu giữ tri thức khi hủy bỏ) |
|
|
126
126
|
| Benchmark / Định lượng | `results.tsv` (theo dõi hiệu năng và số liệu đánh giá) |
|
|
127
127
|
| Chương trình lớn | `program.md` (bản thiết kế chương trình lớn nhiều giai đoạn) |
|
|
128
|
-
| Gate 1 | Phê duyệt trong `decision.md` |
|
|
129
|
-
| Gate 2 | Phê duyệt trong `plan.md` |
|
|
130
|
-
| Gate 3 |
|
|
128
|
+
| Gate 1 | Phê duyệt trong `decision.md` (Kỹ sư hoặc Auto-DELEGATED) |
|
|
129
|
+
| Gate 2 | Phê duyệt trong `plan.md` (Kỹ sư hoặc Auto-DELEGATED) |
|
|
130
|
+
| Gate 3 | Nghiệm thu trong `review.md` (Kỹ sư hoặc Auto-DELEGATED) |
|
|
131
131
|
|
|
132
132
|
---
|
|
133
133
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
<technical_decision task_id="[TASK-ID]" dec_id="[DEC-ID]" version="1.0" framework="RIPER-5">
|
|
4
4
|
|
|
5
|
-
<!-- GIAI ĐOẠN CHỈ ĐỌC (READ-ONLY). Đề xuất các phương án.
|
|
5
|
+
<!-- GIAI ĐOẠN CHỈ ĐỌC (READ-ONLY). Đề xuất các phương án. PAIR: kỹ sư chọn. DELEGATED: agent tự chọn phương án tối ưu và tự động chuyển phase. -->
|
|
6
6
|
<decision_status>
|
|
7
7
|
<phase>INNOVATE</phase>
|
|
8
8
|
<mode>READ-ONLY</mode>
|
|
@@ -98,9 +98,11 @@
|
|
|
98
98
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
|
-
## 6. Quyết Định
|
|
101
|
+
## 6. Quyết Định Triển Khai (Implementation Decision)
|
|
102
102
|
|
|
103
|
-
<!--
|
|
103
|
+
<!-- Chế độ PAIR: Kỹ sư con người điền phần này trước khi duyệt Gate 1.
|
|
104
|
+
Chế độ DELEGATED / Fast-Track: Agent tự động điền phương án khuyến nghị (Recommendation)
|
|
105
|
+
vào <selected_option>, ghi rõ rationale và ký duyệt Gate 1 với [AUTO: DELEGATED]. -->
|
|
104
106
|
<engineer_decision>
|
|
105
107
|
<selected_option></selected_option>
|
|
106
108
|
<rationale></rationale>
|
|
@@ -133,10 +135,9 @@
|
|
|
133
135
|
|
|
134
136
|
<gate id="G1">
|
|
135
137
|
- [ ] Toàn bộ phương án đã được trình bày và phân tích đánh đổi.
|
|
136
|
-
- [ ]
|
|
137
|
-
- [ ] Phương án do kỹ sư chọn đã được ghi nhận ở trên.
|
|
138
|
+
- [ ] Phương án được chọn đã được ghi nhận ở trên.
|
|
138
139
|
- [ ] Không còn quyết định nghiệp vụ / schema / bảo mật nào đang bỏ ngỏ.
|
|
139
|
-
<approved_by></approved_by>
|
|
140
|
+
<approved_by></approved_by> <!-- Tên kỹ sư (PAIR) hoặc [AUTO: DELEGATED] (DELEGATED/Fast-Track) -->
|
|
140
141
|
<approved_date></approved_date>
|
|
141
142
|
</gate>
|
|
142
143
|
|
|
@@ -127,8 +127,8 @@
|
|
|
127
127
|
- [ ] Điều kiện dừng đã được định nghĩa cho từng slice.
|
|
128
128
|
- [ ] Điểm hoàn nguyên (rollback point) đã được định nghĩa cho từng slice.
|
|
129
129
|
- [ ] Danh sách lệnh được phép đã được liệt kê.
|
|
130
|
-
- [ ]
|
|
131
|
-
<approved_by></approved_by>
|
|
130
|
+
- [ ] Kế hoạch đã được ký duyệt.
|
|
131
|
+
<approved_by></approved_by> <!-- Tên kỹ sư (PAIR) hoặc [AUTO: DELEGATED] (DELEGATED/Fast-Track) -->
|
|
132
132
|
<approved_date></approved_date>
|
|
133
133
|
</gate>
|
|
134
134
|
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
- [ ] Rủi ro tồn đọng đã được chấp nhận rõ ràng.
|
|
143
143
|
- [ ] Quyết định review: PASS.
|
|
144
144
|
- [ ] Sẵn sàng bàn giao (handoff).
|
|
145
|
-
<approved_by></approved_by>
|
|
145
|
+
<approved_by></approved_by> <!-- Tên kỹ sư (PAIR) hoặc [AUTO: DELEGATED] (DELEGATED/Fast-Track) -->
|
|
146
146
|
<approved_date></approved_date>
|
|
147
147
|
</gate>
|
|
148
148
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
<priority>P2</priority> <!-- P0=khẩn cấp | P1=cao | P2=bình thường | P3=thấp -->
|
|
12
12
|
<risk>MEDIUM</risk> <!-- LOW | MEDIUM | HIGH -->
|
|
13
13
|
<estimated_story_points>2</estimated_story_points> <!-- 1 SP ≈ 2-4 giờ làm việc kỹ thuật tập trung -->
|
|
14
|
-
<working_mode>PAIR</working_mode> <!--
|
|
14
|
+
<working_mode>PAIR</working_mode> <!-- PAIR (mặc định: dừng chờ duyệt từng gate) | DELEGATED (fast-track: tự động chạy liên tục qua các phase) | MANUAL | DIAGNOSE-ONLY -->
|
|
15
15
|
<current_phase>RESEARCH</current_phase> <!-- RESEARCH | INNOVATE | PLAN | EXECUTE | REVIEW -->
|
|
16
16
|
<owner>@engineer</owner>
|
|
17
17
|
<decision_owner>@engineer</decision_owner>
|
|
@@ -124,18 +124,19 @@
|
|
|
124
124
|
- [ ] Hành vi hiện tại đã được hiểu và ghi nhận tài liệu.
|
|
125
125
|
- [ ] Luồng thực thi đã được truy vết đầy đủ.
|
|
126
126
|
- [ ] Không còn rào cản khảo sát chưa giải quyết.
|
|
127
|
+
<!-- Ở chế độ DELEGATED / Fast-Track: Agent tự động đánh giá và chuyển sang Innovate -->
|
|
127
128
|
</gate>
|
|
128
129
|
</phase>
|
|
129
130
|
|
|
130
131
|
<phase name="Innovate" order="2">
|
|
131
|
-
<!-- CHỈ ĐỌC. Đề xuất 2-3 phương án khả thi.
|
|
132
|
+
<!-- CHỈ ĐỌC. Đề xuất 2-3 phương án khả thi. PAIR: kỹ sư chọn. DELEGATED: agent tự chọn phương án tối ưu. -->
|
|
132
133
|
- [ ] Đề xuất 2–3 hướng tiếp cận khác nhau kèm ma trận đánh đổi.
|
|
133
134
|
- [ ] Tạo artifact `decision.md`.
|
|
134
135
|
<gate id="G1" label="Gate 1 — Phê duyệt phương án (Decision Approved)">
|
|
135
|
-
- [ ] Các phương án đã được
|
|
136
|
+
- [ ] Các phương án đã được xem xét và phân tích đánh đổi.
|
|
136
137
|
- [ ] Phương án được chọn đã ghi nhận vào `decision.md`.
|
|
137
138
|
- [ ] Không còn quyết định nghiệp vụ/schema/bảo mật nào đang bỏ ngỏ.
|
|
138
|
-
<approved_by></approved_by>
|
|
139
|
+
<approved_by></approved_by> <!-- Tên kỹ sư (PAIR) hoặc [AUTO: DELEGATED] (DELEGATED/Fast-Track) -->
|
|
139
140
|
<approved_date></approved_date>
|
|
140
141
|
</gate>
|
|
141
142
|
</phase>
|
|
@@ -149,8 +150,8 @@
|
|
|
149
150
|
- [ ] Phạm vi file được phép / bị cấm sửa được xác định rõ ràng.
|
|
150
151
|
- [ ] Điểm hoàn nguyên (rollback point) được định nghĩa cho từng slice.
|
|
151
152
|
- [ ] Điều kiện dừng khẩn cấp được nêu rõ.
|
|
152
|
-
- [ ]
|
|
153
|
-
<approved_by></approved_by>
|
|
153
|
+
- [ ] Kế hoạch đã được ký duyệt.
|
|
154
|
+
<approved_by></approved_by> <!-- Tên kỹ sư (PAIR) hoặc [AUTO: DELEGATED] (DELEGATED/Fast-Track) -->
|
|
154
155
|
<approved_date></approved_date>
|
|
155
156
|
</gate>
|
|
156
157
|
</phase>
|
|
@@ -171,9 +172,9 @@
|
|
|
171
172
|
<gate id="G3" label="Gate 3 — Nghiệm thu đạt (Review Passed)">
|
|
172
173
|
- [ ] Mọi AC đều được kiểm chứng kèm bằng chứng thực tế.
|
|
173
174
|
- [ ] Rủi ro tồn đọng đã được chấp nhận.
|
|
174
|
-
- [ ] Quyết định review: PASS
|
|
175
|
+
- [ ] Quyết định review: PASS.
|
|
175
176
|
- [ ] Sẵn sàng bàn giao (handoff).
|
|
176
|
-
<approved_by></approved_by>
|
|
177
|
+
<approved_by></approved_by> <!-- Tên kỹ sư (PAIR) hoặc [AUTO: DELEGATED] (DELEGATED/Fast-Track) -->
|
|
177
178
|
<approved_date></approved_date>
|
|
178
179
|
</gate>
|
|
179
180
|
</phase>
|