Agent审查
- 作者仓库星标 0
- 作者更新于 实时读取
- 作者仓库 skills-registry
- 领域
- 效率工具
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @tomevault-io · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- 无特殊要求
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- Shell 执行
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: patch
description: Propose a code patch for a finding. Produces a unified diff against the current HEAD plus a shor…
category: 效率工具
runtime: 无特殊运行时
---
# patch 输出预览
## PART A: 任务判断
- 适用问题:日常重复事务、资料整理、邮件或工作流提效。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Workspace / What to do / Refusing to patch”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于日常重复事务、资料整理、邮件或工作流提效,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Workspace / What to do / Refusing to patch”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、执行终端命令、会按任务需要访问外部网络、通常不需要额外 API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、执行终端命令;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/tmp` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、执行终端命令。
先用一个小任务确认它会围绕“Workspace / What to do / Refusing to patch”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: patch
description: Propose a code patch for a finding. Produces a unified diff against the current HEAD plus a shor…
category: 效率工具
source: tomevault-io/skills-registry
---
# patch
## 什么时候使用
- 用于审阅代码、文档或方案并给出可执行反馈 适合处理重复事务、信息整理、邮件和日常工作流提效,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;通常不需要额外…
- 面向日常重复事务、资料整理、邮件或工作流提效,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Workspace / What to do / Refusing to patch」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、执行终端命令;会按任务需要访问外部网络;通常不需要额外 API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "patch" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Workspace / What to do / Refusing to patch
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> 无特殊运行时 | 读取文件、写入/修改文件、执行终端命令 | 会按任务需要访问外部网络
安全层 -> 通常不需要额外 API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} patch
Propose a minimal code patch that fixes a confirmed finding. You are not shipping the fix; you are handing the analyst a starting diff and explaining what it does. The analyst reviews, edits if needed, and opens a PR by hand.
Workspace
./src— the repository at its current HEAD, on the default branch, writable./context.json— hasscrutineer.api_base,scrutineer.token,scrutineer.repository_id,scrutineer.finding_id(required; this skill only makes sense finding-scoped)./report.json— write the patch + rationale here./schema.json— shape ofreport.json
What to do
Read
./context.json. Ifscrutineer.finding_idis missing, write{"error": "no finding_id in context.json; patch is finding-scoped"}toreport.jsonand exit 0.Fetch the finding:
GET {api_base}/findings/{finding_id}withAuthorization: Bearer {token}. Readlocation,cwe,trace,boundary,validation,rating. These five together tell you where the sink is, what the vulnerable input flow looks like, and what dangerous behaviour you need to stop.Inside
./src, edit files to fix the finding. Constraints:- Minimal. Change only what the fix requires. Do not refactor surrounding code, rename variables, reformat unrelated lines, or upgrade dependencies unless the fix inherently requires it.
- In place. Fix the sink where it lives. If the finding's
locationispkg/foo/bar.go:42, that is where the patch should land (or at the nearest layer where a guard is sensible — e.g. the input validator that feeds the sink). - Consistent. Match the existing code style and idioms. If the codebase uses a specific sanitiser, validator, or helper for similar cases, reuse it. Do not introduce a new helper module for a one-off fix.
- Safe. The patch must not break the reproduction's documented legitimate behaviour — only block the dangerous path. If you cannot tell where the dangerous path diverges from legitimate use, stop and write an inconclusive report (see below).
- Include a test when practical. If the repo has a test suite that covers the vulnerable code path, add a regression test that would fail without your patch. If the repo has no tests, or the sink is in a place that is hard to cover, skip this and say why in
rationale.
Once you have a working tree edit, generate a unified diff against HEAD:
cd src git add -N . git diff HEAD -- . > /tmp/patch.diffRead
/tmp/patch.diffand put its contents intoreport.jsonunder thepatchfield. Do not commit; the diff is the artefact. If the diff is empty, something went wrong — do not write an empty patch. Write{"error": "patch produced no diff"}and exit 0.POST a finding note summarising the patch:
POST {api_base}/findings/{finding_id}/noteswith:{ "body": "Proposed patch in scan #{scan_id}.\n\nFiles changed: ...\n\n{short rationale}\n\nApply with: `git apply` the diff from the scan report.", "by": "patch" }The note lives on the finding page; the full diff lives in
report.jsonand is viewable on the scan page.Do not PATCH any editable fields on the finding. Specifically:
- Do not set
fix_commit— that field means a shipped upstream fix, not a proposal. The analyst sets it after their PR merges. - Do not set
fix_version— same reason. - Do not touch
status. Lifecycle transitions belong to the analyst.
- Do not set
Write
./report.json:{ "patch": "diff --git a/pkg/foo/bar.go b/pkg/foo/bar.go\n...", "rationale": "Short prose — two or three sentences. What the guard is, why it blocks the trace, what legitimate input it still lets through.", "files_changed": ["pkg/foo/bar.go", "pkg/foo/bar_test.go"], "base_commit": "<HEAD sha from ./src>", "tests_added": true, "notes": "Optional: anything the analyst should know — a second sink you spotted but didn't patch, a style choice you weren't sure of, a test you couldn't write." }base_commitis the HEAD sha the diff applies to. The analyst needs this togit amorgit applycleanly — if they rebased since the scan, they know the patch may not apply and can regenerate.
Refusing to patch
Write {"error": "...", "rationale": "..."} and exit 0 in any of these cases — do not ship a bad patch:
- The finding prose is too thin (empty Trace, empty Validation). You need both to know where the sink is and what behaviour to stop.
- The fix is architectural (e.g. "rewrite this whole module to not shell out") rather than localisable. A patch skill proposes a surgical fix; larger changes are an issue comment for the maintainer, not a diff.
- The codebase is in a language or framework you cannot confidently edit without risking regressions. It is better to say so than to produce a plausible-looking but wrong patch.
- The finding has already been fixed upstream. Check
git log -- {location}— if a recent commit looks like it addressed the sink, surface the SHA innotesand refuse to duplicate.
Constraints
- Do not push. Do not commit. Do not open a PR. The scrutineer workspace is ephemeral and isolated; your diff is the only thing that survives the scan.
- Do not add dependencies unless the vulnerability genuinely requires one (e.g. a sanitiser library the codebase already uses elsewhere). New top-level deps in a patch almost always mean the fix is in the wrong place.
- Do not edit the lockfile, go.sum, Gemfile.lock, package-lock.json, Cargo.lock, etc. unless you also changed the manifest that owns it. Stray lockfile churn makes diffs hard to review.
- Do not touch files outside what the fix requires. CI config, docs unrelated to the fix, README — leave alone.
Source: alexandre-daubois/scrutineer — distributed by TomeVault.
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核