From agent-workflows
Spawns N agents in isolated git worktrees to independently reimplement a spec, producing convergence/divergence maps to detect ambiguities, gaps, and clarity issues. Use for spec validation.
npx claudepluginhub sjarmak/agent-workflowsThis skill uses the workspace's default tool permissions.
Independent Verification by Reimplementation. Spawns N agents in isolated worktrees to implement the SAME specification independently, with no knowledge of each other's code. Compares outputs to produce a convergence/divergence map that reveals where the spec is clear, where it is ambiguous, and what it fails to specify at all.
Mandates invoking relevant skills via tools before any response in coding sessions. Covers access, priorities, and adaptations for Claude Code, Copilot CLI, Gemini CLI.
Share bugs, ideas, or general feedback.
Independent Verification by Reimplementation. Spawns N agents in isolated worktrees to implement the SAME specification independently, with no knowledge of each other's code. Compares outputs to produce a convergence/divergence map that reveals where the spec is clear, where it is ambiguous, and what it fails to specify at all.
This is NOT prototyping. Agents implement the same spec, not different strategies. The value is in the convergence/divergence analysis, not in picking a winner. Where implementations converge, the spec is unambiguous. Where they diverge, the spec has gaps or hidden assumptions. The divergence map IS the output.
$ARGUMENTS — format: [N] [path/to/spec.md or inline specification] where N is optional (default: 3, min 2, max 5)
Extract:
If the spec input is missing or unclear, ask the user to provide a specification before proceeding. The spec should describe WHAT to build, not HOW — the whole point is to see how independent agents interpret the "how."
If a file path is given: read it and extract the full specification content.
If inline: parse the specification description.
Prepare a specification brief that includes:
Present the specification brief to the user and confirm before proceeding. Do NOT fill in gaps or resolve ambiguities — present the spec as-is. If you notice potential ambiguities, note them privately but do not hint at them to the user or the agents. The agents must encounter ambiguities naturally.
Launch all N agents in parallel using the Agent tool. Every agent receives the exact same specification brief with no strategy assignment, no hints, and no differentiation. Each agent MUST:
isolation: "worktree" — each gets its own copy of the reposubagent_type: "general-purpose"IMPLEMENTATION_NOTES.md in the repo root documenting:
Agent prompt template (identical for all agents):
You are an implementation agent. Your job is to implement the following specification independently.
## Specification
{specification_brief}
## Instructions
1. Read any relevant existing code in the repo to understand the current codebase
2. Implement the specification fully — create and modify files as needed
3. Where the spec is silent or ambiguous, make your own best judgment call
4. Document EVERY assumption and decision in IMPLEMENTATION_NOTES.md (see format below)
5. Stage and commit all changes with message: "replicate: implement spec"
## IMPLEMENTATION_NOTES.md Format
Write this file in the repo root with the following sections:
### Assumptions Made
For each assumption:
- What the spec did not specify
- What you assumed
- Why you chose this interpretation
### Ambiguities Encountered
For each ambiguity:
- The ambiguous requirement
- How you interpreted it
- What alternative interpretations exist
### Design Decisions
For each significant decision:
- What you decided
- Why
- What alternatives you considered
### Spec Gaps
- Requirements the spec should have included but did not
- Information you needed but had to guess
Be thorough in your notes. The notes are as important as the code — they reveal what the spec actually communicates vs. what it leaves open to interpretation.
Do NOT:
- Try to be creative or novel — just implement the spec as you understand it
- Guess what other implementers might do
- Over-engineer beyond what the spec requires
After ALL agents return, perform a systematic comparison:
For each agent's worktree:
IMPLEMENTATION_NOTES.mdgit diff --stat from base to see files changedIdentify every decision point where ALL agents made the same choice. For each convergence point:
Identify every decision point where agents made different choices. For each divergence point:
Aggregate all "Spec Gaps" entries from the agents' IMPLEMENTATION_NOTES.md files:
Compare the implementations at the structural level:
Rate the spec on a simple scale:
| Rating | Meaning | Convergence Rate |
|---|---|---|
| Clear | Agents converged on nearly everything | >80% of decisions |
| Mostly Clear | Some divergence on secondary concerns | 60-80% of decisions |
| Ambiguous | Significant divergence on core decisions | 40-60% of decisions |
| Underspecified | Agents built materially different things | <40% of decisions |
Full list of decision points where all agents agreed, grouped by category. These are the spec's strengths.
Full list of decision points where agents disagreed, with:
All missing specifications, prioritized by:
A concrete list of changes to the specification that would eliminate the discovered ambiguities and fill the identified gaps. For each revision:
Save the full output to replicate_{slugified_topic}.md in the working directory.
Ask the user:
/replicate again to verifyisolation: "worktree". Agents implementing in the same working directory would contaminate each other./diverge-prototype, agents are NOT given different strategies. They all implement the same spec with the same instructions. Divergence must emerge naturally from spec ambiguity, not from assigned differences.Sits after spec writing and before implementation, as a specification quality gate:
/diverge (research) -> /converge (spec) -> /replicate (spec quality gate) -> /diverge-prototype (build)
Use /replicate when you want to verify that a specification is clear and complete enough to hand off for implementation. If the divergence map reveals significant ambiguity, revise the spec and run /replicate again before proceeding to /diverge-prototype or direct implementation.