plugins/the-rewrite-room/skills/user-docs-to-ai-skill/SKILL.md
Converts user-facing documentation (how-to guides, tutorials, API references, examples) in any format — Markdown, PDF, DOCX, PPTX, XLSX, AsciiDoc, RST, HTML, Jupyter notebooks, man pages, TOML/YAML/JSON configs, and plain text — into Claude Code skill directories with SKILL.md plus thematically grouped references/*.md files. Use when given a docs directory or mixed-format documentation to transform into an AI skill. Uses MCP file-reader server for binary formats.
npx skillsauth add jamie-bitflight/claude_skills user-docs-to-ai-skillInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
<docs_path>$1</docs_path> <output_plugin>$2</output_plugin> <output_skill>$3</output_skill>
Converts human-readable documentation in any text or binary format into a Claude Code skill directory. Supports Markdown, PDF, DOCX, PPTX, XLSX, AsciiDoc, RST, HTML, Jupyter notebooks, man pages, config files, and plain text. Uses the MCP file-reader server for binary document formats. The output is consumed by Claude, not humans — every word must serve AI comprehension, not user readability.
<docs_path/> — GitHub URL (e.g. https://github.com/astral-sh/ty) or local directory path containing documentation<output_plugin/> — name for the output plugin (e.g., ty-skill)<output_skill/> — (optional) name for the skill within the plugin; derived from project name when not providedCreates plugins/<output_plugin/>/skills/<output_skill/>/ containing:
SKILL.md — valid frontmatter + AI-facing workflow instructions + links to all reference filesreferences/ — thematically grouped knowledge files, each linked from SKILL.mdflowchart TD
Start([Skill receives source + output_plugin]) --> Phase0[Phase 0 — Input Resolution]
Phase0 --> Q_src{source type?}
Q_src -->|GitHub URL| Clone["git clone source .claude/worktrees/project-name/\nproject-name = last URL segment"]
Q_src -->|Local path| UseLocal[Use path as-is]
Clone --> SetRoot[Set docs_root = .claude/worktrees/project-name/]
UseLocal --> SetRoot
SetRoot --> Q_name{output_skill provided?}
Q_name -->|No| DeriveName[Derive output_skill from project-name]
Q_name -->|Yes| FindDocs
DeriveName --> FindDocs[Locate documentation within docs_root]
FindDocs --> Q_docs{docs/ directory exists?}
Q_docs -->|Yes| UseDocs[Set docs_path = docs_root/docs/]
Q_docs -->|No| ScanAll["Task: Explore agent\nGlob all .md files across docs_root\nReturn list of markdown and inline doc files"]
UseDocs --> Inv
ScanAll --> Inv[Glob all files in docs_path\nCount by format category — see input-resolution.md\nIdentify top-level sections and index files\nFlag MCP-dependent formats]
Inv --> Phase1[Phase 1 — Extraction]
Phase1 --> Extract[Apply extraction patterns per doc type\nSee extraction-patterns.md]
Extract --> Phase15[Phase 1.5 — Workflow Identification]
Phase15 --> WfDetect[Scan atoms for TYPE: pattern and TYPE: constraint atoms<br>that describe multi-step sequences or decision trees]
WfDetect --> Q0{Any workflow-shaped atoms found?}
Q0 -->|No| Classify
Q0 -->|Yes — delegate each to process-siren| WfDelegate["Task: subagent_type='process-siren:process-siren'<br>Output: resources/workflows/{slug}.md"]
WfDelegate --> Classify[Classify remaining atoms into themes\nEach theme becomes one reference file]
Classify --> Phase2[Phase 2 — Structure]
Phase2 --> Scaffold[Scaffold output directory\nplugins/<output_plugin/>/skills/<output_skill/>/]
Scaffold --> Write[Phase 3 — Write]
Write --> RefFiles[Write references/*.md files\nOne file per theme — see skill-structure-guide.md]
RefFiles --> SkillMD[Write SKILL.md\nFrontmatter + workflow + links to all reference files]
SkillMD --> Phase4[Phase 4 — Verify]
Phase4 --> QC[Apply quality-criteria.md checklist\nFix any failing criteria]
QC --> Q2{All criteria pass?}
Q2 -->|No| Fix[Fix failing items — re-run checklist]
Fix --> Q2
Q2 -->|Yes| Done([Done — report output path and file inventory])
Run before any extraction. Do not skip.
See input-resolution.md for complete branching logic. Summary:
source matches https://github.com/* — it is a GitHub URL:
project-name from the last path segment (e.g. astral-sh/ty → ty)git clone <source> .claude/worktrees/<project-name>/ (path relative to project root)docs_root = .claude/worktrees/<project-name>/source as a local directory path and set docs_root = sourceIf output_skill was not passed as input, derive it from project-name (the last URL segment or last path segment of the local path).
docs_root/docs/ existsdocs_path = docs_root/docs/ and proceedGlob("**/*.md", docs_root) plus check for inline docstrings; collect all markdown file paths; set docs_path to the list of discovered filesGlob("**/*", docs_path) — list all filesfile-reader server (PDF, DOCX, PPTX, XLSX) — these need the file-reader MCP tool during extractionindex.md, README.md, index.html, or equivalent) to understand top-level structureReport the inventory before proceeding to Phase 1.
Apply extraction patterns from extraction-patterns.md.
For non-markdown formats (PDF, DOCX, PPTX, XLSX, AsciiDoc, RST, HTML, Jupyter, man pages, config files), apply the format-specific extraction patterns from the Format-Specific Extraction section of extraction-patterns.md. Use the MCP file-reader server tools for binary formats that the Read tool cannot parse.
Extraction produces a structured list of knowledge atoms:
ATOM: <one-sentence fact, constraint, parameter, or pattern>
TYPE: <command | parameter | constraint | pattern | error | example>
SOURCE: <filename:section>
Collect atoms into a flat list first. Do not group yet — grouping happens in Phase 2.
Runs after Phase 1 extraction, before Phase 2 grouping. Identifies workflow-shaped atoms and converts them to validated Mermaid diagrams via process-siren.
See workflow-identification.md for detection criteria, delegation prompt construction, and blocking-condition responses.
Scan the flat atom list produced in Phase 1. An atom is workflow-shaped when it meets any of:
Simple sequential prose ("first do X, then do Y") without branching is NOT workflow-shaped — leave it as atoms for thematic grouping.
For each identified workflow-shaped atom cluster, delegate via Agent tool:
Task: subagent_type="process-siren:process-siren"
Context to include in the prompt:
- The raw prose or atom text verbatim
- What the workflow represents (1 sentence of context)
- Output file path: plugins/<output_plugin/>/skills/<output_skill/>/resources/workflows/{slug}.md
Output: resources/workflows/{slug}.md — validated Mermaid flowchart file
Derive {slug} from the workflow topic (e.g., installation-flow, error-recovery, auth-decision).
process-siren blocks when it detects undefined actors, vague conditions, or missing terminal states. Respond by:
<!-- TODO: manual-workflow-needed — [describe the gap] --> and continueAfter all workflow files are written, add a ## Workflows section to the output SKILL.md listing each file:
## Workflows
- [Workflow Name](./resources/workflows/slug.md)
Group atoms into themes. Each theme becomes one reference file.
Rules:
For each theme, write references/{theme-slug}.md.
Follow the format rules in skill-structure-guide.md.
Write all reference files before writing SKILL.md.
After all reference files exist:
[text](./references/filename.md)Apply the checklist in quality-criteria.md before declaring done.
If any item fails, fix it and re-run the checklist. Do not declare done with failing criteria.
development
When an application needs to store config, data, cache, or state files. When designing where user-specific files should live. When code writes to ~/.appname or hardcoded home paths. When implementing cross-platform file storage with platformdirs.
testing
Enforce mandatory pre-action verification checkpoints to prevent pattern-matching from overriding explicit reasoning. Use this skill when about to execute implementation actions (Bash, Write, Edit) to verify hypothesis-action alignment. Blocks execution when hypothesis unverified or action targets different system than hypothesis identified. Critical for preventing cognitive dissonance where correct diagnosis leads to wrong implementation.
tools
Reference guide for the Twelve-Factor App methodology — 15 principles (12 original + 3 modern extensions) for building portable, resilient, cloud-native applications. Use when evaluating application architecture, designing cloud-native services, reviewing codebases for methodology compliance, advising on configuration, scaling, observability, security, and deployment patterns. Incorporates the 2025 open-source community evolution and cloud-native reinterpretations of each factor.
development
Use when auditing docs vs code drift, syncing docs after changes, optimizing CLAUDE.md or SKILL.md for AI consumption, validating GLFM and Markdown, or summarizing files/URLs/images — routes each task to the correct specialist agent via /rwr:audit, /rwr:optimize, or /rwr:author