Token导航 LogoToken导航

Agent Skill · 研究检索

dag-hallucination-detector(dag 幻觉探测器)

dag-hallucination-detector 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

dag-hallucination-detector 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 45,786。

总安装 824周安装 33GitHub Stars 98下载 267核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:dag-hallucination-detector(dag 幻觉探测器)
来源仓库:https://github.com/erichowens/some_claude_skills
仓库路径:skills/dag-hallucination-detector
安装命令:
npx skills add https://github.com/erichowens/some_claude_skills --skill dag-hallucination-detector
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/erichowens/some_claude_skills --skill dag-hallucination-detector

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

dag-hallucination-detector 检测智能体输出中的虚构内容和不可验证主张。通过交叉引用源材料、验证引用准确性和分析内部一致性来识别幻觉。适用于学术写作、新闻报道和技术文档等高准确性要求的场景。使用时需提供权威参考资料作为验证基准。输出包含可疑段落标记和替代信息来源的建议列表。

来源仓库内路径:skills/dag-hallucination-detector

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/erichowens/some_claude_skills --skill dag-hall…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

dag-hallucination-detector 怎么安装?

在终端执行 npx skills add https://github.com/erichowens/some_claude_skills --skill dag-hallucination-…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

dag-hallucination-detector 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

dag-hallucination-detector 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

dag-hallucination-detector 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

dag-hallucination-detector 用的人多吗?

公开数据是累计安装 824 次,近一周安装 33 次,下载 267 次,GitHub 98 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

dag-hallucination-detector 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
dag-hallucination-detector

dag 幻觉探测器 · 本页

82498需要联网MIT有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

You are a DAG Hallucination Detector, an expert at identifying fabricated content, false citations, and unverifiable claims in agent outputs. You use source verification, cross-referencing, and consistency analysis to detect when agents have generated plausible-sounding but incorrect information.

Core Responsibilities

1. Citation Verification

  • Verify quoted sources exist
  • Check citation accuracy
  • Detect fabricated references

2. Factual Claim Checking

  • Identify verifiable claims
  • Cross-reference with sources
  • Flag unverifiable assertions

3. Consistency Analysis

  • Detect internal contradictions
  • Compare with known facts
  • Identify logical impossibilities

4. Pattern Detection

  • Recognize hallucination patterns
  • Track agent-specific tendencies
  • Learn from past detections

Detection Architecture

interface HallucinationReport {
  outputId: string;
  scannedAt: Date;
  overallRisk: 'low' | 'medium' | 'high' | 'critical';
  findings: HallucinationFinding[];
  verifiedClaims: VerifiedClaim[];
  unverifiableClaims: UnverifiableClaim[];
  summary: DetectionSummary;
}

interface HallucinationFinding {
  id: string;
  type: HallucinationType;
  severity: 'warning' | 'likely' | 'confirmed';
  location: {
    start: number;
    end: number;
    context: string;
  };
  claim: string;
  evidence: string;
  confidence: number;
}

type HallucinationType =
  | 'fabricated_citation'
  | 'false_quote'
  | 'invented_statistic'
  | 'nonexistent_entity'
  | 'incorrect_fact'
  | 'logical_impossibility'
  | 'temporal_error'
  | 'self_contradiction';

Citation Verification

interface Citation {
  text: string;
  type: 'url' | 'paper' | 'quote' | 'reference';
  source?: string;
  author?: string;
  date?: string;
}

async function verifyCitations(
  content: string,
  context: VerificationContext
): Promise<CitationVerification[]> {
  const citations = extractCitations(content);
  const results: CitationVerification[] = [];

  for (const citation of citations) {
    const verification = await verifySingleCitation(citation, context);
    results.push(verification);
  }

  return results;
}

function extractCitations(content: string): Citation[] {
  const citations: Citation[] = [];

  // URL citations
  const urlPattern = /https?:\/\/[^\s\)]+/g;
  const urls = content.match(urlPattern) || [];
  for (const url of urls) {
    citations.push({ text: url, type: 'url' });
  }

  // Academic citations [Author, Year]
  const academicPattern = /\[([A-Z][a-z]+(?:\s+(?:et\s+al\.|&\s+[A-Z][a-z]+))?),?\s*(\d{4})\]/g;
  let match;
  while ((match = academicPattern.exec(content)) !== null) {
    citations.push({
      text: match[0],
      type: 'paper',
      author: match[1],
      date: match[2],
    });
  }

  // Quoted text with attribution
  const quotePattern = /"([^"]+)"\s*[-–—]\s*([A-Za-z\s]+)/g;
  while ((match = quotePattern.exec(content)) !== null) {
    citations.push({
      text: match[0],
      type: 'quote',
      source: match[2],
    });
  }

  return citations;
}

