npm install
npm run dev # Start dev server at localhost:4321
npm run build # Production buildImportant: This file covers content format and contribution mechanics. For boundary rules — what always applies, what needs approval, and what is prohibited — see AGENTS.md. Those rules apply to all contributors, not just AI agents.
Documentation is Markdown (.md) by default. Pages that need interactive components — such as <Tabs syncKey="lang"> for multi-language sections — use .mdx. See .docs-plan/decisions.md for the full policy.
Files live in docs/ (project root) and follow the site map defined in astro.config.mjs. Astro reads them via a symlink at src/content/docs/.
Every .md file in docs/ must have this frontmatter:
---
title: "Page Title" # Required
description: "One-line description" # Required
sidebar:
order: 1 # Optional: only where reading order matters
---| Field | Required | Values | Notes |
|---|---|---|---|
title |
Yes | string | Page title |
description |
Yes | string | Used in search, llms.txt, and meta tags |
sidebar.order |
No | number | Controls position within auto-generated sidebar sections. Only set where reading order matters (e.g., getting-started tutorials). Omit to use alphabetical order. |
Each top-level section has a specific purpose. Match your content accordingly:
| Section | Type | Purpose | CLI commands? |
|---|---|---|---|
concepts/ |
Explanation | What it is, how it works, why it matters | No — link to guides |
getting-started/ |
Tutorial | Step-by-step learning path | Yes — complete and linear |
guides/ |
How-to | Task-oriented instructions | Yes — where relevant |
reference/ |
Reference | Lookup information | Sparingly — for syntax examples only |
- Write in plain, direct language
- Use icp-cli commands for all CLI examples
- Make code examples self-contained and copy-pasteable
- Link to external docs for tool-specific details (see AGENTS.md linking rules)
- Use standard markdown features (code blocks, tables, links, headings)
- Use relative paths with
.mdextension for internal links (e.g.,[Quickstart](../getting-started/quickstart.md)) — works on both the Astro site and GitHub
- Reference
dfx— it is deprecated. CI will reject it. - Use
.mdxwithout a clear need for interactive components (default to.md) - Duplicate content that lives in external docs (icp-cli, JS SDK, icskills)
- Nest sidebar items more than 3 levels deep
- Add images without alt text
- Write for a specific framework version — always describe "latest"
- CLI-focused guides (install, deploy, identity) → belong in icp-cli docs, link from here
- Concept-focused guides → inline relevant
icpcommands, link to full icp-cli guide - Missing icp-cli guide → create in icp-cli repo first, then link from here
Images live in src/assets/images/, organized by docs section:
src/assets/images/
├── concepts/ # Concept diagrams
├── getting-started/ # Tutorial visuals
├── guides/ # Guide diagrams, organized by subsection
│ ├── canisters/
│ ├── frontends/
│ └── ...
└── reference/ # Reference diagrams
Rules:
- Use descriptive kebab-case filenames (e.g.,
canister-internals.png,create-canister-flow.png) - Always include alt text:
 - Prefer SVG for diagrams (scalable, smaller). Use PNG for hand-drawn illustrations and screenshots.
- When carrying over portal images, keep the existing hand-drawn visual style
- Decide case-by-case during content writing whether a portal image is worth carrying over
- Portal images are in
portal/static/img/docs/— copy and rename to match the new structure
The build generates /llms.txt and per-page .md endpoints from your content. This is automatic — no extra work needed when writing pages. However:
- Frontmatter
descriptionis used as the page summary inllms.txt— write clear, useful descriptions - Adding a new sidebar section in
astro.config.mjsrequires updating theSECTIONSarray inplugins/astro-agent-docs.mjsto match, otherwise pages in that section won't appear inllms.txt
.sources/ contains pinned git submodules that agents use as ground truth when writing and reviewing content — CLI references, API signatures, skill files, code examples, and the old portal docs.
Do not edit files in .sources/ directly. They are read-only references; changes go to the upstream repos.
Current pinned release versions are in .sources/VERSIONS. Bumping a submodule is a maintainer task — follow the procedure in AGENTS.md "Bumping submodules". The two pinning strategies are:
- Release-pinned (
icp-cli,motoko,motoko-core,cdk-rs,candid,response-verification) — pinned to the latest release tag so docs reflect what users actually have installed. Never pin past the latest release. - main/master-tracked (
portal,examples,icskills, and others) — track the default branch; the branch tip is the canonical source.
Some files are auto-synced from other repositories. Do not edit these files directly. Changes must go to the source repo.
Currently synced:
docs/languages/motoko/— fromcaffeinelabs/motokodocs/guides/tools/migrating-from-dfx.md— fromdfinity/icp-cli
| Section | Review Team |
|---|---|
| All docs (default) | @dfinity/editorial |
/guides/security/ |
@dfinity/product-security + @dfinity/editorial |
/guides/defi/ |
@dfinity/defi + @dfinity/editorial |
/guides/chain-fusion/ |
@dfinity/defi + @dfinity/editorial |
/guides/backends/timers |
@dfinity/team-dsm + @dfinity/editorial |
/guides/frontends/custom-domains |
@dfinity/boundary-node + @dfinity/editorial |
/guides/frontends/certification |
@dfinity/trust + @dfinity/editorial |
/reference/ic-interface-spec, /reference/http-gateway-spec |
@dfinity/interface-spec + @dfinity/team-dsm + @dfinity/consensus |
/languages/motoko/ (synced) |
@dfinity/languages |
/guides/tools/ |
@dfinity/dx + @dfinity/editorial |
Before submitting a PR, manually verify:
- No dfx references —
dfxis banned (except inguides/tools/migrating-from-dfx.md) .mdxonly where needed — default to.md; use.mdxonly for interactive components (tabs)- Valid frontmatter — required fields present, valid values
npm run build— Site builds without errors
Note: Validation scripts are not yet set up on this branch. They are preserved on
restructuring-attempt-1and will be restored when the docs are ready for production. CI deployment to the IC asset canister runs on every push tomain(see.github/workflows/deploy-ic.yml).
Before setting a task to draft status in Beads, verify:
- Content brief from the stub is fully addressed
- All code examples are tested and copy-pasteable
- icp-cli commands verified against CLI reference
- Cross-links from
<!-- Cross-Links -->converted to actual markdown links - Source material HTML comments removed from the final content
npm run buildpasses
All tasks are tracked in Beads (bd). See AGENTS.md → "Multi-agent workflow" for the full coordination protocol.
Key commands:
bd ready— show tasks you can work on (no unresolved blockers)bd update <id> --status draft --notes "PR #X"— mark task as draft after PR creationbd list --limit 0— see all tasks (default caps at 50)
See .docs-plan/README.md for analysis artifacts and .docs-plan/migration-plan.md for execution details.