ilandahan/AID / skills/pipeline-orchestrator
pipeline-orchestrator
VerifiedDrives the Phase 4-5 dev pipeline state machine with sub-agent reviews and bounded autoresearch gates. Use when running /pipeline or executing an approved plan.
| File | Kind | Size |
|---|---|---|
| SKILL.extended.md | markdown | 11.7 KB |
| SKILL.md | skill md | 70.3 KB |
| config.default.json | config | 1.5 KB |
| gate.mjs | script | 38.3 KB |
| gate.test.mjs | script | 31.9 KB |
| references/escalation-protocol.md | markdown | 4.4 KB |
| references/load-bearing-assumptions.md | markdown | 3.2 KB |
| references/state-machine.md | markdown | 8.8 KB |
| test-escalation-loop.shexecutable | script | 13.8 KB |
references/escalation-protocol.md
View on GitHub# Escalation Protocol
What happens when a pipeline step hits its maximum iteration count.
---
## When Escalation Triggers
### Trigger 1: Max Iterations (unscored steps only)
Unscored steps (binary pass/fail from test execution) escalate on max iterations:
| Step | Counter | Default Max |
|------|---------|-------------|
| TDD (re-run) | test_fix | 5 |
| API_TESTS (re-run) | api_fix | 5 |
| E2E_TESTS (re-run) | e2e_fix | 5 |
Scored steps (CODE_REVIEW, VISUAL_QA, TEST_REVIEW) do NOT have max iterations — they iterate until the score threshold is met. Their only escalation trigger is cost (Trigger 2).
### Trigger 2: Cost Limit
The pipeline escalates when `cost.estimated_cost_usd >= config.cost_limits.max_per_run_usd`:
```
Pipeline Cost Limit Reached
Current cost: $XX.XX (limit: $YY.YY)
Step: [current_step] | Iterations used: code_review [N]/[max], test_fix [N]/[max], ...
Cost Breakdown:
CODE_REVIEW (x2): $X.XX
TEST_REVIEW (x1): $X.XX
PHASE_GATE: $X.XX
Options:
1. /pipeline resume — Continue (raises limit by 50%)
2. /pipeline abort — Stop pipeline, save progress
```
A cost warning (non-blocking) is shown at `warn_at_usd`.
---
## Escalation Procedure
### Step 1: Update State
```json
{
"pipeline_status": "ESCALATED",
"current_step": "ESCALATED",
"last_updated": "[now]"
}
```
### Step 2: Build Summary
Collect from `last_review_result`:
- Overall score and per-category scores
- All `action_required` items
- All issues with severity CRITICAL or MAJOR
- `biggest_gaps` and `score_justification`
- Iteration history for the failing step (scores across attempts)
- Cumulative cost from `cost.estimated_cost_usd`
### Step 3: Present to User
```
Pipeline Escalated
Step [STEP_NAME] failed after [N] iterations (max: [MAX]).
Cost so far: $X.XX / $Y.YY
Score Trend Across Attempts:
Attempt 1: X.X/10 [security: X, quality: X, arch: X, docs: X]
Attempt 2: X.X/10 [security: X, quality: X, arch: X, docs: X]
Attempt 3: X.X/10 [security: X, quality: X, arch: X, docs: X]
Persistent Issues (not resolved across attempts):
[List of unresolved action_required items from last review]
Biggest Gaps: [from last review biggest_gaps]
Options:
1. Resume — Reset this step's counter and try again
Usage: Reply "resume" or "/pipeline resume"
2. Override — Skip this step with documented justification
Usage: Reply "override: [reason]" or "/pipeline override [reason]"
Note: Override is logged in step_history with your justification
3. Reset — Reset ALL counters and restart from DEVELOP
Usage: Reply "reset" or "/pipeline reset"
4. Abort — Stop the pipeline entirely
Usage: Reply "abort" or "/pipeline abort"
```
### Step 4: Wait for User Decision
Do NOT proceed automatically. The pipeline is paused until the user responds.
---
## Handling User Responses
### Resume
1. Reset the specific counter to 0: `iterations[counter] = 0`
2. Set `pipeline_status: "running"`
3. Return to the failing step (e.g., CODE_REVIEW)
4. Log in `step_history`: `{ "step": "ESCALATION_RESUME", "note": "User resumed [step]" }`
### Override
1. Log in `step_history`: `{ "step": "ESCALATION_OVERRIDE", "note": "User skipped [step]: [justification]" }`
2. Set `pipeline_status: "running"`
3. Advance to the NEXT step in the sequence
4. Display warning: "Step [X] overridden. Justification logged."
### Reset
1. Reset ALL iteration counters to 0
2. Set `pipeline_status: "running"`, `current_step: "DEVELOP"`
3. Log in `step_history`: `{ "step": "ESCALATION_RESET", "note": "User reset pipeline" }`
### Abort
1. Set `pipeline_status: "completed"` (with note: aborted)
2. Archive to `history.json` with abort flag
3. Log in `step_history`: `{ "step": "ESCALATION_ABORT", "note": "User aborted pipeline" }`
---
## Anti-Patterns
| Don't | Why |
|-------|-----|
| Auto-resume after escalation | Defeats the purpose of human oversight |
| Skip security CRITICAL issues | Never override security — fix them |
| Reset without reviewing issues | Same issues will recur |
| Abort without documenting why | Lose learning opportunity |
---
## Escalation Metrics
Track in `history.json` for improvement:
- Which steps escalate most frequently
- Average iterations before escalation
- Most common persistent issues
- Whether overrides correlate with production bugs
- Average cost per pipeline run
- Score trends: which categories consistently score lowest
- Cost per iteration (are later iterations cheaper as issues narrow?)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |