Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
tiangong-ai avatar

Document Granular Decompose

  • 86 installs
  • 7 repo stars
  • Updated August 4, 2026
  • tiangong-ai/skills

Helps with documentation tasks.

About

document-granular-decompose is a Claude Code skill for documentation. It helps solo builders move faster with AI-assisted development.

  • document-granular-decompose
  • Documentation
  • AI-coding skill

Document Granular Decompose by the numbers

  • 86 all-time installs (skills.sh)
  • +2 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #673 of 1,879 Documentation skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/tiangong-ai/skills --skill document-granular-decompose

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs86
repo stars7
Last updatedAugust 4, 2026
Repositorytiangong-ai/skills

What it does

Helps with documentation tasks.

Files

SKILL.mdMarkdownGitHub ↗

Document Granular Decompose

Core Goal

  • Parse a local document through POST /mineru_with_images.
  • Always force return_txt=true.
  • Read environment variables for endpoint, request identity, and model routing:
  • UNSTRUCTURED_API_BASE_URL (example: https://your-unstructured-host:7770)
  • UNSTRUCTURED_AUTH_TOKEN
  • UNSTRUCTURED_PROVIDER (optional)
  • UNSTRUCTURED_MODEL (optional)
  • Return only plain fulltext (prefer API txt; fallback to joined result[].text).

Triggering Conditions

  • Need robust document fulltext extraction for PDF/Office/image files.
  • Need image-aware MinerU parsing but only textual output for downstream chunking/search/summarization.
  • Need to standardize provider/model/token input via environment variables instead of ad-hoc command parameters.

Workflow

1. Prepare environment variables.

export UNSTRUCTURED_AUTH_TOKEN="your-fastapi-bearer-token"
export UNSTRUCTURED_API_BASE_URL="https://your-unstructured-host:7770"
# Optional routing overrides. Omit them to let the server choose its defaults.
export UNSTRUCTURED_PROVIDER="vllm"
export UNSTRUCTURED_MODEL="Qwen/Qwen3.5-122B-A10B-FP8"

2. Run extraction and print fulltext to stdout.

python3 scripts/mineru_fulltext_extract.py \
  --file "/absolute/path/to/document.pdf"

3. Save fulltext to a local file when needed.

python3 scripts/mineru_fulltext_extract.py \
  --file "/absolute/path/to/document.pdf" \
  --output "/absolute/path/to/fulltext.txt"

Request Contract

  • Endpoint resolution:
  • --api-url if provided
  • else UNSTRUCTURED_API_BASE_URL + /mineru_with_images
  • else fail fast with missing environment variable error
  • Method: POST multipart form.
  • Query params:
  • Force return_txt=true (always set by script).
  • Form fields sent:
  • file (required)
  • provider (optional, from UNSTRUCTURED_PROVIDER when set)
  • model (optional, from UNSTRUCTURED_MODEL when set)
  • Header sent:
  • Authorization: Bearer $UNSTRUCTURED_AUTH_TOKEN

Supported File Types (Strict)

  • Supported file types:
  • .bmp, .doc, .docm, .docx, .dot, .dotx, .gif, .jp2, .jpeg, .jpg, .odp, .odt, .pdf, .png, .pot, .potx, .pps, .ppsx, .ppt, .pptm, .pptx, .tiff, .webp, .xls, .xlsm, .xlsx, .xlt, .xltx
  • Office formats:
  • .doc, .docm, .docx, .dot, .dotx, .odp, .odt, .pot, .potx, .pps, .ppsx, .ppt, .pptm, .pptx, .xls, .xlsm, .xlsx, .xlt, .xltx
  • Any other extension is rejected before sending API requests.

Output Rules

  • Success output must be plain text fulltext only.
  • Fulltext source priority:

1. response.txt 2. join non-empty response.result[].text by blank lines

  • Do not output chunk metadata/json unless the user explicitly requests debugging.

Error Handling

  • Missing required env vars (UNSTRUCTURED_API_BASE_URL, UNSTRUCTURED_AUTH_TOKEN): fail fast with actionable message.
  • Missing UNSTRUCTURED_PROVIDER or UNSTRUCTURED_MODEL: omit the form field and let the service choose its default.
  • HTTP 401/403: report token/auth issue.
  • HTTP 4xx/5xx: print status and API error body if available.
  • Missing text in response: fail with explicit schema mismatch error.

References

  • references/env.md
  • references/request-response.md

Assets

  • assets/config.example.env

Scripts

  • scripts/mineru_fulltext_extract.py

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.