$npx -y skills add Lylll9436/Paper-Polish-Workflow-skill --skill ppw-teamOrchestrate parallel paper processing. Split paper into sections and run any eligible Skill (polish, translation, de-ai) across sections via subagents. 团队协作模式:将论文拆分为章节并行处理。
| 1 | ## Purpose |
| 2 | |
| 3 | This Skill orchestrates parallel paper processing by splitting a paper into H1 sections and dispatching eligible Skills to subagents. In Phase 19 (current), it validates the proof-of-concept gate by running a single subagent on one section. Full parallel dispatch across all sections is Phase 20. |
| 4 | |
| 5 | ## Trigger |
| 6 | |
| 7 | **Activates on:** `ppw:team [skill] [file]` invocations. |
| 8 | |
| 9 | **Examples:** |
| 10 | - "ppw:team polish paper.tex" / "团队模式润色论文" |
| 11 | - "ppw:team translation draft.md" / "并行翻译论文各章节" |
| 12 | - "ppw:team de-ai paper.tex" |
| 13 | |
| 14 | ## Modes |
| 15 | |
| 16 | | Mode | Default | Behavior | |
| 17 | |------|---------|----------| |
| 18 | | `guided` | Yes | split -> user confirms sections -> user selects PoC section -> run PoC -> user confirms quality | |
| 19 | | `direct` | | skip confirmations, auto-select all body sections and first section for PoC | |
| 20 | |
| 21 | **Mode inference:** "直接" or "direct" in trigger switches to direct mode. |
| 22 | |
| 23 | ## References |
| 24 | |
| 25 | `required: []` -- This Skill does not produce academic text itself. It orchestrates other Skills that load their own references at runtime. No reference files are needed by the orchestrator. |
| 26 | |
| 27 | ## Ask Strategy |
| 28 | |
| 29 | **Guided mode** -- three interaction points via AskUserQuestion: |
| 30 | 1. Section selection (multiSelect) after splitting |
| 31 | 2. PoC section selection (single select) from selected sections |
| 32 | 3. PoC quality confirmation (approve/retry/exit) |
| 33 | |
| 34 | **Direct mode** -- skip all three: auto-select all body sections (exclude preamble and bibliography), auto-select first body section for PoC, auto-approve PoC output. |
| 35 | |
| 36 | ## Workflow |
| 37 | |
| 38 | ### Step 0: Workflow Memory (Recording Only) |
| 39 | |
| 40 | - Skip pattern detection -- orchestrator is not suitable for auto-direct-mode recommendation. |
| 41 | - Recording happens after Step 1 validation (see Step 1). |
| 42 | |
| 43 | ### Step 1: Parse Arguments and Validate |
| 44 | |
| 45 | - Parse `$ARGUMENTS` to extract: Skill name (first word) and file path (remaining words). |
| 46 | - Validate Skill name against whitelist: `["translation", "polish", "de-ai"]` |
| 47 | - If Skill is not in whitelist, reject with exact message: "[Skill] requires full-paper context and cannot run in parallel. Please run /ppw:[skill] directly." |
| 48 | - Validate file exists and is `.tex` or `.md` format. If file not found or wrong format, report error and stop. |
| 49 | - Read the paper file content. |
| 50 | - **Record workflow:** Append `{"skill": "ppw:team", "ts": "<ISO timestamp>"}` to `.planning/workflow-memory.json`. Create file as `[]` if missing. Drop oldest entry if log length >= 50. |
| 51 | |
| 52 | ### Step 2: Create Working Directory |
| 53 | |
| 54 | - Create `.paper-team/` directory structure: `sections/`, `output/`. |
| 55 | - If `.paper-team/` already exists: in guided mode, ask to overwrite or cancel; in direct mode, overwrite silently. |
| 56 | - Create backup of original paper: `.paper-team/{filename}-backup-{YYYYMMDD-HHmm}.{ext}` (timestamped to prevent overwrite on re-runs). |
| 57 | - Initialize `.paper-team/manifest.json`: |
| 58 | |
| 59 | ```json |
| 60 | { |
| 61 | "version": "1.0", |
| 62 | "created": "<ISO timestamp>", |
| 63 | "source_file": "<original file path>", |
| 64 | "source_format": "tex|md", |
| 65 | "target_skill": "<skill name>", |
| 66 | "sections": [], |
| 67 | "poc": { "section_id": null, "status": "pending", "timestamp": null }, |
| 68 | "backup": "<backup filename>" |
| 69 | } |
| 70 | ``` |
| 71 | |
| 72 | ### Step 3: Split Paper into Sections |
| 73 | |
| 74 | **For .tex files:** |
| 75 | - Preamble: everything from start through `\begin{document}` (inclusive). Label "00 - Preamble". |
| 76 | - Bibliography: from `\bibliography{}` or `\printbibliography` through `\end{document}`. Label "99 - Bibliography". |
| 77 | - Section boundaries: each `\section` command. Match `\section` followed by optional `*` and optional `[...]` then `{...}`. Ignore lines starting with `%` (LaTeX comments). |
| 78 | - Content between `\begin{document}` and the first `\section{}` is "00 - Pre-section content" (if non-empty after trimming). |
| 79 | - Each section: content from its `\section{Title}` line through the line before the next `\section{` or the bibliography boundary. |
| 80 | |
| 81 | **For .md files:** |
| 82 | - Frontmatter: content before the first `# ` heading. Label "00 - Frontmatter" (if non-empty). |
| 83 | - Split at lines beginning with `# ` (H1 headings). |
| 84 | - Each H1 heading and its content until the next `# ` is one section. |
| 85 | |
| 86 | **Section file naming:** `{NN}-{sanitized-title}.{ext}` where NN = zero-padded sequence number, sanitized-title = title lowercased, spaces to hyphens, special chars removed, max 50 chars. Preamble: `00-preamble.{ext}`. Pre-section: `00-presection.{ext}`. Bibliography: `99-bibliography.{ext}`. Frontmatter: `00-front |