doublecheck by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill doublecheck对 AI 生成的内容运行三层验证流程。目标不是告诉用户什么是正确的——而是提取每一个可验证的声明,找到用户可以独立核实的来源,并标记任何看起来像是幻觉模式的内容。
Doublecheck 有两种模式:主动模式(持续)和单次模式(按需)。
当用户调用此技能但未提供特定文本进行验证时,激活持续性的 doublecheck 模式。回复如下:
Doublecheck 现已激活。 我将在呈现回复前验证其中的事实性声明。在每个实质性回复后,您会看到一个内联的验证摘要。在任何回复后说"完整报告"以获取包含详细来源的三层完整验证。随时可以通过说"关闭 doublecheck"来关闭它。
然后在对话的剩余时间里遵循以下所有规则:
规则:在发送前对每个回复进行分类。
在生成任何实质性回复之前,确定其是否包含可验证的声明。对回复进行分类:
| 回复类型 | 包含可验证声明? | 操作 |
|---|---|---|
| 事实分析、法律指导、法规解读、合规指导,或包含案例引用或法规引用的内容 | 是——高密度 | 运行完整验证报告(见下文高风险内容规则) |
| 文档、研究或数据摘要 | 是——中等密度 | 对关键声明运行内联验证 |
| 代码生成、创意写作、头脑风暴 | 很少 | 跳过验证;注明 doublecheck 模式不适用于此类内容 |
| 随意对话、澄清问题、状态更新 | 否 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 静默跳过验证 |
规则:主动模式的内联验证。
当主动模式适用时,不要为每个回复生成单独的完整验证报告。相反,使用以下模式将验证直接嵌入到您的回复中:
验证 部分。格式:
---
**验证(已检查 N 个声明)**
- [已验证] "声明文本" -- 来源:[URL]
- [已验证] "声明文本" -- 来源:[URL]
- [可信] "声明文本" -- 未找到具体来源
- [捏造风险] "声明文本" -- 未能找到此引用;请在使用前核实
对于主动模式,优先考虑速度。对引用、特定统计数据以及任何您置信度较低的声明进行网络搜索。您不需要搜索那些常识性或您有高置信度的声明——只需将它们评为"可信"并继续。
如果任何声明被评为"有争议"或"捏造风险",请在验证部分之前突出指出,以便用户立即看到。当自动升级适用时(见下文),将此提示放在完整报告的顶部、摘要表之前:
**请注意:** 我对 [具体声明] 没有把握。我找不到支持它的来源。您在使用前应独立核实。
规则:对高风险发现自动升级为完整报告。
如果您的内联验证发现任何被评为"有争议"或"捏造风险"的声明,不要生成内联验证。相反,将"请注意"提示放在回复的顶部,然后使用 assets/verification-report-template.md 中的模板生成完整的三层验证报告。当某些内容明显错误时,用户不应需要请求详细报告。
规则:高风险内容的完整报告。
如果回复包含法律分析、法规解读、合规指导、案例引用或法规引用,始终使用 assets/verification-report-template.md 中的模板生成完整验证报告。不要对这些内容类型使用内联验证——对于这种高风险内容,简略格式不合适。
规则:内联验证的可发现性页脚。
当生成内联验证(非完整报告)时,始终在验证部分末尾附加以下行:
_说"完整报告"以获取包含来源的详细三层验证。_
规则:应请求提供完整验证。
如果用户说"完整报告"、"运行完整验证"、"验证那个"、"doublecheck 那个"或类似的话,运行完整的三层流程(如下所述),并使用 assets/verification-report-template.md 中的模板生成完整报告。
当用户调用此技能并提供特定文本进行验证(或引用之前的输出)时,运行完整的三层流程,并使用 assets/verification-report-template.md 中的模板生成完整验证报告。
当用户说"关闭 doublecheck"、"停止 doublecheck"或类似的话时,回复:
Doublecheck 现已关闭。 我将正常回复,不进行内联验证。您可以随时重新激活它。
以批判性的视角重读目标文本。您在这一层的任务是提取和内部分析——暂时不进行网络搜索。
逐句检查目标文本,提取每一个断言了可验证内容的陈述。对每个声明进行分类:
| 类别 | 寻找什么 | 示例 |
|---|---|---|
| 事实性 | 关于事物如何或曾经如何的断言 | "Python 创建于 1991 年","GPL 要求衍生作品开源" |
| 统计性 | 数字、百分比、数量 | "95% 的企业使用云服务","合同有 30 天终止条款" |
| 引用 | 对特定文档、案例、法律、论文或标准的引用 | "根据 CDA 第 230 条...","在 Mayo v. Prometheus (2012) 案中..." |
| 实体 | 关于特定人物、组织、产品或地点的声明 | "OpenAI 由 Sam Altman 和 Elon Musk 创立","GDPR 适用于欧盟居民" |
| 因果性 | 声称 X 导致 Y 或 X 引发 Y 的声明 | "此漏洞允许远程代码执行","该法规是为应对 2008 年金融危机而通过的" |
| 时间性 | 日期、时间线、事件序列 | "截止日期是 3 月 15 日","2.0 版本在安全补丁之前发布" |
为每个声明分配一个临时 ID(C1, C2, C3...),以便在后续层中跟踪。
对照彼此审查提取的声明:
立即标记任何内部矛盾——这些问题无需外部验证即可识别。
仅基于您自己的知识对每个声明进行初步评估:
记录您的初始置信度,但暂时不要将其作为发现报告。这是第 2 层的输入,不是输出。
对每个提取的声明,搜索外部证据。本层的目的是找到用户可以访问以独立验证声明的 URL。
对于每个声明:
制定搜索查询,以找到主要来源。对于引用,搜索确切的标题或案例名称。对于统计数据,搜索具体的数字和主题。对于事实性声明,搜索关键实体和关系。
运行搜索,使用 web_search。如果第一次搜索没有返回相关结果,重新制定查询并用不同的术语再试一次。
评估您找到的内容:
记录结果,并附上来源 URL。即使您也总结了来源所说的内容,也始终提供 URL。
优先选择主要和权威来源:
注意来源是次要的(新闻文章、博客文章、维基页面)还是主要的。用户可以据此权衡。
引用是幻觉风险最高的类别。对于任何引用特定案例、法规、论文、标准或文档的声明:
完全切换您的立场。在第 1 层和第 2 层,您试图理解和验证输出。在这一层,假设输出包含错误,并积极尝试找出它们。
检查以下常见模式:
对于每个通过第 1 层和第 2 层的主要声明,问:
如果发现以下任何情况,请在报告中突出标记:
完成所有三层后,使用 assets/verification-report-template.md 中的模板生成报告。
为每个声明分配最终评级:
| 评级 | 含义 | 用户应该做什么 |
|---|---|---|
| 已验证 | 找到并链接了支持来源 | 如果该声明对您的工作至关重要,请抽查来源链接 |
| 可信 | 与常识一致,未找到具体来源 | 视为合理但未经证实;如果依赖其做决定,请独立核实 |
| 未验证 | 未能找到支持或矛盾的证据 | 在没有独立核实的情况下,不要依赖此声明 |
| 有争议 | 从可信来源找到了矛盾的证据 | 查看矛盾来源;此声明可能是错误的 |
| 捏造风险 | 符合幻觉模式(例如,找不到的引用、无来源的精确统计数据) | 假设这是错误的,直到您能从主要来源确认它 |
始终在报告末尾包含以下内容:
此验证的局限性:
- 此工具加速了人工验证;它不能替代人工验证。
- 网络搜索结果可能不包括最新信息或付费墙后的来源。
- 对抗性审查使用了可能产生原始输出的同一底层模型。它能发现许多问题,但无法发现所有问题。
- 评级为"已验证"的声明意味着找到了支持来源,并不代表该声明绝对正确。来源也可能出错。
- 评级为"可信"的声明仍可能是错误的。没有矛盾证据并不能证明其准确性。
法律内容具有较高的幻觉风险,因为:
对于法律内容,要特别仔细审查:案例引用、法规引用、法规解读和司法管辖区声明。尽可能搜索法律数据库。
每周安装数
473
仓库
GitHub 星标数
26.7K
首次出现
12 天前
安全审计
已安装于
gemini-cli419
codex417
opencode409
github-copilot406
cursor406
kimi-cli402
Run a three-layer verification pipeline on AI-generated output. The goal is not to tell the user what is true -- it is to extract every verifiable claim, find sources the user can check independently, and flag anything that looks like a hallucination pattern.
Doublecheck operates in two modes: active mode (persistent) and one-shot mode (on demand).
When the user invokes this skill without providing specific text to verify, activate persistent doublecheck mode. Respond with:
Doublecheck is now active. I'll verify factual claims in my responses before presenting them. You'll see an inline verification summary after each substantive response. Say "full report" on any response to get the complete three-layer verification with detailed sourcing. Turn it off anytime by saying "turn off doublecheck."
Then follow ALL of the rules below for the remainder of the conversation:
Rule: Classify every response before sending it.
Before producing any substantive response, determine whether it contains verifiable claims. Classify the response:
| Response type | Contains verifiable claims? | Action |
|---|---|---|
| Factual analysis, legal guidance, regulatory interpretation, compliance guidance, or content with case citations or statutory references | Yes -- high density | Run full verification report (see high-stakes content rule below) |
| Summary of a document, research, or data | Yes -- moderate density | Run inline verification on key claims |
| Code generation, creative writing, brainstorming | Rarely | Skip verification; note that doublecheck mode doesn't apply to this type of content |
| Casual conversation, clarifying questions, status updates | No | Skip verification silently |
Rule: Inline verification for active mode.
When active mode applies, do NOT generate a separate full verification report for every response. Instead, embed verification directly into your response using this pattern:
Verification section.Format:
---
**Verification (N claims checked)**
- [VERIFIED] "Claim text" -- Source: [URL]
- [VERIFIED] "Claim text" -- Source: [URL]
- [PLAUSIBLE] "Claim text" -- no specific source found
- [FABRICATION RISK] "Claim text" -- could not find this citation; verify before relying on it
For active mode, prioritize speed. Run web searches for citations, specific statistics, and any claim you have low confidence about. You do not need to search for claims that are common knowledge or that you have high confidence about -- just rate them PLAUSIBLE and move on.
If any claim rates DISPUTED or FABRICATION RISK, call it out prominently before the verification section so the user sees it immediately. When auto-escalation applies (see below), place this callout at the top of the full report, before the summary table:
**Heads up:** I'm not confident about [specific claim]. I couldn't find a supporting source. You should verify this independently before relying on it.
Rule: Auto-escalate to full report for high-risk findings.
If your inline verification identifies ANY claim rated DISPUTED or FABRICATION RISK, do not produce inline verification. Instead, place the "Heads up" callout at the top of your response and then produce the full three-layer verification report using the template in assets/verification-report-template.md. The user should not have to ask for the detailed report when something is clearly wrong.
Rule: Full report for high-stakes content.
If the response contains legal analysis, regulatory interpretation, compliance guidance, case citations, or statutory references, always produce the full verification report using the template in assets/verification-report-template.md. Do not use inline verification for these content types -- the stakes are too high for the abbreviated format.
Rule: Discoverability footer for inline verification.
When producing inline verification (not a full report), always append this line at the end of the verification section:
_Say "full report" for detailed three-layer verification with sources._
Rule: Offer full verification on request.
If the user says "full report," "run full verification," "verify that," "doublecheck that," or similar, run the complete three-layer pipeline (described below) and produce the full report using the template in assets/verification-report-template.md.
When the user invokes this skill and provides specific text to verify (or references previous output), run the complete three-layer pipeline and produce a full verification report using the template in assets/verification-report-template.md.
When the user says "turn off doublecheck," "stop doublecheck," or similar, respond with:
Doublecheck is now off. I'll respond normally without inline verification. You can reactivate it anytime.
Re-read the target text with a critical lens. Your job in this layer is extraction and internal analysis -- no web searches yet.
Go through the target text sentence by sentence and pull out every statement that asserts something verifiable. Categorize each claim:
| Category | What to look for | Examples |
|---|---|---|
| Factual | Assertions about how things are or were | "Python was created in 1991", "The GPL requires derivative works to be open-sourced" |
| Statistical | Numbers, percentages, quantities | "95% of enterprises use cloud services", "The contract has a 30-day termination clause" |
| Citation | References to specific documents, cases, laws, papers, or standards | "Under Section 230 of the CDA...", "In Mayo v. Prometheus (2012)..." |
| Entity | Claims about specific people, organizations, products, or places | "OpenAI was founded by Sam Altman and Elon Musk", "GDPR applies to EU residents" |
| Causal | Claims that X caused Y or X leads to Y | "This vulnerability allows remote code execution", "The regulation was passed in response to the 2008 financial crisis" |
| Temporal | Dates, timelines, sequences of events | "The deadline is March 15", "Version 2.0 was released before the security patch" |
Assign each claim a temporary ID (C1, C2, C3...) for tracking through subsequent layers.
Review the extracted claims against each other:
Flag any internal contradictions immediately -- these don't need external verification to identify as problems.
For each claim, make an initial assessment based only on your own knowledge:
Record your initial confidence but do NOT report it as a finding yet. This is input for Layer 2, not output.
For each extracted claim, search for external evidence. The purpose of this layer is to find URLs the user can visit to verify claims independently.
For each claim:
Formulate a search query that would surface the primary source. For citations, search for the exact title or case name. For statistics, search for the specific number and topic. For factual claims, search for the key entities and relationships.
Run the search using web_search. If the first search doesn't return relevant results, reformulate and try once more with different terms.
Evaluate what you find:
Record the result with the source URL. Always provide the URL even if you also summarize what the source says.
Prefer primary and authoritative sources:
Note when a source is secondary (news article, blog post, wiki page) vs. primary. The user can weigh accordingly.
Citations are the highest-risk category for hallucinations. For any claim that cites a specific case, statute, paper, standard, or document:
Switch your posture entirely. In Layers 1 and 2, you were trying to understand and verify the output. In this layer, assume the output contains errors and actively try to find them.
Check for these common patterns:
Fabricated citations -- The text cites a specific case, paper, or statute that you could not find in Layer 2. This is the most dangerous hallucination pattern because it looks authoritative.
Precise numbers without sources -- The text states a specific statistic (e.g., "78% of companies...") without indicating where the number comes from. Models often generate plausible-sounding statistics that are entirely made up.
Confident specificity on uncertain topics -- The text states something very specific about a topic where specifics are genuinely unknown or disputed. Watch for exact dates, precise dollar amounts, and definitive attributions in areas where experts disagree.
Plausible-but-wrong associations -- The text associates a concept, ruling, or event with the wrong entity. For example, attributing a ruling to the wrong court, assigning a quote to the wrong person, or describing a law's provision incorrectly while getting the law's name right.
Temporal confusion -- The text describes something as current that may be outdated, or describes a sequence of events in the wrong order.
Overgeneralization -- The text states something as universally true when it applies only in specific jurisdictions, contexts, or time periods. Common in legal and regulatory content.
Missing qualifiers -- The text presents a nuanced topic as settled or straightforward when significant exceptions, limitations, or counterarguments exist.
For each major claim that passed Layers 1 and 2, ask:
If you find any of these, flag them prominently in the report:
After completing all three layers, produce the report using the template in assets/verification-report-template.md.
Assign each claim a final rating:
| Rating | Meaning | What the user should do |
|---|---|---|
| VERIFIED | Supporting source found and linked | Spot-check the source link if the claim is critical to your work |
| PLAUSIBLE | Consistent with general knowledge, no specific source found | Treat as reasonable but unconfirmed; verify independently if relying on it for decisions |
| UNVERIFIED | Could not find supporting or contradicting evidence | Do not rely on this claim without independent verification |
| DISPUTED | Found contradicting evidence from a credible source | Review the contradicting source; this claim may be wrong |
| FABRICATION RISK | Matches hallucination patterns (e.g., unfindable citation, unsourced precise statistic) | Assume this is wrong until you can confirm it from a primary source |
Always include this at the end of the report:
Limitations of this verification:
- This tool accelerates human verification; it does not replace it.
- Web search results may not include the most recent information or paywalled sources.
- The adversarial review uses the same underlying model that may have produced the original output. It catches many issues but cannot catch all of them.
- A claim rated VERIFIED means a supporting source was found, not that the claim is definitely correct. Sources can be wrong too.
- Claims rated PLAUSIBLE may still be wrong. The absence of contradicting evidence is not proof of accuracy.
Legal content carries elevated hallucination risk because:
For legal content, give extra scrutiny to: case citations, statutory references, regulatory interpretations, and jurisdictional claims. Search legal databases when possible.
Weekly Installs
473
Repository
GitHub Stars
26.7K
First Seen
12 days ago
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
gemini-cli419
codex417
opencode409
github-copilot406
cursor406
kimi-cli402
AI 代码实施计划编写技能 | 自动化开发任务分解与 TDD 流程规划工具
42,300 周安装