Sample driven report writing

From 5throck/ai-workspace-standards · View interactive version

Sample driven report writing is an AI agent skill from the GitHub repository 5throck/ai-workspace-standards. Analyzes a deliverable sample (PDF/DOCX/Markdown) to extract its table-of-contents structure AND, for each section, whether tables and/or charts are mandatory — then researches and drafts report content that matches the sample's exact structure and visual-element requirements. Use when: writing any

How to use this skill

Skill file

Context

This skill generalizes the "write-to-sample" discipline: given a finished reference deliverable (a sample) or an official template form, produce a new deliverable whose chapter structure, section composition, and visual-element usage (tables/charts) match the sample exactly — not approximately.

It replaces engagement-specific hardcoding (a fixed chapter table, a fixed page budget, a fixed team roster) with a sample-analysis procedure that derives all of those from the actual sample on disk. Always re-extract from the real attached sample; never trust a cached or previously-known structure, because template forms are revised (e.g. annual 2026형 → 2027형 editions change chapter counts and required tables).

PM Gateway applies: PM displays an execution plan table before dispatching any specialist at each phase transition. PM may Write/Edit only memory/*.md and CHANGELOG.md directly; deliverable files are produced by dispatched specialists.

When to Use

Execution Steps

  1. Phase 1 — Sample Analysis: Ingest the reference deliverable, extract its structure (TOC, mandatory tables/charts per section, placeholder slots, page budget), and produce a Writing Spec artifact. Confirm the spec with the engagement lead before proceeding.
  2. Phase 2 — Research: Dispatch analytical inputs (financial, legal, industry) mapped to each chapter per the Writing Spec.
  3. Phase 3 — Draft: Assign chapter owners by content type, draft in parallel against the Writing Spec, replace all placeholders, enforce table-to-narrative ratio and mandatory visual elements.
  4. Phase 4 — Validate & Render: Structural validation, visual-element audit, render the draft as .docx / .pdf; any other client-required format is produced outside the workspace from the Markdown draft. Max 2 revision cycles before PM escalation.

Detailed instructions for each phase are below.

Phase 1 — Sample Analysis (the differentiator)

Ingest the actual sample and produce a Writing Spec artifact (memory/<engagement>-writing-spec-<date>.md). This is the single source of truth for the rest of the workflow.

1.1 Ingest the sample

| Sample format | Tool | Notes |

|---|---|---|

| .pdf | md-to-ooxml text extraction / WebFetch / manual read | If image-only PDF, OCR first |

| .docx | md-to-ooxml / md-to-report reader | |

| Other formats (e.g. Korean office formats) | Not processed in the workspace — convert to PDF/DOCX/Markdown outside the workspace first | |

If only a paper/PDF scan exists, ask the engagement lead for the editable source — analysis fidelity drops sharply on scans.

1.2 Extract the structure and the per-section visual-element requirements

For each chapter/section visible in the sample, record in the Writing Spec:

  1. Chapter/section number and title (English + original-language).
  2. Table-of-contents position and approximate page span in the sample.
  3. Table mandatory-flag: count table markers in that section (표 N-N, <table>, pipe-tables). If the sample contains one or more tables in this section, mark it requires-table. Record the typical column structure.
  4. Chart/figure mandatory-flag: count figure/chart markers (그림 N-N, 차트, 그래프, embedded images). Mark requires-chart where present. Record the chart type (trend line, bar, pie, etc.).
  5. Narrative-only sections: sections with neither table nor chart markers — prose is the expected output.
  6. Placeholder/guideline slots: every guideline-instruction block ([작성 가이드라인], [기재 방향], 예시N)) and example block that the sample/template uses to instruct the author. These MUST be replaced with real content in the draft — list them so none survive.
  7. Page-budget target: from the sample's completed length (or the template's stated budget), derive a per-chapter page target.

Critical: the table/chart mandatory-flags are not decorative — a section marked requires-table is incomplete without a table, and requires-chart is incomplete without a chart. The draft cannot be considered done until every mandatory visual element is present.

1.3 Confirm the spec with the engagement lead

Before research begins, confirm the Writing Spec (structure + mandatory visual elements + page budget) with the engagement lead. Template editions drift; a wrong spec wastes an entire drafting cycle.

Phase 2 — Research

Dispatch analytical inputs against the Writing Spec's section list:

Phase 3 — Draft (parallel, against the Writing Spec)

Phase 4 — Validate & Render

  1. Structural validation: chapter order matches the sample TOC; no guideline/example placeholder leftovers survive; per-chapter page count is within ±15% of the Writing Spec page budget.
  2. Visual-element audit: re-scan the draft for each section's mandatory-flag — every requires-table / requires-chart section must contain its element. This is the check most likely to fail; iterate.
  3. Render the final format:
  1. Max 2 revision cycles before PM escalation.

Writing Principles (preserved)

  1. No placeholder leftovers — every guideline/example block in the sample must become real narrative.
  2. Expand through argument density, not appendices — meet page targets by deepening tables/charts/interpretation, never by padding with raw source documents.
  3. Table-to-narrative ratio — every table earns at least half a page of interpretation.
  4. Disclosure fallback (KR profile: DART) — explicitly label company-provided unofficial materials.
  5. Client-data handling — drafts contain financials and PII; review for sensitive data before any git add/commit.
  6. File naming — {company}-{report-type}-{YYYY-MM-DD}_ko.md (draft) → .docx / .pdf (or client format converted outside the workspace), in deliverables/reports/.

Output Format

Related Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.