Install the living-product-docs trio
The living-product-docs packages turn a Playwright tour suite into always-fresh user manuals, and Excel screen specifications — same MDX source, dual rendering targets, drift between MDX + live UI caught as a CI lint step.
Three packages compose into the flow:
| Package | Role |
|---|---|
@ingcreators/annot-product-docs | Core: MDX parser, Playwright screen fixture, drift detector, annot docs CLI |
@ingcreators/annot-product-docs-astro | Astro components (<Screen> / <Overlay> / …) + the Image Service that composes annotated PNGs at build time |
@ingcreators/annot-product-docs-xlsx | Excel adapter — emits one .xlsx per book using either the OSS default layout or a customer-supplied template populated via {var} placeholders + Named Ranges |
Install
Section titled “Install”pnpm add @ingcreators/annot-product-docspnpm add @ingcreators/annot-product-docs-astro # if you want a docs sitepnpm add @ingcreators/annot-product-docs-xlsx # if you want Excel screen-spec output
# Playwright is a peer dep of the core package.pnpm add -D @playwright/testScaffold
Section titled “Scaffold”pnpm annot-docs initDrops three files into the repo:
annot-docs.config.ts # project + book configtests/docs/example.spec.ts # Playwright tourdocs/books/example/SC-001-login.mdx # one screen, three overlaysAuthor one screen
Section titled “Author one screen”---annot: id: SC-001 title: Login screen xlsx: book: Screen spec sheet: SC-001 Login role: screen---
import Screen from "@ingcreators/annot-product-docs-astro/components/Screen.astro";import Overlay from "@ingcreators/annot-product-docs-astro/components/Overlay.astro";
# Login screen
<Screen id="login" src="./shots/login.png">
<Overlay match={{ role: "textbox", name: "Email" }} intent="required" number={1}>**Email** — Enter your registered email.</Overlay>
<Overlay match={{ role: "button", name: "Sign in" }} intent="action" number={2}>Click to sign in.</Overlay>
</Screen>match keys are persistent — Playwright’s ref=eN markers in
aria snapshots are not. The resolver re-finds each overlay’s
target element on every tour run.
Wire up the tour
Section titled “Wire up the tour”import { test } from "@ingcreators/annot-product-docs";
test("login flow", async ({ page, productDocs }) => { await page.goto("/login"); await productDocs.sync({ id: "login", mdxPath: "docs/books/example/SC-001-login.mdx", });});productDocs.sync(...) updates the annot:snapshot +
annot:attributes comment blocks in the MDX in-place, byte-stably
— diffs are stable across reruns when the UI hasn’t changed.
Render the docs
Section titled “Render the docs”# Astro docs sitepnpm --filter docs-site build
# Excel screen specificationspnpm annot-docs-xlsx renderLint for drift in CI
Section titled “Lint for drift in CI”annot-docs lint --ci --json --url http://localhost:5173Six finding kinds — added / removed / renamed / role-changed /
duplicated / attribute-drift. The example GitHub Actions
workflow shipped with the package converts the JSON to per-line
core.warning annotations on the PR diff view.
Next steps
Section titled “Next steps”- Concepts — the MDX format,
<Screen>/<Overlay>, snapshot blocks, attributes. - Playwright tour — full
walkthrough of the tour file shape + the
screenfixture. - Astro integration —
productDocsIntegration(), the Image Service, the seven components. - Xlsx templates — placeholder vocabulary + Named Ranges for customer template authoring.
- Drift detection — the lint flow + the bundled GitHub Actions workflow.
- Recipe: living product docs — end-to-end working example.