# Kami Agent Guide > Personal/global agent rules may live outside this repository. This file records Kami-specific repository maps, Working Rules, Current Risk Areas, Verification, Release Flow, and Fonts. ## Project Kami is a document-generation skill and template system. It ships editorial HTML templates, reference guides, demo assets, and a packaged skill archive. ## Repository Map - `SKILL.md` - skill routing and operating rules. - `CHEATSHEET.md` - quick design reference. - `CLAUDE.md` - Claude-specific notes pointing to AGENTS.md. - `references/` - design, writing, diagram, and production guidance. - `references/design.md`, `writing.md`, `production.md`, `diagrams.md` - full specs. - `references/resume-writing.md` - resume-specific bullet/project framing rules. - `references/anti-patterns.md` - six-category checklist for reviewing drafts. - `references/mermaid.md` - Mermaid diagram support: the two render paths (PDF vs browser) and the authoring pipeline. - `references/mermaid-theme.json` - canonical Kami↔beautiful-mermaid color/font theme (kept in sync with `tokens.json`). - `references/tokens.json` - canonical color tokens (drift-checked by `scripts/tokens.py`). - `references/checks_thresholds.json` - rhythm / density / orphan check thresholds (loaded by `scripts/checks.py`). - `references/brand-profile.md` and `references/brand.example.md` - optional brand profile behavior and public example. - `.claude-plugin/marketplace.json` - **generated** Claude Code plugin marketplace metadata. Points Claude Code at `plugins/kami`. - `.agents/plugins/marketplace.json` - **generated** Codex repo marketplace. Points Codex at `plugins/kami`; never hand-edit. - `plugins/kami/` - **generated** Claude Code / Codex plugin tree. Mirrors the lightweight skill package under `plugins/kami/skills/kami/`; edit source files and run `python3 scripts/build_metadata.py`. - `assets/templates/` - document templates including browser-only landing page variants. - `scripts/highlight.py` - Pygments-based syntax highlighting for code blocks at build time. - `assets/demos/` - README showcase demos. - `assets/showcase/` - README and public-site-only screenshots; excluded from `dist/kami.zip`. - `assets/diagrams/` - diagram prototypes and generated diagram assets; `src/*.mmd` records the Mermaid source of the `sequence` / `class` / `er` diagrams. - `scripts/mermaid_normalize.py` - re-themes any beautiful-mermaid SVG to the Kami palette and makes it WeasyPrint-safe (resolves `color-mix()`/`var()` to static hex, rewrites fonts). Pure Python, no Node; ships in the package. - `assets/fonts/` and `assets/illustrations/` - bundled visual assets. - `styles.css` - shared web-facing styles. - `index.html`, `index-zh.html`, `index-en.html`, `index-ja.html`, `index-ko.html`, `index-tw.html` - public site entrypoints. - `robots.txt`, `sitemap.xml`, and `vercel.json` - public crawler, deployment, and AI visibility files. - `llms.txt` - AI crawler and model-facing project summary. - `scripts/build.py` - CLI shell: build targets and dispatch to lint / verify / checks / tokens modules. - `scripts/verify.py` - end-to-end render verification (page count, embedded fonts, advisory density scan). - `scripts/lint.py` - template CSS lint rules and base/variant cross-template `:root` consistency check (CN↔EN and CN↔KO). - `scripts/tokens.py` - `tokens.json` drift check across HTML templates and PPTX slide scripts. - `scripts/checks.py` - PDF-side checks: placeholders, orphans, density, slide-deck rhythm. - `scripts/optional_deps.py` - centralized loader for weasyprint / pypdf / PyMuPDF with consistent install hints. - `scripts/shared.py` - shared constants and the canonical `HTML_TEMPLATES` registry used by the build scripts. - `scripts/ensure-fonts.sh` - verified font recovery helper (portable across bash 3.2+). - `scripts/package-skill.sh` - package builder for the release archive. - `scripts/site_facts.py` - public-site fact drift checks (install commands, version, template and diagram counts across `index*.html`, README, `llms.txt`); wired into `build.py --check`. - `scripts/check-update.sh` - quiet daily update check invoked from `SKILL.md`; read-only VERSION compare, silent on any failure. - `scripts/build_metadata.py` - codegen for Claude Code / Codex marketplace metadata and plugin mirror files. Run after changing `SKILL.md`, `CHEATSHEET.md`, `VERSION`, `references/`, `scripts/`, or shipped lightweight assets. - `scripts/draft-release-notes.py` - bilingual release notes scaffold from `git log`. - `scripts/tests/test_build.py` - zero-dependency test suite for build and shared helpers. - `.github/workflows/check.yml` - PR/push CI that runs `--check` and the test suite. - `.github/workflows/release.yml` - tag-triggered workflow that builds and attaches `dist/kami.zip` to the release. - `dist/kami.zip` - tracked release archive. Reference docs are English-only. Language-specific output differences (CN/EN/KO) belong in templates, not duplicated reference files. ## Commands ```bash python3 scripts/build.py python3 scripts/build.py --check python3 scripts/build.py --verify python3 scripts/build.py --check-placeholders path/to/filled.html python3 scripts/build.py --check-markdown path/to/filled.pdf python3 scripts/build.py --check-orphans path/to/doc.pdf python3 scripts/build.py --check-density path/to/doc.pdf python3 scripts/build.py --check-rhythm slides slides-en python3 scripts/build_metadata.py python3 scripts/build_metadata.py --check python3 scripts/tests/test_build.py # Re-theme + WeasyPrint-safe a beautiful-mermaid SVG (no Node), then embed in a diagram shell: python3 scripts/mermaid_normalize.py raw.svg -o clean.svg python3 scripts/draft-release-notes.py V1.4.0..HEAD --version V1.4.1 --title "Steadier Hand" bash scripts/ensure-fonts.sh bash scripts/package-skill.sh ``` ## Working Rules - Style changes must update `references/design.md` and the matching template tokens. - Landing or documentation-site work follows `references/design.md` Section 11: «Documentation site» for the doc shell (sidebar rail, on-this-page TOC, borderless prev/next pager, build-time zero-JS code highlighting) and «Responsive screenshot verification» (screenshot at 375px / 1280px per locale, objective line-widow scan) before shipping. - For hosted Kami site or public landing changes, first separate generic template work from Kami's own website. Generic behavior lives in `assets/templates/landing-page*` and `references/`; Kami site facts live across `index*.html`, `styles.css`, README, `llms.txt`, `robots.txt`, `sitemap.xml`, and `vercel.json`. - Public facts are wider than the hero. Pricing, install path, version, release, support, analytics, FAQ, and positioning claims must move together across pages, metadata, AI files, and download links. Do not leave site-only analytics or tracking changes contradicting "no analytics" or app/package privacy copy. - Content changes should avoid CSS churn unless layout behavior is part of the task. - For document or template tasks, lock the output contract before editing: language, template, output format, page or length target, visual acceptance check, and verification command. - Prefer the nearest existing template and deterministic verifier. Do not add a template, shared CSS layer, dependency, script flag, or optional mode unless the current request cannot be satisfied without it. - New templates should copy the nearest existing template, stay aligned with `references/design.md`, and add demo coverage. - Do not use graphic emoticons in docs, template comments, or script output. - Do not use em dashes (U+2014) in repository docs, generated documents, template comments, or site copy; use colons, commas, periods, or parentheses instead. Self-check: `grep -rn '—' README.md llms.txt index*.html`. Teaching counter-examples inside `references/anti-patterns.md` are exempt; its rule #27 covers the generated-document side. - Use `OK:` and `ERROR:` for status text in scripts. - Use `scripts/ensure-fonts.sh` to recover required fonts with retry and size validation when local font files are missing or truncated. It downloads to the XDG user font dir (`${XDG_DATA_HOME:-~/.local/share}/fonts/kami`), never into the skill's `assets/fonts`, so an installed Claude Desktop skill stays small; inside a repo checkout it is a no-op because the committed large fonts already satisfy the templates' relative path. - Do not bundle large CJK font files into `dist/kami.zip`; package scripts should exclude them while templates keep stable local-preview paths. The skill ZIP uploaded to Claude Desktop must be the `scripts/package-skill.sh` output under the 6MB package ceiling and must contain a top-level `kami/` skill folder; a hand-zipped checkout includes the tracked large fonts and Claude Desktop rejects it. - Do not bundle README/public-site-only showcase screenshots into `dist/kami.zip`; keep them under `assets/showcase/` and exclude that directory in `scripts/package-skill.sh`. - Keep multilingual public pages, `llms.txt`, `robots.txt`, sitemap, JSON-LD, and FAQ content aligned when changing public positioning or install instructions. - Brand profile support is optional context. Keep public examples in `references/`; do not hard-code a maintainer's private local profile content. - Slides default to WeasyPrint HTML-to-PDF templates unless the user explicitly needs editable PPTX output. - Templates intentionally inline their CSS rather than share a `_kami.css` partial: each template must remain a single self-contained HTML file so users can copy-paste it without a build step. When fixing CSS drift, apply the same change across affected templates rather than introducing a build-time include. - All template registries live in `scripts/shared.py`: `HTML_TEMPLATES` (PDF docs), `SCREEN_TEMPLATES` (browser-only), and `DIAGRAM_TEMPLATES` (assets/diagrams). `build.py` derives its target dicts from them via `build_targets()` / `screen_targets()` / `diagram_targets()`. Update the registry, not the per-script dicts, when adding or removing a template or diagram. - Mermaid diagrams: never embed raw beautiful-mermaid SVG into a PDF-bound template. WeasyPrint cannot resolve `color-mix()`, render ``, or fetch a runtime web font, so always pipe through `scripts/mermaid_normalize.py` first (`--check` lint enforces this). It is pure Python, no Node bundled. `xychart-beta` is browser-only (it styles via `