refactor(skills): align MPI skills with Agent Skills best practices
The skill metadata had drifted: every SKILL.md name field lacked the mpi- prefix, contradicting the directory names and the Agent Skills specification. Descriptions were also missing negative triggers, making it easy for the agent to load the wrong skill. Rewrote the pdf-to-docx skill to follow progressive disclosure: the main SKILL.md dropped from 318 lines to 80, with detailed code examples moved to on-demand references. Added uv run instructions and /// script PEP 723 metadata so dependencies are declared inline and installed automatically. Fixed the pptx skill's script paths and added CLI usage messages to both pptx scripts and the normalize script. Removed the empty self-review directory that was superseded by the unified translation-review skill.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
---
|
||||
name: chinese-text-normalize
|
||||
description: Normalize Chinese markdown files — remove extraneous mid-sentence line breaks from fixed-width exports while preserving TOC structures, section headers, and intentional paragraph breaks.
|
||||
name: mpi-chinese-text-normalize
|
||||
description: Normalize Chinese markdown files by removing extraneous mid-sentence line breaks from fixed-width exports while preserving TOC structures, section headers, and intentional paragraph breaks. Do not use for English prose, wiki-link index files, or mixed CJK/English documents without manual review.
|
||||
compatibility: Requires Python 3.9+ and uv. The script uses only the standard library.
|
||||
---
|
||||
|
||||
When Chinese text has hard line breaks at a fixed width (~20-25 chars) — common in PDF exports, OCR output, or poorly-converted documents — use this skill to join them into flowing paragraphs.
|
||||
@@ -13,7 +14,13 @@ When Chinese text has hard line breaks at a fixed width (~20-25 chars) — commo
|
||||
|
||||
## Approach
|
||||
|
||||
Run `scripts/normalize_breaks.py <directory>` — it processes all .md files in the directory.
|
||||
Run with `uv`:
|
||||
|
||||
```bash
|
||||
uv run skills/mpi-chinese-text-normalize/scripts/normalize_breaks.py <directory>
|
||||
```
|
||||
|
||||
It processes all `.md` files in the directory.
|
||||
|
||||
The script handles three file patterns:
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
# /// script
|
||||
# requires-python = ">=3.9"
|
||||
# dependencies = []
|
||||
# ///
|
||||
|
||||
"""
|
||||
Fix extraneous line breaks in Chinese markdown files.
|
||||
|
||||
@@ -6,8 +11,9 @@ Three file patterns:
|
||||
2. Mostly-paragraph with stray breaks + outline TOC -> join broken lines, preserve list items
|
||||
3. Already fine -> skip (idempotent)
|
||||
|
||||
Usage: python3 normalize_breaks.py <directory>
|
||||
Usage: uv run normalize_breaks.py <directory>
|
||||
"""
|
||||
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
@@ -155,6 +161,9 @@ def process_file(filepath):
|
||||
|
||||
|
||||
def main():
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: uv run normalize_breaks.py <directory>", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
workdir = Path(sys.argv[1])
|
||||
files = sorted(workdir.glob('*.md'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user