Extract Legacy Document

Extract Legacy Document is a command for Claude Code from oscal-compass-lab/compliance-trestle-skills. It costs 26 tokens per session (280 once invoked), scanned A, original, Apache-2.0.

A document-extraction command that turns a PDF, DOCX, Markdown, or text file into normalized Markdown plus source maps and metadata. A source map records where extracted content came from.

In plain words
What is it for?
Use it to extract legacy security-plan content and produce sections, source mappings, metadata, and a manifest for later OSCAL conversion.
Why use it?
It creates a traceable starting point for converting older compliance material while leaving the original files unchanged.

Command for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bash plugins/document-transform/oscal-document-workbench/scripts/extract-legacy-doc.sh <input> --output <dir>.

Part of the oscal-document-workbench plugin — 1 skill, 8 commands shipped together

Good fit Use it to extract legacy security-plan content and produce sections, source mappings, metadata, and a manifest for later OSCAL conversion.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/oscal-compass-lab/compliance-trestle-skills
agentmods
npx agentmods add commands/oscal-compass-lab/compliance-trestle-skills/extract-legacy-doc

Made for: Claude Code.

Or install oscal-document-workbench, the plugin that ships this one along with the rest of its 1 skill, 8 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for Extract Legacy Document

README.md
[![agentmods](https://agentmods.dev/badge/commands/oscal-compass-lab/compliance-trestle-skills/extract-legacy-doc/github.svg)](https://agentmods.dev/commands/oscal-compass-lab/compliance-trestle-skills/extract-legacy-doc)
Your own site
<a href="https://agentmods.dev/commands/oscal-compass-lab/compliance-trestle-skills/extract-legacy-doc"><img src="https://agentmods.dev/badge/commands/oscal-compass-lab/compliance-trestle-skills/extract-legacy-doc/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for Extract Legacy Document

Your own site · 80×15
<a href="https://agentmods.dev/commands/oscal-compass-lab/compliance-trestle-skills/extract-legacy-doc"><img src="https://agentmods.dev/badge/commands/oscal-compass-lab/compliance-trestle-skills/extract-legacy-doc.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 280 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00026 $0.00280
Opus 5 $0.00013 $0.00140
Sonnet 5 $0.00005 $0.00056
Haiku 4.5 $0.00003 $0.00028

Measured 13d ago against content hash a3e898a49022, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

Extract Legacy Document scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/document-transform/oscal-document-workbench/commands/extract-legacy-doc.md · 43 lines

What it actually says

/oscal-document-workbench:extract-legacy-doc

Extract text from PDF, DOCX, Markdown, or text into normalized Markdown plus source-map and manifest files.

How to run

bash plugins/document-transform/oscal-document-workbench/scripts/extract-legacy-doc.sh <input> --output <dir>

Arguments

  • <input> : PDF, DOCX, Markdown, or text file
  • --output <dir> : directory for extracted.md, source-map.csv, sections.json, metadata, and manifest

Outputs

  • extracted.md
  • source-map.csv
  • sections.json
  • extracted-metadata.json
  • extract-manifest.json

Exit codes

  • 0 : success
  • 2 : bad arguments or unreadable input
  • 5 : required extractor dependency is missing
  • 6 : unsupported format

Safety notes

  • Keep source files unchanged.
  • Maintain source traceability for every mapped OSCAL field.
  • Mark uncertain mappings as needs_review.
  • Do not treat structural validation as an audit opinion.
  • Do not commit sensitive customer evidence or real SSPs.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 43 lines · 26 tokens per session scan A a3e898a49022

Subscribe to this mod's changes

Extract Legacy Document is a command published in the GitHub repository oscal-compass-lab/compliance-trestle-skills (16 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 26 tokens to every session and 280 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.