feat: Ralph Loop integration — mini-reflect, alternatives, structured confidence

- Mini-Reflect for fast workflow: Creator must restate task, list assumptions,
  name highest-damage risk before proposing (catches misunderstandings early)
- Alternatives Considered section: Creator must evaluate 2+ approaches with
  rejection rationale before committing to one (prevents tunnel vision)
- Structured confidence scoring: 3-axis table (task understanding, solution
  completeness, risk coverage) replaces bare 0.0-1.0 number. Low scores
  trigger targeted action (clarify, upgrade workflow, or research)
- Mini-Reflect fallback for skipped tasks: quick reflection even when
  ArcheFlow doesn't activate (non-trivial single-file changes)
This commit is contained in:
2026-04-03 06:08:01 +02:00
parent df0c81ae89
commit 5139f1ad89
3 changed files with 44 additions and 6 deletions

View File

@@ -47,19 +47,30 @@ Agent(
**Context to include:** Task description, Explorer's research output. On cycle 2+: prior cycle's structured feedback (see Cycle Feedback Protocol).
**Context to exclude:** Raw file contents (Explorer already summarized), git diffs, reviewer full outputs.
**Fast workflow only (no Explorer):** The Creator must perform a Mini-Reflect before proposing:
1. Restate the task in your own words (catch misunderstandings early)
2. List 3 assumptions you're making
3. Name the one risk that would cause most damage if wrong
```
Agent(
description: "🏗️ Creator: design proposal",
prompt: "<task description>
You are the CREATOR archetype.
Based on the research findings: <Explorer's output>
<if fast workflow (no Explorer): Before proposing, perform a Mini-Reflect:
1. Restate the task in one sentence
2. List 3 assumptions you're making
3. Name the highest-damage risk
Then propose.>
<if standard/thorough: Based on the research findings: <Explorer's output>>
<if cycle 2+: Prior cycle feedback: <structured feedback — see Cycle Feedback Protocol>>
Design a solution proposal including:
1. Architecture decisions (with rationale)
2. Files to create/modify (with specific changes)
3. Test strategy
4. Confidence score (0.0 to 1.0)
5. Risks you foresee
3. Alternatives considered (at least 2, with rejection rationale)
4. Test strategy
5. Confidence (scored by axis: task understanding, solution completeness, risk coverage)
6. Risks you foresee
<if cycle 2+: 6. How you addressed each unresolved issue from prior feedback>
Be decisive. Ship a clear plan, not a menu of options.",
subagent_type: "Plan"

View File

@@ -32,11 +32,21 @@ Explorer researches, then Creator designs. Sequential — Creator needs Explorer
```markdown
## Proposal: <task>
**Confidence:** <0.0 to 1.0>
### Mini-Reflect (fast workflow only — skip if Explorer ran)
- **Task restated:** <one sentence>
- **Assumptions:** 1) ... 2) ... 3) ...
- **Highest-damage risk:** <the one thing that would hurt most if wrong>
### Architecture Decision
<What and WHY>
### Alternatives Considered
| Approach | Why Rejected |
|----------|-------------|
| <option A> | <reason> |
| <option B> | <reason> |
### Changes
1. **`path/file.ext`** — What changes and why
2. **`path/test.ext`** — What tests to add
@@ -44,6 +54,13 @@ Explorer researches, then Creator designs. Sequential — Creator needs Explorer
### Test Strategy
- <specific test cases>
### Confidence
| Axis | Score | Note |
|------|-------|------|
| Task understanding | <0.0-1.0> | <why> |
| Solution completeness | <0.0-1.0> | <gaps?> |
| Risk coverage | <0.0-1.0> | <unknowns?> |
### Risks
- <what could go wrong + mitigations>
@@ -51,13 +68,14 @@ Explorer researches, then Creator designs. Sequential — Creator needs Explorer
- <adjacent concerns deliberately excluded>
```
**Confidence triggers:** If any axis scores below 0.5, flag it to the orchestrator. Low task understanding → clarify with user. Low solution completeness → consider standard workflow. Low risk coverage → spawn targeted Explorer research.
## Creator with Prior Feedback (Cycle 2+)
When the Creator receives structured feedback from a prior cycle, the proposal must include an additional section addressing each unresolved issue:
```markdown
## Proposal: <task> (Revision — Cycle N)
**Confidence:** <0.0 to 1.0>
### Prior Feedback Response
| Issue | Source | Action | Rationale |
@@ -75,6 +93,13 @@ When the Creator receives structured feedback from a prior cycle, the proposal m
### Test Strategy
<updated test cases>
### Confidence
| Axis | Score | Note |
|------|-------|------|
| Task understanding | <0.0-1.0> | <why> |
| Solution completeness | <0.0-1.0> | <gaps?> |
| Risk coverage | <0.0-1.0> | <unknowns?> |
### Risks
<updated risks — include any new risks from the revision>

View File

@@ -36,6 +36,8 @@ Do NOT use ArcheFlow for these — just do them directly:
- Config changes to a single file
- Git operations (commit, push, branch)
**Mini-Reflect fallback:** Even when skipping ArcheFlow, apply a quick reflection for non-trivial single-file changes: (1) restate what you're changing, (2) name one assumption, (3) check if it could break anything. This takes ~10 seconds and catches misunderstandings before they become commits.
## Archetypes
| Archetype | Avatar | Virtue | Shadow | Phase |