Install
Install with PiG
pig install npm:pi-artifact-forgerInstall with Pi
pi install npm:pi-artifact-forgerPackages 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 badgedEstimates, 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+Ksearch, 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 navigableindex, regenerable vianpm run make-examples.
| Piece | Path | Role |
|---|---|---|
| Design contract | resources/artifact-forger/_template.html | Single-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. |
| Agent | agents/artifact-forger.md | Zero-context artifact-forger subagent (read/grep/write/edit/bash). Delegating generation here keeps the design system out of the main session's context. |
| Skill | skills/artifact-forger/SKILL.md | Ships with the pi package; trigger rules + inline-generation fallback when the agent isn't installed. |
| User guide | docs/user-guide.md | Generation phrases, genre reference, artifact features, keyboard shortcuts, printing, maintenance. |
| Examples | examples/ | 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 bootstrapsartifacts/_template.htmlif the project has none, generatesartifacts/<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+Ksearch, 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 badgedEstimates. - Diagram look:
classicdefault,handDrawn(seeded) for explainers,neofor dashboards — same Mermaid source either way. - The Document Kit is self-inert: its CSS is scoped under
.docand its JS no-ops without a.docelement, so stripping it from dashboard artifacts is optional. Its marker comments (GENRE:DASHBOARD STARTER,GENRE:DOCUMENT KIT) are contract-internal — artifacts display them with theGENRE·…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: deleteartifacts/_template.htmland 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.