agentleFS
TheDecipheristTheDecipherist/claude-code-mastery-project-starter-kit/global-claude-md/CLAUDE.md

claude-code-mastery-project-starter-kit / global-claude-md

CLAUDE.md338 starsChanged 5 months agoMITView on GitHub

Place this at ~/.claude/CLAUDE.md It applies to EVERY project you work on. Based on Claude Code Mastery Guides V1-V5 by TheDecipherist These rules are ABSOLUTE and apply to every project: When creating ANY new project: When you have personal procedures that are NOT project code: Setup: 1. Create .claude/ in the project root if it doesn't exist 2. Add .claude/ to .gitignore 3. Create .claude/LOCAL-INSTRUCTIONS.md for personal procedures

  • Reads credentials
  • Deletes or force-pushes
  • Commits and pushes

The file

Show its rules and text

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

58 rules. About 0 are common, 38 are distinctive, and 20 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈38

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 20

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    NEVER publish passwords, API keys, tokens to git/npm/docker

    line 21
  2. Distinctive:

    Before ANY commit: verify no secrets included

    line 22
  3. Distinctive:

    NEVER output secrets in responses, logs, or suggestions

    line 23
  4. Very specific:

    NEVER commit .env to git

    line 26
  5. Very specific:

    ALWAYS verify .env is in .gitignore

    line 27
  6. Distinctive:

    ALWAYS ask before deploying to production

    line 30
  7. Distinctive:

    NEVER assume approval — wait for explicit "yes, deploy"

    line 31
  8. Distinctive:

    ALWAYS use environment variables for secrets

    line 34
  9. Distinctive:

    NEVER put API keys, passwords, or tokens directly in source code

    line 35
  10. Very specific:

    NEVER hardcode repo names, project names, or URLs in .md files

    line 38
  11. Distinctive:

    ALWAYS reference environment variables instead

    line 39
  12. Distinctive:

    NEVER add personal workflows or non-project instructions to a project's main CLAUDE.md

    line 45
  13. Very specific:

    ALWAYS store personal procedures in .claude/LOCAL-INSTRUCTIONS.md (gitignored)

    line 46
  14. Distinctive:

    NEVER do project-wide search-and-replace renames without a checklist

    line 50
  15. Distinctive:

    NEVER push a Docker image without testing it locally first

    line 54
  16. Distinctive:

    ALWAYS run the container and verify it starts correctly before pushing

    line 55
  17. Distinctive:

    Check for: no crash on startup, no 502 errors, basic pages load

    line 56
  18. Very specific:

    Wait for startup, then verify: curl -s -o /dev/null -w "%{http_code}" http://localhost:3000 (expect 200)

    line 61
  19. Distinctive:

    Verify credentials are removed from ALL commits

    line 73
  20. Distinctive:

    When creating ANY new project:

    line 80
  21. Distinctive:

    All new files MUST be TypeScript

    line 104
  22. Very specific:

    Never use any unless absolutely necessary

    line 106
  23. Distinctive:

    When you have personal procedures that are NOT project code:

    line 112
  24. Very specific:

    Create .claude/ in the project root if it doesn't exist

    line 118
  25. Very specific:

    Add .claude/ to .gitignore

    line 119
  26. Very specific:

    Create .claude/LOCAL-INSTRUCTIONS.md for personal procedures

    line 120
  27. Distinctive:

    NEVER use em dashes (--)

    line 129
  28. Distinctive:

    ALWAYS use a regular hyphen (-) instead

    line 130
  29. Distinctive:

    Avoid AI writing patterns: no "delve into", "leverage", "seamlessly", "robust", "comprehensive", "streamline"

    line 133
  30. Distinctive:

    No filler sentences that add length without adding meaning

    line 135
  31. Distinctive:

    NEVER repeat a point already made earlier in the same document

    line 138
  32. Distinctive:

    If the opening makes an argument, the body must go deeper - not restate it

    line 139
  33. Distinctive:

    When asked to create documents (PDF, MD, reports, notes) with no specified location:

    line 147
  34. Very specific:

    ALWAYS default to the /docs directory in the project root

    line 148
  35. Very specific:

    Create /docs if it doesn't exist

    line 149
  36. Very specific:

    Add /docs to .gitignore - generated docs don't belong in git

    line 150
  37. Distinctive:

    When tracking data in files:

    line 153
  38. Very specific:

    ALWAYS create tracking files in /docs

    line 154
  39. Distinctive:

    NEVER commit tracking files to git

    line 155
  40. Very specific:

    Before creating any tracking file: verify /docs is in .gitignore

    line 156
  41. Distinctive:

    When creating research notes, API doc summaries, or analysis during a session:

    line 159
  42. Very specific:

    ALWAYS store in _ai_temp/ directory

    line 160
  43. Very specific:

    Add _ai_temp/ to .gitignore if not already there

    line 161
  44. Distinctive:

    NEVER swallow errors silently

    line 169
  45. Distinctive:

    ALWAYS log errors with context before re-throwing

    line 170
  46. Very specific:

    Add process.on('unhandledRejection') handler to entry points

    line 171
  47. Distinctive:

    ALWAYS define explicit success criteria

    line 174
  48. Distinctive:

    Every test must assert something meaningful

    line 176
  49. Distinctive:

    No file > 300 lines (split if larger)

    line 179
  50. Distinctive:

    No function > 50 lines (extract helpers)

    line 180
  51. Distinctive:

    All tests must pass before committing

    line 181
  52. Distinctive:

    ALWAYS use StrictDB for all database access (shared instance pattern)

    line 186
  53. Distinctive:

    NEVER create database connections in individual files

    line 187
  54. Very specific:

    When multiple await calls are independent, ALWAYS use Promise.all

    line 190
  55. Distinctive:

    NEVER await independent operations sequentially - evaluate dependencies first

    line 191
  56. Distinctive:

    When converting images to WebP:

    line 197
  57. Very specific:

    Use /clear between unrelated tasks

    line 210
  58. Distinctive:

    Use Plan Mode for anything bigger than a simple fix

    line 212

