Analyze and fix CI/CD pipeline failures including build errors, test failures, and linting issues
/plugin marketplace add teliha/dev-workflows/plugin install dev-workflows@dev-workflowsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
README.mdThis skill automatically activates when:
Get failure logs
# Get the failed workflow run
gh run view <RUN_ID>
# Get detailed logs
gh run view <RUN_ID> --log-failed
Categorize the failure
Detect project type to apply appropriate fixes:
foundry.toml existsforge buildforge testforge fmtsolhint (if available)next.config.js or next.config.tsnpm run build / next buildnpm test / jesteslint / next linttsc --noEmitprettierpackage.json with TypeScriptnpm run buildnpm testnpm run linttsc --noEmitCargo.tomlcargo buildcargo testcargo clippycargo fmtCommon causes:
Fix approach:
TypeScript example:
// Error: Property 'foo' does not exist on type 'Bar'
// Fix options:
// 1. Add the property
interface Bar {
foo: string;
}
// 2. Type assertion (if intentional)
const x = (obj as any).foo;
// 3. Optional chaining (if might not exist)
const x = obj.foo ?? undefined;
Solidity example:
// Error: Undeclared identifier 'bar'
// Fix: Check if function exists, correct spelling
function foo() external {
_bar(); // Use correct function name
}
Common causes:
Fix approach:
Important: Do NOT blindly change test expectations. Understand WHY it's failing.
Example:
// If the test expectation is wrong:
expect(result).toBe(10); // Fails with actual: 11
// Fix: Update if 11 is actually correct
expect(result).toBe(11);
// If the code is wrong:
// Fix the implementation, not the test
Common issues:
Fix approach:
Commands:
# ESLint
npm run lint -- --fix
# or
eslint --fix .
# Prettier
npm run format
# or
prettier --write .
# Solidity
forge fmt
Fix automatically:
# Foundry
forge fmt
# Prettier
prettier --write .
# Rust
cargo fmt
Common fixes:
// Missing type
const x = getData(); // Error: implicit any
const x: DataType = getData(); // Fix: add type
// Wrong type
const x: string = 123; // Error: not assignable
const x: number = 123; // Fix: correct type
// Nullable
const len = str.length; // Error: possibly undefined
const len = str?.length ?? 0; // Fix: handle null
Common fixes:
// Wrong path
import { Foo } from './foo'; // Error: not found
import { Foo } from './foo.js'; // Fix: add extension
// or
import { Foo } from '@/lib/foo'; // Fix: use alias
// Missing package
import { z } from 'zod'; // Error: not found
// Fix: npm install zod
Before committing fixes:
Foundry:
forge fmt --check
forge build
forge test
Next.js/TypeScript:
npm run lint
npm run type-check # or tsc --noEmit
npm test
npm run build
General:
# Run the same CI commands locally
After fixing, provide a summary:
## CI Fix Summary
### Error Type
[Build/Test/Lint/Format/Type]
### Root Cause
[Brief explanation of what caused the failure]
### Fixes Applied
1. [Description of fix 1]
2. [Description of fix 2]
### Files Modified
- `path/to/file1.ts`
- `path/to/file2.ts`
### Verification
- [x] Build passes
- [x] Tests pass
- [x] Lint passes
- [x] Format check passes
### Commit
```bash
git add .
git commit -m "fix: resolve CI failures - [brief description]"
## Safety Checks
Before pushing fixes:
- [ ] All tests pass locally
- [ ] Build succeeds
- [ ] Linting passes
- [ ] Formatting is correct
- [ ] No new warnings introduced
- [ ] Changes are minimal and focused
- [ ] No security issues introduced
## Integration with CI/CD
Use as a composite action in failing workflows:
```yaml
name: Auto-fix CI
on:
workflow_run:
workflows: ["CI"]
types: [completed]
jobs:
fix:
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Caller provides build environment
- uses: actions/setup-node@v4 # or foundry-toolchain, etc.
- run: npm ci
- uses: teliha/dev-workflows/.github/actions/fix-ci@main
with:
failed_run_id: ${{ github.event.workflow_run.id }}
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
<!-- FIX-CI:END -->This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.