AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Docx Report

skill-drharunyuksel-docx-report-skill-docx-report-skill · by drharunyuksel

>-

No reviews yet
0 installs
9 views
0.0% view→install

Install

$ agentstack add skill-drharunyuksel-docx-report-skill-docx-report-skill

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-drharunyuksel-docx-report-skill-docx-report-skill)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
4mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Docx Report? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

.docx Report Skill

Generate professional Word documents with custom branding using the docx npm package and shared helper modules.

Setup

On first use, install the dependency:

cd /references && npm install

Check: if references/node_modules/docx does not exist, run the install before proceeding.

Brand Customization

Edit references/brand-config.js to set your organization name, font, and color palette. This is the only file you need to change to match your brand. See references/color-palette.md for guidance on choosing colors.

Workflow

Step 1: Understand the Content

Before writing any code, determine:

  • What data or analysis needs to be presented?
  • What sections does the report need? (title, summary tables, breakdowns, observations, methodology, etc.)
  • What table schemas are needed? (column names, widths, alignment)

Step 2: Plan Document Structure

Sketch the section order:

  1. Title blocktitleBlock(title, subtitle) + metaLine() for date/source metadata
  2. Data sectionsheading1() + createTable() for each major table, separated by pageBreak()
  3. Narrative sectionsheading1() + heading2() + bodyText() + bulletPoint()
  4. Methodology — at the end, as bullet points

Step 3: Generate the Report Script

If the user doesn't specify an output location, default to the reports/ directory. Create it if it doesn't exist (mkdir -p reports), then create a JS file (e.g., reports/my_report.js) that:

const path = require("path");

// Import shared helpers — always use absolute path to skill references
const SKILL_REF = "/references";
const { createTable, PAGE_W } = require(path.join(SKILL_REF, "table-templates"));
const { heading1, heading2, bodyText, bulletPoint, metaLine, spacer, pageBreak } = require(path.join(SKILL_REF, "typography"));
const { titleBlock, buildDocument, packAndWrite } = require(path.join(SKILL_REF, "page-setup"));

const children = [];
children.push(...titleBlock("Report Title", "Subtitle"));
children.push(metaLine("Report Date: ", "March 28, 2026"));
// ... add sections, tables, observations ...

const doc = buildDocument(children, { headerText: "My Org — Report Title" });
packAndWrite(doc, "reports/my_report.docx");

Replace ` with the actual path to this skill directory (e.g., /path/to/project/.claude/skills/docx-report-skill`).

Step 4: Run & Validate

node reports/my_report.js

Step 5: Present & Iterate

After every run (first creation and every subsequent edit), tell the user:

> "Here's your report. Take a look — if you want any changes, let me know. Once you're happy with it, I'll clean up the build script."

Always ask this after each iteration — not just the first time. If the user requests changes, modify the existing JS file and rerun it. Do not recreate the script from scratch — editing is faster and preserves context.

Step 6: Clean Up

Once the user is satisfied with the report, delete the JS build script:

fs.unlinkSync("reports/my_report.js");

The .docx file is the deliverable. The build script is a temporary artifact.

Helper API Reference

table-templates.js

| Export | Description | |--------|-------------| | COLORS | Object with all brand color hex constants (from brand-config.js) | | FONT | Font family string (from brand-config.js) | | PAGE_W | 9360 — US Letter content width in DXA at 1" margins | | borders | Standard border config object | | cellMargins | Standard cell margin config { top: 60, bottom: 60, left: 100, right: 100 } | | headerCell(text, width) | Branded header cell with white bold centered text | | dataCell(text, width, opts?) | Data cell. opts: { isAlt, align, bold } | | createTable(headers, rows, columnWidths, opts?) | Full table with branded headers + alternating rows. opts: { aligns: ["left","center","right"], boldCols: [false,true] } | | AlignmentType | Re-exported from docx | | WidthType | Re-exported from docx | | BorderStyle | Re-exported from docx | | ShadingType | Re-exported from docx |

