Skip to content

xinetzone/SpecWeave / .agents/skills/doc-page

Doc Page

Verified

Create polished printable document pages for reports, forms, schedules, resumes, memos, and records, with clean A4 layout and optional PDF or DOCX export when needed.

references/validation.md

View on GitHub
# Validation Reference

Use this checklist before handing off a paged HTML document.

## Structural Checks

- The HTML starts with `<!-- Generated by Trae Work -->` on line 1.
- The final response includes the final HTML file path with a `computer://` prefix for Trae rendering.
- The HTML file lives inside a dedicated document folder, not directly in the workspace/output root.
- The document folder is self-contained. For pure single-HTML documents, it may contain only the HTML file; for non-single-HTML documents, it contains only the dependencies required by that HTML.
- Any non-HTML dependencies are referenced with relative paths only.
- `#source` contains continuous semantic content, is hidden on screen, and becomes visible in print CSS.
- `#pages` starts empty and is populated by the screen paginator.
- Visible pages use `.page-frame > .page > .page-content`; flow-pagination pages contain `.page-slice` views of the same source.
- Screen preview controls use `.viewer-tools` or an equivalent transient zoom UI when the template includes viewer controls.
- Content is not manually authored as fixed page 1/page 2 chunks unless intentional.
- Ordinary long tables remain real tables with `thead`, not script-generated continuation tables, unless a complex table requires manual splitting.
- Page numbers are generated after pagination.
- The visual structure matches the document type: report, form, resume, schedule, directory, memo, or formal letter.
- The output is not using the default research-report sample structure when another document genre is clearly requested.

## Visual Checks

- Pages fit browser width with small left/right gray margins.
- Preview zoom scales page frames, not document font sizes.
- Zoom controls are small, transient, and do not permanently cover document content.
- Reset zoom returns to fit-width behavior and the controls fade out afterward.
- If two-column preview is enabled, pages do not overlap and the layout returns to one column when the viewport is too narrow.
- Page gaps are visible but modest.
- Body text remains the intended report size.
- No unexplained running heads or decorative labels occupy page space.
- Large blank areas are explained by page endings or fixed intentional layout; ordinary tables should not be pushed wholesale to the next page.
- Tables, captions, and headings do not overlap page numbers.
- Images are not clipped, stretched, blurred, or too small to inspect.
- Cover images, screenshots, logos, portraits, signatures, and seals use intentional cropping and stable print dimensions.
- Figure captions stay with their images.
- Forms with merged cells, long notes, signatures, or writable areas preserve their intended geometry.
- Resumes, directories, schedules, and formal records remain scannable at print size.
- Browser automation checks should not save `preview.png` or other screenshot artifacts by default. Save screenshots only when the user explicitly asks to see an image preview or when visual debugging requires an artifact.

## Overflow Checks

- No page clips visible content in the screen preview.
- No single fixed-height element is taller than a page.
- No image-plus-caption block is taller than a page unless handled by stronger pagination.
- Long source lists are split into item-level blocks.
- Ordinary long tables are allowed to span pages; complex merged-cell tables and long form cells are split manually, compact-fitted with validation, or handled with a stronger paged-media engine.
- If compact-fit is used, the resulting text remains readable and the page has no hidden overflow.

## Print Checks

When possible, open print preview or export to PDF:

- A4 pages are preserved.
- Zoom controls are hidden.
- Screen preview scaling is disabled.
- Shadows and gray screen background disappear.
- Page breaks are close to the browser preview. In flow-pagination mode, PDF/print is authoritative for exact table header repetition and row fragmentation.
- Table headers repeat in exported PDF when a table crosses a page.
- Images retain acceptable contrast and resolution.
- Last page is not followed by a blank page.

## Common Failure Modes

- **Huge blank gap:** the document is still using hard block-level pagination, oversized keep-together blocks, or fixed-height content; switch to flow-pagination or remove unnecessary `break-inside: avoid`.
- **Text shrinks on small screens:** screen fit is changing typography instead of scaling paper.
- **Sticky zoom controls:** viewer controls keep focus or hover state and never fade out; hide them on a timer and blur clicked buttons.
- **Zoom controls print:** `.viewer-tools` is not hidden in print CSS.
- **Broken reset:** reset sets a fixed scale instead of returning to fit-width behavior.
- **Content clipped:** a fixed element, image, figure, or complex table is taller than page content height.
- **Form bottom clipped:** a long merged-cell table is being treated as one unsplittable block; split it, compact-fit it, or use stronger pagination.
- **Image clipped or missing caption:** an image block is too tall or caption is outside the figure block; resize, split, or keep the caption inside the same `.flow-block`.
- **Blurry cover or screenshot:** the source image resolution is too low for the printed size; use a higher-resolution asset or reduce printed dimensions.
- **Wrong genre:** a form, resume, roster, or letter looks like a research report; revisit `document-types.md`.
- **Manual pagination pain:** content and `.page` structure are coupled; move content back into `#source` and use flow-pagination slices for the screen preview.
canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill.Stars: 198kUpdated Claude CodeCodexVerifiedInstall