Codex

citation-guard

Verify citations against the research corpus to prevent hallucinated references and enforce GRADE compliance

104 stars

Best use case

citation-guard is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

It is a strong fit for teams already working in Codex.

Verify citations against the research corpus to prevent hallucinated references and enforce GRADE compliance

Teams using citation-guard should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/citation-guard/SKILL.md --create-dirs "https://raw.githubusercontent.com/jmagly/aiwg/main/.agents/skills/citation-guard/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/citation-guard/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How citation-guard Compares

Feature / Agentcitation-guardStandard Approach
Platform SupportCodexLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Verify citations against the research corpus to prevent hallucinated references and enforce GRADE compliance

Which AI agents support this skill?

This skill is designed for Codex.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# citation-guard

Automatically verify citations when agents generate content that makes factual claims or references research.

## Triggers


Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):

- "fabricated citations" / "hallucinated references" → citation authenticity check
- "DOI check" → citation DOI validation
- "verify sources" in research context → citation verification

## Purpose

This skill acts as a passive citation guard, activating whenever agents generate content that includes citations or factual claims requiring evidence. It prevents citation hallucination by verifying references exist before they are written.

## Behavior

When triggered, this skill:

1. **Intercept citation generation**:
   - Detect when an agent is about to write content with citations
   - Extract all REF-XXX, DOI, and @-mention references

2. **Verify against corpus**:
   - Check each reference exists in `.aiwg/research/sources/` or `.aiwg/research/findings/`
   - Validate REF-XXX identifiers match frontmatter
   - Flag any references not in corpus

3. **Check GRADE compliance**:
   - Load quality assessment for cited sources
   - Verify hedging language matches evidence quality level
   - Suggest language corrections if overclaiming detected

4. **Allow or warn**:
   - All citations valid: Proceed silently
   - GRADE violation: WARN with suggested language fix
   - Hallucinated citation: BLOCK with specific error

5. **Track gaps**:
   - Log uncitable claims to `.aiwg/research/TODO.md`
   - Track frequently needed but missing sources

## Activation Conditions

```yaml
activation:
  always_active_for:
    - technical-writer
    - documentation-synthesizer
    - requirements-analyst
    - architecture-designer
    - domain-expert
    - technical-researcher

  triggers_on_content:
    - pattern: "REF-\\d{3}"
    - pattern: "@\\.aiwg/research/"
    - pattern: "according to"
    - pattern: "research (shows|demonstrates|suggests|indicates)"
    - pattern: "\\(\\w+ et al\\., \\d{4}\\)"
```

## Integration

This skill uses:
- `project-awareness`: Load project's research corpus path
- Citation Verifier agent for deep verification when needed

## References

- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/rules/citation-policy.md - Citation policy rules
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/agents/citation-verifier.md - Citation Verifier agent
- @$AIWG_ROOT/agentic/code/frameworks/sdlc-complete/schemas/research/hallucination-detection.yaml - Detection patterns
- @.aiwg/research/docs/grade-assessment-guide.md - GRADE methodology

Related Skills

verify-citations

104
from jmagly/aiwg

Verify all citations in a document against the research corpus

Codex

citation-check

104
from jmagly/aiwg

Check a file for citation quality and GRADE compliance

Codex

citation-backfill

104
from jmagly/aiwg

Rebuild bidirectional citation edges across the research corpus. Scans outgoing citation tables, computes the inverse map, and rewrites all incoming tables to match. Fixes one-directional citation graphs after batch inductions.

Codex

aiwg-orchestrate

104
from jmagly/aiwg

Route structured artifact work to AIWG workflows via MCP with zero parent context cost

venv-manager

104
from jmagly/aiwg

Create, manage, and validate Python virtual environments. Use for project isolation and dependency management.

pytest-runner

104
from jmagly/aiwg

Execute Python tests with pytest, supporting fixtures, markers, coverage, and parallel execution. Use for Python test automation.

vitest-runner

104
from jmagly/aiwg

Execute JavaScript/TypeScript tests with Vitest, supporting coverage, watch mode, and parallel execution. Use for JS/TS test automation.

eslint-checker

104
from jmagly/aiwg

Run ESLint for JavaScript/TypeScript code quality and style enforcement. Use for static analysis and auto-fixing.

repo-analyzer

104
from jmagly/aiwg

Analyze GitHub repositories for structure, documentation, dependencies, and contribution patterns. Use for codebase understanding and health assessment.

pr-reviewer

104
from jmagly/aiwg

Review GitHub pull requests for code quality, security, and best practices. Use for automated PR feedback and approval workflows.

YouTube Acquisition

104
from jmagly/aiwg

yt-dlp patterns for acquiring content from YouTube and video platforms

Quality Filtering

104
from jmagly/aiwg

Accept/reject logic and quality scoring heuristics for media content