.claude/skills/pipeline-guards/SKILL.md
Safety constraints and quality gates for pipeline and workflow execution
npx skillsauth add baekenough/oh-my-customcode pipeline-guardsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Defines mandatory safety constraints for all pipeline, workflow, and iterative execution within the oh-my-customcode system. Prevents infinite loops, enforces timeouts, and establishes quality gates.
System-wide — these guards apply to dag-orchestration, worker-reviewer-pipeline, and any iterative process.
| Guard | Default | Hard Cap | Applies To | |-------|---------|----------|------------| | Max iterations | 3 | 5 | worker-reviewer-pipeline | | Max DAG nodes | 20 | 30 | dag-orchestration | | Max parallel agents | 4 | 5 | R009 (all pipelines) | | Max parallel steps | 4 | 4 | pipeline parallel blocks | | Timeout per node | 300s | 600s | dag-orchestration nodes | | Timeout per pipeline | 900s | 1800s | worker-reviewer-pipeline | | Max retry count | 2 | 3 | Failure retry strategies | | Max PR improvement items | 20 | 50 | pr-auto-improve | | Max auto-improve items | 20 | 50 | omcustom-auto-improve | | Max files per agent | 10 | 15 | All agent spawns (advisory) |
Guards are enforced at two levels:
Each skill checks guard limits before execution:
Before starting pipeline:
1. Check max_iterations ≤ hard cap
2. Check timeout ≤ hard cap
3. Check node count ≤ hard cap
If any exceeded → warn user, use hard cap value
The stuck-detector hook monitors for guard violations:
PostToolUse → check:
- Iteration count > max_iterations?
- Elapsed time > timeout?
- Same error repeated > max_retry?
If any → emit advisory to stderr
[Quality Gate Check]
├── Critical issues: {count} (must be 0)
├── Major issues: {count} (must be ≤ threshold)
├── Minor issues: {count} (informational)
└── Gate: PASS | FAIL
[DAG Completion Gate]
├── Nodes completed: {n}/{total}
├── Nodes failed: {count}
├── Nodes skipped: {count}
└── Gate: PASS | PARTIAL | FAIL
When guards are triggered, they integrate with existing advisory systems:
| Event | Action | |-------|--------| | Max iterations reached | → stuck-recovery advisory | | Repeated failures | → model-escalation advisory | | Timeout approaching (80%) | → warn user, suggest early termination | | Hard cap hit | → force stop, report to user |
Advisory guard for agent task scope. When a single agent is assigned too many files, it becomes a bottleneck in parallel execution.
| Signal | Default | Action | |--------|---------|--------| | Files per agent > 10 | Advisory warning | Suggest splitting by layer/domain | | Files per agent > 15 | Hard warning | Require explicit user override |
Display:
[Guard] ⚠ Agent assigned {n} files (> 10) — consider splitting by layer
[Guard] 🛑 Agent assigned {n} files (> 15) — requires explicit override
This integrates with R009 Adaptive Parallel Splitting: if a stalled agent is detected AND it was assigned > 10 files, the splitting recommendation is stronger.
Pipelines can override defaults (within hard caps):
# In pipeline/workflow spec
guards:
max_iterations: 4 # Override default 3, cannot exceed 5
timeout_per_node: 120 # Override default 300s
timeout_pipeline: 600 # Override default 900s
quality_gate: all_pass # all_pass | majority_pass
When a pipeline or workflow must be terminated:
[Kill Switch] Activated
├── Reason: {max_iterations | timeout | user_request | stuck_detected}
├── Pipeline: {name}
├── Progress: {completed}/{total} steps
├── Preserved state: /tmp/.claude-pipeline-$PPID.json
└── Action: Stopped gracefully, state saved for resume
The kill switch:
On guard-triggered termination:
{
"pipeline": "feature-review",
"terminated_at": "2026-03-07T10:15:00Z",
"reason": "max_iterations_reached",
"completed_iterations": 3,
"last_verdict": "FAIL",
"remaining_issues": [
{"severity": "major", "file": "src/auth.ts", "line": 42, "description": "..."}
],
"worker_last_output": "...",
"resumable": true
}
Guard warnings appear inline:
[Guard] ⚠ Iteration 3/3 — final attempt
[Guard] ⚠ Timeout 80% (240s/300s) — consider early termination
[Guard] 🛑 Max iterations reached — pipeline stopped
[Guard] 🛑 Hard timeout (600s) — force stop
| Rule/Skill | Integration | |------------|-------------| | R009 | Max parallel agents enforced (hard cap: 5, soft default: 4) | | R010 | Guards run in orchestrator only | | R015 | Guard warnings displayed transparently | | dag-orchestration | Node count and timeout limits | | worker-reviewer-pipeline | Iteration and pipeline timeout limits | | pr-auto-improve | Improvement item count limits | | omcustom-auto-improve | Auto-improve item count limits | | stuck-recovery | Guard triggers feed into stuck detection | | model-escalation | Repeated failures trigger escalation advisory | | task-decomposition | Subtask file counts validated against granularity guard thresholds |
development
Generate and maintain a persistent codebase wiki — LLM-built interlinked markdown knowledge base (Karpathy LLM Wiki pattern)
development
Use the project wiki as RAG knowledge source — search wiki pages to answer codebase questions before exploring raw files
tools
Analyze task trajectories to propose reusable SKILL.md candidates from successful patterns
data-ai
hada.io RSS feed monitoring for AI agent/harness articles with automated /scout analysis