A general-purpose Agent Skill for supply chain document review, dimension inspection report verification, and seal/signature checks. Core pipeline: Document sorting -> Image extraction -> OCR recognition -> Verification -> Review report output
Quickly select execution path based on user goal:
User wantsMinimum stepsMain outputsSort document package, extract imagesStep 1output/, image/, _ImageIndex.xlsxCheck seals, signatures, scanned textStep 1 -> Step 2imagetomd/, OCR keyword cluesVerify dimension correctnessStep 1 -> Step 3Judgement consistency check resultsGenerate full review conclusionStep 1, optionally Step 2/3, then Step 4ReviewReport.md
Quick judgment:
PDF / DOCX / XLSX document package -> prioritize Step 1seal / signature / scanned document / OCR -> add Step 2OK / NG / Pass / Fail / tolerance -> add Step 3summary report / final review conclusion -> execute Step 4 lastWhen a user provides a document package containing PDF, DOCX, XLSX files, this skill organizes the scattered files into a reviewable structure and provides directly usable intermediate results and reports for manual review.
Common suitable tasks:
output/, image/, imagetomd/) for traceabilityUse this skill when the user shows the following intent:
Typical trigger phrases:
dimension inspection reportpart dimension inspectionsupply chain reviewsupplier document reviewquality document reviewtable data reviewjudgement consistency checkseal reviewstamp reviewsignature reviewPDF to DOCXextract imagesIf unsure how to start, follow this order:
.pdf, .docx, .xlsx, .xlsm files?Decision rules:
Do not promise completion in these cases; explain boundaries first:
.pdf, .docx, .xlsx, .xlsmAfter task completion, the following structure is typically created:
text
Task Folder/
├── Original files
├── output/
│ ├── *.pdf.docx
│ ├── *.docx
│ ├── *.xlsx
│ └── _ImageIndex.xlsx
├── image/
│ └── Extracted images saved in subdirectories by source file
├── imagetomd/
│ └── OCR Markdown generated per image
└── ReviewReport.md
output/ for traceabilityWhen converting PDF to DOCX, image positions retain two types of information:
MethodPurposeEmbedded imageFor manual review directly in DOCXPath reference [Image Reference] image/...For agent or manual backtracking to original image
Extract embedded images from PDF, DOCX, XLSX/XLSM and save to image/{source file name}/.
File TypeImage Naming ConventionPDFsource.pdf-p{page}-img{seq}.{ext}DOCXsource.docx-{seq}.{ext}XLSX/XLSMsource.xlsx-{seq}.{ext}
image/imagetomd/HERDSMAN_SKILL_DIR or scripts/config.jsonFor common dimension inspection tables, the script checks:
OK / PassAggregate data from output/, image/, imagetomd/ to generate a report for manual review, with additional OCR text scanning for:
seal / stampsignatureExecute in the following order by default. Do not skip steps unless the user explicitly requests only partial results.
First confirm the following:
If the user has not been clear, ask at least once — do not make assumptions.
Main entry script:
powershell
uv run python "<skill-dir>/scripts/task_convert_extract.py" --dir "<task-folder>"
This step will:
image/output/output/_ImageIndex.xlsxpowershell
python "<skill-dir>/scripts/image_to_markdown.py" --dir "<task-folder>"
Optional parameters:
powershell
python "<skill-dir>/scripts/image_to_markdown.py" --dir "<task-folder>" --force
python "<skill-dir>/scripts/image_to_markdown.py" --dir "<task-folder>" --model "paddleocr-ppocrv5-server"
python "<skill-dir>/scripts/image_to_markdown.py" --dir "<task-folder>" --batch-size 20
This step is mandatory only in these scenarios:
powershell
python "<skill-dir>/scripts/extract_verify_data.py" --dir "<task-folder>"
When template column positions vary, supplement with these parameters:
powershell
python "<skill-dir>/scripts/extract_verify_data.py" --dir "<task-folder>" --seq-col 2 --item-col 3 --std-col 5 --method-col 7 --data-start 9 --data-cols 5 --judge-col 14 --data-start-row 24
Enhancements:
√, ○ as pass judgement43°±5°, Φ6-0.05, ≥5.4MPa, 13(+0.2/0)Applicable to:
powershell
python "<skill-dir>/scripts/generate_report.py" --dir "<task-folder>"
Optional output formats:
powershell
python "<skill-dir>/scripts/generate_report.py" --dir "<task-folder>" --format md
python "<skill-dir>/scripts/generate_report.py" --dir "<task-folder>" --format json
python "<skill-dir>/scripts/generate_report.py" --dir "<task-folder>" --format summary
Key output includes:
The final response should at least cover:
The following phrases should typically trigger this skill:
text
"Review this supplier document package for dimension judgement issues."
"Convert all PDFs in this task folder to reviewable versions and extract images."
"Check this batch of reports for stamp or signature clues."
"Check if the OK/NG judgements in the Excel match the measured values."
"Once done, produce a review report."
Recommended response strategy:
Standard pass terms:
OK合格 (Pass)√○Standard fail terms:
NOK不合格 (Fail)NGThe following are considered non-standard pass terms and require user notification:
PASS正确 (Correct)通过 (Pass)If measured values are outside tolerance range but the judgement column still reads:
OK合格 (Pass)It must be marked as a high-risk item with explicit warning in the summary.
When OCR hits the following keywords, only indicate "relevant text clues found" — do not draw conclusions:
印章 (seal)公章 (official stamp)签名 (signature)Do not overwrite original files. All output should be placed in:
output/image/imagetomd/Configuration file: scripts/config.json
json
{
"base_url": "http://127.0.0.1:8080",
"ocr_model": "paddleocr-ppocrv5-server",
"ocr_transport": "auto",
"request_timeout": 120,
"retry_count": 2,
"retry_delay": 5,
"ocr_script_dir": ""
}
Priority (high to low):
--modelconfig.jsonRelevant environment variables:
HERDSMAN_BASE_URL: Override OCR service addressHERDSMAN_SKILL_DIR: Explicitly specify OCR skill root directoryHERDSMAN_OCR_TRANSPORT: Override OCR transport method ( auto / http / script)image/ not found#task_convert_extract.py firstHERDSMAN_SKILL_DIR or update scripts/config.jsonExecute on demand, no forced full workflow:
PathPurposescripts/task_convert_extract.pyDocument sorting, PDF to DOCX, image extraction, index generation entry pointscripts/image_to_markdown.pyImage OCR recognition and Markdown outputscripts/extract_verify_data.pyDimension data extraction and judgement consistency verificationscripts/generate_report.pyAggregate and generate review reportscripts/config.jsonOCR model and service configurationreferences/setup-guide.mdEnvironment installation and setup instructionsreferences/naming-conventions.mdDirectory structure and naming conventions