Ci code reviewer

From KjellKod/quest · View interactive version

Ci code reviewer is an AI agent skill from the GitHub repository KjellKod/quest. Automated CI code review for GitHub PRs using OpenAI Codex. Validates PR descriptions, checks implementation alignment, enforces Quest architecture boundaries, and maps test coverage to acceptance criteria when PRs move to ready-for-review.

How to use this skill

Skill file

CI Code Reviewer

Automated code review for CI pipelines. Designed to run inside GitHub Actions

via openai/codex-action, producing a single structured PR comment.

This skill extends .skills/code-reviewer/SKILL.md with CI-specific

adaptations: no interactive prompts, PR description validation, and concise

output formatting for automated comments.

At activation, announce the skill name and scope in one line. Example: [ci-code-reviewer] reviewing PR #97.

See .skills/review-anti-patterns.md for the shared rule set.


When to Use

Use this skill when:

Do NOT use for:


Required Context

Before starting the review, read:

  1. AGENTS.md -- architecture boundaries and coding conventions
  2. .skills/code-reviewer/SKILL.md -- severity model and review baseline

If any file is missing, note it in the output and continue with available context.


Severity Model (Use in PR Comments)

Classify findings using these levels, and include the level in each finding:

Rule: avoid comment-only style polish and trivial corrections. Prefer high signal.


Review Process

Step 0: PR Description Validation (Mandatory)

This step is mandatory and must appear first in the output.

Check the PR description for:

  1. Good explanation: WHAT changed and WHY it is needed.
  2. OR link/path to plan file: for example .quest/*/phase_01_plan/plan.md

or docs/implementation/....

If neither condition is met:

If description exists but is very thin (fewer than ~20 words, little context):

Step 0.5: Implementation Alignment

Verify that what the PR implements matches what it claims to do.

Use the best available source of intent, in priority order:

  1. Plan file referenced in PR description (preferred)
  2. Acceptance criteria listed in PR description
  3. PR description intent (what + why) if no explicit AC

Missing plan file is not a reason to skip alignment. Fall back to description.

Compare expectations vs diff:

For each acceptance criterion:

If all criteria align, stay silent on this section.

Step 0.6: Existing Comment Fetch Budget

When fetching existing PR review comments before posting the CI review, use a bounded budget:

Stop when the fetch succeeds, a confirmed permission/API failure occurs, or the budget is exhausted.

Step 1: Identify Changed Files and Scope

  1. Run git diff --name-only <base>...<head>.
  2. Run git diff --stat <base>...<head>.
  3. Categorize changed files into:

Use these categories to decide which boundary checks and quality checks apply.

Step 2: Architecture Boundaries

Apply Quest boundaries from AGENTS.md:

For each changed file, verify:

Boundary violations are Must fix or Blocker depending on severity.

Step 3: Correctness and Contracts

Review for:

Focus on behavior correctness, not style preferences.

Step 4: Security Hygiene

PR-focused checks:

Secret leakage is always Blocker.

Step 5: Test Coverage (Map to Acceptance Criteria)

If acceptance criteria are available from Step 0.5:

  1. Map each automated criterion to tests or validation evidence.
  2. If missing, flag as Must fix.

For workflow/config/skill-only changes, acceptable evidence can include:

If no criteria are available:

updates or explicit rationale. Missing validation -> Should fix.

Step 6: Code Quality and Maintainability

Review for clarity, maintainability, and consistency with existing patterns.

Markdown and YAML:

Shell scripts:

JSON/schema/config integrity:

Apply minimal diff principle: smallest correct change, no speculative refactors.


Output Format

Keep output concise. Omit sections with no findings.

**PR Description:** PASS | FAIL - one-line explanation

**Summary:** 1-3 bullets. Recommendation: APPROVE / REQUEST CHANGES

**Findings** (only sections with issues):

**Blocker**
[N] Blocker - path:line - description and suggested fix

**Must fix**
[N] Must fix - path:line - description and suggested fix

**Should fix**
[N] Should fix - path:line - description and suggested fix

**Plan alignment** (only if gaps/scope creep found): list issues
**Test gaps** (only if gaps found): list missing coverage
**Architecture** (only if violations found): list violations

Finding numbers are review-local indices. Use [N] format, increment in current-review order, and keep the number with the finding if it is converted to canonical JSON as review_local_index.

Line number guidance:

Brevity rules:

Signature

Append this block at the end of every PR review comment:

<pre>
     ▐▛███▜▌
    ▝▜█████▛▘
      ▘▘ ▝▝
<agent name and model> in Collaboration with <github username>
</pre>

Replace agent name/model and github username with the actual values.


Principles

  1. Correctness over style
  2. Boundaries are enforced
  3. Tests map to acceptance criteria
  4. Security hygiene is non-negotiable
  5. Minimal diff and high signal feedback
  6. Autonomous operation (no interactive prompts)
  7. Explicit severity on every finding
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.