law-pipeline

Normalizes Chinese law Markdown into VuePress site pages with versioning and progress tracking.

776|96|Updated Mar 22, 2022
One-click install
npx skills add https://github.com/ImCa0/just-laws --skill law-pipeline
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: law-pipeline
Source: https://github.com/ImCa0/just-laws/tree/main/.agents/skills/law-pipeline
Command: npx skills add https://github.com/ImCa0/just-laws --skill law-pipeline

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Converting raw Chinese legal texts into a structured, deployable documentation site involves repetitive formatting, category routing, sidebar configuration, and version management that is error-prone when done by hand.

Core Features & Use Cases

  • Automated Normalization: Converts law Markdown files from .temp/laws_md into classified A/B/C-type deliverables under docs/{category}/{slug}/, formatting articles, headings, attachments, and tables (optionally reading paired Word files for table grids).
  • Site Configuration Sync: With --apply-site, updates category pages, VuePress sidebar entries for multi-part laws, and LAWS_PROGRESS.md collection status and statistics.
  • Multi-Version Management: Maintains versions.json metadata and versions/{effectiveFrom}/ directories for future and historical law versions, with validation and effective-date rotation via npm scripts.
  • Use Case: When a newly amended law is published, run the pipeline in preview mode to inspect warnings, then apply it to archive the old text, promote the new version, and rebuild the site.

Quick Start

Normalize the law Markdown files in .temp/laws_md into the Just Laws site, preview the warnings first, then apply the site updates and run the build.

Frequently Asked Questions about law-pipeline

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

FAQPage Schema
How do I convert Chinese law Markdown files into a VuePress site?

Run the normalize_law.py script with explicit input files from .temp/laws_md, an output directory, and the known_slugs.json mapping. Preview results in a temp directory first, then rerun with --apply-site to write deliverables and sync category pages, sidebar, and progress tracking.

How do I manage multiple versions of an amended law on a documentation site?

Place the new version under versions/{effectiveFrom}/README.md and register it in versions.json with promulgation and effective dates. Use the laws:versions:validate and laws:versions:promote npm scripts to validate metadata and rotate the current version on its effective date.

Can the pipeline extract tables from Word documents?

Yes, when a Markdown law contains tables, the script looks for a same-named .docx file in the paired laws directory and reads its table grid via the Word XML structure, preserving merged-cell placeholders in the generated Markdown tables.

Why does the script skip some laws during batch processing?

The --only-uncollected flag skips laws already marked as collected in LAWS_PROGRESS.md, and inputs not listed in the progress file are skipped with a warning. A default filtered list also excludes specific laws unless --include-filtered is passed.

What are the limitations for multi-part C-type laws?

C-type laws split by part are fully supported for initial collection, but version switching only works for single-file A/B laws. For C-type updates, the workflow stops and requires extending version routing, sidebar, and rotation scripts first.