agentleFS
BhavinMBhavinM/my-claude-setup/CLAUDE.md

my-claude-setup

CLAUDE.md0 starsChanged 10 months agoMITView on GitHub

This file provides coding standards and architecture patterns for Claude Code. SETUP INSTRUCTIONS: 1. Search for all <!-- CUSTOMIZE --> markers 2. Fill in your project-specific details 3. Remove examples that don't apply to your project 4. Adjust rules to match your team's conventions This template is generalized from a production SaaS setup. Adapt as needed. --> These rules address recurring mistakes that cause real issues. Each one prevents debugging time, security vulnerabilities, or broken builds: Use the Task tool…

The file

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

6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Search for all <!-- CUSTOMIZE --> markers

    line 7
  2. Distinctive:

    Remove examples that don't apply to your project

    line 9
  3. Distinctive:

    Use type guards, not type assertions

    line 56
  4. Very specific:

    Use destructuring: const { name } = user not const name = user.name

    line 58
  5. Very specific:

    Use millisecond constants (e.g., const TIMEOUT = 30_000) instead of magic numbers

    line 59
  6. Very specific:

    Use the Task tool to delegate tasks to specialized sub-agents.

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 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 Template for Next.js / Supabase / TypeScript Projects This file provides coding standards and architecture patterns for Claude Code. SETUP INSTRUCTIONS: 1. Search for all <!-- CUSTOMIZE --> markers
  1. Fill in your project-specific details
  2. Remove examples that don't apply to your project
  3. Adjust rules to match your team's conventions

This template is generalized from a production SaaS setup. Adapt as needed. -->

<!-- CUSTOMIZE: Replace with a brief description of your project Example: "Acme SaaS platform — Next.js App Router, Supabase, TypeScript." -->

Critical Rules

These rules address recurring mistakes that cause real issues. Each one prevents debugging time, security vulnerabilities, or broken builds:

  • Using any defeats TypeScript's safety net — bugs and security issues reach production undetected. Use proper types or unknown.
  • console.log/console.error in production breaks structured logging, making production debugging impossible. Use a proper logger (e.g., Pino, Winston, or your framework's logging utility).
  • Missing import 'server-only' allows server code to bundle into the client, leaking API keys and database credentials to the browser.
  • Server actions must validate inputs with Zod schemas and verify authentication before processing. Unauthenticated or unvalidated data must never reach the database.
  • Tables without RLS expose all rows to any authenticated user — one missing policy means customer data leaks across accounts.
  • Forgetting to await params in async server components causes runtime errors in Next.js that are hard to trace.
  • useEffect often masks logic that belongs in a server component, event handler, or derived state. Each use should be justified with a comment.
  • Multiple separate useState calls that change together cause re-renders and state sync bugs. Prefer a single state object.
  • Custom form handling bypasses the shared validation pipeline. Use react-hook-form + Zod to keep validation consistent.
  • Building custom UI when your component library already has the component creates visual inconsistency and double maintenance. Check your component library first.
<!-- CUSTOMIZE: Add any project-specific or framework-specific critical rules here. Examples: - "When merging upstream, propagate infrastructure changes to all product apps." - "Use your framework's Server Action wrapper for auth + validation on every mutation." - "Never use the admin Supabase client without documenting why RLS bypass is needed." -->

Monorepo

<!-- CUSTOMIZE: List your apps/packages here, or remove this section for single-app projects. -->

Commands

<!-- CUSTOMIZE: Add your project's dev, build, test, and lint commands here. -->

Architecture

<!-- CUSTOMIZE: Describe your app's architecture (multi-tenant, data fetching, auth, type safety). -->

Code Style

  • Interfaces over types for object shapes; export all types
  • Use type guards, not type assertions
  • Service pattern: private class + exported factory function
  • Use destructuring: const { name } = user not const name = user.name
  • Use millisecond constants (e.g., const TIMEOUT = 30_000) instead of magic numbers
  • See .claude/rules/coding-style.md for full style guide

Delegate to Agents

Use the Task tool to delegate tasks to specialized sub-agents. Agents are defined in .claude/agents/ — check agent descriptions to find the right one for your task.

Verification

<!-- CUSTOMIZE: Add your project's typecheck, lint, and test commands here. -->

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.