Skip to content
ci-doctor logo

CI Doctor

ci-doctor

Diagnose and fix CI/CD pipeline failures, test errors, GitHub Actions issues, and code scanning alerts. Use when: - CI pipeline fails (red build) - GitHub Actions workflow errors - Test failures in CI (Vitest, Playwright) - TypeScript/lint errors blocking builds - GitHub notifications about fail...

SKILL.md

Full skill instructions

CI Doctor

Diagnose and fix CI failures fast. Read logs, identify root cause, fix or delegate.

Context Files (Read First)

For project structure, read from Docs/​context/:

  • Docs/​context/​repo-structure.md - File locations
  • Docs/​context/​conventions.md - CI/​build patterns

Workflow

1. FETCH    → Get failure details (gh cli or logs)
2. DIAGNOSE → Identify error category
3. FIX      → Apply fix or delegate to specialist skill
4. VERIFY   → Run locally to confirm
5. PUSH     → Commit and push fix

Step 1: Fetch Failure Details

# Get recent workflow runs
gh run list --limit 5

# Get failed run details
gh run view <run-id>

# Get job logs
gh run view <run-id> --log-failed

# Get PR checks
gh pr checks

If user provides a GitHub URL, extract info with gh:

gh pr view <url> --json statusCheckRollup
gh run view <url>

Step 2: Diagnose Error Category

Error PatternCategoryAction
tsc errors, "TS2xxx"TypeScriptFix type errors
biome lint, "lint error"LintDelegate to lint-fixer
FAIL src/​...test.tsTest failureDelegate to test-writer or fix
npm ci failedDependencyCheck package-lock.json
types.ts changedGenerated typesRegenerate and commit
timeout, ETIMEDOUTFlaky/​infraRetry or increase timeout
permission deniedSecrets/​authCheck workflow permissions
CodeQL alert, code scanningSecurity vulnerabilitySee "Code Scanning Alerts" section

Step 3: Fix by Category

TypeScript Errors

# Run locally to see all errors
npm run typecheck:ci
# or
npx tsc -p tsconfig.ci.json --noEmit

Fix each error. Common patterns:

  • Missing imports
  • Type mismatches
  • Unused variables (remove or prefix with _)

Lint Errors

Delegate: Use the lint-fixer skill

Or quick fix:

npx @biomejs/​biome check --write .

Test Failures

  1. Run failing test locally:
npm run test --workspace=apps/​raamattu-nyt -- --run <test-file>
  1. If complex, delegate: Use the systematic-debugging skill

  2. If test needs update, delegate: Use the test-writer skill

Generated Types Out of Sync

Supabase types:

# Regenerate (requires SUPABASE_PROJECT_ID and SUPABASE_ACCESS_TOKEN)
npx supabase gen types typescript --project-id "$SUPABASE_PROJECT_ID" > apps/​raamattu-nyt/​src/​integrations/​supabase/​types.ts
git add apps/​raamattu-nyt/​src/​integrations/​supabase/​types.ts
git commit -m "Regenerate Supabase types"

OpenAPI types:

npx openapi-typescript ./​openapi.yaml -o apps/​raamattu-nyt/​src/​lib/​openapi.types.ts
git add apps/​raamattu-nyt/​src/​lib/​openapi.types.ts
git commit -m "Regenerate OpenAPI types"

Dependency Issues

# Clear and reinstall
rm -rf node_modules package-lock.json
npm install
git add package-lock.json
git commit -m "Refresh package-lock.json"

Code Scanning Alerts (CodeQL)

GitHub Code Scanning uses CodeQL to find security vulnerabilities. Access alerts via:

# List all code scanning alerts
gh api repos/​{owner}/​{repo}/​code-scanning/​alerts --jq '.[] | {number, state, rule: .rule.id, severity: .rule.security_severity_level, file: .most_recent_instance.location.path, line: .most_recent_instance.location.start_line}'

# Get specific alert details
gh api repos/​{owner}/​{repo}/​code-scanning/​alerts/<alert-number>

# List open alerts only
gh api repos/​{owner}/​{repo}/​code-scanning/​alerts?state=open

Common CodeQL Alerts and Fixes:

Alert TypeFix
js/​xssSanitize user input before rendering, use textContent not innerHTML
js/​sql-injectionUse parameterized queries, never concatenate user input
js/​path-injectionValidate/​sanitize file paths, use path.join with basename
js/​prototype-pollutionUse Object.create(null) or validate object keys
js/​insecure-randomnessUse crypto.randomUUID() instead of Math.random()
js/​hardcoded-credentialsMove secrets to environment variables
js/​log-injectionSanitize user input before logging
js/​regex-injectionEscape regex special characters in user input