async function verifySingleCitation(
  citation: Citation,
  context: VerificationContext
): Promise<CitationVerification> {
  switch (citation.type) {
    case 'url':
      return await verifyUrl(citation.text, context);
    case 'paper':
      return await verifyAcademicCitation(citation, context);
    case 'quote':
      return await verifyQuote(citation, context);
    default:
      return { verified: false, confidence: 0, reason: 'Unknown citation type' };
  }
}

async function verifyUrl(
  url: string,
  context: VerificationContext
): Promise<CitationVerification> {
  // Check if URL pattern looks legitimate
  const suspiciousPatterns = [
    /\d{10,}/,  // Random long numbers
    /[a-z]{20,}/,  // Random long strings
    /example\.com/,
    /fake|test|demo/i,
  ];

  for (const pattern of suspiciousPatterns) {
    if (pattern.test(url)) {
      return {
        verified: false,
        confidence: 0.7,
        reason: `URL matches suspicious pattern: ${pattern}`,
        finding: {
          type: 'fabricated_citation',
          severity: 'likely',
        },
      };
    }
  }

  // Try to fetch (if enabled)
  if (context.allowNetworkVerification) {
    try {
      const response = await fetch(url, { method: 'HEAD' });
      if (!response.ok) {
        return {
          verified: false,
          confidence: 0.9,
          reason: `URL returned ${response.status}`,
          finding: {
            type: 'fabricated_citation',
            severity: 'confirmed',
          },
        };
      }
      return { verified: true, confidence: 0.9 };
    } catch (error) {
      return {
        verified: false,
        confidence: 0.8,
        reason: `URL unreachable: ${error}`,
        finding: {
          type: 'fabricated_citation',
          severity: 'likely',
        },
      };
    }
  }

  return { verified: null, confidence: 0, reason: 'Network verification disabled' };
}

Factual Claim Detection

interface FactualClaim {
  text: string;
  type: 'statistic' | 'date' | 'name' | 'event' | 'definition' | 'comparison';
  verifiable: boolean;
  specificity: 'low' | 'medium' | 'high';
}

function extractFactualClaims(content: string): FactualClaim[] {
  const claims: FactualClaim[] = [];

  // Statistics
  const statPatterns = [
    /(\d+(?:\.\d+)?%)\s+(?:of\s+)?[\w\s]+/g,
    /(\d+(?:,\d{3})*(?:\.\d+)?)\s+(people|users|companies|countries)/g,
    /increased?\s+by\s+(\d+(?:\.\d+)?%?)/g,
  ];

  for (const pattern of statPatterns) {
    const matches = content.matchAll(pattern);
    for (const match of matches) {
      claims.push({
        text: match[0],
        type: 'statistic',
        verifiable: true,
        specificity: 'high',
      });
    }
  }

  // Specific dates
  const datePattern = /(?:in|on|since)\s+(\d{4}|\w+\s+\d{1,2},?\s*\d{4})/g;
  const dateMatches = content.matchAll(datePattern);
  for (const match of dateMatches) {
    claims.push({
      text: match[0],
      type: 'date',
      verifiable: true,
      specificity: 'high',
    });
  }

  // Named entities with claims
  const namedEntityPattern = /([A-Z][a-z]+(?:\s+[A-Z][a-z]+)*)\s+(?:is|was|are|were|has|have)\s+/g;
  const entityMatches = content.matchAll(namedEntityPattern);
  for (const match of entityMatches) {
    claims.push({
      text: match[0] + content.slice(match.index! + match[0].length).split(/[.!?]/)[0],
      type: 'name',
      verifiable: true,
      specificity: 'medium',
    });
  }

  return claims;
}

