rhzy-law-supplement-pipeline

Archives legal regulation docx files into markdown and builds structured cross-reference wikis.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/pinedu/xmc-work-wiki --skill rhzy-law-supplement-pipeline-pinedu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rhzy-law-supplement-pipeline
Source: https://github.com/pinedu/xmc-work-wiki/tree/main/skills/rhzy-law-supplement-pipeline
Command: npx skills add https://github.com/pinedu/xmc-work-wiki --skill rhzy-law-supplement-pipeline-pinedu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-docx, and includes references (resource) components.

What problem does it solve? When a manager sends legal regulation docx files (national statutes, State Council orders, local government regulations) for archiving, manual filing is slow, error-prone, and often produces duplicates or miscounted articles. This Skill automates the full two-phase pipeline: converting docx regulations into verified markdown archives, then structuring multiple archived regulations into a searchable 6-file wiki with per-article slices, cross-regulation comparison tables, and scenario checklists. ## Core Features & Use Cases - Phase 1 Archiving (docx to md): A 5-step SOP covering MD5 duplicate detection, python-docx parsing, automatic classification into 5 directory types by document number and issuing authority, scripted archiving, and mandatory index synchronization. - Phase 2 Structuring (md to wiki): A 6-step SOP that turns 2+ archived regulations into a README index, per-regulation article slices (original text + key obligations + project actions with red/yellow/green ratings), a cross-regulation comparison table applying the stricter-standard principle, and a scenario quick-reference table with monthly checklists. - Built-in Pitfall Prevention: Four documented pitfalls covering MD5 re-archiving, false unarchived flags, annotation-line deduplication in article counting, and Chinese numeral conversion errors. - Use Case: A manager sends a docx compilation of construction labor regulations; the Skill detects duplicates via MD5, extracts and archives each regulation in about 5 minutes, syncs all indexes, then structures 4 archived regulations into a 6-file wiki supporting full-text search, article lookup, and cross-regulation comparison. ## Quick Start Archive the attached regulation docx file and, if at least two related regulations are already archived, structure them into a searchable wiki with article slices and a cross-regulation comparison table.

Frequently Asked Questions about rhzy-law-supplement-pipeline

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I archive legal regulation docx files into markdown automatically?

Run the 5-step SOP: compare MD5 hashes against existing archives to detect duplicates, parse the docx with python-docx to identify chapters and articles, classify into the correct directory by document number and issuing authority, execute the archiving script template, then synchronize all index files.

How to build a searchable wiki from multiple archived regulations?

Once two or more same-topic regulations are archived as markdown, run the 6-step structuring SOP: verify article counts, create a README index, slice each regulation into per-article entries with obligations and project actions, build a cross-regulation comparison table, and add a scenario quick-reference table.

How does MD5 detection prevent duplicate regulation archiving?

The pipeline runs md5sum on the incoming docx and compares it against previously archived source files. Matching hashes mean the file was already archived, so processing stops and the existing archive is reused instead of regenerating files.

Why does legal article counting fail on Chinese regulation documents?

Counts fail when annotation lines referencing article numbers are not excluded, or when Chinese numerals above ten are converted through incomplete dictionaries. The fix is to filter annotation lines and compare Chinese numeral strings directly as IDs without numeric conversion.

What are the limitations of this docx regulation archiving pipeline?

It does not handle OCR-failed scanned documents such as signature-page scans, docx files containing multiple merged documents requiring manual confirmation, or cases where only a single raw markdown file is needed without structuring.