Guidance for AI coding agents working in this repository. Loaded into agent context — keep concise.
cadence-lang.org is the Docusaurus v3 documentation site for the Cadence smart contract programming language (Flow network). Content lives in docs/ as Markdown/MDX, rendered by Docusaurus with Code Hike for syntax-highlighted code blocks and an optional Typesense search index. Deployed at https://cadence-lang.org.
Node 20.x required (package.json engines.node).
npm i— install dependenciesnpm run start— local dev server at http://localhost:3000npm run build— production build intobuild/(used by CI)npm run serve— serve the built sitenpm run clear— clear Docusaurus caches (.docusaurus/,.cache-loader/)npm run swizzle— swizzle a Docusaurus theme componentnpm run write-translations/npm run write-heading-ids— Docusaurus i18n / heading-id maintenancenpm run deploy—docusaurus deploy(GitHub Pages); production deploy is actually driven by Vercel
No test suite is configured — there are no test scripts in package.json. CI (.github/workflows/deploy.yml) validates changes by running npm run build on push to main.
docusaurus.config.js— single source of site config: navbar,onBrokenLinks: "throw", versioned docs (currentlabeled "1.0"), JSON-LDheadTags(Organization, WebSite, ComputerLanguage, FAQPage), conditional Typesense theme, Code Hike remark plugin (Nord theme, line numbers, copy button), optionalGTAGanalytics,scripts: ['/hotjar.js'].sidebars.js— one autogenerated sidebar (docSidebar) over the entiredocs/tree; ordering is driven by_category_.jsonfiles inside each docs subfolder.docs/— all documentation content:language/— Cadence language reference; subdirsaccounts/,operators/,types-and-type-system/,values-and-types/tutorial/— numbered tutorial pages (01-first-steps.mdthrough09-voting.md)cadence-migration-guide/— Cadence 1.0 migration content- top-level pages: anti-patterns, design-patterns, security-best-practices, solidity-to-cadence, testing-framework, contract-upgrades, json-cadence-spec, project-development-tips, measuring-time, why, index
src/— site code (React):pages/— custom routes (index.js,community.js) plus JSON content files consumed by themcomponents/—HomepageFeatures/,Details/,feedbackFaces.tsxtheme/— swizzled Docusaurus components:Admonition/,AnnouncementBar/,Details/,DocCard/,Layout/,TOC/,MDXComponents.js,NotFound.jsui/design-system/,css/custom.css,utils/gtags.client.ts
static/— copied verbatim to build root:favicon.ico,fonts/,img/,llms.txt,robots.txt,hotjar.js(loaded via thescriptsfield indocusaurus.config.js)versions.json—["current"]; only the live version exists, labeled "1.0" in config. No archived versions — don't rundocusaurus docs:versionunless intentionally branching.vercel.json— URL rewrites/redirects (e.g. legacy/docs/1.0/*→/docs/*,/docs/language/<type-page>→/docs/language/types-and-type-system/<type-page>). Update here when moving pages..github/workflows/deploy.yml— on push tomain, build check + Typesense scrape usingdocsearch.config.json.scrape.ymlalso exists in the same folder.
- Node 20.x is pinned (
package.jsonengines; CI usesactions/setup-node@v3withnode-version: 20). Don't bump one without the other. - Docusaurus is pinned to 3.0.0 exactly (no caret).
@docusaurus/core,@docusaurus/preset-classic, and@docusaurus/module-type-aliasesmust move together. - Broken links fail the build.
onBrokenLinks: "throw"indocusaurus.config.js. When renaming a docs page, grep acrossdocs/andsrc/and update references (or add a redirect invercel.json). - Typesense search is env-gated. The theme only loads when both
TYPESENSE_NODEandTYPESENSE_SEARCH_ONLY_API_KEYare set (see.env.example). Locally, search UI is absent unless those are set. - Code Hike is active on all docs code blocks (
remarkCodeHikewith Nord theme,lineNumbers: true,showCopyButton: true). Standard fenced code blocks work as-is. - Sidebar is autogenerated. Control labels and position via each folder's
_category_.json, not by editingsidebars.js. - Tailwind scans
src/**/*anddocs/**/*.mdxonly (tailwind.config.jscontent). Tailwind classes inside plain.mddocs will not be generated — use.mdxif you need them. - URL redirects belong in
vercel.json, not page front-matter. Follow existing patterns there when restructuring. - Licensing is split: source under Apache 2.0 (
LICENSE.txt), content under CC-BY-4.0 (CC-BY-4.0.txt); seeLICENSE.md.
package-lock.json— regenerated bynpm i/node_modules,/build,.docusaurus/,.cache-loader/— gitignored build artifactsstatic/llms.txt— curated for LLM discovery; verify source before editing