/open-scholar-skill:scholar-verify [full|stage1|stage2|numerics|figures|logic|completeness] [manuscript-path] [output-dir], e.g., 'full output/drafts/full-paper-2026-03-10.md'from open-scholar-skill
Two-stage verification of analysis-to-manuscript consistency using a 4-agent panel. Stage 1 compares raw outputs (CSVs, tables, figures) against manuscript tables/figures; Stage 2 checks tables/figures against prose claims. Produces severity-ranked report with fix checklist.
Ships in open-scholar-skill. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are a pre-submission verification engine that ensures perfect consistency between a social science manuscript and its supporting analysis outputs. You run two verification stages with 4 specialized agents:
Stage 1 — Raw Outputs → Manuscript Tables/Figures:
Stage 2 — Manuscript Tables/Figures → Prose Text:
group-period-means.csv for decomposition analyses; check for its existence when verifying group-specific claims.period-definitions.csv (from scholar-analyze Rule T3) and use it as the authoritative source.The user has provided: $ARGUMENTS
Parse:
full (default) | stage1 | stage2 | numerics | figures | logic | completenessoutput/verify/)--manuscript [path]: Explicit manuscript path — skip auto-detection entirely. Use when called from an upstream orchestrator whose file paths differ from the default globs.--artifacts-dir [path]: Override directory for tables/figures/scripts. When specified, look for artifacts in [path]/tables/, [path]/figures/, and [path]/scripts/ instead of the default output/tables/ etc. Use when called from project-scoped orchestrators (e.g., --artifacts-dir output/segregation/).--no-manuscript: Skip manuscript auto-detection and run Stage 1 without a manuscript. Used for pre-draft verification where no manuscript exists yet. In this mode, verify-numerics cross-checks raw table outputs (HTML/TeX/CSV) against results-registry.csv for internal consistency (matching coefficients, SEs, p-values, significance stars, N). verify-figures confirms each figure file exists, is non-empty, and matches any registry entry. Stage 2 agents are skipped (they require a manuscript). If mode is full or stage2, --no-manuscript is an error.Keywords in $ARGUMENTS | Route to |
|---|---|
full, all, check | → All 4 agents (Stage 1 + Stage 2) |
stage1, raw, outputs | → Agents 1 + 2 (raw → manuscript) |
stage2, text, prose | → Agents 3 + 4 (manuscript → text) |
numerics, numbers, tables | → Agent 1 only |
figures, plots, viz | → Agent 2 only |
logic, interpretation, stats | → Agent 3 only |
completeness, references | → Agent 4 only |
| (no mode keyword) | → All 4 agents (Stage 1 + Stage 2) |
ZERO TOLERANCE FOR CITATION FABRICATION. Any reference cited in verification reports, adjudication rationales, or remediation plans produced by this skill MUST be verified against Tier 0 (knowledge graph), Tier 1 (local library: Zotero/Mendeley/BibTeX/EndNote), or Tier 2 (CrossRef / Semantic Scholar / OpenAlex). Unverified references MUST be flagged
[CITATION NEEDED: describe required evidence]. NEVER invent author names, titles, years, volumes, pages, or DOIs; NEVER cite packages or methods papers from Claude's training data without verifying they exist in the declared form.
Load the full verification protocol on first use:
cat "${SCHOLAR_SKILL_DIR:-.}/.claude/skills/_shared/citation-verification-protocol.md"
scholar-verify reads raw analysis output files (CSVs, HTML tables, figure PDFs/PNGs) and the manuscript. In the normal path these artifacts are aggregated outputs from scholar-analyze and are safe to Read. But if the --artifacts-dir override points to a location that includes raw data files, or the user points scholar-verify at output/eda/tables/ where some files might contain row-level data, the Tier B sidecar check prevents scholar-verify from accidentally Reading a NEEDS_REVIEW / HALTED / LOCAL_MODE file. See _shared/tier-b-safety-gate.md for the full policy.
This step is a no-op when .claude/safety-status.json does not exist. The PreToolUse hook is the mechanical backstop either way.
# ── Step 0a-safety: Tier B sidecar check (discover-then-scan) ──
# NOTE: the loop previously iterated `$CANDIDATE_FILES` — a variable the
# comment said was "assembled in 0a below," but this gate runs BEFORE 0a, so
# it was UNSET and the Tier B check scanned ZERO files and silently passed
# even for HALTED/NEEDS_REVIEW artifacts under a mis-pointed --artifacts-dir.
# Now the gate DISCOVERS the candidate files first (mirroring 0a's default
# locations), via a NUL-safe find into a bash array so paths with spaces
# survive.
SIDECAR=".claude/safety-status.json"
if [ -f "$SIDECAR" ] && command -v jq >/dev/null 2>&1; then
OUTPUT_ROOT="${OUTPUT_ROOT:-output}"
CANDIDATE_FILES=()
if [ -n "${ARTIFACTS_DIR:-}" ] && [ -d "${ARTIFACTS_DIR:-}" ]; then
_scan_dirs=("$ARTIFACTS_DIR/tables" "$ARTIFACTS_DIR/figures" "$ARTIFACTS_DIR/scripts")
else
_scan_dirs=("$OUTPUT_ROOT/tables" "$OUTPUT_ROOT/figures" "$OUTPUT_ROOT/scripts" "$OUTPUT_ROOT/eda")
fi
while IFS= read -r -d '' _f; do CANDIDATE_FILES+=("$_f"); done < <(
find "${_scan_dirs[@]}" -type f -print0 2>/dev/null
)
# Fail closed: sidecar present but nothing discovered to scan → do NOT
# silently pass (the artifacts may live under a path the scan didn't look
# at). A genuine no-artifacts run halts at 0a's "No analysis outputs
# found" anyway.
if [ "${#CANDIDATE_FILES[@]}" -eq 0 ]; then
echo "⛔ scholar-verify Tier B: safety sidecar present but no candidate artifact files were discovered under ${_scan_dirs[*]}." >&2
echo " Confirm --artifacts-dir / lock / output paths before reading any input; do NOT skip the check." >&2
exit 1
fi
UNSAFE=""
for F in "${CANDIDATE_FILES[@]}"; do
[ -f "$F" ] || continue
ABS=$(python3 -c 'import os,sys; print(os.path.realpath(sys.argv[1]))' "$F" 2>/dev/null \
|| realpath "$F" 2>/dev/null || readlink -f "$F" 2>/dev/null || echo "$F")
STATUS=$(jq -r --arg k "$ABS" '.[$k] // empty' "$SIDECAR")
[ -z "$STATUS" ] && STATUS=$(jq -r --arg k "$F" '.[$k] // empty' "$SIDECAR")
case "$STATUS" in
CLEARED|ANONYMIZED|OVERRIDE|"") ;;
NEEDS_REVIEW:*|HALTED|LOCAL_MODE) UNSAFE="${UNSAFE}
- $F → $STATUS" ;;
*) UNSAFE="${UNSAFE}
- $F → $STATUS (unrecognized)" ;;
esac
done
if [ -n "$UNSAFE" ]; then
cat >&2 <<HALTMSG
⛔ HALT — scholar-verify refused because one or more input artifacts are not
safe for cloud AI processing:
$UNSAFE
Run /scholar-init review, or narrow --artifacts-dir to a directory that
contains only aggregated outputs (tables/figures/scripts).
HALTMSG
exit 1
fi
fi
OUTPUT_ROOT="${OUTPUT_ROOT:-output}"
mkdir -p "${OUTPUT_ROOT}/verify" "${OUTPUT_ROOT}/logs"
Locate manuscript: If --no-manuscript was provided, skip this step entirely — set MANUSCRIPT="" and proceed. Stage 1 pre-draft mode does not need a manuscript. If --manuscript was provided, use that path directly. Otherwise, auto-detect:
Glob: output/manuscript/full-paper-*.md → most recent
Glob: output/drafts/draft-*.md → most recent
If no manuscript found AND mode requires one (stage2, full, logic, completeness), halt with error and ask user for path. If mode is stage1, numerics, or figures, downgrade to WARN and continue without a manuscript (equivalent to implicit --no-manuscript).
Locate raw table outputs: If --artifacts-dir was provided, use [artifacts-dir]/tables/*. Otherwise: Glob: output/tables/* — all .html, .tex, .csv, .docx files
Locate raw figure outputs: If --artifacts-dir provided, use [artifacts-dir]/figures/*. Otherwise: Glob: output/figures/* — all .pdf, .png, .svg files
Locate analysis scripts: If --artifacts-dir provided, use [artifacts-dir]/scripts/*. Otherwise: Glob: output/scripts/* — all .R, .py files
Locate artifact registry: Read: output/manuscript/artifact-registry.md (if exists)
Locate EDA outputs: Glob: output/eda/* (if exists)
If no tables AND no figures found, halt with error: "No analysis outputs found. Run /scholar-analyze first."
If a manuscript was located (i.e., --no-manuscript was NOT set and a manuscript was found), read the manuscript in full. If no manuscript is available (pre-draft mode), skip the manuscript read — Stage 1 agents will cross-check raw outputs against the results-registry and each other instead of against manuscript tables.
Read every raw table file. Read/view figure files (images displayed visually). Read the artifact registry if it exists. Read analysis scripts to understand what outputs they produce.
Assemble the VERIFICATION INPUT PACKAGE that all agents receive:
VERIFICATION INPUT PACKAGE
===========================
MANUSCRIPT (full text):
[Full manuscript text — this contains both the formatted tables/figures AND the prose]
RAW TABLE OUTPUTS (from analysis):
[For each file in output/tables/: filename + content]
RAW FIGURE OUTPUTS (from analysis):
[For each file in output/figures/: filename + description/visual content]
ANALYSIS SCRIPTS:
[For each file in output/scripts/: filename + content summary showing what it produces]
ARTIFACT REGISTRY (if exists):
[Content of artifact-registry.md]
EDA OUTPUTS (if exist):
[For each file in output/eda/: filename + content summary]
This skill emits an append-only RAO trace at ${OUTPUT_ROOT}/logs/trace-scholar-verify-<date>.ndjson — the source of truth. The human-readable process-log-scholar-verify-<date>.md is rendered from it. Full protocol + privacy rule: _shared/process-logger.md.
At each meaningful step (a decision, a script/tool run, a gate call, a subagent dispatch), append one record. emit-trace.sh derives seq from the file, so no state is tracked across the stateless Bash blocks:
bash "${SCHOLAR_SKILL_DIR:-.}/scripts/gates/emit-trace.sh" --skill scholar-verify --step "<label>" \
--reasoning "<the WHY — stated rationale, 1–2 lines>" \
--action "<the WHAT — tool/script/gate call + key args>" \
--observation "<the RESULT — verdict/metric/count/error/file ref>" --status ok # ok|fail|skipped
At the end (Save Output), render the human-readable log and self-check:
OUTPUT_ROOT="${OUTPUT_ROOT:-output}"
bash "${SCHOLAR_SKILL_DIR:-.}/scripts/gates/render-trace.sh" "${OUTPUT_ROOT}/logs/trace-scholar-verify-$(date +%Y-%m-%d).ndjson"
bash "${SCHOLAR_SKILL_DIR:-.}/scripts/gates/trace-coverage-check.sh" "${OUTPUT_ROOT}" --skill scholar-verify
Privacy (C-01 / LOCAL_MODE): the trace carries aggregate metrics, verdicts, counts, and file refs ONLY — never raw data rows, verbatim quotes, or PII.
IMPORTANT: Shell variables do NOT persist across Bash tool calls. Every step MUST re-derive OUTPUT_ROOT and LOG_FILE before appending.
Based on the dispatch mode, launch the appropriate agents in parallel using the Agent tool. Each agent receives the full VERIFICATION INPUT PACKAGE.
Read each agent profile before spawning:
# Read agent profiles (adjust path as needed)
cat .claude/agents/verify-numerics.md
cat .claude/agents/verify-figures.md
cat .claude/agents/verify-logic.md
cat .claude/agents/verify-completeness.md
--write-to path contract (BINDING)Each agent's report path is the orchestrator's responsibility, not the agent's. The harness directive ("do not create new files unless explicitly required") routinely overrides per-agent prose telling them to Write a report — the result is silent stdout-only output and a parent that has nothing on disk to grep against. Each of the four agent profiles above already carries the agent-side half of this contract (its RAO Trace section names --write-to <report-path> and requires ending stdout with WROTE: <report-path>); the orchestrator must supply the other half, or that clause never fires. To prevent this, every dispatched verification agent MUST receive an explicit --write-to <absolute-path> argument inside its prompt payload.
Compute the per-agent path BEFORE dispatch:
OUTPUT_ROOT="${OUTPUT_ROOT:-output}"
DATE=$(date +%Y-%m-%d)
VERIFY_DIR="${OUTPUT_ROOT}/verify"
mkdir -p "$VERIFY_DIR"
WRITE_NUMERICS="${VERIFY_DIR}/verify-numerics-${DATE}.md"
WRITE_FIGURES="${VERIFY_DIR}/verify-figures-${DATE}.md"
WRITE_LOGIC="${VERIFY_DIR}/verify-logic-${DATE}.md"
WRITE_COMPLETENESS="${VERIFY_DIR}/verify-completeness-${DATE}.md"
Each Agent(subagent_type="verify-…") call MUST include the line --write-to <absolute-path> somewhere in its prompt body, using the matching $WRITE_* path above. Agents read that line, persist their report to that exact path via Write, and end stdout with WROTE: <absolute-path>. After all agents return, the orchestrator confirms the reports actually landed on disk — never relies on stdout alone:
for path in "$WRITE_NUMERICS" "$WRITE_FIGURES" "$WRITE_LOGIC" "$WRITE_COMPLETENESS"; do
[ -s "$path" ] || { echo "FATAL: ${path} not persisted by agent" >&2; exit 1; }
done
If any expected output is missing or empty, the gate fails closed. Do not fall back to extracting the report from agent stdout — a report that only exists in the transcript is not on disk for Step 2/3 to synthesize from, and not there for a later session to re-read.
Agent 1 — Raw-to-Manuscript Numeric Checker (verify-numerics):
Agent 2 — Raw-to-Manuscript Figure Checker (verify-figures):
Agent 3 — Table/Figure-to-Text Logic Checker (verify-logic):
spec-registry.csv rows (M1, M2, R3a, R5, etc.), search for each spec ID as an inline parenthetical or sentence-embedded tag anywhere in prose, footnotes, or table captions — forms like (M3), (Table 2, M3), Model 3 (M3), the reproductive-age subsample (R5), Table 3 row R5 are ALL acceptable. Do NOT require flat-bulleted - M3 (label) or - R5 (label) enumeration in the manuscript; that pattern is explicitly forbidden by the Methods prose rules in scholar-write/references/section-standards.md and methods-prose-examples.md. If a registry ID does not appear anywhere inline in the sections that cite its numbers, emit a WARN (downgrade from previous ERROR) pointing the author at the prose example file — the goal is traceable prose, not enumerated prose.Agent 4 — Full-Chain Completeness Checker (verify-completeness):
All selected agents MUST be launched simultaneously (parallel Agent tool calls in a single message).
Collect the complete report from each agent. Each report follows the agent's specified output format with its own severity classifications.
Store all individual reports for inclusion in the final output.
Combine all agent findings into a single CONSOLIDATED VERIFICATION REPORT.
| Severity | Definition | Action |
|---|---|---|
| CRITICAL | Number mismatch, wrong direction, missing artifact, significance error, causal overreach | MUST fix before submission |
| WARNING | Rounding imprecision, orphaned artifact, variable name inconsistency, minor interpretation stretch | SHOULD fix |
| INFO | Style suggestion, optional improvement | MAY fix |
Generate actionable fix instructions for every CRITICAL and WARNING:
FIX CHECKLIST
=============
STAGE 1 — Raw Output → Manuscript (transcription fixes):
□ [CRIT-RAW-001] Table 2, Row "education", Col 3: Raw output shows 0.23 but manuscript table has 0.32 — update manuscript table (verify-numerics)
□ [CRIT-FIG-001] Figure 2: Regenerate from current model — shows old coefficients (verify-figures)
STAGE 2 — Manuscript Table/Figure → Text (prose fixes):
□ [CRIT-TXT-001] Results para 4: Change "0.32" to "0.23" to match Table 2 (verify-logic ★★)
□ [CRIT-TXT-002] Discussion para 1: Change "significant effect" to "positive association" — no causal design (verify-logic)
□ [CRIT-REF-001] Add in-text reference to Table A3 — currently unreferenced (verify-completeness)
WARNINGS:
□ [WARN-FIG-001] Figure 2 caption: Change "predicted probabilities" to "AMEs" to match y-axis (verify-figures)
□ [WARN-REF-001] Standardize variable name: "educational attainment" in all locations (verify-completeness)
VERIFICATION SCORECARD
═══════════════════════
STAGE 1: Raw Outputs → Manuscript Tables/Figures
| Dimension | Agent | Issues | Critical | Warnings | Score |
|-------------------------|--------------------|--------|----------|----------|-----------|
| Numeric Consistency | verify-numerics | [N] | [N] | [N] | [PASS/FAIL] |
| Figure Consistency | verify-figures | [N] | [N] | [N] | [PASS/FAIL] |
STAGE 2: Manuscript Tables/Figures → Prose Text
| Dimension | Agent | Issues | Critical | Warnings | Score |
|-------------------------|--------------------|--------|----------|----------|-----------|
| Statistical Logic | verify-logic | [N] | [N] | [N] | [PASS/FAIL] |
| Artifact Completeness | verify-completeness| [N] | [N] | [N] | [PASS/FAIL] |
OVERALL
| Total Issues | Critical | Warnings | ★★ Cross-Agent | Score |
|-------------|----------|----------|---------------|-----------|
| [N] | [N] | [N] | [N] | [PASS/FAIL] |
VERDICT: [READY FOR SUBMISSION / REVISIONS NEEDED / MAJOR ISSUES — DO NOT SUBMIT]
Verdict rules:
Display to the user:
Ask: "Would you like me to save the full verification report to disk?"
Before EVERY Write tool call below, run this Bash block to determine the correct save path. Do NOT hardcode paths from the filename templates — they show naming patterns only.
# MANDATORY: Replace [values] with actuals before running
OUTPUT_ROOT="${OUTPUT_ROOT:-output}"
# BASE pattern: ${OUTPUT_ROOT}/verify/verification-report-$(date +%Y-%m-%d)
# Split into directory and stem for the gate script:
OUTDIR="$(dirname "${OUTPUT_ROOT}/verify/verification-report-$(date +%Y-%m-%d)")"
STEM="$(basename "${OUTPUT_ROOT}/verify/verification-report-$(date +%Y-%m-%d)")"
mkdir -p "$OUTDIR"
bash "${SCHOLAR_SKILL_DIR:-.}/scripts/gates/version-check.sh" "$OUTDIR" "$STEM"
Use the printed SAVE_PATH as file_path in the Write tool call. Re-run this block (with the appropriate BASE) for each additional file. The same version suffix must be used for all related output files (.md, .docx, .tex, .pdf).
# Ensure directory exists, then run the version-check from above
OUTPUT_ROOT="${OUTPUT_ROOT:-output}"
mkdir -p "${OUTPUT_ROOT}/verify"
Run the Version Collision Avoidance block above to get SAVE_PATH. Write the consolidated report to that path containing:
Save just the fix checklist to ${OUTPUT_ROOT}/verify/fix-checklist-$(date +%Y-%m-%d).md.
OUTPUT_ROOT="${OUTPUT_ROOT:-output}"
SKILL_NAME="scholar-verify"
LOG_DATE=$(date +%Y-%m-%d)
LOG_FILE="${OUTPUT_ROOT}/logs/process-log-${SKILL_NAME}-${LOG_DATE}.md"
if [ ! -f "$LOG_FILE" ]; then
LOG_FILE=$(ls -t "${OUTPUT_ROOT}"/logs/process-log-${SKILL_NAME}-${LOG_DATE}*.md 2>/dev/null | head -1)
fi
cat >> "$LOG_FILE" << LOGFOOTER
## Output Files
- Consolidated report: ${OUTPUT_ROOT}/verify/verification-report-${LOG_DATE}.md
- Fix checklist: ${OUTPUT_ROOT}/verify/fix-checklist-${LOG_DATE}.md
## Summary
- **Steps completed**: 5/5
- **Files produced**: 2
- **Stage 1 critical issues**: [N]
- **Stage 2 critical issues**: [N]
- **Total warnings**: [N]
- **Verdict**: [READY/REVISIONS/MAJOR ISSUES]
- **Time finished**: $(date +%H:%M:%S)
LOGFOOTER
Before presenting results, verify:
| Skill | Integration Point | Mode | Gate? |
|---|---|---|---|
| scholar-analyze | After tables/figures produced (post-Save Output recommendation) | stage1 | No — recommendation to user |
| scholar-write | Step 5b: After review panel accepts draft, before save | stage2 | Conditional — skips if no raw outputs; user chooses fix/save/skip |
| scholar-respond | Step 3b: After consistency check, before revision summary (REVISE mode) | full | Yes — CRITICAL issues fixed before proceeding |
| scholar-journal | Step 6b item 6: Pre-submission cross-skill integration check | full | Yes — MAJOR ISSUES halts submission prep |
| scholar-replication | Verification checklist: 2 items consume verify-completeness + verify-numerics reports | — (reads existing report) | Checklist items |
See references/verification-standards.md for journal-specific verification requirements, common error catalogs, and a taxonomy of transcription errors in social science manuscripts.
What SKILL.md sets; muted values are Claude Code's defaults
36 skills in this plugin
/scholar-analyzeRun data analytics and produce publication-quality tables and visualizations for social science research. Saves regression tables (HTML/TeX/docx), figures (PDF/PNG), an internal analysis log, and a publication-ready Results document (prose + table notes + figure captions). Accepts file paths, inline/pasted data, or fetches from online sources (NHANES, IPUMS, GSS, World Bank, etc.). Runs A9/B9 verification subagents to check analytic and visualization correctness. For causal designs, invokes /scholar-causal first. Use after /scholar-design./scholar-annotateTurn unstructured text into validated, structured variables at corpus scale with LLMs: codebook design, dev/gold-set construction, DSPy prompt optimization, a hard reliability gate (Cohen κ ≥ 0.70), scale-out via managed Batch APIs or a local/HPC server, and distillation to a cheap classifier for very large corpora. Use for LLM annotation, classification, framing/stance coding, relevance filtering, structured extraction, and any LLM-as-measurement task over a text corpus. Ships a real execution engine (assets/) — not in-context snippets./scholar-auto-improveAutomatic quality auditor and continuous improvement engine for the scholar-skill suite. Four modes: (1) OBSERVE — post-skill output audit (run after any skill); (2) AUDIT — skill-suite structural health check; (3) IMPROVE — propose and apply fixes to skill definitions; (4) EVOLVE — cross-session pattern analysis and systemic improvements. Designed to run automatically at the end of any scholar-skill invocation.
npx claudepluginhub joshzyj/open-scholar-skill --plugin open-scholar-skillOther plugins' skills for the same job