legislative-flattener

Flatten hierarchical legislative DOCX text into numbered requirements with classifications.

Updated Oct 27, 2025
One-click install
npx skills add https://github.com/cri-matthew/legislative-flattener-skill --skill legislative-flattener
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: legislative-flattener
Source: https://github.com/cri-matthew/legislative-flattener-skill/tree/main/.
Command: npx skills add https://github.com/cri-matthew/legislative-flattener-skill --skill legislative-flattener

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the extraction of hierarchical legislative or regulatory text from Word documents into a flat, numbered list of discrete requirements, saving time and reducing manual mapping effort.

Core Features & Use Cases

  • Flatten parent-child structures into standalone requirements while preserving references
  • Maintain context paths for traceability in regulatory mappings
  • Export results to XLSX, CSV, JSON, and Markdown for reporting and analysis
  • Detect normative language and extract keywords to speed up cross-framework mapping

Quick Start

  • Install dependencies: pip install python-docx openpyxl
  • Basic usage: python flattener_utility.py input.docx output.xlsx
  • Specify formats: python flattener_utility.py input.docx output.csv --format csv
  • View outputs: open the generated XLSX or JSON file to review flattened requirements

Frequently Asked Questions about legislative-flattener

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

FAQPage Schema
How do I flatten hierarchical legislative text from Word documents into requirements?

Flatten hierarchical legislative text by converting DOCX files into a flat, numbered list of discrete requirements. The Skill reads document structure and numbering metadata, identifies parent-child relationships, and exports to XLSX, CSV, JSON, or Markdown while preserving full context paths for traceability.

Can I extract and classify regulatory requirements by normative language?

Yes. The Skill detects normative language (SHALL, MUST, SHOULD, MAY) and classifies requirement types as Mandate, Prohibition, Permission, Definition, or Informative. This classification speeds up cross-framework mapping and compliance analysis workflows.

What file formats can I export flattened requirements to?

Export flattened requirements to XLSX, CSV, JSON, or Markdown formats. Multiple export options let you choose the format that fits your reporting, analysis, or downstream compliance documentation needs.

Do I need specific dependencies to run the legislative flattener?

Install python-docx and openpyxl via pip. These dependencies enable reading Word document structure and writing to Excel exports; basic usage is python flattener_utility.py input.docx output.xlsx.

How does requirement mapping work when documents have nested sections?

The Skill preserves hierarchical references and generates context paths for each flattened requirement, maintaining traceability back to parent sections. This lets you map nested regulatory structures into flat requirement lists while retaining the source hierarchy for audit and compliance reporting.

What types of regulatory documents does this work with?

The Skill processes Word DOCX files containing legislative or regulatory text with hierarchical numbering and structure. It's designed for requirement mapping, compliance analysis, regulatory reporting, and documentation processing across standards and regulatory frameworks.