check

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Local Agent Checks

本地Agent检查

Run every
.continue/agents/*.md
check against the current changes, just like the GitHub PR checks do in CI.
针对当前更改运行所有
.continue/agents/*.md
检查,就像CI中的GitHub PR检查一样。

Workflow

工作流程

1. Gather context (write to disk, NOT into your context)

1. 收集上下文(写入磁盘,而非存入你的上下文)

  • Run
    git diff main...HEAD
    and write it to
    /tmp/check-diff.patch
    . If the diff is empty, also try
    git diff --cached
    and
    git diff
    .
    • Cap the diff: If the diff exceeds 3000 lines, truncate it to 3000 lines when writing. Add a final line:
      \n... (diff truncated at 3000 lines)
      .
    • Use a single bash command like:
      git diff main...HEAD | head -3000 > /tmp/check-diff.patch
  • Run
    git log main..HEAD --oneline
    and write it to
    /tmp/check-log.txt
    .
  • If there are no changes at all, tell the user and stop.
  • Do NOT read these files back into your own context. The sub-agents will read them directly.
  • 运行
    git diff main...HEAD
    并将结果写入
    /tmp/check-diff.patch
    。如果差异为空,也尝试
    git diff --cached
    git diff
    • 限制差异长度:如果差异超过3000行,写入时截断至3000行,并添加最后一行:
      \n... (diff truncated at 3000 lines)
    • 使用如下bash命令:
      git diff main...HEAD | head -3000 > /tmp/check-diff.patch
  • 运行
    git log main..HEAD --oneline
    并将结果写入
    /tmp/check-log.txt
  • 如果完全没有更改,告知用户并停止操作。
  • 请勿将这些文件读入你自己的上下文。子Agent会直接读取它们。

2. Discover agent checks

2. 发现Agent检查项

  • Glob
    .continue/agents/*.md
    to find all agent check files.
  • Do NOT read the agent files. Just extract the filename and use it to derive the check name (e.g.,
    code-conventions.md
    → "Code Conventions").
  • Present the user with the list of checks that will run, then proceed immediately without waiting.
  • 匹配
    .continue/agents/*.md
    以找到所有Agent检查文件。
  • 请勿读取Agent文件。仅提取文件名并据此生成检查名称(例如
    code-conventions.md
    → "代码规范")。
  • 向用户展示即将运行的检查列表,然后立即继续,无需等待。

3. Run checks in parallel (background agents)

3. 并行运行检查(后台Agent)

For each agent check file, spawn a sub-agent with these settings:
  • subagent_type: "general-purpose"
  • model: "haiku"
    (fast and cheap for review tasks)
  • run_in_background: true
Use this prompt structure:
You are a code reviewer running an automated check on a pull request.
对于每个Agent检查文件,生成一个具有以下设置的子Agent:
  • subagent_type: "general-purpose"
  • model: "haiku"
    (适用于审查任务的快速低成本模型)
  • run_in_background: true
使用如下提示词结构:
You are a code reviewer running an automated check on a pull request.

Setup

Setup

  1. Read your check instructions from: {absolute path to .continue/agents/xxx.md}
  2. Read the diff from: /tmp/check-diff.patch
  3. Read the commit log from: /tmp/check-log.txt
  1. Read your check instructions from: {absolute path to .continue/agents/xxx.md}
  2. Read the diff from: /tmp/check-diff.patch
  3. Read the commit log from: /tmp/check-log.txt

Your Task

Your Task

Review the diff according to your check instructions. For each finding:
  1. State the severity (Error / Warning / Info)
  2. Reference the specific file and line from the diff
  3. Explain what's wrong and how to fix it
If everything looks good and you have no findings, say "PASS" and briefly explain why the changes are clean for your check.
If you have findings, say "FAIL" and list them.
Keep your response concise. Do not repeat the diff back. Focus only on actionable findings. Your final message must start with either "PASS" or "FAIL" on its own line.

Launch ALL sub-agents in a single message (all Task tool calls together).
Review the diff according to your check instructions. For each finding:
  1. State the severity (Error / Warning / Info)
  2. Reference the specific file and line from the diff
  3. Explain what's wrong and how to fix it
If everything looks good and you have no findings, say "PASS" and briefly explain why the changes are clean for your check.
If you have findings, say "FAIL" and list them.
Keep your response concise. Do not repeat the diff back. Focus only on actionable findings. Your final message must start with either "PASS" or "FAIL" on its own line.

在一条消息中启动所有子Agent(所有Task工具调用一起执行)。

4. Collect results efficiently

4. 高效收集结果

After launching all agents, wait for them to complete by reading their output files. Do NOT read full outputs into your context. Instead:
  • For each background agent, use Bash to read just the last 30 lines of its output file:
    tail -30 {output_file}
  • Parse whether it says PASS or FAIL and extract the key findings.
启动所有Agent后,通过读取它们的输出文件等待完成。请勿将完整输出读入你的上下文。而是:
  • 对于每个后台Agent,使用Bash读取其输出文件的最后30行:
    tail -30 {output_file}
  • 解析结果是PASS还是FAIL,并提取关键发现。

5. Summarize results

5. 汇总结果

Present a summary table with emoji status indicators:
| Check | Result |
|-------|--------|
| ✅ Code Conventions | Passed |
| ❌ Security | 2 errors, 1 warning |
| ✅ Test Quality | Passed |
| ⚠️ Mobile Layout | 1 warning |
| ... | ... |
Use these emojis:
  • ✅ = all clear, no findings
  • ❌ = has Error-severity findings
  • ⚠️ = has Warning-severity findings but no errors
使用表情符号状态指示器展示汇总表格:
| 检查项 | 结果 |
|-------|--------|
| ✅ 代码规范 | 通过 |
| ❌ 安全检查 | 2个错误,1个警告 |
| ✅ 测试质量 | 通过 |
| ⚠️ 移动端布局 | 1个警告 |
| ... | ... |
使用以下表情符号:
  • ✅ = 无问题,未发现任何问题
  • ❌ = 存在错误级别的问题
  • ⚠️ = 存在警告级别的问题但无错误

6. Triage findings interactively

6. 交互式分类处理发现的问题

Do NOT dump all failure details in a big block. Instead, use AskUserQuestion to present each failed check's findings and let the user decide what to do.
For each check that has findings, present ONE AskUserQuestion with:
  • The check name as the header
  • A concise description of the finding(s) in the question text
  • Options like:
    • "Fix it" — you will fix the issue
    • "Skip" — ignore this finding
    • (Add other options if contextually appropriate, e.g. "Add to backlog")
You can batch multiple failed checks into a single AskUserQuestion call (one question per failed check, up to 4 per call). If there are more than 4 failed checks, use multiple AskUserQuestion calls.
Then execute whatever the user chose — fix the issues they said to fix, skip the ones they said to skip.
请勿将所有失败详情一次性全部输出。而是使用AskUserQuestion展示每个失败检查的发现,让用户决定如何处理。
对于每个存在问题的检查,展示一个AskUserQuestion,包含:
  • 检查项名称作为标题
  • 问题的简洁描述
  • 选项例如:
    • "修复它" — 你将修复该问题
    • "跳过" — 忽略该问题
    • (根据上下文添加其他合适选项,例如"加入待办事项")
你可以将多个失败检查合并到一个AskUserQuestion调用中(每个失败检查对应一个问题,每次最多4个)。如果失败检查超过4个,使用多个AskUserQuestion调用。
然后执行用户选择的操作——修复用户要求修复的问题,跳过用户选择忽略的问题。