Discover CLAUDE.md best practices for project-specific AI coding guidance, with ready-to-use templates for languages, frameworks, and real-world cases
CLAUDE.md 最佳实践集合 — 让你的 AI 编程助手真正理解你的项目
🌐 简体中文 | English
CLAUDE.md 是 Claude Code 的项目级配置文件——告诉 AI "在这个项目里该怎么表现"。
一个好的 CLAUDE.md 能让 AI 的代码质量提升 数倍。但大多数人不知道怎么写好它。
本项目收集了 GitHub 上最好的 CLAUDE.md 实践,按语言、框架、场景分类,复制粘贴即可用。
# 找到你的项目类型,复制对应的 CLAUDE.md
# 例如:TypeScript + Next.js 全栈项目
cp by-framework/nextjs/CLAUDE.md /your/project/CLAUDE.md
# 根据实际情况修改后即可使用
在看模板之前,先理解核心原则:
| 原则 | 说明 | 示例 |
|---|---|---|
| 具体 | 告诉 AI 具体的规则,而不是模糊的要求 | ✅ "使用 pnpm,不要用 npm" ❌ "用合适的包管理器" |
| 简短 | AI 上下文窗口有限,每一行都要有价值 | ✅ 50 行精炼规则 ❌ 500 行长篇大论 |
| 可测试 | 规则应该能被客观判断是否遵守 | ✅ "函数不超过 50 行" ❌ "写简洁的代码" |
| 项目特定 | 写通用文档不如不写,要写这个项目独有的约定 | ✅ "API 路由放在 src/api/" ❌ "保持代码整洁" |
# ❌ 太模糊
请写高质量的代码,注意性能和可读性。
# ❌ 太长,像教程
## 什么是 React?
React 是一个用于构建用户界面的 JavaScript 库...(省略 200 行)
# ❌ 重复 AI 已知的知识
请使用 ESLint 来检查代码质量。ESLint 是一个...
# ✅ 具体、简短、项目特定
- 包管理器:pnpm(不要用 npm/yarn)
- 测试:vitest,测试文件放在 __tests__/ 下
- API 路由命名:kebab-case,如 /api/user-profile
- 数据库:Prisma OR
Mine your Claude Code and Codex logs into a local you.md agent profile.
Local-first AI coding agent for VS Code & Cursor. Ollama, LM Studio & your inference fleet. Cursor-grade agent UX — offline, private, zero token cost.
A self-improving skill for AI coding agents (Claude Code, Cursor, AGENTS.md): recognize a hard-won golden path in a session and harvest it into a reusable skill/rule for next time.
Second brain for Forward Deployed Engineers. Engagement memory + 35 skills across 6 domains, all behind one @fde... Works with any AI coding agent.
Game-development Agent Skills for AI coding agents: install once and a master router loads the right skill for your engine and task. 66 original, version-pinned skills (plus a master router) in the portable SKILL.md format that runs across Claude Code, Cursor, Codex, Copilot, Gemini CLI and more, for Godot, Unity, Unreal, web and beyond.
Honey (I Shrunk the AI) by GreenPT: a cross-tool coding skill that cuts AI coding-agent token usage and LLM API costs — write less code, less prose, and denser agent-to-agent handoffs (−53%, lossless in benchmarks) with no loss of quality. Works with Claude Code, Cursor, GitHub Copilot, Codex, Gemini CLI, Windsurf, Cline & Kiro.
Workflows from the Neura Market marketplace related to this Cursor resource