aztec-packages
CLAUDE.md458 starsChanged 2 months agoApache-2.0View on GitHub
You are working with the Aztec Protocol Documentation - a comprehensive documentation site built with Docusaurus 3 for a privacy-centric zkRollup solution for Ethereum. Your role includes both technical development tasks and ensuring all documentation meets quality standards for accuracy, clarity, and usability. This project uses Yarn 4.13.0 as specified in the packageManager field of package.json. Make sure to use Yarn for all dependency management. The generators read the pinned aztec-node checkout (see "aztec-node code: the pin" below): The RELEASE_TYPE…
- Reads credentials
We split this CLAUDE.md into the rules it gives an agent
47 rules. About 0 are common, 34 are distinctive, and 13 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈34
Distinctive · estimate
This author's own choices. Worth a look.
13
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 104
Use conditional blocks to show content only for specific release types:
- Very specific: line 174
Use scripts/update_docs_versions.sh to update configs and reconcile: ./scripts/update_docs_versions.sh network mainnet v4.2.0
- Very specific: line 177
Create new versions with: yarn docusaurus docs:version:<instance-id> <version>
- Very specific: line 192
Local: Start a sandbox manually, provision the pinned CLI and export the pin (see "aztec-node code: the pin"), then run …
- Very specific: line 193
AZTEC_NODE_URL: All example index.ts files and run.sh use this env var (defaults to http://localhost:8080). - Distinctive: line 195
When adding new TypeScript examples:
- Very specific: line 197
Create a directory under examples/ts/ with index.ts, config.yaml, and empty yarn.lock
- Very specific: line 198
Use process.env.AZTEC_NODE_URL ??
- Very specific: line 199
Add the example to the list in examples/ts/aztecjs_runner/run.sh if it should be executed at runtime
- Distinctive: line 208
Ensure proper sentence structure and paragraph flow
- Distinctive: line 215
Use second person "you" perspective for user guides, how-to guides, and tutorials
- Distinctive: line 216
Use first person plural "we" perspective for conceptual pages, architectural overviews and explanations
- Distinctive: line 217
Keep language inclusive and accessible
- Distinctive: line 219
Avoid passive voice where possible
- Distinctive: line 220
Avoid jargon unless necessary (and define it when used)
- Distinctive: line 229
Keep paragraphs focused on single concepts
- Distinctive: line 235
Verify all technical information is correct
- Distinctive: line 236
Ensure no critical steps are missing in procedures
- Distinctive: line 237
Check that all prerequisites are stated upfront
- Distinctive: line 243
Verify code blocks are syntactically correct
- Distinctive: line 244
Ensure proper language tags for syntax highlighting
- Distinctive: line 245
Check that examples are practical and runnable
- Distinctive: line 247
Follow coding best practices for the language
- Distinctive: line 252
Verify proper heading hierarchy (H1 → H2 → H3, etc.)
- Distinctive: line 253
Ensure consistent use of lists (ordered vs unordered)
- Distinctive: line 254
Check that related information is grouped together and that duplicate information is minimized
- Distinctive: line 261
Add helpful notes, warnings, and tips using appropriate formatting
- Distinctive: line 268
Use these terms consistently throughout:
- Distinctive: line 270
[Aztec Protocol]: - Always capitalize and use full name on first mention
- Distinctive: line 271
[PXE]: - Always capitalize and use full name (Private eXecution Environment) on first mention
- Very specific: line 272
Wallet vs Account: - Never use wallet.address.
- Very specific: line 276
Code terms: Use backticks for inline code, commands, file names, and technical terms
- Distinctive: line 277
Emphasis: Use _italics_ sparingly for emphasis
- Very specific: line 278
File paths: Always use forward slashes (e.g., /usr/local/bin)
- Very specific: line 279
Placeholders: Use [PLACEHOLDER_NAME] format in examples
- Very specific: line 280
Punctuation: Do not use em-dashes (—) or en-dashes (–).
- Distinctive: line 284
Use sentence case for all headings (H1 through H6): Only capitalize the first word and proper nouns.
- Distinctive: line 285
Applying this to existing files: When editing an existing page that uses Title Case, convert the headings you touch (and ideally the whole …
- Distinctive: line 289
Every guide should include:
- Very specific: line 302
Every markdown file MUST include front-matter with a description field:
- Distinctive: line 315
Use active voice and be user-focused
- Distinctive: line 316
Avoid redundancy with the page title
- Distinctive: line 344
When reviewing, provide feedback in this format:
- Distinctive: line 347
Critical Issues: Must-fix problems affecting accuracy or usability
- Distinctive: line 390
When in doubt, favor explicit over implicit information
- Distinctive: line 391
Consider the user's journey through the entire documentation site
- Distinctive: line 394
When making changes to documentation processes or tooling, remember to check and update READMEs, project documentation (like this file), …
≈ “Common” is an estimate: at least 1 in 5 of the 25,680 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Overview
You are working with the Aztec Protocol Documentation - a comprehensive documentation site built with Docusaurus 3 for a privacy-centric zkRollup solution for Ethereum. Your role includes both technical development tasks and ensuring all documentation meets quality standards for accuracy, clarity, and usability.
Development Commands
Package Manager
This project uses Yarn 4.13.0 as specified in the packageManager field of package.json. Make sure to use Yarn for all dependency management.
Essential Commands
yarn- Install dependenciesyarn start- Start development server (runs preprocessing first, then starts Docusaurus)yarn build- Build production site with full validation (includes clean, preprocess, spellcheck, and move steps)- It ends with the search index check: renaming or moving a page a search probe expects (
PROBESinscripts/check_search_index.mts) fails the build until the probe lists the new path
- It ends with the search index check: renaming or moving a page a search probe expects (
yarn serve- Serve the built static siteyarn spellcheck- Run spell checking with cspell on markdown filesyarn clean- Clean build artifacts and processed docs
API Documentation Generation
The generators read the pinned aztec-node checkout (see "aztec-node code: the pin" below):
yarn generate:aztec-nr-api- Generate Aztec.nr API docs (requires the pinned nargo:node scripts/aztec_node.mts provision nargo)yarn generate:aztec-nr-api v1.0.0- Generate for a specific versionRELEASE_TYPE=mainnet yarn generate:aztec-nr-api v4.2.0- Generate with explicit release typeyarn generate:typescript-api- Generate TypeScript API docs (requires the checkout'syarn-projectto be built)yarn generate:typescript-api v3.0.0-devnet.6- Generate for a specific versionRELEASE_TYPE=mainnet yarn generate:typescript-api v4.2.0- Generate with explicit release typeyarn generate:node-api-reference- Generate Node JSON-RPC API reference (reads the checkout'syarn-projectsource withdocs/node_modules/typescript; no build needed)yarn generate:node-api-reference --target-dir <dir>- Generate into a specific versioned docs directory
The RELEASE_TYPE env var overrides version string pattern matching for output folder selection. This is useful when the version string doesn't self-identify its release type.
Development Workflow
The documentation uses a preprocessing system that:
- Pulls code from source files using
#include_codemacros - Generates auto-documentation from TypeScript/JavaScript sources
- Processes version macros (
#release_version,#release_network,#include_aztec_version, etc.) - Processes conditional content blocks (
#if/#elif/#else/#endif) - Outputs to
processed-docs/folder (used only in production builds)
For development:
yarn preprocess- Run preprocessing manually (uses dotenv for configuration)yarn start- Runs preprocessing once at startup and serves from source directories- Important: Hot reloading is NOT available - you must restart the dev server to see changes
aztec-node code: the pin
The aztec-node (Labs) code the docs quote is the commit aztec-node.json pins, with its toolchain versions (aztec, bb, noir, l1-artifacts). Everything in docs/ that reads aztec-node code (#include_code, references: frontmatter, the API generators, check_doc_references.sh) reads a checkout of that commit, never the labs/ submodule, which is the Foundation's build input and can move independently.
node scripts/aztec_node.mts fetchchecks the commit out into.aztec-node/tree(gitignored;AZTEC_NODE_DIRoverrides the path).yarn build,yarn startand./bootstrap.shrun it first.- Snippet and
references:paths keep theirlabs/prefix, which names the checkout:labs/yarn-project/...reads.aztec-node/tree/yarn-project/..., and source links name aztec-node at the pinned commit. node scripts/aztec_node.mts checkfails on any drift: a checkout at another commit or with edited files, toolchain versions that differ from the tag's, or an l1-artifacts version inpackage.jsonthat differs from the pin.- Move the pin with
node scripts/aztec_node.mts pin <tag>(a release or nightly tag), never by hand; then set@aztec-foundation/l1-artifactsto the versionchecknames, runyarn install, and commitaztec-node.jsonwithpackage.jsonandyarn.lock. pinneedsghlogged in: it records the sha256 of each noir release archive innoirArchivesoncegh attestation verifyproves noir's publish workflow built it, andprovisionrefuses a nargo archive whose sha256 differs. Never editnoirArchivesto get past a mismatch: it means the release archive changed after the pin.- Tools that need nargo, bb or the aztec CLI use the pinned published ones:
node scripts/aztec_node.mts provision nargo bb cli, theneval "$(node scripts/aztec_node.mts env)"exportsNARGO,BB,AZTECand the versions. Never run nargo insidedocs/or the checkout: it takesdocs/Nargo.tomlas its workspace. - A release cut moves the pin to the release tag in its own worktree only (
/release-docs,/release-network-docs); the dev docs keep their pin.
Preprocessing Environment Variables
The preprocessing system uses these environment variables:
| Variable | Description | Default |
RELEASE_TYPE | Release type: nightly, devnet, testnet, mainnet | mainnet |
DOCS_COMMIT | Commit named by source links into this repository (docs/examples/ snippets); required when RELEASE_TYPE is set to anything but nightly | HEAD |
NIGHTLY_TAG | Version for nightly builds (falls back to COMMIT_TAG) | from developer_version_config.json |
DEVNET_TAG | Version for devnet builds | from developer_version_config.json |
TESTNET_TAG | Version for testnet builds | from developer_version_config.json |
MAINNET_TAG | Version for mainnet builds | from developer_version_config.json |
COMMIT_TAG | Legacy variable, used as fallback for NIGHTLY_TAG | next |
Preprocessing Macros
Release-type-aware macros:
#release_version- Resolves to the version for the currentRELEASE_TYPE:nightly→NIGHTLY_TAG,devnet→DEVNET_TAG,testnet→TESTNET_TAG,mainnet→MAINNET_TAG
#release_network- Resolves to the network name for CLI--networkflag:nightly→local-network,devnet→devnet,testnet→testnet,mainnet→mainnet
Foundation macro:
#include_foundation_version-v<installed @aztec-foundation/l1-artifacts version>; use it for links and Nargo dependencies into aztec-packages' own code (l1-contracts/,barretenberg/).#include_foundation_version_without_prefixdrops thev(npm versions)
Legacy macros:
#include_aztec_version- UsesCOMMIT_TAG(a Labs version, never a ref into aztec-packages)#include_devnet_version,#include_testnet_version,#include_mainnet_version- Version-specific macros
#include_code paths: Snippet paths may point into docs/node_modules (e.g. docs/node_modules/@aztec-foundation/l1-artifacts/...). For those snippets the generated source link resolves to the installed package's own version tag, NOT COMMIT_TAG - only the package's tag is guaranteed to match the extracted snippet line-for-line (see src/preprocess/include_code.js).
Conditional Content
Use conditional blocks to show content only for specific release types:
#if(devnet)
Content for devnet docs
#elif(testnet)
Content for testnet docs
#else
Default content
#endifSupported conditions (matching RELEASE_TYPE values): nightly, devnet, testnet, mainnet
Notes:
- Conditional blocks are processed before version macro substitution (so you can use version macros inside conditionals)
- Nested conditionals are not supported
- The
#elseblock is optional
Documentation Architecture
Key Directories
docs/- Root-level documentation (landing page, shared content)docs-developers/- Developer documentation source filesdocs-network/- Network/node operator documentation source filesdeveloper_versioned_docs/- Version-specific developer documentationnetwork_versioned_docs/- Version-specific network documentationdeveloper_versioned_sidebars/- Version-specific developer sidebar configurationsnetwork_versioned_sidebars/- Version-specific network sidebar configurationsprocessed-docs/- Generated docs for production builds (gitignored)src/preprocess/- Preprocessing scripts and macro handlerssrc/components/- React components for documentationstatic/img/- Static images and assetsstatic/aztec-nr-api/- Auto-generated Aztec.nr API documentation (HTML)static/typescript-api/- Auto-generated TypeScript API documentation (markdown)examples/- Code examples (Noir circuits, Noir contracts, Solidity, TypeScript)examples/ts/- TypeScript aztec.js examples withdocker-compose.ymlfor CI executionexamples/ts/aztecjs_runner/- Runner script that executes examples against a live networkscripts/- Build and utility scriptsscripts/typescript_api_generation/- TypeScript API doc generation scripts and config
Content Structure
This site uses Docusaurus multi-instance docs with independent versioning:
- Developer Guides (
/developers/) - Getting started, tutorials, references (mainnet + testnet + devnet + nightly versions) - Network Guides (
/network/) - Node operation and network participation (mainnet + testnet versions)
Auto-Generated API Documentation
Two API reference systems generate documentation from source code:
- Aztec.nr API (
static/aztec-nr-api/) - Generated from the checkout'snoir-projects/aztec-nr/usingnargo doc - TypeScript API (
static/typescript-api/) - Generated from the checkout'syarn-project/packages using TypeDoc
The TypeScript API generation is configured in scripts/typescript_api_generation/config.json and documents:
- Client SDKs:
aztec.js,accounts,pxe,wallet-sdk,wallets,entrypoints - Core Libraries:
stdlib,foundation,constants
Versioning System
Uses Docusaurus multi-instance versioning with separate version tracks:
- Developer docs: Version config in
developer_version_config.json, stored indeveloper_versioned_docs/ - Network docs: Version config in
network_version_config.json, stored innetwork_versioned_docs/ - Both config files map release types to version strings (e.g.,
{"mainnet": "v4.2.0", "testnet": "v4.1.0", ...}) docusaurus.config.jsauto-generates*_versions.jsonfrom these configs (filtered to versions with existing directories, plus any extra unmapped directories)- Use
scripts/update_docs_versions.shto update configs and reconcile:./scripts/update_docs_versions.sh network mainnet v4.2.0 - Each docs instance has its own version dropdown in the navbar
- Preprocessing macros (
#include_code,#release_version, conditionals, etc.) only work in source folders, not in versioned copies - Create new versions with:
yarn docusaurus docs:version:<instance-id> <version>
Code Examples Pipeline
The examples/ directory contains runnable code examples that are included in documentation via #include_code markers. The examples pipeline has two stages:
Validation (type-checking): examples/bootstrap.sh compiles Noir circuits, Noir contracts, Solidity, and type-checks TypeScript examples. This runs on every PR.
The Solidity examples compile against the l1-contracts sources shipped in the @aztec-foundation/l1-artifacts devDependency (see examples/solidity/foundry.toml). Its version in package.json must equal toolchain.l1Artifacts in aztec-node.json (the pinned aztec-node's BB_VERSION); node scripts/aztec_node.mts check fails until both move together.
The examples build with the pin's published toolchain, the same code the snippets quote: examples/bootstrap.sh provisions nargo, bb and the aztec CLI (@aztec-labs/aztec) at the pinned versions, the contracts' Nargo path dependencies point into the default checkout (.aztec-node/tree; an AZTEC_NODE_DIR override never applies to them), and the TS examples install @aztec-labs/* at AZTEC_VERSION and @aztec-foundation/* at BB_VERSION from npm.
Execution (runtime testing): TypeScript examples in examples/ts/ are executed against a live Aztec network via Docker Compose. The examples/ts/docker-compose.yml spins up Anvil (L1 fork), an Aztec local network, and a runner service that executes the examples.
- CI:
docs/bootstrap.sh cicallsexamples/bootstrap.sh execute, which usesrun_compose_testfromci3/ - Local: Start a sandbox manually, provision the pinned CLI and export the pin (see "aztec-node code: the pin"), then run
examples/ts/aztecjs_runner/run.sh AZTEC_NODE_URL: All exampleindex.tsfiles andrun.shuse this env var (defaults tohttp://localhost:8080). In Docker Compose, it points tohttp://local-network:8080.
When adding new TypeScript examples:
- Create a directory under
examples/ts/withindex.ts,config.yaml, and emptyyarn.lock - Use
process.env.AZTEC_NODE_URL ?? "http://localhost:8080"for the node URL - Add the example to the list in
examples/ts/aztecjs_runner/run.shif it should be executed at runtime
Documentation Review Standards
Primary Review Objectives
1. Grammar & Language
- Fix grammatical errors, typos, and punctuation issues
- Ensure proper sentence structure and paragraph flow
- Correct verb tense consistency (prefer present tense for instructions)
- Fix subject-verb agreement and pronoun references
2. Tone & Voice
- Maintain a professional tone
- Use second person "you" perspective for user guides, how-to guides, and tutorials
- Use first person plural "we" perspective for conceptual pages, architectural overviews and explanations
- Keep language inclusive and accessible
- Favor concise, direct language
- Avoid passive voice where possible
- Avoid jargon unless necessary (and define it when used)
- Be encouraging rather than prescriptive ("you can" vs "you must" where appropriate)
3. Conciseness
- Remove redundant information
- Combine related short sentences
- Replace wordy phrases with concise alternatives
- Eliminate unnecessary qualifiers and filler words
- Keep paragraphs focused on single concepts
Technical Review Criteria
4. Accuracy & Completeness
- Verify all technical information is correct
- Ensure no critical steps are missing in procedures
- Check that all prerequisites are stated upfront
- Validate command syntax and parameters
- Confirm version numbers and compatibility information
5. Code & Examples
- Verify code blocks are syntactically correct
- Ensure proper language tags for syntax highlighting
- Check that examples are practical and runnable
- Include expected output where relevant
- Follow coding best practices for the language
6. Structure & Organization
- Confirm logical information flow (simple → complex)
- Verify proper heading hierarchy (H1 → H2 → H3, etc.)
- Ensure consistent use of lists (ordered vs unordered)
- Check that related information is grouped together and that duplicate information is minimized
- Validate all internal links and cross-references
7. User Experience
- Include clear action items and expected outcomes
- Provide troubleshooting for common issues
- Add helpful notes, warnings, and tips using appropriate formatting
- Include "Next steps" or "Related topics" where appropriate
Consistency Standards
Terminology
Use these terms consistently throughout:
- [Aztec Protocol] - Always capitalize and use full name on first mention
- [PXE] - Always capitalize and use full name (Private eXecution Environment) on first mention
- Wallet vs Account - Never use
wallet.address. A wallet is software that holds multiple accounts; accounts have addresses, not wallets. Useaccount.address,sender.address,alice.address, etc. instead
Formatting Conventions
- Code terms: Use
backticksfor inline code, commands, file names, and technical terms - Emphasis: Use italics sparingly for emphasis
- File paths: Always use forward slashes (e.g.,
/usr/local/bin) - Placeholders: Use
[PLACEHOLDER_NAME]format in examples - Punctuation: Do not use em-dashes (
—) or en-dashes (–). Use commas, colons, parentheses, or separate sentences instead.
Heading Capitalization
Use sentence case for all headings (H1 through H6). Only capitalize the first word and proper nouns. Do not capitalize common nouns, verbs, prepositions, articles, or conjunctions. Applying this to existing files: When editing an existing page that uses Title Case, convert the headings you touch (and ideally the whole page) to sentence case. The goal is to converge on one style across the site, rather than preserving historical inconsistency.
Standard Sections
Every guide should include:
- Front-matter - YAML metadata block with required
descriptionfield - Title - Clear, descriptive, and action-oriented
- Overview - Brief description of what the guide covers
- Prerequisites - Required knowledge, tools, or access
- Steps/Content - Main body with clear headings
- Verification - How to confirm successful completion
- Troubleshooting - Common issues and solutions (where applicable)
- Next Steps - Related guides or advanced topics
Front-matter Requirements
Every markdown file MUST include front-matter with a description field:
---
title: "Page Title"
description: "Brief, SEO-friendly description of the page content (50-160 characters recommended)"
---The description should:
- Clearly summarize the page's purpose and content
- Be between 50-160 characters for optimal SEO
- Use active voice and be user-focused
- Avoid redundancy with the page title
- Help users understand what they'll learn or accomplish
Special Instructions
Do Review For:
- ✅ Missing front-matter or missing
descriptionfield in front-matter - ✅ Ambiguous instructions that could confuse users
- ✅ Missing context or assumptions about user knowledge
- ✅ Outdated screenshots or version references
- ✅ Broken markdown formatting
- ✅ Headings using Title Case instead of sentence case (see "Heading Capitalization")
- ✅ Em-dashes (
—) in prose (see "Formatting Conventions") - ✅ Missing alt text for images
- ✅ Security implications of commands or configurations
Do NOT Change:
- ❌ Product-specific command names or parameters
- ❌ Intentionally simplified examples for beginners
- ❌ Legal disclaimers or license text
- ❌ Direct quotes from external sources
- ❌ API endpoint URLs or configuration values
- ❌ Existing migration notes in
resources/migration_notes.md: never modify already-published migration entries. Instead, add new migration notes to the## TBDsection at the top of the file.
Review Output Format
When reviewing, provide feedback in this format:
- Summary: Brief overview of the document's current state
- Critical Issues: Must-fix problems affecting accuracy or usability
- Improvements: Suggested enhancements for clarity and consistency
- Positive Aspects: What's working well (to maintain in future edits)
For inline edits, use clear markers:
[GRAMMAR]- Grammar or spelling fix[CLARITY]- Rewrite for better understanding[TECHNICAL]- Technical accuracy correction[STYLE]- Style guide compliance[STRUCTURE]- Organization improvement
Project-Specific Guidelines
Domain Context
- Industry: Blockchain, Smart Contracts, Privacy, zero-knowledge, rollups on Ethereum
- Primary Users: Smart contract developers, protocol engineers, protocol researchers
- Documentation Type: Explainer docs, how-to guides, reference docs, API docs, tutorials
Version Management
- Current versions: see
./versions.json - Version notation format: vX.X.X (e.g., v0.86.0)
External References
Approved external documentation sources:
Spell Checking Configuration
- Uses cspell with custom dictionary at
docs-words.txt - Checks files in
docs/,versioned_docs/,internal_notes/, and snippet components - Ignores
node_modules,processed-docs,processed-docs-cache - Imports additional configuration from
../cspell.json
Notes for Claude
- Prioritize clarity and user success over strict style adherence
- When in doubt, favor explicit over implicit information
- Consider the user's journey through the entire documentation site
- Flag any content that might need subject matter expert review
- Suggest improvements even if they go beyond pure editing
- When making changes to documentation processes or tooling, remember to check and update READMEs, project documentation (like this file), and code comments
Last updated: 2026-10-30 Version: 1.10
In this repository22 other files it gives its agents.
- avm-transpiler/CLAUDE.mdCLAUDE.md
- barretenberg/CLAUDE.mdCLAUDE.md
- CLAUDE.mdCLAUDE.md
- docs/llms.txtllms.txt
- acir-formal-proofsSkill
- adding-benchmarksSkill
- bench-regressionSkill
- capture-app-flowSkill
- chonk-inputsSkill
- ci-logsSkill
- create-issueSkill
- cycleSkill
- fixSkill
- genesis-constantsSkill
- merge-train-infraSkill
- merge-trainsSkill
- noir-sync-updateSkill
- prep-cycleSkill
- release-docsSkill
- release-network-docsSkill
- update-doc-referencesSkill
- updating-changelogSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