typography.js

| Export | Description | |--------|-------------| | heading1(text) | Large bold, primary brand color, HEADING1 | | heading2(text) | Medium bold, secondary brand color, HEADING2 | | heading3(text) | Small bold, primary brand color, HEADING_3 | | bodyText(text) | 10pt regular body paragraph | | metaLine(label, value) | Bold label + regular value on same line | | bulletPoint(text) | Bullet using proper numbering config | | spacer() | Empty paragraph with spacing | | pageBreak() | Page break paragraph | | externalLink(text, url, label?) | Clickable hyperlink. Optional bold label prefix. |

page-setup.js

| Export | Description | |--------|-------------| | titleBlock(title, subtitle?) | Returns Paragraph[] — centered title + subtitle with brand-colored border | | buildDocument(children, opts?) | Full Document with styles, numbering, header, footer, page setup. opts: { headerText } (defaults to ORG_NAME from brand-config) | | packAndWrite(doc, outputPath) | Pack to buffer and write .docx file |

Common Pitfalls

Do NOT import directly from docx

Never do this in your report script:

// WRONG — causes "rootKey" validation errors
const { Paragraph, TextRun, ExternalHyperlink } = require("docx");
// or
const { Paragraph, TextRun } = require(path.join(SKILL_REF, "node_modules/docx"));

The docx library uses instanceof checks internally. When your script imports from a different require() path than the helpers, Node.js creates separate module instances. Objects from your import fail the helpers' instanceof checks, causing the XML serializer to emit invalid rootKey elements instead of proper `` nodes — resulting in:

Element 'rootKey': This element is not expected. Expected is ( {http://schemas.openxmlformats.org/wordprocessingml/2006/main}sectPr ).

Instead, use only the helper functions (bodyText, metaLine, bulletPoint, heading1, etc.) for all content. If you need raw docx classes (e.g., AlignmentType, BorderStyle), import them from table-templates.js which re-exports them from the correct module instance:

// CORRECT — use re-exports from helpers
const { AlignmentType, BorderStyle, COLORS } = require(path.join(SKILL_REF, "table-templates"));

Hyperlinks

Use the externalLink() helper from typography.js for clickable links:

// Clickable hyperlink with optional bold label
children.push(externalLink("View Spreadsheet", "https://docs.google.com/spreadsheets/d/ABC123", "Source: "));

Never construct ExternalHyperlink directly — always use the externalLink() helper.

Design Principles

  1. Always use buildDocument() to create the Document — never construct new Document() directly. It includes required numbering configs, styles, header, and footer.
  1. Column widths must sum to PAGE_W (9360 DXA). Pre-calculated suggestions:

| Layout | Column Widths | |--------|--------------| | 2 equal | [4680, 4680] | | 3 equal | [3120, 3120, 3120] | | 4-col (rank, code, desc, count) | [700, 1200, 5460, 2000] | | 4-col (code, desc, all, active) | [1100, 4460, 1900, 1900] | | 3-col (category, all, active) | [4360, 2500, 2500] | | 7-col (label + 6 values) | [2460, 1150, 1150, 1150, 1150, 1150, 1150] |

  1. Use ShadingType.CLEAR for fills — never SOLID (causes black backgrounds).
  1. Page breaks between major sections to prevent table splits.
  1. All fonts come from brand-config.js — the helpers enforce this.
  1. Colors only from the palette — see references/color-palette.md.

Quality Checklist

  • [ ] Script runs without errors (node reports/my_report.js)
  • [ ] All tables have branded header rows
  • [ ] Column widths sum to 9360
  • [ ] Page breaks separate major sections
  • [ ] Title block present with bottom border
  • [ ] Header and footer appear on every page
  • [ ] No direct new Document() usage — uses buildDocument()
  • [ ] No direct require("docx") or require(".../node_modules/docx") — use only helper functions and re-exports
  • [ ] Build script deleted after user approves the final report

Example

See references/generate-example.js for a complete, runnable example.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.