Output Generator
Use this skill at Step 8.
Inputs
- Analysis result (Step 6)
- Selected mode (A/B/C/D or auto)
- Output language
- File format preference
Mandatory Sections
Every output must include:
- Scope & as-of date
- Conclusion summary
- Issue tree
- Detailed analysis
- Annotated bibliography
- Verification guide
Citation Integrity Rules (Anti-Laundering)
Apply docs/style-guides/legal-research-core-contract.md. In the Verification Guide
(mandatory section #6), list primary sources separately from supporting commentary
and flag any conclusion where primary-source verification was not possible.
Templates
references/mode-a-template.mdreferences/mode-b-template.mdreferences/mode-c-template.mdreferences/mode-d-template.mdreferences/citation-format-guide.md
If output intent matches legal opinion deliverables (법률 의견서, opinion letter, legal opinion, formal opinion, opinion memo), ALWAYS read:
.claude/skills/legal-opinion-formatter/SKILL.md
This is a mandatory routing rule for opinion-letter style outputs.
Mode Auto-Selection Rules
When output_mode is auto, select based on the dominant query characteristic:
| Query characteristic | Mode |
|---|---|
| Executive summary, management briefing, quick action list | A — Executive Brief |
| Multi-jurisdiction comparison, regulatory matrix, divergence | B — Comparative Matrix |
| Enforcement history, case law survey, regulatory decisions | C — Enforcement & Case Law |
| Deep statutory analysis, article-by-article commentary, black-letter text | D — Black-letter & Commentary |
Tie-breaking rule: prefer Mode B when 2+ jurisdictions and a comparison table is useful; prefer Mode A when the user signals a time constraint or uses words like "summary" or "quick overview."
State selected mode and one-line rationale before generating output (e.g., Mode B selected — 3 jurisdictions require comparative matrix.).
Format & Save Rules
- First query in session: ask preferred file format.
- Later queries: confirm previous format.
- Before promising a save, confirm the requested format is actually available in the current environment.
.docxrequirespython-docx..pdfand.pptxrequire a working converter path; if unavailable, state the limitation and offer.docxor.html.
- Show inline preview first.
- Save only after explicit confirmation.
- If the deliverable will trigger Step 10 (Mode B/C/D, memo, or opinion), save the confirmed content as a markdown draft first and return that draft path to the orchestrator. Do not treat this draft as the final artifact.
- After Step 10 completes or is explicitly skipped, render the final requested format exactly once.
- After final rendering, verify the artifact exists on disk and is non-empty before reporting success.
- If file name collides, append
_v2,_v3, etc.
Scripts
- Unix-like:
scripts/file-converter.sh - Windows PowerShell:
scripts/file-converter.ps1
Use the converter wrapper when deterministic file conversion dispatch is needed.