/research:vision-extractfrom research
Transcribes scanned page images into per-page and combined Markdown source text via a pluggable vision adapter (codex CLI or generic command template). Supports resumable extraction with retry, page validation, and optional PDF rasterization.
Ships in research. 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.
None: SKILL.md is the whole skill.
Transcribe a directory of scanned page PNGs into Markdown source text — the acquisition step for inducting scanned books / pages. Provider-neutral: the vision call is a pluggable adapter, not hardcoded to one CLI.
# Pages already exist at .aiwg/research/sources/images/<slug>/pages/
aiwg corpus vision-extract --slug tufte-1983-visual-display --provider codex
# Rasterize a PDF to page PNGs first (poppler pdftoppm), then transcribe
aiwg corpus vision-extract --slug my-book --rasterize sources/pdfs/my-book.pdf --dpi 200 --provider codex
# Provider-neutral: any vision CLI via a wrapper script (see below)
chmod +x ./vision.sh
aiwg corpus vision-extract --slug my-book \
--provider command \
--command './vision.sh {image} {prompt_file} {out}'
# Resume (skips pages already marked complete); --force re-does them
aiwg corpus vision-extract --slug my-book --start 20 --end 40
aiwg corpus vision-extract --slug my-book --force
Save this wrapper as vision.sh; it receives the image, prompt file, and output
paths as separate arguments:
#!/bin/sh
claude -p "$(cat "$2")" --image "$1" > "$3"
Outputs to .aiwg/research/sources/text/<slug>-vision/: per-page
pages/page-NNN.md, combined <slug>-vision.vision.md + stripped .txt, run.log.
--provider | Vision call |
|---|---|
codex (default) | codex exec --sandbox read-only --image … --output-last-message (set AIWG_CODEX_BIN/--model as needed) |
command | a shell template (--command or AIWG_VISION_COMMAND) with {image} / {prompt_file} / {out} placeholders — wire any vision CLI (Claude, a custom script). The command writes the transcription to {out} (or stdout). |
Both require a vision-capable model to be reachable; needs-infrastructure.
Command templates must use unquoted, unescaped placeholders: {image} → "$1",
{prompt_file} → "$2", {out} → "$3". Paths are passed as separate shell
arguments; AIWG_VISION_IMAGE, AIWG_VISION_PROMPT_FILE, and AIWG_VISION_OUT
are also exported. For example: vision-cli --image {image} --prompt-file {prompt_file} > {out}.
Templates may expand only $1, $2, $3, $AIWG_VISION_IMAGE,
$AIWG_VISION_PROMPT_FILE, and $AIWG_VISION_OUT, also in braced form
(${1}, ${AIWG_VISION_OUT}, etc.). All other $ parameter/variable expansions are rejected,
including shell names ($SHELL), $IFS, special parameters, arithmetic, and braced
operators such as ${1:-fallback}. A $ inside single quotes is literal text and allowed.
Keep the provided references quoted when using them as data arguments.
Command substitution ($(), backticks, eval, nested shell invocations with -c
(including redirections and env … sh -c), here-documents and here-strings (<<),
# outside single quotes, and backslash-newline line continuations (anywhere, regardless of quoting) are rejected. Put complex logic in a wrapper script
that receives the paths as data arguments. Templates are trusted executable code
and must not re-parse path values as shell source. Validation is defense in depth;
keep path arguments quoted in the wrapper, as in the example above.
[?] / [unreadable] markers, figure/chart text markers, no summarizing; must start exactly # Page N.# Page N; otherwise retried (--retries) then written with an <!-- extraction-status: failed --> marker.<!-- extraction-status: complete --> are skipped unless --force..txt.--rasterize <pdf> renders the PDF to page-NNN.png via poppler pdftoppm
(macOS: brew install poppler; Debian/Ubuntu: apt install poppler-utils) at
--dpi (default 200), into the slug's images dir. Omit it when page PNGs already
exist (the script's original input contract).
src/artifacts/corpus-tools/vision-extract.ts — port of section9
codex_vision_extract_pages.sh, generalized off the hardcoded codex CLI.research-acquire / research-acquisition-agent (PDF/metadata)
and the media-transcript tooling (audio/video) as the scanned-page acquisition path.What SKILL.md sets; muted values are Claude Code's defaults
42 skills in this plugin
/best-practices-auditResearch-grounded validation of a target (file, directory, or topic) against external best practices and vendor docs. Produces a cited, evidence-grounded comparison./citation-backfillRebuild bidirectional citation edges in a research corpus. Scans outgoing citations, computes the inverse map, rewrites incoming tables. Fixes one-directional graphs./corpus-exportPackage corpus subsets as distribution archives. Filter by cluster, topic, REF range, or custom expression; bundles PDFs, analysis, citations, and BibTeX into tar.gz.npx claudepluginhub jmagly/aiwg --plugin researchOther plugins' skills for the same job