≈ “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

Global CLAUDE.md — Security Gatekeeper & Standards

Place this at ~/.claude/CLAUDE.md It applies to EVERY project you work on. Based on Claude Code Mastery Guides V1-V5 by TheDecipherist


Identity

  • GitHub: YourUsername
  • SSH: git@github.com:YourUsername/<repo>.git

NEVER EVER DO

These rules are ABSOLUTE and apply to every project:

NEVER Publish Sensitive Data

  • NEVER publish passwords, API keys, tokens to git/npm/docker
  • Before ANY commit: verify no secrets included
  • NEVER output secrets in responses, logs, or suggestions

NEVER Commit .env Files

  • NEVER commit .env to git
  • ALWAYS verify .env is in .gitignore

NEVER Auto-Deploy

  • ALWAYS ask before deploying to production
  • NEVER assume approval — wait for explicit "yes, deploy"

NEVER Hardcode Credentials

  • ALWAYS use environment variables for secrets
  • NEVER put API keys, passwords, or tokens directly in source code

NEVER Publish Dynamic Data in Markdown Files

  • NEVER hardcode repo names, project names, or URLs in .md files
  • ALWAYS reference environment variables instead
  • BAD: docker push myusername/myproject:latest
  • GOOD: docker push $DOCKER_HUB_REPO:latest
  • This applies to: CLAUDE.md, README.md, CONTRIBUTING.md, and all documentation

NEVER Put Personal Instructions in Public Files

  • NEVER add personal workflows or non-project instructions to a project's main CLAUDE.md
  • ALWAYS store personal procedures in .claude/LOCAL-INSTRUCTIONS.md (gitignored)
  • Examples of what belongs there: social media workflows, personal tracking, marketing procedures

NEVER Rename Without a Plan

  • NEVER do project-wide search-and-replace renames without a checklist
  • Renaming causes cascading failures in .md, .env, comments, strings, and paths

NEVER Push Docker Images Without Local Testing

  • NEVER push a Docker image without testing it locally first
  • ALWAYS run the container and verify it starts correctly before pushing
  • Check for: no crash on startup, no 502 errors, basic pages load

Docker Pre-Push Checklist

  1. Build: docker build -t $IMAGE_NAME .
  2. Run: docker run -d -p 3000:3000 --name test-container $IMAGE_NAME
  3. Wait for startup, then verify: curl -s -o /dev/null -w "%{http_code}" http://localhost:3000 (expect 200)
  4. Check logs: docker logs test-container
  5. Clean up: docker stop test-container && docker rm test-container
  6. Only then push

