← LeaderboardThe Skill Leaderboard

dialectic-citation-guard

Verify code citations within ±4 lines and route multi-agent debates across 4 risk tiers to stop hallucinated line numbers and sycophancy.

Published by sickn33 ↗sickn33/agentic-awesome-skills

Try your first task

A source-grounded starter task has not been verified for this skill yet.

SKILL.md

name: dialectic-citation-guarddescription: "Verify code citations within ±4 lines and route multi-agent debates across 4 risk tiers to stop hallucinated line numbers and sycophancy."category: developmentrisk: safesource: selfsource_type: selflicense: MITlicense_source: "https://github.com/Tomsabay/dialectic-agent-kit/blob/c8b8751a182b59146d768df9d1221c68a53a7d72/LICENSE"date_added: "2026-11-29"author: Tomsabaytags: [multi-agent, verification, citations, code-review, guardrails]

DIALECTIC Citation Guard & 4-Tier Consensus Router

Overview

Multi-agent code reviews and critic/proposer debates frequently suffer from two failure modes: fabricated file/line citations accepted uncritically by downstream agents (sycophancy), and multi-round debate token blowup on low-risk tasks. This skill enforces deterministic verbatim citation checks against actual workspace files before any claim enters consensus, paired with a four-tier risk router (T0–T3).

When to Use

  • Running a multi-agent code review, architecture audit, or root-cause analysis where agents cite specific files and line numbers.
  • Controlling token spend and debate rounds in orchestrator/critic pipelines without sacrificing factual precision.
  • Do not use this skill as a replacement for running a compiler or test suite; it verifies source claims, not runtime behavior.

Prerequisites

  • Read access to the local repository files being cited.
  • No network access, API keys, or external packages are required for the core verification rules.

How It Works

1. Establish the inputs

Collect the proposed finding or claim, including each cited path, line number, and verbatim quote, alongside the task risk tier (T0 trivial, T1 standard, T2 stateful/security, T3 destructive/irreversible). Treat agent outputs as untrusted data until checked against disk.

2. Verify every citation within ±4 lines

  1. Resolve the cited path, including symlinks. Read only regular files inside the authorized workspace. Reject paths outside it and files containing secrets.
  2. Read the window [max(1, line - 4), line + 4].
  3. First search for the literal quote. If it is absent, compare with whitespace normalized on both sides and disclose any normalized match. Classify the result using the actual line span.
  4. Classify each citation as exact_line_match, window_match, quote_not_found, or file_not_found.
  5. Reject or strip any finding whose supporting citation returns quote_not_found or file_not_found before passing it to the next debate round.

3. Route debate depth by consensus tier

  • T0 (fast path): single verified pass; skip multi-agent critique.
  • T1 (single critic): ask an authorized local verifier to check the citations when available. Otherwise verify the citations directly and disclose the scope.
  • T2 (structured debate): use up to two rounds of independent critique when the user authorizes delegation. Escalate unresolved verified conflicts.
  • T3 (human gate): require verified citations, explicit blast radius, and user confirmation before execution.

4. Verify the result

Report the exact count of verified vs. rejected citations, the consensus tier applied, and whether any claim was dropped for failing verbatim verification.

Examples

User request: Audit this multi-agent bug report before applying the patch.
Inputs: Claim citing `auth.py:42` with quote `if token is None: return True` and local file `auth.py`.
Expected result (illustrative): Checks lines 38-46 of `auth.py`, reports `quote_not_found`, blocks the hallucinated claim from consensus, and flags the finding for re-inspection.

Limitations

  • Verifies textual fidelity within a ±4 line window, not semantic correctness or runtime execution.
  • Very large generated or minified single-line files require excerpting before line-window comparison.

Safety and side effects

Read-only inspection of local workspace files (risk: safe). Keep the default workflow local. Get separate approval for any external review and the exact excerpts it would receive. Keep secrets out of citation excerpts and logs.

Sources and related skills

dialectic-citation-guard by sickn33 · The Skill Leaderboard