Home / All Skills / Docs & Knowledge / invoice
Docs & Knowledge · nexu-io/html-anything

invoice

Standard Invoice: Sender/Recipient + Line Items + Tax + Totals + Payment Instructions

L1 Basic · Source registration onlyV1 Commit-PinnedDual-pass Audit
Author nexu-ioGitHub nexu-io/html-anything ↗Stars 8827License Apache-2.0(仓库根 LICENSE 文件为 Apache License Version 2.0;package.json "license": "Apache-2.0";GitHub API spdx_id Apache-2.0)Commit 553ed98c28
Control levels describe skill capabilities and suggested control measures; they do not represent quality or safety certifications, nor do they dictate usability. Usage decisions rest entirely with users and administrators. Different agent hosts apply varying constraints; do not assume hosts provide automatic protection. Third-party skill copyrights belong to their original authors. Use at your own risk.

1How It Works & Mechanism

The 5-section structure of the single-page A4 invoice is fixed: header (invoice number/date/due date) → From/Bill to → line items table → right-aligned tax + totals → payment instructions.

next/src/lib/templates/skills/invoice/SKILL.md
- Header: 发票号 / 日期 / 截止日
The structural list acts as the field checklist; the model only needs to fill in the content section by section, ensuring easily forgotten blocks like tax and payment instructions are not missed.

Print usability is handled exclusively via @media print: the print branch removes shadows, removes borders, and adjusts padding; a single-column collapse fallback is also provided for viewports below 720px.