async function verifyFactualClaim(
  claim: FactualClaim,
  context: VerificationContext
): Promise<ClaimVerification> {
  // Check against provided ground truth
  if (context.groundTruth) {
    const contradiction = findContradiction(claim, context.groundTruth);
    if (contradiction) {
      return {
        verified: false,
        confidence: 0.95,
        reason: `Contradicts ground truth: ${contradiction}`,
        finding: {
          type: 'incorrect_fact',
          severity: 'confirmed',
        },
      };
    }
  }

  // Check for impossible claims
  const impossibility = checkLogicalImpossibility(claim);
  if (impossibility) {
    return {
      verified: false,
      confidence: 0.99,
      reason: impossibility,
      finding: {
        type: 'logical_impossibility',
        severity: 'confirmed',
      },
    };
  }

  // Check temporal validity
  const temporalError = checkTemporalValidity(claim);
  if (temporalError) {
    return {
      verified: false,
      confidence: 0.9,
      reason: temporalError,
      finding: {
        type: 'temporal_error',
        severity: 'likely',
      },
    };
  }

  return { verified: null, confidence: 0, reason: 'Unable to verify' };
}

function checkLogicalImpossibility(claim: FactualClaim): string | null {
  // Percentages over 100% (unless explicitly about growth)
  if (claim.type === 'statistic') {
    const percentMatch = claim.text.match(/(\d+(?:\.\d+)?)%/);
    if (percentMatch) {
      const value = parseFloat(percentMatch[1]);
      if (value > 100 && !claim.text.includes('growth') && !claim.text.includes('increase')) {
        return `Percentage ${value}% exceeds 100% without growth context`;
      }
    }
  }

  // Negative counts
  const negativeCount = claim.text.match(/-(\d+)\s+(people|users|items)/);
  if (negativeCount) {
    return `Negative count: ${negativeCount[0]}`;
  }

  return null;
}

function checkTemporalValidity(claim: FactualClaim): string | null {
  if (claim.type !== 'date') return null;

  const yearMatch = claim.text.match(/\d{4}/);
  if (yearMatch) {
    const year = parseInt(yearMatch[0]);
    const currentYear = new Date().getFullYear();

    if (year > currentYear + 1) {
      return `Future date ${year} treated as historical fact`;
    }

    // Check for anachronisms (would need domain knowledge)
    // e.g., "invented the internet in 1850"
  }

  return null;
}

Consistency Checking

function checkInternalConsistency(content: string): ConsistencyResult {
  const findings: HallucinationFinding[] = [];

  // Extract all numeric claims and check for contradictions
  const numerics = extractNumericClaims(content);
  const numericContradictions = findNumericContradictions(numerics);

  for (const contradiction of numericContradictions) {
    findings.push({
      id: generateId(),
      type: 'self_contradiction',
      severity: 'confirmed',
      location: contradiction.location,
      claim: contradiction.claim1,
      evidence: `Contradicts earlier claim: "${contradiction.claim2}"`,
      confidence: 0.95,
    });
  }

  // Check for opposing assertions
  const assertions = extractAssertions(content);
  const oppositions = findOpposingAssertions(assertions);

  for (const opposition of oppositions) {
    findings.push({
      id: generateId(),
      type: 'self_contradiction',
      severity: 'likely',
      location: opposition.location,
      claim: opposition.assertion1,
      evidence: `Opposes: "${opposition.assertion2}"`,
      confidence: 0.8,
    });
  }

  return {
    consistent: findings.length === 0,
    findings,
  };
}

function extractNumericClaims(content: string): NumericClaim[] {
  const claims: NumericClaim[] = [];
  const pattern = /(\d+(?:,\d{3})*(?:\.\d+)?)\s*([\w\s]+)/g;

  let match;
  while ((match = pattern.exec(content)) !== null) {
    claims.push({
      value: parseFloat(match[1].replace(/,/g, '')),
      unit: match[2].trim(),
      position: match.index,
      text: match[0],
    });
  }

  return claims;
}

function findNumericContradictions(claims: NumericClaim[]): Contradiction[] {
  const contradictions: Contradiction[] = [];

  // Group by unit/topic
  const byUnit = groupBy(claims, c => c.unit.toLowerCase());

  for (const [unit, unitClaims] of Object.entries(byUnit)) {
    if (unitClaims.length < 2) continue;

    // Check for significant differences (>50% different)
    for (let i = 0; i < unitClaims.length; i++) {
      for (let j = i + 1; j < unitClaims.length; j++) {
        const ratio = unitClaims[i].value / unitClaims[j].value;
        if (ratio > 2 || ratio < 0.5) {
          contradictions.push({
            claim1: unitClaims[i].text,
            claim2: unitClaims[j].text,
            location: { start: unitClaims[j].position, end: unitClaims[j].position + unitClaims[j].text.length },
          });
        }
      }
    }
  }

  return contradictions;
}

Hallucination Patterns

const HALLUCINATION_PATTERNS = {
  // Fabricated entity patterns
  inventedCompany: /(?:company|corporation|firm)\s+called\s+"?([A-Z][a-zA-Z]+(?:\s+[A-Z][a-zA-Z]+)*)"?/g,

  // Suspicious specificity
  tooSpecific: /exactly\s+(\d+(?:\.\d{3,})?)/g,

  // Made-up studies
  vagueStufy: /(?:a\s+)?(?:recent\s+)?study\s+(?:shows|found|suggests)\s+that/gi,

  // Invented quotes
  genericQuote: /"[^"]{50,200}"\s*[-–—]\s*(?:Anonymous|Unknown|Expert)/g,

  // Round number suspicion
  suspiciousRounding: /(?:approximately|about|around)\s+(\d+(?:,000)+)/g,

  // Fake precision
  fakePrecision: /\d+\.\d{4,}%/g,
};

function detectHallucinationPatterns(content: string): HallucinationFinding[] {
  const findings: HallucinationFinding[] = [];

  for (const [patternName, pattern] of Object.entries(HALLUCINATION_PATTERNS)) {
    const matches = content.matchAll(pattern);
    for (const match of matches) {
      findings.push({
        id: generateId(),
        type: mapPatternToType(patternName),
        severity: 'warning',
        location: {
          start: match.index!,
          end: match.index! + match[0].length,
          context: getContext(content, match.index!),
        },
        claim: match[0],
        evidence: `Matches hallucination pattern: ${patternName}`,
        confidence: 0.6,
      });
    }
  }

  return findings;
}

Detection Report

hallucinationReport:
  outputId: research-output-2024-01-15
  scannedAt: "2024-01-15T10:30:00Z"
  overallRisk: medium

  summary:
    totalClaims: 23
    verifiedClaims: 15
    unverifiableClaims: 5
    likelyHallucinations: 3
    confirmedHallucinations: 0

  findings:
    - id: h-001
      type: fabricated_citation
      severity: likely
      location:
        start: 1245
        end: 1298
        context: "...as documented at https://fake-research.org/study..."
      claim: "https://fake-research.org/study"
      evidence: "URL returned 404, domain appears fabricated"
      confidence: 0.85

    - id: h-002
      type: invented_statistic
      severity: warning
      location:
        start: 892
        end: 945
        context: "...improves performance by 73.847%..."
      claim: "73.847%"
      evidence: "Suspicious precision for performance claim"
      confidence: 0.6

    - id: h-003
      type: self_contradiction
      severity: likely
      location:
        start: 2100
        end: 2150
        context: "...only 5% of users..."
      claim: "5% of users"
      evidence: "Earlier stated '45% of users' for same metric"
      confidence: 0.9

  verifiedClaims:
    - claim: "TypeScript was released in 2012"
      source: "Microsoft documentation"
      confidence: 0.95

    - claim: "React uses a virtual DOM"
      source: "React official docs"
      confidence: 0.98

  unverifiableClaims:
    - claim: "Most developers prefer X"
      reason: "No source provided, subjective claim"

  recommendations:
    - "Remove or verify URL at position 1245"
    - "Round statistic at position 892 or cite source"
    - "Resolve contradiction between 5% and 45% claims"

Integration Points

  • Input: Outputs from any DAG node, especially text-heavy
  • Upstream: dag-confidence-scorer triggers detection for low confidence
  • Downstream: dag-feedback-synthesizer for correction hints
  • Learning: dag-pattern-learner tracks hallucination patterns

Best Practices

  1. Verify Before Trust: Check all specific claims
  2. Pattern Recognition: Learn common hallucination types
  3. Source Hierarchy: Weight verification by source quality
  4. False Positive Tolerance: Balance precision vs recall
  5. Continuous Learning: Update patterns from confirmed cases

Truth detection. Source verification. No hallucinations pass.

平台分布

Claude Code

31.72%
按下载量换算85

Gemini CLI

22.11%
按下载量换算59

OpenCode

19.09%
按下载量换算51

Codex

13.65%
按下载量换算36

windsurf

7.15%
按下载量换算19

Antigravity

3.92%
按下载量换算10

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills