From ck
Executes multi-stage pipelines with staggered timing: downstream stages start early on partial upstream outputs, self-correcting via convergence loops to dramatically reduce total runtime.
npx claudepluginhub juliusbrussee/cavekitThis skill uses the workspace's default tool permissions.
Run pipeline stages with staggered timing instead of sequentially. The leader starts first;
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides agent creation for Claude Code plugins with file templates, frontmatter specs (name, description, model), triggering examples, system prompts, and best practices.
Run pipeline stages with staggered timing instead of sequentially. The leader starts first; followers start after a configurable delay and build from whatever upstream output exists at that point. Combined with convergence loops, followers self-correct as upstream artifacts arrive and stabilize.
Start downstream work early with partial upstream output. Convergence loops correct the errors introduced by working from incomplete input.
The insight is that waiting for perfect upstream output is wasteful. A follower working from 80% of the upstream artifacts will produce output that is ~60-70% correct on the first pass. But with convergence loops running, the follower re-reads the upstream artifacts on each iteration and corrects course. By the time the leader finishes, the follower is already most of the way done.
Stage 1: Specs ████████████████████ (5 hours)
Stage 2: Plans ████████████████ (4 hours)
Stage 3: Implement ████████ (3 hours)
─────────────────────────────────────────────
Total: 12 hours
Stage 1: Specs ████████████████████ (5 hours)
Stage 2: Plans ████████████████ (4 hours, started 1.5h after Stage 1)
Stage 3: Implement ████████████ (3 hours, started 3h after Stage 1)
─────────────────────────────────────────────
Total: ~7 hours
The key mechanism is convergence -- the iterative loop that re-reads inputs each pass. Without convergence loops, speculative-pipeline would produce garbage. With them, early errors wash out over iterations.
context/
├── specs/ # Stage 1 output: implementation-agnostic specs
├── plans/ # Stage 2 output: framework-specific plans
├── impl/ # Stage 3 output: implementation tracking
└── prompts/
├── 001-generate-specs.md # Stage 1 prompt
├── 002-generate-plans.md # Stage 2 prompt
└── 003-implement.md # Stage 3 prompt
Open three terminal windows (or use tmux panes):
# Terminal 1: Specs from reference materials (leader -- starts immediately)
{LOOP_TOOL} context/prompts/001-generate-specs.md -n 5 -t 2h
# Terminal 2: Plans from specs (follower -- starts after 1-hour delay)
{LOOP_TOOL} context/prompts/002-generate-plans.md -n 5 -t 2h -d 1h
# Terminal 3: Implementation from plans (follower -- starts after 2-hour delay)
{LOOP_TOOL} context/prompts/003-implement.md -n 10 -t 1h -d 2h
Parameter reference:
-n 5 -- Run up to 5 convergence iterations-t 2h -- Time budget per iteration (max total time = iterations x budget)-d 1h -- Delay before starting (speculative-pipeline offset)Replace {LOOP_TOOL} with your convergence loop runner (any script or tool that repeatedly
executes a prompt against the codebase, committing between iterations).
| Time | Stage 1 (Specs) | Stage 2 (Plans) | Stage 3 (Implement) |
|---|---|---|---|
| 0:00 | Starts. Reads refs, begins generating specs. | Waiting (1.5h delay). | Waiting (3h delay). |
| 1:30 | Iteration 1 complete. ~50% of specs written. Committed. | Starts. Reads partial specs, begins generating plans. | Waiting. |
| 3:00 | Iteration 2. Specs ~80% complete. | Iteration 1 complete. Plans based on partial specs. Some plans will need correction. | Starts. Reads partial specs + plans, begins implementing. |
| 4:00 | Iteration 3. Specs ~92% complete, converging. | Iteration 2. Re-reads updated specs. Corrects plans. Plans ~65% correct. | Iteration 1 complete. Some implementation based on incomplete plans. |
| 5:00 | Converged. Specs complete. Done. | Iteration 3. Re-reads final specs. Plans ~88% correct. | Iteration 2. Re-reads corrected plans. Fixes implementation. |
| 5:30 | -- | Iteration 4. Plans converged. Done. | Iteration 3. Implementation ~75% correct. |
| 7:00 | -- | -- | Iteration 4-5. Implementation converges. Done. |
Result: ~7 hours total versus ~12 hours sequential.
The delay determines how much upstream work exists when the follower starts. Too short and the follower wastes iterations on garbage input. Too long and you lose the time savings.
| Upstream Stage Duration | Recommended Delay | Rationale |
|---|---|---|
| 1-2 hours | 15-30 minutes | Short stages produce useful partial output quickly |
| 2-4 hours | 1 hour | Enough time for the first iteration to complete and commit |
| 4+ hours | 1-2 hours | First iteration should have substantial output |
For pipelines with more than 3 stages, stagger each stage relative to Stage 1:
# 5-stage pipeline example
{LOOP_TOOL} {PROMPT_001} -n 5 -t 2h # Stage 1: starts immediately
{LOOP_TOOL} {PROMPT_002} -n 5 -t 2h -d 1h # Stage 2: 1h delay
{LOOP_TOOL} {PROMPT_003} -n 8 -t 1h -d 2h # Stage 3: 2h delay
{LOOP_TOOL} {PROMPT_004} -n 8 -t 1h -d 3h # Stage 4: 3h delay
{LOOP_TOOL} {PROMPT_005} -n 10 -t 45m -d 4h # Stage 5: 4h delay
Notice the pattern:
A speculative-pipeline pipeline has converged when:
Thrashing = the follower keeps making large changes because upstream output keeps changing.
Signs of thrashing:
Fix thrashing by:
In multi-agent setups, speculative-pipeline applies at the pipeline level, not the agent team level:
Pipeline Level (speculative-pipeline timing):
Stage 1 (Specs) → Single agent or agent team
Stage 2 (Plans) → Single agent or agent team (starts after delay)
Stage 3 (Implement) → Agent team dispatched via Agent tool (starts after delay)
Each stage can internally use agent teams (multiple teammates working in parallel on different domains), but the stages themselves are staggered using speculative-pipeline timing.
Do not confuse:
They are orthogonal and composable.
When setting up a speculative-pipeline pipeline: