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
In this repository26 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibilitySkill
- api-conventionsSkill
- code-reviewSkill
- create-serviceSkill
- css-structureSkill
- debuggerSkill
- dependency-vettingSkill
- design-reviewSkill
- dev-pitfallsSkill
- dockerSkill
- docker-swarmSkill
- mcp-builderSkill
- mdd-workflowSkill
- mongodb-backupsSkill
- mongodb-replica-setsSkill
- mongodb-rulesSkill
- nginxSkill
- nodejsSkill
- responsive-cssSkill
- schema-source-of-truthSkill
- test-writerSkill
- tui-builderSkill
- wafSkill
- web-architectureSkill
- web-performanceSkill
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
- Very specific: line 21
NEVER publish passwords, API keys, tokens to git/npm/docker
- Distinctive: line 22
Before ANY commit: verify no secrets included
- Distinctive: line 23
NEVER output secrets in responses, logs, or suggestions
- Very specific: line 26
NEVER commit .env to git
- Very specific: line 27
ALWAYS verify .env is in .gitignore
- Distinctive: line 30
ALWAYS ask before deploying to production
- Distinctive: line 31
NEVER assume approval — wait for explicit "yes, deploy"
- Distinctive: line 34
ALWAYS use environment variables for secrets
- Distinctive: line 35
NEVER put API keys, passwords, or tokens directly in source code
- Very specific: line 38
NEVER hardcode repo names, project names, or URLs in .md files
- Distinctive: line 39
ALWAYS reference environment variables instead
- Distinctive: line 45
NEVER add personal workflows or non-project instructions to a project's main CLAUDE.md
- Very specific: line 46
ALWAYS store personal procedures in .claude/LOCAL-INSTRUCTIONS.md (gitignored)
- Distinctive: line 50
NEVER do project-wide search-and-replace renames without a checklist
- Distinctive: line 54
NEVER push a Docker image without testing it locally first
- Distinctive: line 55
ALWAYS run the container and verify it starts correctly before pushing
- Distinctive: line 56
Check for: no crash on startup, no 502 errors, basic pages load
- Very specific: line 61
Wait for startup, then verify: curl -s -o /dev/null -w "%{http_code}" http://localhost:3000 (expect 200)
- Distinctive: line 73
Verify credentials are removed from ALL commits
- Distinctive: line 80
When creating ANY new project:
- Distinctive: line 104
All new files MUST be TypeScript
- Very specific: line 106
Never use any unless absolutely necessary
- Distinctive: line 112
When you have personal procedures that are NOT project code:
- Very specific: line 118
Create .claude/ in the project root if it doesn't exist
- Very specific: line 119
Add .claude/ to .gitignore
- Very specific: line 120
Create .claude/LOCAL-INSTRUCTIONS.md for personal procedures
- Distinctive: line 129
NEVER use em dashes (--)
- Distinctive: line 130
ALWAYS use a regular hyphen (-) instead
- Distinctive: line 133
Avoid AI writing patterns: no "delve into", "leverage", "seamlessly", "robust", "comprehensive", "streamline"
- Distinctive: line 135
No filler sentences that add length without adding meaning
- Distinctive: line 138
NEVER repeat a point already made earlier in the same document
- Distinctive: line 139
If the opening makes an argument, the body must go deeper - not restate it
- Distinctive: line 147
When asked to create documents (PDF, MD, reports, notes) with no specified location:
- Very specific: line 148
ALWAYS default to the /docs directory in the project root
- Very specific: line 149
Create /docs if it doesn't exist
- Very specific: line 150
Add /docs to .gitignore - generated docs don't belong in git
- Distinctive: line 153
When tracking data in files:
- Very specific: line 154
ALWAYS create tracking files in /docs
- Distinctive: line 155
NEVER commit tracking files to git
- Very specific: line 156
Before creating any tracking file: verify /docs is in .gitignore
- Distinctive: line 159
When creating research notes, API doc summaries, or analysis during a session:
- Very specific: line 160
ALWAYS store in _ai_temp/ directory
- Very specific: line 161
Add _ai_temp/ to .gitignore if not already there
- Distinctive: line 169
NEVER swallow errors silently
- Distinctive: line 170
ALWAYS log errors with context before re-throwing
- Very specific: line 171
Add process.on('unhandledRejection') handler to entry points
- Distinctive: line 174
ALWAYS define explicit success criteria
- Distinctive: line 176
Every test must assert something meaningful
- Distinctive: line 179
No file > 300 lines (split if larger)
- Distinctive: line 180
No function > 50 lines (extract helpers)
- Distinctive: line 181
All tests must pass before committing
- Distinctive: line 186
ALWAYS use StrictDB for all database access (shared instance pattern)
- Distinctive: line 187
NEVER create database connections in individual files
- Very specific: line 190
When multiple await calls are independent, ALWAYS use Promise.all
- Distinctive: line 191
NEVER await independent operations sequentially - evaluate dependencies first
- Distinctive: line 197
When converting images to WebP:
- Very specific: line 210
Use /clear between unrelated tasks
- Distinctive: line 212
Use Plan Mode for anything bigger than a simple fix
≈ “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.
Files
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
.envto git - ALWAYS verify
.envis 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
.mdfiles - 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
- Build:
docker build -t $IMAGE_NAME . - Run:
docker run -d -p 3000:3000 --name test-container $IMAGE_NAME - Wait for startup, then verify:
curl -s -o /dev/null -w "%{http_code}" http://localhost:3000(expect 200) - Check logs:
docker logs test-container - Clean up:
docker stop test-container && docker rm test-container - Only then push
If Credentials Are Ever Exposed
- IMMEDIATELY rotate/change the exposed credentials
- Clean git history:
git filter-repo --replace-text <(echo 'OLD_SECRET==>REDACTED') - Force push:
git push --force origin main - Verify credentials are removed from ALL commits
- 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 instructionstsconfig.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
anyunless 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:
- Create
.claude/in the project root if it doesn't exist - Add
.claude/to.gitignore - Create
.claude/LOCAL-INSTRUCTIONS.mdfor 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
/docsdirectory in the project root - Create
/docsif it doesn't exist - Add
/docsto.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
/docsis 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.gitignoreif 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
awaitcalls are independent, ALWAYS usePromise.all - NEVER await independent operations sequentially - evaluate dependencies first
Image Conversion
When converting images to WebP:
- Try
ffmpegfirst (most commonly available) - Fallback:
cwebpthenconvert(ImageMagick)
ffmpeg -i input.png -quality 85 output.webpWorkflow
- One task, one chat
- Use
/clearbetween unrelated tasks - Quality over speed - ask if unsure
- Use Plan Mode for anything bigger than a simple fix
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
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.