next/src/lib/templates/skills/invoice/example.html
@media print {
The example removes box-shadow/border from .sheet in the print branch and switches to a white background; the requirement to 'preserve color contrast' in the body text is implemented by 'modifying only the background and padding while leaving text colors intact'.

Amounts are not limited to just a Total: the example provides an auditable hierarchy of Subtotal → Sales tax · NY (9%) → Net before tax.

next/src/lib/templates/skills/invoice/example.html
<div class="total-row tax"><span>Sales tax · NY (9%)</span><span>$3,246.48</span></div>
Layering taxes and net amounts makes the invoice auditable; payment terms separately specify Net 30 days + 1.5% monthly late fee + deposit deduction.

The template itself is the prompt: the SKILL.md body is read by the loader, assembled with the shared preface and user content, and passed to the local agent CLI for execution.

next/src/app/api/convert/route.ts
prompt = assemblePrompt({ body: skill.body, content, format });
Runtime does not execute code inside the template directory: /api/convert only receives {agent, templateId, content}, fetches the SKILL.md body via loadSkill(templateId) as the prompt core, and hands it to the locally authenticated agent CLI; HTML streams back to the frontend via stdout.

The skill directory consists purely of plain-text assets: the loader reads SKILL.md from disk, and no executable code inside the directory is loaded.

next/src/lib/templates/loader.ts
const raw = safeRead(path.join(dir, "SKILL.md"));
Skills in the file system are merely text: the loader reads SKILL.md directory by directory, extracts frontmatter as picker metadata, and returns the body; no modules within this template directory are imported or executed.

The shared preface is injected before the template, establishing the highest priority that 'the template only defines layout/style/palette/font/component library, while quantity is determined by user content'.

next/src/lib/templates/shared.ts
【内容驱动数量 — 最高优先级, 覆盖模板里的任何数字】
Injected before the template body, the shared preface specifies that 'the template only defines layout/style/palette/font/component library, while quantity is determined by user content'—therefore, the layout list in this template serves as a 'reusable layout pool' rather than a hard limit on pages or frames.

The shared preface is injected before the template, establishing the highest priority that 'the template only defines layout/style/palette/font/component library, while quantity is determined by user content'.

next/src/lib/templates/shared.ts
- **禁止使用 Write / Edit / MultiEdit / Bash / Create / 任何文件系统工具**。不要把 HTML 写到任何 \`.html\` 文件里。前端直接捕获你的 stdout 文本, 文件落盘由前端负责。
The preface explicitly prohibits file system tools and requires pure HTML to stream directly from the response body, with disk persistence handled by the frontend—thus, there is no disk-write behavior on the skill side.

The skill directory consists purely of plain-text assets: the loader reads SKILL.md from disk, and no executable code inside the directory is loaded.

next/src/lib/templates/loader.ts
const exampleHtml = safeRead(path.join(dir, "example.html"));
example.html in the directory is a golden sample distributed with the repository; the preview route directly reads and serves it from disk (without building or compiling), serving both as a quality baseline and as showcase asset.

2Core Capabilities

01Print-ready A4 single page (@media print + mobile single-column collapse)
02Line items table (Description / Quantity / Unit Price / Amount)
03From / Bill to two-column split layout
04Tiered tax and totals (Subtotal / Sales tax / Net before tax)
05Payment instructions + handwritten-style signature section

4Recommended Governance & Evidence

Suggested Controls for Safe Operation
For Agent Runtime
Can be auto-loaded
For Administrators
Register source and version
Evidence & Triggers (File Paths & Excerpts)
  • SKILL.md: Pure prompt instructions and rule text, with no script execution or external impact
Audit Notes: 🟢 Green (). Scope of evaluation = the skill's own directory: zero URLs inside the directory (example.html contains no http(s) endpoints either). The directory contains only SKILL.md and example.html, with zero scripts, zero executable code, zero network endpoints, zero credential reading, and zero disk-writing instructions—executing according to SKILL.md merely results in the host model outputting an HTML text stream without any outbound or disk persistence actions. Behaviors of the host wrapper and consumer side are not grounds for rating tier, but are recorded in verdict.risks: the shared.ts preface requires the output to reference Tailwind CDN (https://cdn.tailwindcss.com) and Google Fonts, the runtime spawns the locally authenticated agent CLI (envFor transparently passes process.env), and the preview iframe uses sandbox="allow-scripts allow-same-origin".

5Second-Pass Verification

  • [ok] 规范↔示例:五段全覆盖 — header(INV-2025-0142 / Issued 14 October 2025 / Due 13 November 2025)、Bill to、明细表(Description 表头)、Subtotal/Sales tax/Net before tax、Payment terms 全部命中。
  • [ok] 打印样式核对 — 示例 `@media print` 分支确做去阴影/去边框/改 padding(`.sheet { box-shadow: none; border: none; margin: 0; padding: 32px 36px; }`),与正文「@media print 样式」一致。
  • [ok] 「颜色对比保留」核对 — 打印分支只改背景/阴影/边距,未改文字色变量(--ink/--muted 保持),对比度不降。
  • [ok] 移动端兜底(正文未要求) — 示例另有 `@media (max-width: 720px)` 把 parties/pay/signoff/totals 塌成单列,属超出规范的加固,非违背。
  • [ok] 税务/条款为示例文案 — 示例的 NY 9% 销售税、1.5% 月服务费、30 天账期均为演示内容,正文未规定任何税务口径,须由用户输入决定——不算夸大也不构成合规保证。
  • [ok] 目录资产面普查 — glob 全量:SKILL.md、example.html;无 scripts/、无 references/、无数据文件、无包管理器清单。
  • [ok] 可执行代码普查 — example.html 内 <script> 计数 = 0,fetch/XMLHttpRequest/WebSocket 命中 0;SKILL.md 全篇无脚本或可执行代码。
  • [ok] 外链端点普查 — 目录内(含 example.html)零 http(s) 命中,产物离线自持。

6Verdict & Scenarios

  • Ready to print out of the box, with narrow-screen fallback included
  • Complete, auditable hierarchy of amounts
  • Payment instructions and signature block provide a complete professional document feel
  • Best for: Billing for freelancers/studios, SaaS subscription invoices, consulting project billing statements; best suited when a single-page invoice with clear amount tiers and direct printability is needed.
    Not for: Scenarios requiring accounting system integration or automated tax calculation (the template does not validate tax logic); formal invoices requiring digital signatures and audit trails; contexts requiring Chinese VAT invoice elements.
    Install Agent-Ready
    ① Verified Mirror 2026-09-15
    Option A · Direct DownloadDownload invoice.tar.gz
    sha256: a389000ce1b07884…
    Option B · Copy Guide for Agent
    install.json
    Agents automatically download and verify mirrors from this JSON guide.
    ② Upstream GitHub
    GitHub Repo ↗
    Pinned to commit 553ed98c28.