The help site was written for the launch and nobody has touched it since. Since then, developers changed how discount codes expire, added a minimum order value and renamed two error codes. Nobody knows which help pages are still right, so support no longer links to them and writes the same answers by hand instead.
FACET keeps a short, checkable description of each feature, called a record, next to your code, and comments in the code, called AnchorAn anchor is a comment in the source code, starting with @facet:, that names the record the code belongs to. FACET reads these comments to know where each feature is implemented.In the glossary, link each record to the code it describes. By the end of this guide you build a small, static product help site from your FACET records, with articles you write yourself, and npx facet docs site check fails whenever a record, the code anchored to it or your article text has changed since the build. None of those can change behind the site's back without the check saying so.
The commands below use the example shop from “One answer instead of three”, which has one record for discount codes. In your own project, start with one topic that support gets asked about a lot.
Step 1Describe the site in one file
The site is defined by an editorial configuration, by default docs/site.json. It names the topics, the readers and the articles. Save this as docs/site.json:
{ "version": 1, "mode": "reference", "language": "en", "visibility": "public", "catalog": true, "title": "Demo Shop help", "description": "How cart, discount codes and checkout behave in the Demo Shop.", "topics": [ { "id": "checkout", "title": "Cart and checkout", "description": "Filling the cart, discount codes and placing an order.", "prefixes": ["checkout/"] } ], "audiences": [ { "id": "customers", "title": "Customers", "kind": "customer", "description": "People who buy in the shop." }, { "id": "support", "title": "Support", "kind": "creator", "description": "People who answer customer questions." } ], "articles": [ { "id": "discount-codes", "title": "Discount codes", "kind": "faq", "topic": "checkout", "category": "Cart and checkout", "audience": "", "description": "When a code works, when it expires and why the shop refuses it.", "tags": ["discount", "coupon", "voucher"], "features": ["checkout/discounts/redeem-code"], "sections": [ { "title": "Until when does a code work?", "body": "Until the end of its last day in UTC, for every customer in every time zone. A code whose last day is 31 May works until 23:59:59 UTC on 31 May.", "sources": ["checkout/discounts/redeem-code"] }, { "title": "Why was my code refused?", "body": "The shop names the reason with a code.", "table": { "columns": ["Code", "Reason"], "rows": [ ["E2002", "The code has expired."], ["E2003", "The cart is below the code's minimum order value."], ["E2004", "The order already has a code. Only one code per order."] ] }, "sources": ["checkout/discounts/redeem-code"] } ] } ]}
visibility: "public"keeps source paths and internal details out of the site and lists only active features. Use"internal"for a site your team reviews.catalog: trueadds a page with every feature the records describe, so nothing is missing just because no article covers it.topicssort features by id prefix: everything undercheckout/lands in "Cart and checkout".- Each article section names its
sources, the records it is based on. The text is yours; the check later ties it to those records.
If you prefer to start from a draft, leave articles empty at first: npx facet docs site compose --config docs/site.json then prints the configuration with one article per topic, built from the record summaries. Once articles has content, compose refuses, so it never overwrites your writing.
Step 2Check the plan and see what the records cannot answer yet
npx facet docs site plan --config docs/site.json


plan validates the configuration and exits with an error if an article cites a record that does not exist, or a public article cites one that is not active. gaps lists KnowledgeKnowledge is the part of a record with five fixed questions about using the feature, such as prerequisites, limits and common mistakes. The owner answers them, and FACET generates help, FAQ and onboarding text from the answers.In the glossary questions the record's owner has not answered yet, such as common_pitfalls. The site never fills them with invented text; answer them in the record if readers need them.
Step 3Build the site and confirm it matches its sources
Keep the generated site and its lock file out of Git. The lock holds the digests the check compares against and is never published:
printf 'docs-site/\ndocs-site.lock.json\n' >> .gitignore
Build and check:
npx facet docs site build --config docs/site.json --output docs-sitenpx facet docs site check --config docs/site.json --output docs-site


docs-site/ holds plain HTML, CSS and JavaScript with a local search, and needs no application server. Preview it locally with any static file server, for example:
python3 -m http.server 8000 -d docs-site
Open http://localhost:8000/article-discount-codes.html:


Step 4Change the code and watch the check refuse the old site
Marketing extends the code KETTLE15 by a month. A developer changes one line in src/checkout/discount.ts, the file that carries the anchor of the discount-code record:
{ code: "KETTLE15", kind: "percent", value: 15, expiresOn: "2026-12-31", minSubtotal: 5000 },The article does not mention KETTLE15. Run the check anyway:
npx facet docs site check --config docs/site.json --output docs-site


The check does not guess whether the change matters for the text. It says that something the site is based on changed, and exits with status 1. Someone reads the article again; here it still holds, because it never named that code. Remove the old preview and build again:
rm -r docs-site docs-site.lock.jsonnpx facet docs site build --config docs/site.json --output docs-sitenpx facet docs site check --config docs/site.json --output docs-site
The check prints Documentation check: docs-site again. Publish only the docs-site/ folder.
Step 5If the check says something else
documentation stale: record or anchor inventory changed: a record or a file with an@facet:anchor changed since the build. Read the affected articles, update them if needed, then rebuild.documentation stale: editorial configuration changed:docs/site.jsonchanged since the build. Rebuild after review.documentation modified: index.html(or another file): somebody edited the built output. Rebuild instead of editing generated files.destination exists: …/docs-site (build to a new directory):buildnever overwrites. Remove the old preview first, or pass another--output.lock destination exists: …/docs-site.lock.json: the lock of the old build is still there. Remove it together with the old folder.
For more on keeping help content in step with the product, read The help article says 14 days. The code says 30.