# Checks Walkthrough You are helping a developer set up **Checks** — AI code review that runs on every PR. Each check is a markdown file in the repo. It runs as a full agent on every PR — not just reading the diff, but able to read files, run bash, and use a browser. If it finds something, it fails the PR with a one-click fix. Otherwise, it passes silently. **Complete all steps below in order. If you hit an error you can't recover from, direct the user to [docs.continue.dev](https://docs.continue.dev/) for help.** --- ## Step 1: Orient Welcome the user. Keep it brief — one or two sentences about what you're going to do together: > We're going to set up AI checks for your repo. I'll explore your codebase, write checks tailored to your project, and get you set up to run them. Then create a task list and mark Task 1 in progress: 1. Explore codebase & write checks 2. Try a check 3. Connect to Mission Control (optional) ## Step 2: Git Setup 1. Verify this is a git repo: `git rev-parse --git-dir 2>/dev/null` — stop if not. 2. Check for uncommitted changes: `git status --porcelain` If dirty, ask: > You have uncommitted changes. I'd like to stash them and create a new branch. OK? If approved: ```bash git rev-parse --abbrev-ref HEAD # save original branch git stash push -m "Stashing before checks setup" git checkout -b add-checks ``` Remember the original branch and whether you stashed — you'll restore later. ## Step 3: Explore & Write Checks **Speed target: under 60 seconds. Stay shallow — surface patterns, don't read entire files.** Run these in parallel where possible: ### Codebase scan - Project structure, languages, frameworks, build system - Linters, formatters, type checkers already in use - Testing framework & patterns - CI/CD workflows - Contributing guidelines (CONTRIBUTING.md, CLAUDE.md, AGENTS.md) ### PR review history (via `gh` CLI, skip if `gh` is not available) ```bash gh pr list --state merged --limit 30 --json number,title # For 3-5 recent PRs with review comments: gh api repos/{owner}/{repo}/pulls/{number}/comments --jq '.[] | {body: .body, path: .path}' ``` Look for: what reviewers commonly flag, what linters don't catch, what areas get the most review attention. ### Propose checks Share 3-5 bullet findings, then propose exactly **3 checks** via a multiselect question (all selected by default). **Cardinal rule: never create a check for something already enforced by a deterministic tool** (linter, type checker, CI step). Checks are for things that require judgment — slop, drifting conventions, security anti-patterns, poor taste. Each proposed check must be specific to this project and clearly valuable. ### Write check files Create `.continue/checks/` and write one `.md` file per check: ```markdown --- name: Human-Readable Check Name description: One-sentence description. --- # Check Name ## Context WHY this check exists. Reference specific project patterns, configs, or review comments you found. ## What to Check ### 1. Category Concrete instructions with specific file paths/patterns and GOOD/BAD code examples from this codebase. ### 2. Category ... ## Key Files List the files most relevant to this check. ## Exclusions Cases where this check does NOT apply. ``` Keep file names lowercase with hyphens (e.g., `error-handling.md`, `api-conventions.md`). ### Install the check skill and update agent config Install the `/check` skill so the user can run checks locally anytime: ```bash npx skills add continuedev/skills --skill check ``` Then add a section to the project's agent configuration file so checks become part of the workflow. Choose the right file based on what exists or what tool the user is using: - **CLAUDE.md** — if using Claude Code - **AGENTS.md** — if using a generic agent setup - **COPILOT.md** — if using GitHub Copilot - If none of these exist, create the most appropriate one. Append a section like this: ```markdown ## Checks Before opening a pull request, run `/check` to validate the diff against all `.continue/checks/*.md` checks. All checks must pass or be explicitly acknowledged before the PR is created. See [docs.continue.dev/checks/running-locally](https://docs.continue.dev/checks/running-locally) for details. ``` Mark Task 1 complete. ## Step 4: Try a Check Mark Task 2 in progress. Now let the user see a check in action. Ask them which of the checks they just created they'd like to try: > Which check would you like to try? I'll run it against your current diff right now. Present the list of checks they created as options. Once they pick one, run the check: 1. Write the diff to disk (don't read it into context): `git diff main...HEAD | head -3000 > /tmp/check-diff.patch` — if empty, also try `git diff --cached` and `git diff` 2. Write the commit log: `git log main..HEAD --oneline > /tmp/check-log.txt` 3. Read the selected check file from `.continue/checks/` 4. Read `/tmp/check-diff.patch` and `/tmp/check-log.txt` 5. Evaluate the diff against the check's criteria as a code reviewer: - For each finding: state severity (Error / Warning / Info), reference the specific file and line from the diff, explain what's wrong and how to fix it - If everything looks good, report PASS - If there are findings, report FAIL and list them 6. Present the result — if it fails, offer to fix the issues This demonstrates what the check will do on every PR when connected to Mission Control. Mark Task 2 complete. ## Step 5: Commit & PR Commit the check files and open a PR: ```bash git add .continue/checks/ git add .claude/skills/ 2>/dev/null git add CLAUDE.md AGENTS.md COPILOT.md 2>/dev/null # whichever was modified git commit -m "Add checks for automated PR review Checks: - [list each check name]" git push origin HEAD gh pr create --title "Add checks for automated PR review" --body "Adds AI-powered code review checks that run on every PR. ## Checks added [list each check with one-line description] ## How it works Each check is a markdown file in \`.continue/checks/\`. They run as full agents on every PR — reading files, running commands, and providing one-click fixes when they find issues. ## Run locally \`\`\` /check \`\`\` ## Next steps Connect to [Mission Control](https://continue.dev) to run these automatically on every PR." ``` If you stashed changes earlier, restore them: ```bash git checkout git stash pop ``` ## Step 6: Mission Control Mark Task 3 in progress. Tell the user: > Your checks are committed and ready. Right now you can run them locally with `/check`. To run them automatically on every PR as GitHub status checks: > > 1. **Sign up at [continue.dev](https://continue.dev)** — connect your GitHub org > 2. **Enable checks** — select which repos to monitor > 3. **That's it** — every PR will run your checks and report pass/fail as GitHub status checks, with one-click fixes for failures > > The checks you wrote are the same ones that run in CI. Edit the markdown files to update what gets checked. No config, no YAML, no build steps. > > **Run checks locally:** [docs.continue.dev/checks/running-locally](https://docs.continue.dev/checks/running-locally) > **Full docs:** [docs.continue.dev](https://docs.continue.dev) Mark Task 3 complete. Share the PR URL if one was created.