Implements the Rensin "Elephant and Goldfish" methodology for intent-driven software engineering via persistent planning and zero-context execution.
Resources
3Install
npx skillscat add therealr2d2/elephant-goldfish-workflow-skill Install via the SkillsCat registry.
SKILL.md
Skill: Elephant-Goldfish Workflow
This skill implements the "Elephant and Goldfish" methodology (Rensin 2026). It ensures that software engineering tasks are driven by explicit written intent and verified by a zero-context executioner and an adversarial reviewer.
## Workflow Overview Always follow these five phases to ensure high-quality, reproducible code changes.Phase 1: The Elephant (Persistent Planning)
- Goal: Draft a "Goldfish-proof"
SPEC.md. - Action: Document all requirements, constraints, edge cases, and testing strategies.
- Personalization: Ask the user: "What would you like to name your Mean Reviewer? (Default: Froggy)".
- Preference: Ask the user if they wish to skip Phase 2 (Adversarial Spec Review).
- Absolute Path Discovery: Determine the absolute path of the project root (e.g., via
pwd) and prepare to include it in the Context Bundle instructions. - Context Bundle: Gather necessary files. All contents MUST be Base64 encoded. Format:
<file path="relative/path" encoding="base64">BASE64_CONTENT</file>. - Frontmatter: Ensure
SPEC.mdhas YAML frontmatter:RetryCount: 0 Version: 1.x.x LastReviewer: [ReviewerName] - UX: Display "๐ Elephant at work...".
Phase 2: Adversarial Pre-Review (Spec Attack) - OPTIONAL
- Action: Spawn the Mean Reviewer (e.g., "[ReviewerName]").
- Persona: A ruthless architect eager to find bugs and ambiguities.
- Stall Protection: HARD LIMIT of 3 iterations. If no agreement is reached, the user acts as Human Arbiter to break the tie.
- UX: Display "๐บ [ReviewerName] is hunting for bugs in the Spec...".
Phase 3: The Goldfish (Stateless Execution)
- Action: Spawn a "Goldfish" sub-agent (
invoke_agent) with NO previous chat history. - Input: Feed ONLY the
SPEC.md, the Base64 Context Bundle, any Failure Logs, and the Absolute Project Root Path. - Workspace Setup: The Goldfish MUST use the Absolute Project Root Path to create the sandbox using this PowerShell logic:
$absRoot = "[ProvidedAbsolutePath]"; $target = Join-Path $absRoot "tmp-goldfish-run"; for ($i=0; $i -lt 5; $i++) { if (Test-Path $target) { try { Remove-Item -Recurse -Force $target -ErrorAction Stop; break } catch { Write-Host "Retrying cleanup..."; Start-Sleep -s 2 } } else { break } }; New-Item -ItemType Directory $target -Force - Tooling Mandate: The Goldfish MUST use
write_fileorreplacetools. - Strict Path Mandate: Write ALL files EXCLUSIVELY to the absolute
$targetdirectory. - Decoding Rule: Use
[System.Convert]::FromBase64String($content)to decode contents. - Verification Rule: Before reporting success, the Goldfish MUST run
ls $targetto prove existence. - UX: Display "๐ Goldfish executing...".
Phase 4: Adversarial Post-Review (Code Attack)
- Action: Spawn [ReviewerName] again.
- Input: Provide [ReviewerName] with the
SPEC.mdand the full contents of the absolutetmp-goldfish-rundirectory. - Decision Matrix:
- Pass: If NO bugs are found, proceed IMMEDIATELY to Phase 5.
- Spec Failure: If the spec was unclear, return to Phase 1.
- Execution Failure: Increment
RetryCountin YAML. If <= 2, retry Phase 3 and **attach the Reviewer's critique as a Failure Log**. If > 2, return to Phase 1.
- UX: Display "๐บ [ReviewerName] is attacking the code...".
Phase 5: Synthesis & Cleanup
- Safety Check: Check
git status. If "modified", prompt: "Manual Merge Required (Concurrent Changes Detected)". - Backup: Create a timestamped backup:
./backups/pre-goldfish-$(Get-Date -Format "yyyyMMdd-HHmmss")/. - Merge: Present Synthesis Plan. Upon approval, use
robocopy [AbsTarget] [AbsRoot] /MIR. - Cleanup: Delete the absolute
tmp-goldfish-rundirectory.