sk-pipeline-patterns
Skill4 starsChanged 6 months agoMITView on GitHub
Defines the six canonical pipeline topologies (Sequential, Parallel Fan-Out, Iterative Loop, Human-Gated, Spec-Driven, 4D Wrapper) and their capability requirements. Use when an orchestrator is selecting an execution pattern for a new pipeline, matching a task's information flow to a topology, or checking Q7 capability gates before pattern traversal.
In this repository43 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms-full.txtllms.txt
- llms.txtllms.txt
- cutting-a-releaseSkill
- cutting-a-releaseSkill
- adding-a-pipeline-stepSkill
- brainstormingSkill
- change-modelsSkill
- creating-a-pipelineSkill
- deleting-a-pipeline-stepSkill
- finishing-a-development-branchSkill
- migrating-a-pipelineSkill
- optimizing-a-pipelineSkill
- pipeline-architect-protocolSkill
- pipeline-auditor-protocolSkill
- pipeline-failure-analyzer-protocolSkill
- pipeline-optimizer-protocolSkill
- pipeline-quality-reviewer-protocolSkill
- pipeline-spec-reviewer-protocolSkill
- pipeline-task-executor-protocolSkill
- running-a-pipelineSkill
- sk-4d-methodSkill
- sk-claude-code-conventionsSkill
- sk-dynamic-routingSkill
- sk-hashline-protocolSkill
- sk-hierarchical-contextSkill
- skill-architect-protocolSkill
- sk-model-migrationSkill
- sk-model-resolverSkill
- sk-pipeline-grillingSkill
- sk-pipeline-pathsSkill
- sk-pipeline-stateSkill
- sk-platform-dispatchSkill
- sk-rationalization-resistanceSkill
- sk-spec-driven-developmentSkill
- sk-worktree-safetySkill
- sk-write-review-isolationSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- updating-a-pipeline-stepSkill
- using-superpipelinesSkill
- verification-before-completionSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 67
IF workflow_requires_tracked_source_isolation == true AND platform_profile.capabilities.worktrees == false: available patterns = {1, 4, 6}.
- Very specific: line 68
IF platform_profile.capabilities.parallel_subagents == false: Patterns 2 and 5 are unavailable (their parallel fan-out cannot execute …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Pipeline Patterns — Selection Reference
Distills Patterns 1–6 for pipeline topology selection. Load via agent
skills:frontmatter; not user-invocable.
<glossary>
<term name="Pattern 3 (Iterative Loop)">A fix/heal cycle bounded by max iterations and an escalation protocol.</term>
<term name="Pattern 5 (Spec-Driven Development)">A multi-phase workflow where a specification acts as a formal contract for parallel implementation.</term>
<term name="Pattern 6 (4D Wrapper)">A per-invocation processing framework that runs inside all other patterns.</term>
</glossary>Pattern Selection Matrix
<pattern_matrix>
| Pattern | Information Flow | Worktree | Capability Requirements (Q7) | Best Applied To |
| 1. Sequential | Linear (A → B → C) | Optional | none | Strictly dependent sequential phases. |
| 2. Parallel | Fan-Out / Merge | Conditional | parallel_subagents: true; worktrees: true only for tracked-source writers | Independent analyses or reviews. |
| 3. Iterative | Loop (Test → Fix) | Conditional | worktrees: true only for tracked-source writers | Fix/heal cycles with defined exit criteria. |
| 4. Gated | Phase → GATE → User | Selective | none | Destructive or irreversible operations. |
| 5. Spec-Driven | Spec → Plan → Implement | Conditional | parallel_subagents: true; worktrees: true only for tracked-source writers | Large feature work or complex migrations. |
| 6. 4D Method | Wrapper (Internal) | N/A | none | Every agent turn within any other pattern. |
| </pattern_matrix> |
Q7 capability gating: A worktree requirement is about tracked-source writer isolation, not topology alone. "Degrades to sequential" hides this — degrading scope is fine; degrading tracked-source isolation is not. Pattern 2, 3, or 5 on a platform with worktrees: false is valid for artifact-only data pipelines, but invalid when any step edits tracked source across parallel, iterative, or spec-driven branches. The worktree requirement binds code-writer steps only: data-retrieval/generation steps within a worktree pattern still OMIT isolation (a no-tracked-change worktree is auto-cleaned, losing gitignored artifacts — issue #31).
Pattern 3 — Iterative Loop Protocol
<protocol>
### 1. LOOP EXECUTION
- **Cycle**: Tester (identifies failures) → Analyzer (diagnoses RCA) → Fixer (applies fix) → Restart.
- **Iteration Cap**: Maximum 3 iterations by default.2. ESCALATION (HARD-GATE)
<HARD-GATE>
**STOP** immediately and escalate to the user if:
- Iteration count ≥ 3.
- Failure count does not decrease for 2 consecutive cycles.
- A fix reveals a new failure in a different architectural location (regression).
</HARD-GATE>3. EARLY TERMINATION SIGNALS
- "One more fix should do it" (after 2+ failures).
- "The fix is almost working" (indicates lack of convergence).
</protocol>
Pattern 5 — Spec-Driven Development (SDD)
<sdd_workflow>
- Specify: Generate
spec.md(WHAT + WHY). - Plan: Generate
plan.md(HOW). - Tasks: Decompose into
tasks.md. - Gate: Mandatory human review of spec and tasks.
- Implement: Parallel execution of tasks with two-stage review. </sdd_workflow>
Decision Tree
<decision_tree> Q7 capability preflight (consult before traversal):
- IF
workflow_requires_tracked_source_isolation == trueANDplatform_profile.capabilities.worktrees == false: available patterns = {1, 4, 6}. Skip the Pattern 2 / 3 / 5 branches below and emit advisory: "This workflow requires tracked-source writer isolation, but this platform has worktrees:false. Limited to Patterns 1 and 4." - IF
platform_profile.capabilities.parallel_subagents == false: Patterns 2 and 5 are unavailable (their parallel fan-out cannot execute safely). Allow Pattern 3 when eitherworktrees: trueORworkflow_requires_tracked_source_isolation == false.
Is the task multi-step with dependencies?
- NO: Apply 4D Method and execute directly.
- YES:
- Independent/Mergeable tasks? → Pattern 2 (requires
worktrees + parallel_subagents). - Fix/Heal cycle? → Pattern 3 (requires
worktrees). - Irreversible action? → Pattern 4 (Human Gate).
- Feature work? → Pattern 5 (SDD; requires
worktrees + parallel_subagents). - Linear dependency? → Pattern 1. </decision_tree>
- Independent/Mergeable tasks? → Pattern 2 (requires
<invariants>
- Disk-based handoffs (file paths) must be used instead of pasting content between agents.
- Pattern 6 (4D) must execute within every agent turn across all patterns.
- Escalation state must be explicitly written to `pipeline-state.json` on failure.
</invariants>Reference Files
sk-4d-method/SKILL.md— Per-invocation wrapper.sk-spec-driven-development/SKILL.md— SDD implementation details.sk-write-review-isolation/SKILL.md— Review loop protocol.sk-worktree-safety/SKILL.md— Parallel isolation rules.references/ai-pipelines-trimmed.md— Full conventions trimmed for runtime.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

