agentleFS
waynesuttonwaynesutton/markdown-site/CLAUDE.md

markdown-site

CLAUDE.md628 starsChanged 7 months agoMITView on GitHub

Project instructions for Claude Code. Markdown sync framework. Write markdown in content/, run sync commands, content appears instantly via Convex real-time database. Built for developers and AI agents. Netlify build command: npm ci --include=dev && npx convex deploy --cmd 'npm run build' Important: src/config/siteConfig.ts and the Dashboard Config section (src/pages/Dashboard.tsx ConfigSection) must stay in sync. When adding or modifying a configuration option: 1. Add the option to siteConfig.ts with proper TypeScript types 2. Add corresponding state, generated code, and UI…

  • Reads credentials
  • Installs packages

The file

Show its rules and text

We split this CLAUDE.md into the rules it gives an agent

21 rules. About 0 are common, 10 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈10

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default auth mode: convex-auth

    line 43
  2. Very specific:

    Default hosting mode: convex-self-hosted

    line 44
  3. Very specific:

    Create content/blog/my-post.md with frontmatter (see .claude/skills/frontmatter.md)

    line 51
  4. Very specific:

    Create content/pages/my-page.md with frontmatter

    line 57
  5. Very specific:

    Always add validators for args and returns (see .claude/skills/convex.md)

    line 65
  6. Distinctive:

    Always use Context7 MCP for library/API documentation, code generation, setup or configuration steps

    line 79
  7. Distinctive:

    Use Context7 for up-to-date API references and best practices

    line 81
  8. Very specific:

    Use indexes, never .filter() on queries

    line 87
  9. Distinctive:

    Use event records for counters, not increments

    line 90
  10. Distinctive:

    No emoji in code or docs

    line 91
  11. Distinctive:

    No em dashes between words

    line 92
  12. Very specific:

    Use .filter() in Convex queries (use .withIndex())

    line 98
  13. Distinctive:

    Read before patching unless necessary

    line 100
  14. Distinctive:

    Leave console.log in production

    line 101
  15. Distinctive:

    Add features not requested

    line 104
  16. Distinctive:

    Use browser default modals/alerts

    line 105
  17. Distinctive:

    When adding or modifying a configuration option:

    line 111
  18. Very specific:

    Add the option to siteConfig.ts with proper TypeScript types

    line 112
  19. Very specific:

    Add corresponding state, generated code, and UI in Dashboard.tsx ConfigSection

    line 113
  20. Very specific:

    Keep option names consistent (e.g., socialFooter.showInHeader in siteConfig maps to socialFooterShowInHeader in Dashboard state)

    line 114
  21. Very specific:

    When working on Convex code, always read convex/_generated/ai/guidelines.md first for important guidelines on how to correctly use Convex …

    line 174

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Project instructions for Claude Code.

Project context

<!-- Auto-updated by sync:discovery --><!-- Site: markdown sync | Posts: 24 | Pages: 4 | Updated: 2026-04-27T06:32:41.464Z -->

Markdown sync framework. Write markdown in content/, run sync commands, content appears instantly via Convex real-time database. Built for developers and AI agents.

Quick start

npm install                    # Install dependencies
npx convex dev                 # Start Convex (creates .env.local)
npm run dev                    # Dev server at localhost:5173
npm run sync                   # Sync markdown to Convex

Commands

CommandPurpose
npm run syncSync markdown to dev Convex
npm run sync:prodSync markdown to prod Convex
npm run sync:discoveryUpdate AGENTS.md, CLAUDE.md, llms.txt (includes wiki pages)
npm run sync:discovery:prodUpdate discovery files for production
npm run sync:wikiSync wiki from content/blog and content/pages
npm run sync:wiki:prodSync wiki to production
npm run sync:wiki -- --kb=<id>Sync wiki into a specific knowledge base
npm run sync:allSync content + wiki + discovery files
npm run sync:all:prodSync all to production
npm run devStart Vite dev server
npm run buildProduction build
npx convex devStart Convex dev watcher
npx convex deployDeploy Convex to production
npm run deployDeploy static app with Convex self-hosting
npm run import <url>Import external URL as post