Workflow:

  1. Fetch alert details with gh api
  2. Read the affected file and understand the vulnerability
  3. Apply the appropriate fix
  4. Test locally
  5. Commit and push - CodeQL will re-analyze

Dismissing False Positives:

# Dismiss alert as false positive
gh api -X PATCH repos/​{owner}/​{repo}/​code-scanning/​alerts/<number> -f state=dismissed -f dismissed_reason=false_positive -f dismissed_comment="Reason here"

Step 4: Verify Locally

Before pushing, run the same checks CI runs:

# TypeScript
npm run typecheck:ci || npx tsc -p tsconfig.ci.json

# Lint
npx @biomejs/​biome lint .

# Build
npm run build

# Tests
npm run test --workspace=apps/​raamattu-nyt

Step 5: Push Fix

git add -A
git commit -m "Fix CI: <brief description>"
git push

Then monitor: gh run watch

Project CI Structure

This project has these workflows:

WorkflowFileTriggersChecks
CI.github/​workflows/​ci.ymlPR, push to mainTypeScript, Lint, Build
Tests.github/​workflows/​tests.ymlPR, push (code changes)Vitest, Playwright smoke
Supabase Sync.github/​workflows/​supabase-sync.ymlVariousType generation

Delegation Guide

SituationDelegate To
Lint/​format errorslint-fixer skill
Test needs rewritingtest-writer skill
Complex bug in testsystematic-debugging skill
Supabase migration issuesupabase-migration-writer skill
Type refactoring neededcode-refactoring skill

Quick Commands Reference

# See what's failing
gh pr checks
gh run list --limit 3

# Get logs for failed run
gh run view <id> --log-failed

# Re-run failed jobs
gh run rerun <id> --failed

# Watch current run
gh run watch

More DevOps & CI/CD skills

Project scaffolding, deployment configuration, and CI/CD setup for Google ADK agents.

6K 472.6K
View

Set up tracing, logging, and monitoring for deployed ADK agents across Cloud Trace, BigQuery, and third-party platforms.

6K 472.6K
View

Enterprise Azure infrastructure architect generating Bicep or Terraform from workload descriptions.

1.5K 454.3K
View
azure-kubernetes logo
DevOps & CI/CD

azure-kubernetes

Plan and configure production-ready Azure Kubernetes Service clusters with Day-0 and Day-1 best practices.

1.5K 447.1K
View

Raw mechanical interfaces fusing Swiss typographic print with military terminal aesthetics. Rigid grids, extreme type scale contrast, utilitarian color, analog degradation effects. For data-heavy dashboards, portfolios, or editorial sites that need to feel like declassified blueprints.

92.7K 354.9K
View
just-scrape logo
DevOps & CI/CD

just-scrape

Web search, scraping, extraction, crawling, and monitoring via ScrapeGraph AI CLI.

69 245K
View

Skill for working with Firebase Hosting (Classic). Use this when you want to deploy static web apps, Single Page Apps (SPAs), or simple microservices. Do NOT use for Firebase App Hosting.

462 159.7K
View

Deploy and manage web apps with Firebase App Hosting. Use this skill when deploying Next.js/Angular apps with backends.

462 159.1K
View
deploy-to-vercel logo
DevOps & CI/CD

deploy-to-vercel

Deploy applications and websites to Vercel. Use when the user requests deployment actions like "deploy my app", "deploy and give me the link", "push this live", or "create a preview deployment".

31.9K 146.6K
View
programmatic-seo logo
DevOps & CI/CD

programmatic-seo

Build SEO-optimized pages at scale using templates, data, and proven playbook patterns.

53.3K 140.1K
View

Design and build isolated, reusable Convex backend components with clear boundaries and app-facing wrappers.

63 123.5K
View

Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

31.9K 116.1K
View

Coding & apps AI tools

Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View
Imagica logo
Coding & apps

Imagica

Build a no-code AI app in minutes.

Freemium
View
E
Coding & apps

Emergent.sh

An IDE for code migration from legacy to modern frameworks through coding agents.

Freemium
View
Wonder Dynamics logo
Coding & apps

Wonder Dynamics

Automate CGI animation in live-action scenes

Paid
View
M
Coding & apps

Mixo

Launch a website in seconds with AI.

Paid
View
AI Code Convert logo
Coding & apps

AI Code Convert

Streamline Your Coding Experience with AI Code Helper

Free
View