From hp5200-printer
Print a test page from the HP DeskJet 5200 with a joke message, ink levels, printer IP, agent identity, and repo URL. Demonstrates templated variable injection in a skill.
npx claudepluginhub danielrosehill/claude-code-plugins --plugin hp5200-printerThis skill uses the workspace's default tool permissions.
Print a humorous test document that doubles as a capability demo — showing templated variable injection, live ink level queries, and printer auto-discovery.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
Print a humorous test document that doubles as a capability demo — showing templated variable injection, live ink level queries, and printer auto-discovery.
Read context/printer-config.md for the CUPS printer name and IP.
Before generating the document, collect these values:
| Variable | How to get it |
|---|---|
AGENT_NAME | The name of the AI agent running this skill (e.g. "Claude Code") |
MODEL_NAME | The model powering the agent (e.g. "Opus 4.6", "Sonnet 4.6") — use whatever model you are |
PRINTER_IP | From context/printer-config.md |
CUPS_NAME | From context/printer-config.md |
INK_COLOR | Query via IPP (see check-ink skill) — tri-color cartridge percentage |
INK_BLACK | Query via IPP — black cartridge percentage |
TIMESTAMP | Current date and time |
cat > /tmp/hp5200-ink.test <<'EOF'
{
OPERATION Get-Printer-Attributes
GROUP operation-attributes-tag
ATTR charset attributes-charset utf-8
ATTR naturalLanguage attributes-natural-language en
ATTR uri printer-uri $uri
ATTR keyword requested-attributes marker-names,marker-levels
}
EOF
ipptool -tv ipp://PRINTER_IP:631/ipp/print /tmp/hp5200-ink.test 2>&1 | grep marker-levels
rm -f /tmp/hp5200-ink.test
Parse the two integers from marker-levels — first is tri-color, second is black.
Generate the Typst source with all variables injected:
#set page(paper: "a4", margin: 2.5cm)
#set text(font: "IBM Plex Sans", size: 11pt)
#v(3cm)
#align(center)[
#text(size: 48pt)[🤖]
#v(0.5cm)
#text(size: 28pt, weight: "bold")[I Set Up A Local AI Agent]
#v(0.4cm)
#text(size: 20pt)[...And All It Did Was Print]
#v(0.2cm)
#text(size: 28pt, weight: "bold")[This Lousy Document]
#v(0.4cm)
#text(size: 48pt)[😄]
#v(1.5cm)
#line(length: 60%, stroke: 0.5pt)
#v(0.6cm)
#text(size: 10pt, fill: luma(80))[
Printed by *«AGENT_NAME»* (`«MODEL_NAME»`) \
«TIMESTAMP» \
Printer: `«CUPS_NAME»` at `«PRINTER_IP»`
]
#v(0.4cm)
#text(size: 10pt, fill: luma(80))[
*Ink levels at time of printing:* \
Tri-color (CMY): «INK_COLOR»% #h(1cm) Black: «INK_BLACK»%
]
#v(0.6cm)
#text(size: 8pt, fill: luma(120))[
If you're reading this, the printer works. \
The AI is self-aware enough to be sarcastic. \
We're all going to be fine. Probably.
]
#v(1cm)
#text(size: 8pt, fill: luma(150))[
Plugin: `https://github.com/danielrosehill/Claude-HP5200-Skill-plugin`
]
]
Replace all «VARIABLE» placeholders with the actual gathered values before writing the file.
mkdir -p /tmp/hp5200-print
typst compile /tmp/hp5200-print/test.typ /tmp/hp5200-print/test.pdf
lp -d «CUPS_NAME» /tmp/hp5200-print/test.pdf
No approval needed — this is a test page, the user invoked it knowing what it does.
Tell the user the test page has been sent and to check the printer output tray. Include the ink levels in your response too.