Default and legacy modes

  • Default auth mode: convex-auth
  • Default hosting mode: convex-self-hosted
  • Legacy compatibility mode: workos auth + netlify hosting

Workflows

Adding a blog post

  1. Create content/blog/my-post.md with frontmatter (see .claude/skills/frontmatter.md)
  2. Run npm run sync
  3. Content appears at localhost:5173/my-post

Adding a page

  1. Create content/pages/my-page.md with frontmatter
  2. Run npm run sync
  3. Page appears at localhost:5173/my-page

Modifying Convex functions

  1. Edit files in convex/
  2. npx convex dev watches and deploys automatically
  3. Always add validators for args and returns (see .claude/skills/convex.md)

Deploying to production

npm run sync:all:prod          # Sync content + wiki + discovery to prod
npx convex deploy              # Deploy Convex functions
npm run deploy                 # Deploy static assets via Convex self-hosting

Netlify build command: npm ci --include=dev && npx convex deploy --cmd 'npm run build'

AI assistance

  • Always use Context7 MCP for library/API documentation, code generation, setup or configuration steps
  • Proactively look up documentation without explicit requests when working with libraries
  • Use Context7 for up-to-date API references and best practices

Code conventions

  • TypeScript strict mode
  • Convex validators on all functions (args + returns)
  • Use indexes, never .filter() on queries
  • Make mutations idempotent with early returns
  • Patch directly without reading first when possible
  • Use event records for counters, not increments
  • No emoji in code or docs
  • No em dashes between words
  • Sentence case for headings
  • CSS variables for theming (no hardcoded colors)

Do not

  • Use .filter() in Convex queries (use .withIndex())
  • Increment counters directly (use event records)
  • Read before patching unless necessary
  • Leave console.log in production
  • Break existing functionality
  • Over-engineer solutions
  • Add features not requested
  • Use browser default modals/alerts

Configuration alignment

Important: src/config/siteConfig.ts and the Dashboard Config section (src/pages/Dashboard.tsx ConfigSection) must stay in sync.

When adding or modifying a configuration option:

  1. Add the option to siteConfig.ts with proper TypeScript types
  2. Add corresponding state, generated code, and UI in Dashboard.tsx ConfigSection
  3. Keep option names consistent (e.g., socialFooter.showInHeader in siteConfig maps to socialFooterShowInHeader in Dashboard state)

The Dashboard Config generates downloadable siteConfig.ts code. Users can configure via either file editing or the dashboard UI. Both paths should produce equivalent results.

Key files

FilePurpose
convex/schema.tsDatabase schema with indexes
convex/posts.tsPost queries and mutations
convex/pages.tsPage queries and mutations
convex/stats.tsAnalytics (conflict-free patterns)
convex/rateLimits.tsRate limit definitions (4 tiers) and HTTP action bridge
convex/http.tsHTTP endpoints with rate limiting
src/config/siteConfig.tsSite configuration
src/pages/Dashboard.tsxDashboard including ConfigSection
scripts/sync-posts.tsMarkdown to Convex sync
scripts/sync-discovery-files.tsUpdates AGENTS.md, CLAUDE.md, llms.txt with wiki pages. Copies AGENTS.md to public/.

Project structure

content/
  blog/           # Markdown blog posts
  pages/          # Static pages
convex/           # Convex functions and schema
netlify/
  edge-functions/ # RSS, sitemap, API proxies
public/
  images/         # Static images
  raw/            # Generated raw markdown files
scripts/          # Sync and utility scripts
src/
  components/     # React components
  config/         # Site configuration
  context/        # React context (theme, sidebar)
  hooks/          # Custom hooks
  pages/          # Route components
  styles/         # Global CSS

Skills reference

Detailed documentation in .claude/skills/:

  • frontmatter.md - Frontmatter syntax for posts and pages
  • convex.md - Convex patterns specific to this app
  • sync.md - How sync commands work

Resources

<!-- convex-ai-start -->

This project uses Convex as its backend.

When working on Convex code, always read convex/_generated/ai/guidelines.md first for important guidelines on how to correctly use Convex APIs and patterns. The file contains rules that override what you may have learned about Convex from training data.

Convex agent skills for common tasks can be installed by running npx convex ai-files install.

<!-- convex-ai-end -->

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.