|
| 1 | +# Claude Code Setup for Quarto Contributors |
| 2 | + |
| 3 | +This project includes shared [Claude Code](https://docs.anthropic.com/en/docs/claude-code) memory files that help AI assistants understand the Quarto codebase. These files are committed to the repository so all contributors benefit from consistent AI-assisted development. |
| 4 | + |
| 5 | +## What's Included |
| 6 | + |
| 7 | +### `.claude/CLAUDE.md` |
| 8 | + |
| 9 | +Always loaded by Claude Code. Contains the project overview: architecture, setup, build commands, conventions, and key file paths. |
| 10 | + |
| 11 | +### `.claude/rules/` |
| 12 | + |
| 13 | +Path-scoped rule files that load conditionally based on what files you're working with. For example, when editing Lua filters, Claude Code automatically loads filter-specific conventions. |
| 14 | + |
| 15 | +Current rule areas: |
| 16 | +- `changelog.md` — Changelog entry format |
| 17 | +- `filters/` — Lua filter coding conventions and system overview |
| 18 | +- `formats/` — Format handler patterns |
| 19 | +- `rendering/` — Render pipeline architecture |
| 20 | +- `schemas/` — Zod schema patterns |
| 21 | +- `testing/` — Test infrastructure, smoke-all format, Playwright, anti-patterns |
| 22 | +- `typescript/` — Deno essentials, RAL, Cliffy commands |
| 23 | +- `dev-tools/` — Development commands reference |
| 24 | +- `llm-docs-maintenance.md` — LLM documentation staleness checking |
| 25 | + |
| 26 | +Each rule file has a `paths:` frontmatter that controls when it loads: |
| 27 | + |
| 28 | +```yaml |
| 29 | +--- |
| 30 | +paths: |
| 31 | + - "src/resources/filters/**" |
| 32 | +--- |
| 33 | +``` |
| 34 | + |
| 35 | +This means the file only loads when Claude Code is working with files matching those paths. |
| 36 | + |
| 37 | +### `llm-docs/` |
| 38 | + |
| 39 | +Architectural deep-dive documentation for AI assistants. These are NOT auto-loaded — they're read on demand when Claude Code needs detailed understanding of a subsystem. Topics include template systems, error messages, testing patterns, and Lua API reference. |
| 40 | + |
| 41 | +Each llm-doc has staleness metadata in its frontmatter so Claude Code can check if the documented code has changed since the analysis was done. |
| 42 | + |
| 43 | +## Personal Overrides |
| 44 | + |
| 45 | +Create `CLAUDE.local.md` at the repository root for personal overrides. This file is gitignored and won't be committed. Use it for: |
| 46 | + |
| 47 | +- Preferred shell syntax or platform-specific notes |
| 48 | +- Personal workflow customizations |
| 49 | +- References to personal tools or configurations |
| 50 | + |
| 51 | +Claude Code loads `CLAUDE.local.md` alongside the project `CLAUDE.md`. |
| 52 | + |
| 53 | +## Adding or Updating Rules |
| 54 | + |
| 55 | +### New rule file |
| 56 | + |
| 57 | +1. Create `.claude/rules/<area>/rule-name.md` |
| 58 | +2. Add `paths:` frontmatter listing glob patterns relative to the repo root (e.g., `"src/resources/filters/**"`) |
| 59 | +3. Keep rules focused and concise (50-250 lines is typical) |
| 60 | + |
| 61 | +### Update existing rule |
| 62 | + |
| 63 | +Edit the relevant file in `.claude/rules/`. The path scoping ensures changes only affect sessions working with matching files. |
| 64 | + |
| 65 | +### New llm-doc |
| 66 | + |
| 67 | +1. Create `llm-docs/topic-name.md` |
| 68 | +2. Add staleness frontmatter (`main_commit`, `analyzed_date`, `key_files`) |
| 69 | +3. Reference from relevant rule files if helpful |
| 70 | + |
| 71 | +## What's NOT Committed |
| 72 | + |
| 73 | +The `.gitignore` excludes personal Claude Code files: |
| 74 | + |
| 75 | +``` |
| 76 | +CLAUDE.local.md # Personal overrides |
| 77 | +.claude/commands/ # Personal slash commands |
| 78 | +.claude/docs/ # Personal documentation |
| 79 | +.claude/settings.local.json # Local settings |
| 80 | +``` |
| 81 | + |
| 82 | +These stay personal to each developer. |
| 83 | + |
| 84 | +## Further Reading |
| 85 | + |
| 86 | +- [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code) |
| 87 | +- [Memory files reference](https://docs.anthropic.com/en/docs/claude-code/memory) |
0 commit comments