sequential-execution
Sequential Execution
Execute tasks in order when dependencies exist between steps.
When to Use
Use sequential execution when:
- Tasks have dependencies (Task B needs Task A's output)
- Order matters for correctness
- Tasks modify shared state or files
- Workflow has clear sequential stages (e.g., commit → push → PR)
- Later tasks need results from earlier tasks
Parameters
- tasks: Ordered list of task descriptions
- dependencies: Map of task dependencies (which tasks depend on which outputs)
How Sequential Execution Works
Step 1: Identify Dependencies
Map out which tasks depend on others:
- Task A produces output X
- Task B needs input X to proceed
- Task C needs output from Task B
Step 2: Execute in Order
Execute tasks one at a time, passing outputs forward:
- Execute Task A, store output
- Execute Task B with output from A
- Execute Task C with output from B
Step 3: Track Progress
Use todo list to track sequential progress:
- Mark current task as
in-progress - Mark completed tasks as
completed - Keep upcoming tasks as
not-started
Sequential Patterns
Pattern 1: Linear Pipeline
A → B → C → D
Each task depends on the previous task's output.
Pattern 2: Staged Workflow
Stage 1: Setup → Stage 2: Processing → Stage 3: Cleanup
Clear phases that must happen in order.
Pattern 3: Conditional Sequencing
A → (if success) → B → (if failure) → C
Execution path depends on previous results.
Pattern 4: Accumulator Pattern
Start with initial state, each task transforms and passes to next:
- Task 1: Initialize state
- Task 2: Transform state
- Task 3: Enhance state
- Task 4: Finalize state
When to Use Sequential vs Parallel
| Scenario | Execution Type | Reason |
|---|---|---|
| B needs A's output | Sequential | Dependency |
| Multiple independent analyses | Parallel | No dependencies |
| Commit → Push → PR | Sequential | Order matters |
| Analyze multiple files | Parallel | Independent |
| Build → Test → Deploy | Sequential | Must happen in order |
| Review multiple perspectives | Parallel | Independent views |
TodoList Integration
Track sequential progress clearly:
{
"todos": [
{ "id": 1, "title": "Fetch PR details", "status": "completed" },
{ "id": 2, "title": "Run tests", "status": "in-progress" },
{ "id": 3, "title": "Review comments", "status": "not-started" },
{ "id": 4, "title": "Merge PR", "status": "not-started" }
]
}
Common Sequential Workflows
Git Workflow
- Make changes → 2. Commit → 3. Push → 4. Create PR → 5. Merge
PR Processing
- Fetch PR → 2. Analyze → 3. Address comments → 4. Run checks → 5. Merge
Build Pipeline
- Install dependencies → 2. Build → 3. Test → 4. Package → 5. Deploy
Code Review
- Read code → 2. Identify issues → 3. Write comments → 4. Submit review
Error Handling
In sequential execution:
- If step N fails, steps N+1 onwards cannot proceed
- Decide whether to:
- Retry failed step
- Skip to error handling flow
- Abort entire sequence
- Continue with partial results
Best Practices
- Make dependencies explicit: Clearly document what each task needs
- Pass data forward: Each task receives output from previous task
- Track progress: Update todo list after each step
- Handle errors: Plan for failures at each stage
- Validate inputs: Ensure each task has what it needs before starting
- Log intermediate results: Useful for debugging and resuming
Quick Reference
WHEN TO USE:
✓ Tasks have dependencies
✓ Order matters
✓ Shared state modifications
✓ Must wait for previous results
PATTERNS:
Linear: A → B → C → D
Staged: Setup → Process → Cleanup
Conditional: A → (check) → B or C
Accumulator: Transform state through stages
TODOLIST:
- Mark current step as in-progress
- Keep future steps as not-started
- Mark completed steps as completed
ERROR HANDLING:
- Stop on failure
- Retry step
- Fallback flow
- Abort sequence
More from squirrel289/pax
process-pr
End-to-end workflow for processing pull requests from review to merge
10parallel-execution
CRITICAL skill for executing multiple runSubagent calls in a SINGLE function_calls block for true parallelism. Essential for efficient multi-task workflows, subagent coordination, and maximizing throughput.
10create-pr
Create a pull request from a feature branch with work item metadata. Use when implementation is complete, tested, and ready for review. Supports: (1) PR creation from feature branch, (2) Auto-population of PR template with work item details, (3) Linking to work item ID, (4) PR description generation from commit history
9update-work-item
Update an existing work item with status changes, effort tracking, test results, and related commits. Use when progressing work, recording test results, or adjusting estimates. Supports: (1) Status transitions (proposed → ready → in-progress → ready-for-review → closed), (2) Feature branch creation and sync, (3) Automatic PR creation on ready-for-review transition, (4) Effort tracking (estimated → actual), (5) Test and commit tracking, (6) Dependency validation (all depends_on items must be closed before closing), (7) Notes with timestamps
9create-work-item
Create a new work item (backlog entry) with standardized structure, metadata, and conventions. Use when starting new work, proposing features, or documenting tasks. Supports: (1) Auto-numbering next available ID, (2) Frontmatter with status/priority/effort fields, (3) Goal/Background/Tasks/Deliverables/Acceptance Criteria structure, (4) Dependency tracking via wikilinks
9handle-pr-feedback
Coordinate PR review loop—detect feedback severity, address minor comments automatically, revert work items if major changes needed. Use when PR has unresolved review feedback. Supports: (1) Comment triage by severity, (2) Auto-resolution of minor comments, (3) Work item reversion on blocker feedback, (4) Feedback summarization
9