fixing-pipeline-errors
Provides a tiered approach to debugging and fixing CI/CD failures through intelligent test execution.
Install
mkdir -p .claude/skills/fixing-pipeline-errors && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/13816" && unzip -o skill.zip -d .claude/skills/fixing-pipeline-errors && rm skill.zipInstalls to .claude/skills/fixing-pipeline-errors
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Systematic error detection and fixing strategy for CI/CD pipeline failuresKey capabilities
- →Run fastest unit and validation tests first
- →Execute integration tests without slow markers
- →Run slow tests for full workflow and timeout issues
- →Analyze failure types from CI/CD output
- →Reproduce errors locally using specific test commands
- →Isolate problems using pytest markers
How it works
The skill employs an intelligent test packaging strategy, running tests in tiers from fastest to slowest. It then guides through error detection by analyzing failure types, reproducing locally, isolating problems, and applying minimal fixes.
Inputs & outputs
When to use fixing-pipeline-errors
- →Fixing pipeline errors
- →Debugging failed CI builds
- →Optimizing test execution order
About this skill
Pipeline Error Fix
Systematic error detection and fixing strategy for CI/CD pipeline failures with intelligent test packaging
Systematic approach to quickly identify and fix CI/CD pipeline test failures using intelligent test packaging and tiered error detection.
Intelligent Test Packaging Strategy
Tier 1: Fastest Feedback (< 30 seconds)
Run these tests FIRST to catch common errors quickly:
# Fast tests: Unit + Validation (in-process, no subprocess)
pytest {directories.tests}/unit/ {directories.tests}/validation/ -v --tb=short -x
What these catch:
- Syntax errors
- Import errors
- Configuration errors
- Schema validation errors
- Basic logic errors
Tier 2: Medium Speed (1-5 minutes)
Only run if Tier 1 passes:
# Medium tests: Integration without slow markers (parallel)
pytest {directories.tests}/integration/ -v --tb=short -x -m "not slow" -n auto
What these catch:
- CLI command errors
- Generation logic errors
- File I/O errors
- Path handling issues
Tier 3: Slow Tests (5+ minutes)
Only run if Tier 2 passes:
# Slow tests: QuickStart and full workflow tests
pytest {directories.tests}/integration/ -v --tb=short -x -m "slow"
What these catch:
- Full workflow integration issues
- Timeout issues
- Resource contention
- Complex state interactions
Error Detection Process
Step 1: Analyze Failure Type
Check the CI/CD output to categorize the failure:
| Failure Type | Indicator | Start With |
|-|--||
| Import Error | ModuleNotFoundError, ImportError | Tier 1 |
| Syntax Error | SyntaxError, IndentationError | Tier 1 |
| Schema Error | ValidationError, JSONDecodeError | Tier 1 |
| Assertion Error | AssertionError | Identify test, run that tier |
| Timeout | TimeoutError, "Command timed out" | Tier 3 (optimize test) |
| Process Error | SubprocessError, exit code != 0 | Tier 2 |
Step 2: Reproduce Locally
Always reproduce the error locally before fixing:
# Run the specific failing test
pytest {directories.tests}/path/to/test_file.py::TestClass::test_method -v --tb=long
# Or run with maximum verbosity
pytest {directories.tests}/path/to/test_file.py -v --tb=long -s
Step 3: Isolate the Problem
Use pytest markers to narrow down:
# Run only unit tests
pytest -m unit -v
# Run only fast tests
pytest -m fast -v
# Skip slow tests
pytest -m "not slow" -v
# Run specific test categories
pytest -m cli -v
pytest -m generation -v
pytest -m quickstart -v
Step 4: Fix and Verify
- Make the minimal fix - don't over-engineer
- Run the failing test - ensure it passes
- Run the tier tests - ensure no regressions
- Run full suite - final verification
# Verification sequence
pytest {directories.tests}/path/to/fixed_test.py -v # Fixed test passes
pytest {directories.tests}/unit/ {directories.tests}/validation/ -v # Tier 1 passes
pytest {directories.tests}/integration/ -v -m "not slow" # Tier 2 passes
pytest {directories.tests}/ -v # Full suite passes
Timeout Prevention Strategies
For Subprocess Tests
# Use explicit, reasonable timeouts
result = subprocess.run(
command,
capture_output=True,
text=True,
timeout=30 # Explicit timeout
)
For Long-Running Tests
import pytest
@pytest.mark.slow
@pytest.mark.timeout(120)
def test_quickstart_generation():
"""Mark slow tests explicitly for intelligent packaging."""
pass
CI Configuration
The CI workflow uses staged execution:
# Stage 1: Fast tests (fail-fast, < 30s)
- pytest {directories.tests}/unit/ {directories.tests}/validation/ -v -x
# Stage 2: Medium tests (parallel, fail-fast)
- pytest {directories.tests}/integration/ -v -x -m "not slow" -n auto
# Stage 3: Slow tests (sequential, fail-fast)
- pytest {directories.tests}/integration/ -v -x -m "slow"
Common Pipeline Errors and Fixes
Error: Module Not Found
ModuleNotFoundError: No module named 'scripts'
Fix: Ensure sys.path includes project root:
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
Error: Test Timeout
TimeoutError: Command timed out after 120 seconds
Fix:
- Increase timeout for legitimately slow tests
- Mark test with
@pytest.mark.slow - Optimize the test or split into smaller units
Error: Subprocess Failed
subprocess.CalledProcessError: Command 'x' returned non-zero exit status 1
Fix:
- Capture and log stderr:
result.stderr - Check the actual command being run
- Verify paths work cross-platform
Error: File Not Found
FileNotFoundError: [Errno 2] No such file or directory
Fix:
- Use
Pathobjects for cross-platform paths - Verify fixtures create required directories
- Check
tmp_pathfixture usage
Parallel Execution Considerations
When using pytest-xdist (-n auto):
- Avoid shared state - each worker has its own process
- Use tmp_path fixture - provides unique temp directories
- Don't rely on test order - tests may run in any order
- Avoid file conflicts - use unique file names per test
Quick Reference Commands
# Fast feedback (local development)
pytest {directories.tests}/unit/ {directories.tests}/validation/ -v -x
# Full test with coverage
pytest {directories.tests}/ --cov=scripts --cov=cli -n auto
# Debug a specific test
pytest {directories.tests}/path/test.py::test_name -v --tb=long -s
# List all tests without running
pytest --collect-only
# Run tests matching a pattern
pytest -k "quickstart" -v
# Show slowest tests
pytest --durations=10
Important Rules
- Always start with fast tests - quick feedback loop
- Use fail-fast (-x) - stop on first failure for debugging
- Reproduce locally first - don't push fixes blindly
- Mark slow tests explicitly - enables intelligent packaging
- Use parallel execution - speeds up CI significantly
- Set explicit timeouts - prevent hanging tests
- Test cross-platform - CI runs on multiple OS
When to Use
This skill should be used when strict adherence to the defined process is required.
Prerequisites
- Basic understanding of the agent factory context.
- Access to the necessary tools and resources.
Process
- Review the task requirements.
- Apply the skill's methodology.
- Validate the output against the defined criteria.
Best Practices
- Always follow the established guidelines.
- Document any deviations or exceptions.
- Regularly review and update the skill documentation.
When not to use it
- →When strict adherence to the defined process is not required
- →When the task is not related to CI/CD pipeline failures
Limitations
- →The skill requires a basic understanding of the agent factory context
- →The skill requires access to necessary tools and resources
- →The skill focuses on systematic error detection and fixing
How it compares
This skill provides a systematic, tiered approach to pipeline error fixing with intelligent test packaging and explicit reproduction steps, which is more structured and efficient than debugging without a defined strategy.
Compared to similar skills
fixing-pipeline-errors side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| fixing-pipeline-errors (this skill) | 0 | 5mo | Review | Intermediate |
| ml-pipeline-workflow | 9 | 5mo | No flags | Advanced |
| code-change-verification | 4 | 4mo | Review | Beginner |
| discovering-make-commands | 3 | 5mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by gitwalter
View all by gitwalter →You might also like
ml-pipeline-workflow
wshobson
Build end-to-end MLOps pipelines from data preparation through model training, validation, and production deployment. Use when creating ML pipelines, implementing MLOps practices, or automating model training and deployment workflows.
code-change-verification
openai
Run the mandatory verification stack when changes affect runtime code, tests, or build/test behavior in the OpenAI Agents Python repository.
discovering-make-commands
streamlit
Lists available make commands for Streamlit development. Use for build, test, lint, or format tasks.
mlops-automation
fmind
Guide to refine MLOps projects with task automation, containerization, CI/CD pipelines, and robust experiment tracking.
pipeline-plugin-development
TencentBlueKing
流水线插件开发完整指南,涵盖插件创建、task.json 配置规范、多语言开发示例(Python/Java/NodeJS/Golang)、输入输出规范、错误码规范、发布流程、调试方法。当用户需要开发蓝盾流水线插件、配置 task.json、处理插件输入输出或排查插件错误时使用。
dev
atopile
LLM-focused workflow for working in this repo: compile Zig, run the orchestrated test runner, consume test-report.json/html artifacts, and discover/debug ConfigFlags.