본문으로 건너뛰기
cccskills
무료GitHub에 공개

pr-review-ci-fix

Review failing CI checks on pull requests, diagnose root causes, and fix issues. Covers common failures: tests, linting, type checks, security scans, and builds.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구GitHubGitLab

실행 점수 미검증

설치 방법 보기

포함된 파일(1)

  • SKILL.md6.0 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

PR Review and CI Fixes

Use This Skill When

  • Reviewing CI failures on pull requests
  • Diagnosing test failures
  • Fixing linting or type check errors
  • Resolving build failures
  • Understanding security scan results
  • Unblocking stalled PRs due to CI issues

When NOT to Use

  • Pre-PR testing (run locally first)
  • Infrastructure issues (not PR-level)
  • Flaky test investigation (broader scope)

Context: CI Fix Capability Maturity

Undeveloped: CI failures unclear; don't know how to fix.

Target: Read CI logs, identify root cause, apply fix.

Optimized: Automated CI fixes, pattern detection, preventive changes.

Core Principle

CI failures are clues, not blockers. Understanding CI output and common error patterns enables quick diagnosis and fixes.

Instructions

Step 1: Understand CI System

Identify the CI system:

SystemLog LocationRe-run
GitHub ActionsActions tab on PR"Re-run jobs"
GitLab CICI/CD → PipelinesRe-run button
JenkinsBuild console"Build Again"
CircleCIChecks tabRerun workflow

Step 2: Read CI Logs

Locate and analyze logs:

❌ FAILED: Run tests
  → Look for: error message, stack trace, failed test name
  → Key info: Where exactly did it fail?

Example output:
  FAIL  tests/calculator.test.js
  ● Calculator › should add numbers correctly
    Expected: 5
    Received: NaN
    at test (tests/calculator.test.js:12:5)

Step 3: Categorize Failure Type

Common CI failures:

TypeExampleFix
Test Failure"Expected: 5, Received: NaN"Fix code to match expectation
Linting Error"Unexpected token ';'"Run linter locally, fix issues
Type Error"Cannot find property 'x' on type 'any'"Add type annotations
Build Error"Module not found: 'react'"Install missing dependencies
Security Scan"High severity: SQL injection"Fix vulnerability

Step 4: Test Failure Diagnosis

Common test issues:

## Test Failure: "Expected 5, Received NaN"

### Root Cause Analysis

**Step 1**: Identify test file location
- File: tests/calculator.test.js, Line 12

**Step 2**: Review test code
```javascript
test('should add numbers correctly', () => {
  const result = add(2, 3);
  expect(result).toBe(5);  // Line 12 failing here
});

Step 3: Review implementation

function add(a, b) {
  return a + b;  // Currently returns NaN
}

Step 4: Identify issue

  • Function returns NaN when called with (2, 3)
  • Check: Are parameters being parsed as numbers? Strings?
  • Possible fix: return Number(a) + Number(b);

Step 5: Fix and verify locally

npm test tests/calculator.test.js
# ✓ Test passes
# Push fix

### Step 5: Linting Error Fixes

**Common linting issues:**

```markdown
## Linting Error: "Unexpected token ';'"

### Common Causes
- Extra semicolon: Remove
- Missing semicolon: Add
- Quote mismatch: Use consistent quotes
- Unused variable: Remove or use variable

### Auto-fix
```bash
npm run lint -- --fix
# Automatically fixes 80% of errors

### Step 6: Type Check Errors

**TypeScript/Flow issues:**

```markdown
## Type Error: "Cannot find property 'x' on type 'any'"

### Root Cause
- Variable typed as 'any' but property not guaranteed
- Solution: Add proper type annotation

### Fix
```typescript
// Before
const user: any = getUser();
console.log(user.email);  // TS error

// After
interface User {
  id: number;
  email: string;
}

const user: User = getUser();
console.log(user.email);  // TS OK

### Step 7: Build/Dependency Errors

**Module not found errors:**

```markdown
## Build Error: "Module not found: 'react'"

### Causes
- Package not installed
- Wrong import path
- Version conflict

### Fix
```bash
# Check if package is installed
npm list react

# If not, install it
npm install react

# If installed but not found, try clean install
rm package-lock.json node_modules/
npm install

# If import path wrong:
# Change: import React from 'react-dom'  ❌
# To:     import React from 'react'      ✓

### Step 8: Security Scan Failures

**Fix security vulnerabilities:**

```markdown
## Security: "SQL injection vulnerability"

### Scan Output

CRITICAL: SQL injection in queries.js:12 const query = SELECT * FROM users WHERE id = ${userId} ^^^^^^ Risk: User input directly in SQL


### Fix
```javascript
// Before (vulnerable)
const query = `SELECT * FROM users WHERE id = ${userId}`;
db.run(query);

// After (safe)
const query = 'SELECT * FROM users WHERE id = ?';
db.run(query, [userId]);  // Parameterized query

### Step 9: Check If PR Needs Changes

**Once logs are analyzed, determine next step:**

```markdown
## CI Fix Decision Tree

1. **Is the error in my code?**
   - Yes → Fix it
   - No → Check dependencies

2. **Did I add a new dependency?**
   - Yes → Verify package-lock.json is committed
   - No → Proceed

3. **Is the test failing?**
   - Yes → Review test logic
   - No → Check environment setup

4. **Can I reproduce locally?**
   - Yes → Fix locally, push
   - No → Might be environment issue; check CI config

Common Fix Checklist

  • Read full CI log (not just error summary)
  • Identify failure type (test/lint/type/build/security)
  • Reproduce issue locally
  • Apply fix
  • Run test/check locally to verify
  • Push changes
  • Monitor CI rerun

Output

Deliver:

  1. Failure Diagnosis (root cause identified)
  2. Fix Applied (code changes committed)
  3. Verification (CI passing, test passing locally)
  4. Documentation (if issue was non-obvious)

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Automate 21risk tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

Automate 2chat tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

Automate Ably tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

Automate Abstract tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

Automate Abuselpdb tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

Automate Abyssale tasks via Rube MCP (Composio). Always search tools first for current schemas.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

manu14357/zskills162026년 7월 24일 업데이트

manu14357의 스킬 모두 보기

이 스킬의 문제 신고