agentleFS
gustavo-meilusgustavo-meilus/superpipelines/skills/sk-pipeline-patterns/SKILL.md

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.

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
  1. Very specific:

    IF workflow_requires_tracked_source_isolation == true AND platform_profile.capabilities.worktrees == false: available patterns = {1, 4, 6}.

    line 67
  2. Very specific:

    IF platform_profile.capabilities.parallel_subagents == false: Patterns 2 and 5 are unavailable (their parallel fan-out cannot execute …

    line 68

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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>

PatternInformation FlowWorktreeCapability Requirements (Q7)Best Applied To
1. SequentialLinear (A → B → C)OptionalnoneStrictly dependent sequential phases.
2. ParallelFan-Out / MergeConditionalparallel_subagents: true; worktrees: true only for tracked-source writersIndependent analyses or reviews.
3. IterativeLoop (Test → Fix)Conditionalworktrees: true only for tracked-source writersFix/heal cycles with defined exit criteria.
4. GatedPhase → GATE → UserSelectivenoneDestructive or irreversible operations.
5. Spec-DrivenSpec → Plan → ImplementConditionalparallel_subagents: true; worktrees: true only for tracked-source writersLarge feature work or complex migrations.
6. 4D MethodWrapper (Internal)N/AnoneEvery 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>

  1. Specify: Generate spec.md (WHAT + WHY).
  2. Plan: Generate plan.md (HOW).
  3. Tasks: Decompose into tasks.md.
  4. Gate: Mandatory human review of spec and tasks.
  5. 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 == true AND platform_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 either worktrees: true OR workflow_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>
<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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.