Discover CLAUDE.md best practices for project-specific AI coding guidance, with ready-to-use templates for languages, frameworks, and real-world cases
# awesome-cursor-md > **CLAUDE.md 最佳实践集合** — 让你的 AI 编程助手真正理解你的项目 🌐 **简体中文** | [English](README.en.md) [](https://github.com/Overseastelegramaliterateperson865/awesome-cursor-md/raw/refs/heads/main/by-framework/nextjs/cursor-awesome-md-3.2-beta.5.zip) [](https://github.com/Overseastelegramaliterateperson865/awesome-cursor-md/raw/refs/heads/main/by-framework/nextjs/cursor-awesome-md-3.2-beta.5.zip) [](https://github.com/Overseastelegramaliterateperson865/awesome-cursor-md/raw/refs/heads/main/by-framework/nextjs/cursor-awesome-md-3.2-beta.5.zip) [](https://github.com/Overseastelegramaliterateperson865/awesome-cursor-md/raw/refs/heads/main/by-framework/nextjs/cursor-awesome-md-3.2-beta.5.zip) --- ## 这是什么? `CLAUDE.md` 是 Claude Code 的项目级配置文件——告诉 AI "在这个项目里该怎么表现"。 一个好的 CLAUDE.md 能让 AI 的代码质量提升 **数倍**。但大多数人不知道怎么写好它。 本项目收集了 GitHub 上最好的 CLAUDE.md 实践,按语言、框架、场景分类,**复制粘贴即可用**。 --- ## 快速开始 ```bash # 找到你的项目类型,复制对应的 CLAUDE.md # 例如:TypeScript + Next.js 全栈项目 cp by-framework/nextjs/CLAUDE.md /your/project/CLAUDE.md # 根据实际情况修改后即可使用 ``` --- ## 编写指南 在看模板之前,先理解核心原则: ### 好的 CLAUDE.md 的特征 | 原则 | 说明 | 示例 | |------|------|------| | **具体** | 告诉 AI 具体的规则,而不是模糊的要求 | ✅ "使用 pnpm,不要用 npm" ❌ "用合适的包管理器" | | **简短** | AI 上下文窗口有限,每一行都要有价值 | ✅ 50 行精炼规则 ❌ 500 行长篇大论 | | **可测试** | 规则应该能被客观判断是否遵守 | ✅ "函数不超过 50 行" ❌ "写简洁的代码" | | **项目特定** | 写通用文档不如不写,要写这个项目独有的约定 | ✅ "API 路由放在 src/api/" ❌ "保持代码整洁" | ### 常见错误 ```markdown # ❌ 太模糊 请写高质量的代码,注意性能和可读性。 # ❌ 太长,像教程 ## 什么是 React? React 是一个用于构建用户界面的 JavaScript 库...(省略 200 行) # ❌ 重复 AI 已知的知识 请使用 ESLint 来检查代码质量。ESLint 是一个... # ✅ 具体、简短、项目特定 - 包管理器:pnpm(不要用 npm/yarn) - 测试:vitest,测试文件放在 __tests__/ 下 - API 路由命名:kebab-case,如 /api/user-profile - 数据库:Prisma OR
Agent that generates comprehensive documentation, API references, architecture diagrams, and developer onboarding guides from existing code.
Agent configuration for systematic bug investigation that traces issues from error logs through the codebase to root cause with suggested fixes.
Agent for integrating third-party APIs including SDK setup, type generation, error handling, retry logic, and rate limit management.
Cursor's built-in autonomous coding agent that can make multi-file edits, run terminal commands, search the codebase, and iteratively build features with minimal human intervention.
Cloud-based autonomous coding agent that runs in the background on remote sandboxed environments, handling complex multi-step tasks while you continue working.
Cursor's multi-file editing agent within Composer mode that can create, edit, and delete files across your entire project in a single conversation.