Use when G2 (plan freeze) and G3 (execution readiness) gates have passed — handles all implementation, baseline reproduction, experimentation, and iteration for both Type M and Type D projects; this is Phase 4
This skill orchestrates all implementation and experimentation. It operates in TWO stages:
This two-stage model reflects how real research works: you don't know everything before you start, and early exploration often reshapes the direction.
Literature retrieval is NOT limited to Phase 1. During experiment execution, when you encounter unexpected results, need to understand a technique, or want to compare with a method not in the original literature review — search immediately. Use web search, arXiv, Google Scholar. Add new papers to docs/02_literature/paper-list.md with tag [Found during Phase 4].
If search fails or returns insufficient results:
docs/02_literature/paper-list.md[literature pending]Inject ALL of these into every subagent dispatch during Phase 4:
value_proposition from docs/01_intake/research-anchor.yaml]. All work serves this."primary_metrics from docs/03_plan/evaluation-protocol.yaml]. IMMUTABLE without user permission."target_venue.primary from research-anchor.yaml]. Is current experiment scale adequate?"Before entering Phase 4a, verify ALL items:
docs/04_data_resource/data-quality-report.md exists)docs/04_data_resource/leakage-audit.md clean)research-anchor.yaml resources.compute)evaluation-protocol.yaml)If ANY item fails, STOP and resolve before proceeding.
digraph execution {
rankdir=TB;
g2 [label="G2 passed\nPlan frozen" shape=doublecircle];
g3 [label="G3 check\nExecution readiness" shape=diamond];
g3_fail [label="Resolve blockers" shape=box style=filled fillcolor="#f8d7da"];
subgraph cluster_4a {
label="Phase 4a — Exploratory";
style=dashed;
color=blue;
exp_M [label="Type M: Run 1-2 baselines\n+ error analysis" shape=box style=filled fillcolor="#e0e0ff"];
exp_D [label="Type D: Exploratory data analysis\n+ pattern discovery" shape=box style=filled fillcolor="#cce5ff"];
exp_T [label="(Optional) Theoretical\nanalysis / proof sketch" shape=box style=filled fillcolor="#f0e0ff"];
}
decision [label="Decision Point:\nDoes plan still\nmake sense?" shape=diamond style=filled fillcolor="#fff3cd"];
return_p2 [label="Return to Phase 2\n(refine question)" shape=box style=filled fillcolor="#ffcccc"];
return_p3 [label="Return to Phase 3\n(refine design)" shape=box style=filled fillcolor="#ffcccc"];
adjust [label="Adjust plan\n+ continue" shape=box style=filled fillcolor="#ffffcc"];
subgraph cluster_4b {
label="Phase 4b — Full Execution";
style=dashed;
color=green;
A [label="Stage A\nBuild framework" shape=box];
B [label="Stage B\nReproduce baselines" shape=box style=filled fillcolor="#d4edda"];
C [label="Stage C\nImplement method\n(+ optional proofs)" shape=box];
D [label="Stage D\nIterate & validate" shape=box];
pivot [label="pivot-or-kill\n(after 3 failures)" shape=doubleoctagon style=filled fillcolor="#f8d7da"];
E [label="Stage E\nFull-scale experiments" shape=box style=filled fillcolor="#d4edda"];
}
results [label="Phase 5:\nresults-integration" shape=doublecircle];
g2 -> g3;
g3 -> g3_fail [label="fail"];
g3_fail -> g3 [label="retry"];
g3 -> exp_M [label="pass\nType M"];
g3 -> exp_D [label="pass\nType D"];
exp_M -> exp_T [label="has theory?"];
exp_D -> exp_T [label="has theory?"];
exp_M -> decision;
exp_D -> decision;
exp_T -> decision;
decision -> return_p2 [label="question\nwrong"];
decision -> return_p3 [label="design\nneeds change"];
decision -> adjust [label="minor\nadjustment"];
decision -> A [label="plan\nconfirmed"];
adjust -> A;
A -> B;
B -> C;
C -> D;
D -> D [label="iterate"];
D -> pivot [label="3 failures"];
pivot -> D [label="pivot approved"];
D -> E [label="user confirms\nmethod works"];
E -> results;
}
Phase 4a is deliberately QUICK — it should take a fraction of the effort of full execution. The goal is insight, not completeness. </IRON-LAW>
Goal: Understand the actual problem landscape before committing to full-scale execution.
NOTE: Baselines run here count toward Phase 4b Stage B — they will NOT be re-run. Phase 4a is a subset of the full execution, not a separate exercise.
Output: docs/05_execution/phase4a-exploration-report.md
Phase 4a Exploration Report (Type M):
═════════════════════════════════════
Baselines run: [list with results]
Error analysis findings:
[describe failure patterns, edge cases, systematic issues]
Predicted failure pattern (from Phase 3): [X]
Actual failure pattern: [Y]
Alignment: [matched / partially matched / different]
Quick prototype results (if run): [summary]
Issues or surprises: [list anything unexpected]
Goal: Run the core analysis pipeline once on real data to see what the actual results look like, before committing to the full analysis plan.
NOTE: "Exploratory analysis" means different things in different fields. It is NOT limited to clustering and dimensionality reduction. The point is to execute the main planned analysis at a basic level and examine the output.
Output: docs/05_execution/phase4a-exploration-report.md
Phase 4a Exploration Report (Type D):
═════════════════════════════════════
Data quality: [summary]
Preliminary analysis results:
[describe key outputs from the initial analysis run]
Results vs expectations:
Expected: [what Phase 3 predicted]
Observed: [what actually came out]
Surprises: [anything unexpected]
Assessment of analysis plan:
Still appropriate? [yes / needs adjustment]
Missing analyses? [list]
Unnecessary analyses? [list]
Goal: Run a quick comparison on one benchmark to see if the tool's advantages are real.
Output: Append to docs/05_execution/phase4a-exploration-report.md
Phase 4a Exploration Report (Type C):
═════════════════════════════════════
Quick benchmark: [name]
Our tool: [correctness, runtime, memory]
Competitor A: [correctness, runtime, memory]
Competitor B: [correctness, runtime, memory]
Claimed advantage: [X]
Actual advantage: [Y]
Gap: [large / moderate / marginal / none]
Installation test: [clean / issues]
If the project includes theoretical claims (convergence, complexity, correctness, bounds):
This can run in parallel with the computational exploration above.
Output: Append to docs/05_execution/phase4a-exploration-report.md
Theoretical Analysis (preliminary):
Claim: [what we want to prove]
Proof strategy: [approach]
Key lemma attempted: [which one, result]
Feasibility: [viable / needs weaker claim / blocked by X]
Based on the exploration results, assess the situation and present appropriate options. The most common outcome is local adjustment, not a full phase reset.
Phase 4a exploration complete. Report above.
MY ASSESSMENT: [summarize what was found and what it means for the plan]
YOUR OPTIONS:
1. ✅ PROCEED AS-IS — Plan is confirmed. Continue to Phase 4b.
2. 🔧 LOCAL ADJUSTMENT (most common) — Adjust specific parts of the
plan based on what we learned:
[list specific proposed changes, e.g.:]
- Add experiment X to address [finding]
- Modify analysis step Y because [reason]
- Replace baseline Z with a stronger one
- Adjust method component W based on error analysis
These changes are applied directly — no need to redo Phase 3.
3. 🔄 FOCUSED RE-DISCUSSION — Some findings need deeper thought. I'll
dispatch the Phase 3 agents (Innovation Advisor / Domain Scientist / etc.)
for a FOCUSED discussion on the specific issue:
"[describe the specific issue that needs multi-agent input]"
This is NOT a full Phase 3 redo — just a targeted consultation.
4. ↩️ RETURN TO PHASE 3 — The method/analysis design has a FUNDAMENTAL
problem that can't be fixed with local adjustments.
[Only suggest this if there's a deep structural issue.]
5. ↩️↩️ RETURN TO PHASE 2 — The research question itself is wrong.
[Only suggest this in extreme cases — e.g., the data contradicts
the premise, or the problem doesn't exist.]
Which option? (You can also propose your own adjustments.)
Guidelines for which option to suggest:
| Situation | Recommended Option | |-----------|-------------------| | Results match predictions, plan looks good | 1 (Proceed) | | Baseline stronger/weaker than expected, need to add/change experiments | 2 (Local Adjustment) | | Error analysis reveals a different bottleneck than predicted | 2 or 3 (Adjust or Re-discuss) | | Data shows unexpected pattern worth exploring | 2 (Add experiments to explore it) | | Method's core idea doesn't address the actual problem | 3 or 4 (Re-discuss or Return) | | Data doesn't support the research question at all | 5 (Return to Phase 2) |
For Option 2 (Local Adjustment):
For Option 3 (Focused Re-discussion):
For Options 4 and 5 (Full return):
docs/05_execution/phase4a-exploration-report.mdThe user can also iterate within Phase 4a: If the user says "try X first" or "run one more experiment before deciding," that's fine — Phase 4a can have multiple rounds of quick exploration before the decision point. The MANDATORY STOP is about getting user input before committing to full-scale Phase 4b, not about limiting exploration.
Set up the infrastructure before any experiment runs:
evaluation-protocol.yaml exactlyUse implementer-prompt.md to dispatch coding tasks.
IRON LAW: BASELINES FIRST. NO EXCEPTIONS.
NOTE: If Phase 4a already ran some baselines, carry those results forward — do NOT re-run them. Stage B completes the REMAINING baselines and consolidates all results.
B.1 — Check for pre-computed and Phase 4a results
Before implementing anything, check two sources:
evaluation-protocol.yaml — each baseline's pre_computed.statusdocs/05_execution/phase4a-exploration-report.md — baselines already run in Phase 4a| Status | Action |
|--------|--------|
| accepted | Skip re-running. Import pre-computed results directly into baseline-results.md. Verify the numbers match what was recorded. |
| reference_only | Must re-run under our evaluation protocol. Use pre-computed results as a sanity check — our reproduced numbers should be in the same ballpark. |
| incompatible | Must re-run from scratch. Pre-computed results are discarded for official comparison. |
| (empty) | Must run — no pre-computed results available. |
Report to user:
Baseline execution plan:
Skip (pre-computed accepted): N baselines
Re-run (reference only / incompatible / new): M baselines
Total baselines: N + M
B.2 — Run baselines that need running
For each baseline that needs running:
evaluation-protocol.yamlreference_only pre-computed values)| Discrepancy vs reference | Action | |--------------------------|--------| | ≤ 1% relative | Acceptable. Proceed. | | 1–5% relative | Investigate. Document reason. Proceed if justified. | | > 5% relative | STOP. Debug until resolved or user approves deviation. |
B.3 — Consolidate all baseline results
Merge accepted pre-computed results and newly reproduced results into a single table in docs/05_execution/baseline-results.md:
| Baseline | Source | Dataset | Primary Metric | Seeds | Notes |
|----------|--------|---------|---------------|-------|-------|
| Method A | accepted pre-computed (user's own run) | X | 0.87 ± 0.02 | 5 | Imported from Phase 1 |
| Method B | reproduced (official repo) | X | 0.83 ± 0.01 | 5 | Matched paper within 0.5% |
All downstream comparisons (Stage D, Stage E) use this consolidated table.
Build incrementally — each component must be independently testable:
reproducibility-driven-research: fix seeds, log environment, script everythingIf the project includes theoretical claims (convergence, complexity, correctness):
Complete the formal proofs alongside or before full experimental validation:
Write proofs to docs/05_execution/theoretical-analysis.md (or .tex for LaTeX).
Common proof types in computational research:
| Type | Example | What to Show | |------|---------|-------------| | Convergence | "Our optimizer converges to a stationary point" | Rate and conditions | | Complexity | "Algorithm runs in O(n log n) time" | Tight bound with proof | | Correctness | "Output satisfies property P" | Formal proof, possibly by induction | | Approximation | "Solution is within factor α of optimal" | Bound with construction | | Generalization | "Test error bounded by X with probability Y" | PAC/VC/Rademacher bound |
If a proof attempt FAILS (can't prove the desired result):
evaluation-protocol.yaml training_convergence section). 1-epoch or few-epoch results are NOT experiments.Reporting incomplete execution as final results is FORBIDDEN. </IRON-LAW>
Small-scale validation first. Do NOT run full experiments immediately.
For each iteration round:
| Step | Action | Output | |------|--------|--------| | 1. Diagnose | Analyze WHERE the method fails — error analysis, confusion matrices, loss curves, per-class/per-sample breakdown | Specific failure pattern | | 2. Hypothesize | State WHY based on diagnosis. One hypothesis per round. | Written hypothesis | | 3. Fix | Make ONE targeted change addressing the hypothesis | Code change + rationale | | 4. Measure | Run method to completion, evaluate on ALL seeds, compare to previous round AND baselines | Updated results table | | 5. Report | Present to user: "Round N: changed X because Y. Result: Z vs previous W vs baseline V." | User acknowledgment |
After each round, present this comparison to the user:
=== Iteration Round N Report ===
Hypothesis: [what was wrong]
Change: [what was modified]
Result:
This round: XX.X ± Y.Y (primary metric)
Last round: XX.X ± Y.Y
Best baseline: ZZ.Z ± W.W
Gap to best baseline: ±N.N%
Status: [improving / stagnating / regressing]
Recommendation: [continue iterating / ready for full-scale / consider pivot]
User must acknowledge each report before the next round begins.
Before moving from Stage D to Stage E, the method MUST satisfy:
If the method is drastically worse than all baselines (e.g., 0.42 vs 0.95):
pivot-or-killAfter 3 consecutive failures → trigger pivot-or-kill. No fourth attempt without user decision.
Enter ONLY after user explicitly confirms the method works at small scale AND the minimum performance bar is met.
Run the complete experiment matrix:
evaluation-protocol.yamldocs/03_plan/ablation-design.md| Domain | Pitfall Checks | |--------|---------------| | ML | Overfitting (train vs test gap), data leakage, label noise sensitivity | | Bioinformatics | Batch effects, sequence length bias, homology leakage | | Physics | Conservation law violations, symmetry breaking, unit consistency | | Chemistry | Energy conservation, chirality handling, force field artifacts |
Dispatch methodology-reviewer-prompt.md after Stage E completes.
Category:science-education