This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a documentation website for "Awesome Agentic Patterns" - a curated catalogue of AI agent design patterns. It uses MkDocs with Material theme to generate a static documentation site that can be deployed to GitHub Pages or Cloudflare Workers.
# Initial setup (run once)
python -m venv venv # Create virtual environment
source venv/bin/activate # Activate virtual environment (Linux/Mac)
# venv\Scripts\activate # Activate virtual environment (Windows)
make site_install # Install Python dependencies
npm install # Install Node.js dependencies
# Standard development cycle
source venv/bin/activate # Always activate venv first
python scripts/build_readme.py # Regenerate README.md and mkdocs.yaml from patterns
make site_preview # Serve docs locally at http://localhost:8000
# Building and deployment
make site_build # Build static site to site/ directory
make site_deploy # Deploy to GitHub Pages
npx wrangler deploy # Deploy to Cloudflare Workers (recommended)CRITICAL: Always activate the virtual environment before running any make commands:
source venv/bin/activate # Required before any make commandIf you see "mkdocs: No such file or directory", the virtual environment is not activated.
The project has a unique architecture where pattern documentation drives the entire site:
-
Pattern Files (
patterns/*.md): Source of truth for all patterns- Must include YAML front-matter with: title, status, authors, category, tags
- Content sections: Problem, Solution, Example (with Mermaid diagrams), References
-
Automated Generation: The
scripts/build_readme.pyscript:- Scans all pattern files and extracts metadata
- Updates README.md between
<!-- PATTERN_LIST_START -->and<!-- PATTERN_LIST_END -->markers - Updates mkdocs.yaml navigation structure
- Groups patterns by category
-
Build Process:
make site_linkcopies patterns to docs/ directory- MkDocs builds from docs/ to site/
- Site can be served locally or deployed to GitHub Pages/Cloudflare
- Start with template: Copy
patterns/TEMPLATE.mdto create new pattern files - Required YAML front-matter: Every pattern must include:
--- title: "Clear, Descriptive Title" status: "proposed | emerging | established | validated-in-production | best-practice | experimental-but-awesome | rapidly-improving" authors: ["Contributor Name (@username)"] based_on: ["Original Creator (Source)"] category: "Orchestration & Control | Context & Memory | Feedback Loops | Learning & Adaptation | Reliability & Eval | Security & Safety | Tool Use & Environment | UX & Collaboration | Uncategorized" source: "URL to primary source" tags: [relevant, keywords, here] ---
- Required sections: Problem, Solution, References
- Auto-generation: Run
python scripts/build_readme.pyafter adding/modifying patterns- Updates README.md between
<!-- AUTO-GENERATED PATTERNS START/END -->markers - Updates mkdocs.yaml navigation structure
- Groups patterns by category automatically
- Applies NEW/UPDATED badges based on git history
- Updates README.md between
- Do not edit the auto-generated sections in README.md manually
- Use Mermaid diagrams in patterns for architectural visualization
- Pattern files support full Markdown with front-matter
- CRITICAL: Always add blank lines after headers before starting bullet point lists
- Incorrect:
**Header:**\n- Item 1(renders inline) - Correct:
**Header:**\n\n- Item 1(renders as proper list) - This is required for MkDocs to properly convert Markdown lists to HTML
<ul><li>elements
- Incorrect:
CRITICAL: When adding images or other assets that need to work on both localhost and deployed sites:
- Use absolute paths starting with
/in all asset references - Image references: Use
/image.jpeginstead ofimage.jpegin markdown files - CSS: Custom styles are inlined in
overrides/main.htmlfor reliability - Rationale: MkDocs relative paths can work locally but fail on Cloudflare Workers due to different path resolution behavior
- Example fix: Change
to
This ensures assets load correctly on both local development (localhost:8000) and production deployment (agentic-patterns.com).
scripts/build_readme.py: Core automation script that:- Parses YAML front-matter from all pattern files
- Extracts metadata (title, category, tags, status)
- Regenerates README.md auto-generated sections
- Updates mkdocs.yaml navigation structure
- Applies NEW/UPDATED pattern badges via git history
Makefile: Provides build targets that handle file linking and MkDocs operationsmkdocs.yaml: Site configuration with Material theme and Mermaid supportrequirements.txt: Python dependencies (MkDocs, Material theme, Mermaid plugin)
patterns/ # Source of truth - all pattern .md files
├── TEMPLATE.md # Template for new patterns
└── *.md # Individual pattern files with YAML front-matter
docs/ # Generated by make site_link (don't edit directly)
├── index.md # Symlink to README.md
├── patterns/ # Copy of patterns/ directory
└── ... # Other copied files
site/ # Generated by mkdocs build (deployment artifact)
- Python: MkDocs ecosystem (mkdocs, mkdocs-material, mkdocs-mermaid2-plugin)
- Node.js: Cloudflare Workers deployment via wrangler
- Virtual Environment: Required for Python dependency isolation
- Primary deployment: Cloudflare Workers (
npx wrangler deploy) - Alternative: GitHub Pages (
make site_deploy) - For detailed deployment instructions, see DEPLOYMENT.md