agentleFS
shynlee04shynlee04/hivemind-plugin/skills/sequential-orchestration/SKILL.md

sequential-orchestration

Skill51 starsChanged 7 months agoMITView on GitHub

Safer delegation with sequential task execution, result awaiting, retuning, and boundary enforcement. Ensures unbroken hierarchy chains before any action. Context-first, never act without verified planning.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    SEQUENTIAL IS SAFER: Always prefer sequential over parallel unless:

    line 22
  2. Distinctive:

    Before ANY action, these conditions MUST be verified:

    line 29
  3. Distinctive:

    If ANY check fails → STOP, fix before proceeding.

    line 76
  4. Distinctive:

    Must exist before ANY tactical work

    line 206
  5. Distinctive:

    Must have parent trajectory

    line 211
  6. Distinctive:

    Must have parent tactic

    line 216

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Sequential Orchestration Skill

Core Philosophy

SEQUENTIAL IS SAFER. Always prefer sequential over parallel unless:

  1. Tasks have ZERO file/state overlap
  2. Tasks have ZERO dependency on each other's output
  3. Failure of one task does not affect others

The Absolute Gatekeeping Factor

Before ANY action, these conditions MUST be verified:

1. Parent Hierarchy Exists (UNBROKEN LINK)

// NEVER act without checking hierarchy
const hierarchy = scan_hierarchy({ action: "status" })
if (!hierarchy.trajectory) {
  // STOP - Must declare_intent first
  throw new Error("NO ACTION WITHOUT TRAJECTORY")
}

2. Context Is Pure

// NEVER trust memory after compaction
const drift = think_back({ mode: "check" })
if (drift.score < 40) {
  // STOP - Context corrupted, must reload
  throw new Error("CONTEXT IMPURE - RELOAD REQUIRED")
}

3. Planning Is Retrieved

// NEVER act without verified planning
const plan = recall_mems({ query: "plan" })
if (!plan || plan.length === 0) {
  // STOP - No planning found
  throw new Error("NO ACT WITHOUT SUCCESS RETRIEVAL OF PLANNING")
}

Sequential Delegation Protocol

Step 1: Pre-Delegation Gate

┌─────────────────────────────────────────┐
│  GATE CHECK BEFORE ANY DELEGATION        │
├─────────────────────────────────────────┤
│  [ ] Trajectory exists?                  │
│  [ ] Current tactic defined?             │
│  [ ] Parent node is not stale (>2hr)?    │
│  [ ] No pending failures in brain?       │
│  [ ] Anchors loaded for constraints?     │
└─────────────────────────────────────────┘

If ANY check fails → STOP, fix before proceeding.

Step 2: Delegate with Explicit Return Format

// SEQUENTIAL: Await result, retune based on outcome
const result = await task({
  description: "Clear task description",
  prompt: `
    ## Task: [Specific task]
    
    ## Domain: [Which domain - Backend/Frontend/Shared]
    
    ## Boundaries:
    - DO NOT touch: [files/modules outside domain]
    - MUST verify: [quality gates before return]
    
    ## Return Format:
    {
      "outcome": "success" | "partial" | "failure",
      "files_changed": [...],
      "findings": "...",
      "next_recommended": "..." | null
    }
  `,
  subagent_type: "build" // or appropriate agent
})

// AWAIT the result, do not fire-and-forget

Step 3: Result Processing & Retuning

// PROCESS result before continuing
if (result.outcome === "success") {
  // Capture intelligence
  export_cycle({
    outcome: "success",
    findings: result.findings
  })
  
  // Update hierarchy
  map_context({ level: "action", content: result.findings })
  
  // PROCEED to next task
} else if (result.outcome === "partial") {
  // RETUNE: Adjust plan based on partial success
  save_mem({
    shelf: "partial_progress",
    content: result.findings,
    tags: "needs-followup"
  })
  
  // REROUTE: Decide next action
  if (result.next_recommended) {
    // Follow agent recommendation
  } else {
    // Ask user for guidance
  }
} else if (result.outcome === "failure") {
  // STOP: Do not continue
  // SAVE state for recovery
  save_anchor({
    key: `failure_${Date.now()}`,
    value: JSON.stringify(result)
  })
  
  // ESCALATE to user
  throw new Error(`DELEGATION FAILED: ${result.findings}`)
}

