一键导入
build-guide
Generate a printable Typst build guide (source + PDF) for an ESP32/MCU project by analyzing its docs, source, and schematic
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Generate a printable Typst build guide (source + PDF) for an ESP32/MCU project by analyzing its docs, source, and schematic
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Debug static, hiss, or noise on embedded I2S audio (ESP32 + MAX98357A / PCM DACs), especially streamed PCM. Measure the signal at each pipeline stage instead of guessing at the amp. Use when audio plays but sounds wrong.
Register a project in the monorepo — justfile mod, CI matrix, standard file inventory
Standardize credential handling for an ESP32 project (credentials.h.example, .gitignore, pre-commit protection)
Set up ESP-IDF development environment, create new projects, and verify configuration
Generate a CLAUDE.md for a project with build commands, hardware constraints, architecture, and development tasks
Audit project completeness against the monorepo standard checklist (docs, config, registration)
| name | build-guide |
| description | Generate a printable Typst build guide (source + PDF) for an ESP32/MCU project by analyzing its docs, source, and schematic |
| argument-hint | <project-path> |
| user-invocable | true |
| allowed-tools | Read, Write, Edit, Grep, Glob, Bash, Agent |
Generate or update a printable build guide for the project at $1 (relative
path under packages/<domain>/). The guide is a Typst document plus a rendered
PDF, written to <project-path>/docs/build-guide.{typ,pdf}, aimed at someone
assembling and flashing the hardware from scratch.
It differs from the other doc skills by audience and format:
wiring-doc → WIRING.md: terse pin reference for developers.project-readme → README.md: quick-start for the repo.build-guide → docs/build-guide.pdf: an at-the-bench, print-ready guide
that pulls BOM + wiring + power + assembly + flash + checkout into one styled
document.Read the project sources to gather everything the guide needs. Prefer authoritative sources over prose:
main/pin_config.h (or main/*.h) — authoritative GPIO / bus /
channel assignments. Pin numbers come from here, not the README.WIRING.md — existing wiring tables, I²C topology, power diagram.README.md, CLAUDE.md — purpose, architecture, provisioning, OTA notes.sdkconfig.defaults — target chip, PSRAM/flash size, brown-out, mDNS,
stack sizes, console. Surface any load-bearing settings in troubleshooting.justfile — real build / flash / monitor recipe names and flash offsets.partitions.csv — flash layout / OTA partitions and offsets.main/CMakeLists.txt — REQUIRES reveals components (camera, mdns, ota…).docs/schematics/images/<name>.png — embed it.Identify the board and its constraints (PSRAM mode, 3.3 V-only GPIOs, native USB-Serial-JTAG vs external adapter, GPIO budget, strapping pins).
Write <project-path>/docs/build-guide.typ using the shared template
(see below). Fill each section from real project data; omit sections the
project doesn't use rather than padding with placeholders.
Compile the PDF and link both files from the README (see Compiling and Wiring up sections).
Styling and helpers live in tools/typst/build-guide.typ so all guides look
consistent and improve together. Import it and drive the document with
#show: guide.with(...):
#import "../../../../tools/typst/build-guide.typ": guide, callout, htable, theme
#show: guide.with(
title: "<project-name>",
subtitle: "<one-line what it is>",
version: "<version.txt contents, if any>",
intro: [ short paragraph for the title page ],
meta: (
("Target MCU", [ESP32-S3 (8 MB PSRAM / flash)]),
("Toolchain", [ESP-IDF v5.4 (containerized)]),
),
difficulty: [Intermediate · \~2–3 h],
header-right: "<board name>",
footer-note: [ Pin data mirrors `main/pin_config.h`, which is authoritative. ],
)
= 1 · Overview
...
The relative import path assumes the guide lives at
packages/<domain>/<project>/docs/; from there ../../../../tools/typst/...
reaches the template. Adjust ../ depth for other nesting.
Helpers exported by the template:
guide(...) — page/text/heading styling + title page + table of contents.
Applied via #show: guide.with(...).callout(title, body, kind: "info") — soft left-barred box. kind is one of
info, ok, warn, danger, purple. Override with bar:/fill: colors.htable(cols, header, ..rows, aligns: none) — accent-header, zebra-body
table. header and each row are arrays of content cells.theme — the color dictionary (theme.accent, theme.muted, theme.rule…).Do not re-declare page setup, fonts, heading styles, or table colors in the project file — inherit them from the template so a future style change is a one-file edit.
Use numbered level-1 headings so the table of contents reads as a build order. Include a section only when the project uses it:
callouts for the
headline facts (e.g. core split, "what you get").htable of Qty / Component / Notes, then a short
"Tools required" paragraph. Flag voltage gotchas with a warn callout.#figure(image(...));
explain the bus/topology in prose.htables derived from pin_config.h:
GPIO map, I²C topology, PWM/expander channel map, sensor pinouts.danger callout for the common-ground rule.+ list, power-first, ending with a
pre-power-up continuity check.just <module>::* recipes in a code block, flash
offsets table (from justfile / partitions.csv), download-mode warn callout.htable of tick-box (☐) checks vs expected
results, ordered to match assembly.htable of Symptom / cause & fix, seeded from the
board's known failure modes and load-bearing sdkconfig settings.End with a small muted footer line pointing at the authoritative sources
(pin_config.h, any ADR) and the regenerate command.
Typst is not part of the container toolchain. If typst is missing, install the
CLI from crates.io (GitHub release binaries are blocked by the egress proxy):
CARGO_HTTP_CAINFO=/root/.ccr/ca-bundle.crt cargo install typst-cli --locked
Compile from the guide's directory with the repo root as the sandbox root so
the template import and shared schematic image resolve (both live outside the
project dir). Use the canonical flags — the build-guide-check.yml CI guard
recompiles every guide and fails if the committed PDF differs byte-for-byte, so
the PDF must be produced deterministically:
cd packages/<domain>/<project>/docs
typst compile --creation-timestamp 0 --ignore-system-fonts --root ../../../.. build-guide.typ
--creation-timestamp 0 pins the embedded PDF timestamp; without it the file
carries wall-clock time and never reproduces.--ignore-system-fonts embeds only Typst's bundled fonts, so glyph fallbacks
are identical on every machine (otherwise Linux FreeSans vs macOS SF diverge).TYPST_VERSION in
.github/workflows/build-guide-check.yml); a different compiler release
produces different bytes. Install it with
cargo install typst-cli --version <that-version> --locked.Verify by rendering a page or two to PNG (--pages 1,3) and eyeballing the
layout before committing.
Commit both build-guide.typ and build-guide.pdf — the PDF is the
deliverable and lets people use the guide without installing Typst.
Add a short "Printable build guide" section to the project README.md linking
docs/build-guide.typ and docs/build-guide.pdf, plus the regenerate command.
pin_config.h, partitions.csv, justfile). If source and prose
disagree, trust source and flag it.tools/typst/build-guide.typ.warn/danger callouts, not buried in prose.version.txt, sdkconfig.defaults, and the
justfile for the meta box; don't invent toolchain versions.