-
Iteration 0 — Consistency Check Between Description and Body (static, no dispatch required)
- Read the trigger / use case stated in the frontmatter
- Read the scope covered in the body
- If there's a discrepancy, align the description or body before proceeding to Iteration 1
- Example: Detect discrepancies like the description stating "navigation / form filling / data extraction" but the body only containing CLI references for
- Skipping this step will cause subagents to "reinterpret" the body to match the description, leading to false positives where the skill seems accurate even though it doesn't meet requirements
-
Baseline Preparation: Finalize the target prompt and prepare the following two items:
- 2–3 evaluation scenarios (1 median case + 1–2 edge cases). Use realistic tasks that simulate actual application of the target prompt.
- Requirements checklist (for accuracy calculation). List 3–7 "requirements the deliverable must meet" per scenario. Accuracy % = number of met items / total items. Fix this in advance (don't adjust later).
-
Bias-Free Reading: Have a "blank slate" executor read the instructions. Dispatch a new subagent using the Task tool. Do not rely on self-review (it's structurally impossible to objectively view text you just wrote). If running multiple scenarios in parallel, call multiple agents within a single message. Refer to the "Environmental Constraints" section for handling environments where dispatch isn't possible.
-
Execution: Pass a prompt that follows the Subagent Activation Contract (described later) to the subagent, and have it execute the scenario. The executor will generate the implementation or output, and return a self-report at the end.
-
Dual-Perspective Evaluation: Record the following from the returned results:
- Executor Self-Report (extracted from the subagent's report body): Ambiguities / discretionary completions / points where the executor got stuck applying templates
- Instruction-Side Metrics (judgment rules are centrally defined in this section; refer to this section elsewhere):
- Success/Failure: Success (○) only if all requirements tagged are fully met (○). Failure (×) if even one is unmet (×) or partially met. Use only the binary labels ○ / ×.
- Accuracy (achievement rate % of the requirements checklist. Sum ○ = full points, × = 0, partial = 0.5, then divide by total items)
- Step Count (directly use from the usage metadata returned by the Task tool. Include Read / Grep, do not exclude)
- Duration (use from the Task tool's usage metadata)
- Retry Count (extracted from the subagent's self-report; cannot be measured by the instruction side)
- For failures, add 1 line to the "Ambiguities" section of the presentation format stating "Which [critical] item failed" (for root cause tracking)
- The requirements checklist must include at least one item tagged (success judgment becomes vacuous if there are none). Do not add or remove tags after the fact.
-
Apply Changes: Make minimal fixes to the prompt to resolve ambiguities. Focus on one theme per iteration (multiple related fixes are allowed; unrelated fixes should be deferred to the next iteration).
- Before making a fix, explicitly state "Which item in the requirements checklist / judgment wording this fix addresses" (fixes guessed from axis names often don't work. See the "Fix Ripple Patterns" section below).
-
Re-Evaluate: Repeat steps 2 → 5 with a new subagent (do not reuse the same agent: it may have learned from previous improvements). Increase parallelism if improvement doesn't plateau as iterations progress.
-
Convergence Judgment: Stop when the following are all met for 2 consecutive iterations (use 3 consecutive iterations for high-priority prompts):
- 0 new ambiguities
- Accuracy improvement vs. previous iteration: ≤ +3 percentage points (e.g., saturation from 5% to 8%)
- Step count change vs. previous iteration: ±10% or less
- Duration change vs. previous iteration: ±15% or less
- Overfitting Check: When judging convergence, add one unused hold-out scenario for evaluation. If accuracy drops by 15 percentage points or more from the recent average, overfitting has occurred. Return to baseline scenario design and add edge cases.