Step 4: Boundary Enforcement

// BEFORE each delegation, verify domain boundaries
const DOMAIN_BOUNDARIES = {
  backend: {
    allowed: ["src/lib/", "src/tools/", "src/schemas/", "src/hooks/"],
    forbidden: ["dashboard/", "views/", "components/"]
  },
  frontend: {
    allowed: ["src/dashboard/", "src/views/", "src/components/"],
    forbidden: ["src/lib/", "src/tools/", "src/schemas/"]
  },
  shared: {
    allowed: ["src/types/", "src/utils/", "tests/"],
    forbidden: []
  }
}

function checkBoundary(file: string, domain: string): boolean {
  const boundary = DOMAIN_BOUNDARIES[domain]
  const isAllowed = boundary.allowed.some(p => file.startsWith(p))
  const isForbidden = boundary.forbidden.some(p => file.startsWith(p))
  return isAllowed && !isForbidden
}

The Unbroken Link Principle

A hierarchy chain is UNBROKEN when:

  1. Trajectory → Tactic → Action all exist
  2. Each child has a valid parent reference
  3. Timestamps show reasonable progression (< 2hr gaps)
  4. Cursor position matches actual work focus
// CHECK unbroken link before action
function isChainUnbroken(): boolean {
  const ancestors = getAncestors(cursor)
  const expected = ['trajectory', 'tactic', 'action']
  
  // All three levels must be present
  if (ancestors.length < 3) return false
  
  // Each level must have valid content
  return ancestors.every(node => node.content && node.content.length > 0)
}

// IF chain broken → STOP, use map_context to repair
if (!isChainUnbroken()) {
  console.error("CHAIN BROKEN - Cannot proceed")
  // Use think_back to recover context
  // Use map_context to re-establish chain
}

Hierarchical Actions Protocol

Level 1: Trajectory (Strategic Goal)

  • Set via declare_intent({ mode, focus })
  • Must exist before ANY tactical work
  • Survives compaction (stored in hierarchy.json)

Level 2: Tactic (Implementation Strategy)

  • Set via map_context({ level: "tactic", content })
  • Must have parent trajectory
  • Groups related actions

Level 3: Action (Specific Task)

  • Set via map_context({ level: "action", content })
  • Must have parent tactic
  • Represents atomic work unit

Context-First Protocol

NEVER ACT WITHOUT:

  1. Context Loaded:
scan_hierarchy({ action: "status" })
recall_mems({ query: "relevant context" })
  1. Constraints Known:
list_anchors() // Get immutable constraints
  1. Plan Verified:
// The plan must be retrieved from memory or anchors
// NOT assumed from "I think I remember..."
const plan = recall_mems({ query: "plan trajectory" })
  1. Chain Validated:
const breaks = detectChainBreaks()
if (breaks.length > 0) {
  // STOP - Chain is broken
}

Red Flags - STOP Immediately

ConditionAction
No trajectorydeclare_intent first
Chain brokenmap_context to repair
Drift > 60think_back to recover
No plan in memoryCreate plan before acting
Domain boundary violationReroute to correct domain
Pending failure unacknowledgedAcknowledge and resolve

Quick Reference Commands

// Gate check
scan_hierarchy({ action: "status" })

// Context recovery
think_back({ mode: "full" })

// Chain repair
map_context({ level: "tactic", content: "..." })

// Boundary check
grep({ pattern: file, include: allowedPatterns })

// Result capture
export_cycle({ outcome, findings })

Related Skills

  • delegation-intelligence: Decision patterns for parallel vs sequential
  • evidence-discipline: Verification requirements for claims
  • context-integrity: Context recovery and chain repair
  • session-lifecycle: Session state management

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.