← Catalog

pi-artifact-forger

Artifact generation system for the Pi coding agent: a versioned single-file HTML design contract, a zero-context artifact-forger subagent, and the rules that turn plans and reports into reviewable, self-contained artifacts.

Package

Install

Install with PiG

pig install npm:pi-artifact-forger

Install with Pi

pi install npm:pi-artifact-forger
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "skills": [
    "skills/*"
  ]
}

README

Written by the package's publisher, shown as published in version 0.3.1 (README.md). PiG does not review it.

pi-artifact-forger

Artifact generation system for the Pi coding agent: turn plans, reports, and data into self-contained, reviewable HTML artifacts — dashboards, specs, manuals, decision records, roadmaps — from one versioned design contract.

Extracted from ../pi-elephant-goldfish (which uses it to make EGM plans reviewable) so any project on any machine can forge artifacts with the same design system.

User guide: docs/user-guide.md — everything you can ask for, everything artifacts can do, keyboard reference, printing, and maintenance.

Features

Generation — in any pi session, in any project:

  • Genre auto-detection: dashboard, report, tech spec, product spec, decision (ADR), roadmap, manual — routed from your content's shape, overridable in the request.
  • Ready-made structures: release notes with version rails and diffs; migration guides with warning callouts.
  • Per-artifact overrides: five palettes (dusk default), light/dark, diagram look (classic / handDrawn / neo).
  • Honesty by default: invented data badged Sample Data, estimates badged Estimates, markdown stays the source of truth.

Artifacts — single self-contained HTML files that work over file://:

  • Five palettes + light/dark with live theme sync across charts (Chart.js 4) and diagrams (Mermaid 11).
  • Fit-to-container diagrams with zoom controls, Mermaid source copy, and natural-size SVG export.
  • Document genres get a reading layout: sticky table of contents with scrollspy, Ctrl+K search, callouts, sortable/filterable tables, numbered figures, spec headers, steps, checklists, prereq chips, pros/cons, before/after diffs, and version rails.
  • Print/PDF styling: light values forced per palette, page-break hygiene, interactive chrome hidden.

Operations:

  • Project bootstrap of the versioned design contract (contract:artifact-forger v2); stale templates detected, never edited — upgrade by full re-bootstrap.
  • examples/ — one sample artifact per use case with a navigable index, regenerable via npm run make-examples.
PiecePathRole
Design contractresources/artifact-forger/_template.htmlSingle-file HTML design system: five palettes (dusk default), light/dark, Chart.js 4 + Mermaid 11 theming, zoom/copy/export diagram controls, and a self-inert Document Kit for prose genres (report, tech-spec, product-spec, manual, decision, roadmap). Versioned (contract:artifact-forger v2); never overwritten in target projects — upgrade by full re-bootstrap.
Agentagents/artifact-forger.mdZero-context artifact-forger subagent (read/grep/write/edit/bash). Delegating generation here keeps the design system out of the main session's context.
Skillskills/artifact-forger/SKILL.mdShips with the pi package; trigger rules + inline-generation fallback when the agent isn't installed.
User guidedocs/user-guide.mdGeneration phrases, genre reference, artifact features, keyboard shortcuts, printing, maintenance.
Examplesexamples/One sample artifact per use case (dashboard, report, tech-spec, product-spec, manual, decision, roadmap, release notes) — see examples/README.md. Regenerate with npm run make-examples.

Install

From the git repository (works today):

pi install git:github.com/nsanta/pi-artifact-forger

Or from a local clone:

pi install ./pi-artifact-forger

An npm package is prepared (files, keywords, pi-package marker) but not yet published — once it is, pi install npm:pi-artifact-forger will work.

Development, from a clone:

git clone <this-repo> && cd pi-artifact-forger
npm install && npm test

Set up the agent (one-time per machine)

Pi packages can ship skills but not agents, so the agent installs user-global:

npm run install:agent

This copies the agent to ~/.pi/agent/agents/artifact-forger.md, the canonical template to ~/.pi/agent/artifact-forger/_template.html, and removes legacy artifact-forge copies from the pre-package setup. Re-run it after editing the package sources — never edit the installed copies in place.

Usage

In any pi session, in any project — the full phrase reference lives in the user guide:

  • "Make a dashboard of our Q3 cloud spend" → the session delegates to artifact-forger, which bootstraps artifacts/_template.html if the project has none, generates artifacts/<name>.html, and opens it in your browser. It returns just the path — no design-system context leaks into your session.
  • "Draft a tech spec for the importer" / "write up this migration as a runbook" → the agent auto-detects the genre: dense data → dashboard; work summary → report; proposal → tech-spec / product-spec; decision record → ADR-style decision layout; milestone plan → roadmap; release notes/changelog and migration guides get dedicated structures; procedure → manual. Document genres get a reading layout with TOC, callouts, tables, sortable/filterable tables, Ctrl+K search, print-friendly styling, and statically numbered figures; you can always force a genre in the request.
  • "Use the nordic palette" / "hand-drawn diagram style" → per-artifact overrides.
  • Small tweaks ("add a chart", "change the wording") → edited in place, no delegation.

Design rules (summary)

  • Artifacts must work over file://: one HTML file, inline CSS/JS, pinned UMD CDNs (lucide@0.460.0, chart.js@4.4.7, mermaid@11.4.1), never @latest.
  • Markdown is the source of truth; artifacts are human-facing projections. Plan changes go into markdown first, then the artifact is regenerated — never the reverse.
  • Invented data is badged Sample Data; estimates are badged Estimates.
  • Diagram look: classic default, handDrawn (seeded) for explainers, neo for dashboards — same Mermaid source either way.
  • The Document Kit is self-inert: its CSS is scoped under .doc and its JS no-ops without a .doc element, so stripping it from dashboard artifacts is optional. Its marker comments (GENRE:DASHBOARD STARTER, GENRE:DOCUMENT KIT) are contract-internal — artifacts display them with the GENRE·… variant (middle dot).
  • Projects with a pre-v2 bootstrapped _template.html: generating a document artifact there inline-appends the kit into the artifact (the project template is never edited). Upgrade the template by full re-bootstrap: delete artifacts/_template.html and let the agent re-copy the canonical.

Relationship to pi-elephant-goldfish

pi-elephant-goldfish (EGM for pi) adopts this system for plan-review artifacts via a thin AGENTS.md trigger that delegates to the agent installed from this package. The Goldfish review mechanism itself is unrelated and lives there — this package only forges artifacts.