docforge CLAUDE.md

A set of project instructions for working on the PrecisionUtilityGuild/docforge codebase. The project includes a document server for agent-driven PDF creation and a Slack agent that uses it.

In plain words
What is it for?
Understanding the DocForge and Forge components, following their TypeScript and Typst setup, and running the documented build and development commands.
Why use it?
It gives Claude Code the repository's structure, technology choices, entry points, and verified commands in one place.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/precisionutilityguild/docforge/claude-md
Clone the repo
git clone --depth 1 https://github.com/PrecisionUtilityGuild/docforge
Per session 935 This file is loaded in full into every session.
When invoked 935 The same file — it is already loaded in full.
Security scan C 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00935 $0.00935
Opus 5 $0.00467 $0.00467
Sonnet 5 $0.00187 $0.00187
Haiku 4.5 $0.00093 $0.00093

Measured yesterday against content hash 7eba169d6d5f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

docforge CLAUDE.md scanned grade C with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

npm run build # rm -rf dist && tsc — clean
CLAUDE.md · 65 lines

How it starts

The opening of the file, as written. The whole thing — 65 lines — stays where its author put it; the contents beside it link to each section on GitHub.

typstmcp — codebase notes for Claude

What this is

Two products in one repo (see README.md for the full picture):

  • DocForge — an MCP server (stdio) for agent-driven PDF production via Typst. Engine spec: DOCFORGE.md. Entry point src/index.tsdist/index.js.
  • Forge — a Slack agent (Bolt) that drives DocForge over MCP as a stdio child process, not in-process (src/forge/mcp-client.ts; FORGE_MCP=off forces the in-process fallback). Product spec: FORGE.md. Entry dist/slack/app.js.

Other docs: AUDIT.md (security/correctness audit log), HARDENING.md, .cursor/skills/docforge/SKILL.md (agent-facing tool usage guide).

Stack

  • TypeScript, strict, NodeNext ESM — relative imports need the .js suffix.
  • Node ≥ 20. Runtime deps: @modelcontextprotocol/sdk, @slack/bolt, ajv, zod.
  • Typst 0.14.2 pinned (TYPST_VERSION_PIN in src/config.ts); the typst binary must be on PATH. @preview packages are vendored in vendor/typst-packages/ so compiles need no network.
  • vitest, eslint (flat config + typescript-eslint), prettier (enforced in CI-style via format:check).

Commands (verified 2026-07-13)

npm run build          # rm -rf dist && tsc — clean
npm test               # vitest run — 73 files / 546 tests, ~10 s wall
npm run lint           # eslint — clean
npm run format:check   # prettier — clean (use `npm run format` to fix)
npm run check:typst    # asserts local typst matches the 0.14.2 pin
npm run check:packages # asserts vendored @preview packages present

Heavier gates (documented in README, not run during bootstrap): npm run release:qa (full local release gate), npm run test:visual (golden-PNG regression over 24 templates), npm run forge:smoke. Slack dev loop: npm run slack (needs .env from .env.sample with bot + app tokens).

Layout

  • src/ — engine (compile/, templates/, validation/, qa/, repair/, lint/, sandbox/, security/, versioning/), Slack agent (slack/), the Slack→engine bridge (forge/), transcript→template-data mappers (workflow-mappers/).
  • templates/<id>/ — 21 built-in Typst templates, each with main.typ, components.typ, theme.typ, a JSON schema/README/sample, and a golden-page1.png for visual regression. 3 more live in marketplace/.
  • tests/ — flat *.test.ts files, vitest describe/it, shared helpers in tests/helpers.ts (e.g. templateDir()). Tests import from ../src/**/*.js (compiled-style specifiers, resolved by vitest).
  • scripts/*.mjs — release/QA/dev tooling; syntax-checked by npm run check:scripts.

Read the full file on GitHub · 65 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 65 lines · 935 tokens per session scan C 7eba169d6d5f

Subscribe to this mod's changes

docforge CLAUDE.md is an instructions file published in the GitHub repository PrecisionUtilityGuild/docforge (1 stars, last pushed 1mo ago), licensed MIT. It adds 935 tokens to every session, about $0.0047 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.