From 3491032516cf2fc4e0e686c3f934a13810d6c9d0 Mon Sep 17 00:00:00 2001 From: Nate Date: Mon, 2 Feb 2026 00:18:04 -0800 Subject: [PATCH] Add cn-check skill for AI agent code checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a skill (skills.sh format) that teaches agents how to install and use `cn check` — the Continue CLI command for running AI agent checks locally against working tree changes. Co-Authored-By: Claude Opus 4.5 --- skills/cn-check.zip | Bin 0 -> 2735 bytes skills/cn-check/SKILL.md | 200 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 200 insertions(+) create mode 100644 skills/cn-check.zip create mode 100644 skills/cn-check/SKILL.md diff --git a/skills/cn-check.zip b/skills/cn-check.zip new file mode 100644 index 0000000000000000000000000000000000000000..b4f30f3ef9ee52b7806c491d1c0ea2eb370ea099 GIT binary patch literal 2735 zcmZ{mc{J1u8-Ra?A!J{YCE3@J#=d5W!HjKY#6{VcF_tW2k8DZ8AWIBsYHZme?nF|y zTh_)^j5X2MkbOzEe7g6Z@4M&RbKm#8%OCG~-hUq(I6VUk@G~;$jGX^i{%XvCFyIjg z@$mKXz+SLJGXwPg&Nnf^Cxwe-1?U*Q(E$Jh@5!;v3F7BG^#@|{nVhi~GXQAv0RY$E z5h%Dh0-+S(`9D;^KT#PD$AOb?xPCmaerj_wX~i*wfW2d&c6Xn^8=Ng&RdQZWnEm4& zXLF%k=kN$QrwFYw4vNfj?soBgDLJZnaI%~Efk${;?AD-S#qXF8w21*b3L?E(F0g4N zxpPw8actnd9S^Zio>Yw7tFsLb7$sqe0ot)qp(OTA;#&^8u)e8cV!G*7XSsH$C0bEQ zcC50GuN9f1z{ZGcg1VLKGd^1VP;RR|Rg}YkpaE1>tt+{GM!h8&ShL5oGyXNtQ9CUK zV!0+s=3nfTZE-7^A@(8u%_UxW5Co6wg2|KMSKHKO%$4FwxX6w!$|53oMK>0&Uf`WX z$=FCJQPwKaJ4sKJrb0|2j|qHdHvSma?)JOu7I-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ilities +- XSS risks in user-facing output +- Hardcoded secrets or credentials +- Insecure use of eval() or similar + +If you find issues, edit the files to fix them. If everything looks good, say so and exit. +``` + +The agent receives: + +- The full diff against the base branch +- A list of changed files +- Access to read/edit files in a temporary worktree + +Any edits the agent makes are captured as a patch and reported as a "fail" with suggested changes. + +## How It Works + +1. **Diff** — Computes `git diff ...HEAD` to find changed files +2. **Resolve** — Discovers which checks to run (Hub, local, or `--agent` flags) +3. **Worktree** — Creates a temporary git worktree per check for isolation +4. **Run** — Forks a worker process per check; the agent runs with full tool access +5. **Capture** — After the agent finishes, captures `git diff` in the worktree as a patch +6. **Report** — Renders results: pass (no changes), fail (patch produced), or error + +Checks run in parallel by default. Use `--fail-fast` for sequential execution that stops on first failure. + +## Output + +### Interactive terminal (TTY) + +A live-updating table shows check progress: + +``` +cn check - 3 checks against main - 5 changed files + +Check Status Time +-------------------------------------------- +Security Review * Running 12s +Code Style Pass 8s +Documentation Pending - +``` + +When complete, a full report prints with pass/fail status, agent output, and suggested patches. + +### JSON output (`--format json`) + +```json +{ + "checks": [ + { + "agent": ".continue/agents/security.md", + "name": "security", + "status": "pass", + "patch": "", + "output": "No security issues found.", + "duration": 8.2 + } + ], + "summary": { + "total": 1, + "passed": 1, + "failed": 0, + "errored": 0 + } +} +``` + +## CLI Reference + +``` +cn check [options] + +Options: + --base Base branch for diff (default: auto-detect) + --format Output format: text or json (default: text) + --fix Apply suggested fixes to working tree + --patch Output unified patch (pipe to git apply) + --fail-fast Stop after first failing check + --agent Agent to run (hub slug or local path, repeatable) + --config Path to config file + --org Organization slug + --verbose Enable debug logging +``` + +## Troubleshooting + +| Problem | Solution | +| ---------------------------- | ------------------------------------------------------------------------------------- | +| "No changes detected" | Make sure you have uncommitted changes or specify `--base` | +| "No checks found" | Create `.continue/agents/*.md` files or run `cn login` for Hub checks | +| Check times out (5 min) | Reduce diff size or split into focused agents | +| "Worker exited with code 1" | Run with `--verbose` to see worker stderr | +| Patch conflicts with `--fix` | Apply patches manually: `cn check --patch > changes.patch && git apply changes.patch` |