If Credentials Are Ever Exposed

  1. IMMEDIATELY rotate/change the exposed credentials
  2. Clean git history: git filter-repo --replace-text <(echo 'OLD_SECRET==>REDACTED')
  3. Force push: git push --force origin main
  4. Verify credentials are removed from ALL commits
  5. Alert anyone who may have cloned the repo

New Project Setup

When creating ANY new project:

Required Files

  • .env - Environment variables (NEVER commit)
  • .env.example - Template with placeholders (committed)
  • .gitignore - Must include: .env, .env.*, node_modules/, dist/, CLAUDE.local.md
  • .dockerignore - Must include: .env, .git/, node_modules/
  • CLAUDE.md - Project instructions
  • tsconfig.json - TypeScript configuration (strict mode)

Required Structure

project/
├── src/
├── tests/
├── project-docs/
├── .claude/
│   ├── commands/
│   ├── skills/
│   └── agents/
└── scripts/

TypeScript - Always

  • All new files MUST be TypeScript
  • Use strict mode
  • Never use any unless absolutely necessary

Local Instructions Storage

When you have personal procedures that are NOT project code:

  • Project CLAUDE.md - code architecture, build/test/deploy commands, technical standards
  • .claude/LOCAL-INSTRUCTIONS.md - personal workflows, social media posting, marketing procedures, anything that shouldn't be in the public repo

Setup:

  1. Create .claude/ in the project root if it doesn't exist
  2. Add .claude/ to .gitignore
  3. Create .claude/LOCAL-INSTRUCTIONS.md for personal procedures

Markdown Writing Rules

These apply to any .md file:

No Em Dashes

  • NEVER use em dashes (--)
  • ALWAYS use a regular hyphen (-) instead

Write Like a Human

  • Avoid AI writing patterns: no "delve into", "leverage", "seamlessly", "robust", "comprehensive", "streamline"
  • Be direct and specific - say what something does, not how impressive it is
  • No filler sentences that add length without adding meaning

No Repetition

  • NEVER repeat a point already made earlier in the same document
  • If the opening makes an argument, the body must go deeper - not restate it
  • Introductions and conclusions are the worst offenders

Default File Locations

Documents and Reports

When asked to create documents (PDF, MD, reports, notes) with no specified location:

  • ALWAYS default to the /docs directory in the project root
  • Create /docs if it doesn't exist
  • Add /docs to .gitignore - generated docs don't belong in git

Tracking Files (CSVs, Logs, Metrics)

When tracking data in files:

  • ALWAYS create tracking files in /docs
  • NEVER commit tracking files to git
  • Before creating any tracking file: verify /docs is in .gitignore

Temporary AI Research Files

When creating research notes, API doc summaries, or analysis during a session:

  • ALWAYS store in _ai_temp/ directory
  • Add _ai_temp/ to .gitignore if not already there
  • What goes here: research compilations, code analysis notes, temporary drafts, brainstorming

Coding Standards (All Projects)

Error Handling

  • NEVER swallow errors silently
  • ALWAYS log errors with context before re-throwing
  • Add process.on('unhandledRejection') handler to entry points

Testing

  • ALWAYS define explicit success criteria
  • "Page loads" is NOT a success criterion
  • Every test must assert something meaningful

Quality Gates

  • No file > 300 lines (split if larger)
  • No function > 50 lines (extract helpers)
  • All tests must pass before committing
  • TypeScript compiles with no errors
  • No linter warnings

Database

  • ALWAYS use StrictDB for all database access (shared instance pattern)
  • NEVER create database connections in individual files

Async Performance

  • When multiple await calls are independent, ALWAYS use Promise.all
  • NEVER await independent operations sequentially - evaluate dependencies first

Image Conversion

When converting images to WebP:

  • Try ffmpeg first (most commonly available)
  • Fallback: cwebp then convert (ImageMagick)
ffmpeg -i input.png -quality 85 output.webp

Workflow

  • One task, one chat
  • Use /clear between unrelated tasks
  • Quality over speed - ask if unsure
  • Use Plan Mode for anything bigger than a simple fix

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.