Loading...
Loading...
Compare original and translation side by side
User Request
│
├─→ "init" or "create" → Initialize New CLAUDE.md
│ └─→ Follow: @refs/initialization-workflow.md
│
├─→ "optimize" or "improve" → Optimize Existing CLAUDE.md
│ └─→ Follow: @refs/optimization-patterns.md
│
└─→ "integrate" or "setup MCP/slash commands" → Integration
└─→ Follow: @refs/integration-strategies.md用户请求
│
├─→ "init" 或 "create" → 初始化新的CLAUDE.md
│ └─→ 参考:@refs/initialization-workflow.md
│
├─→ "optimize" 或 "improve" → 优化现有CLAUDE.md
│ └─→ 参考:@refs/optimization-patterns.md
│
└─→ "integrate" 或 "setup MCP/slash commands" → 集成配置
└─→ 参考:@refs/integration-strategies.mdWhen you are implementing new features in this codebase, it's very important that you always make sure to write comprehensive tests for all the functionality you add. We use Jest as our testing framework, and we expect all new code to have at least 80% code coverage.When you are implementing new features in this codebase, it's very important that you always make sure to write comprehensive tests for all the functionality you add. We use Jest as our testing framework, and we expect all new code to have at least 80% code coverage.undefinedundefinedsrc/lib/
**Result:** 70% token reduction, same informationsrc/lib/
**结果:** Token使用量减少70%,信息完整度不变| Project Type | Key Indicators | Template Focus |
|---|---|---|
| Web App | React/Vue/Angular, frontend build | UI components, responsive design, routing |
| Backend API | Express/FastAPI, database, auth | RESTful conventions, validation, security |
| CLI Tool | Commander/Click, stdio | Commands, user experience, file operations |
| Library | Package exports, no app logic | API design, versioning, backward compatibility |
| Monorepo | Workspaces, multiple packages | Cross-package changes, workspace commands |
| 项目类型 | 关键指标 | 模板重点 |
|---|---|---|
| Web应用 | React/Vue/Angular、前端构建 | UI组件、响应式设计、路由 |
| 后端API | Express/FastAPI、数据库、认证 | RESTful规范、校验、安全 |
| CLI工具 | Commander/Click、标准输入输出 | 命令、用户体验、文件操作 |
| 类库 | 包导出、无应用逻辑 | API设计、版本管理、向后兼容 |
| 单体仓库 | 工作区、多包管理 | 跨包变更、工作区命令 |
| Project Complexity | Target Token Count |
|---|---|
| Simple (single-purpose tool) | 100-200 tokens |
| Medium (standard web app) | 200-400 tokens |
| Complex (multi-service platform) | 400-800 tokens |
| Maximum (exception only) | 1000 tokens |
.claude/CLAUDE.md.claude/ARCHITECTURE.md.claude/commands/*.md| 项目复杂度 | 目标Token数量 |
|---|---|
| 简单(单一用途工具) | 100-200 Token |
| 中等(标准Web应用) | 200-400 Token |
| 复杂(多服务平台) | 400-800 Token |
| 最大值(仅特殊情况) | 1000 Token |
.claude/CLAUDE.md.claude/ARCHITECTURE.md.claude/commands/*.mdWhen working on authentication:
@src/lib/auth.ts
@src/middleware/authenticate.ts处理认证相关内容时:
@src/lib/auth.ts
@src/middleware/authenticate.tsundefinedundefinedNote: General software engineering principles are in your global CLAUDE.md. This guide focuses on project-specific patterns and requirements.
undefined注意:通用软件工程原则请查看全局CLAUDE.md。 本指南仅聚焦项目专属模式与要求。
undefinedundefinedundefined
**Detailed Integration Guide:** @refs/integration-strategies.md
**详细集成指南:** @refs/integration-strategies.md| Problem | Solution |
|---|---|
| Over-Documentation | Document project-specific decisions only |
| Stale Information | Verify against current package.json, files |
| Redundant Context | Link to README, add only unique patterns |
| Token Waste | On-demand context by functional area |
| Generic Fluff | Specific patterns: "Use Zod validation, Prisma transactions" |
| 问题 | 解决方案 |
|---|---|
| 过度文档化 | 仅记录项目专属决策 |
| 信息过时 | 与当前package.json、文件验证一致 |
| 上下文冗余 | 链接至README,仅添加独特模式 |
| Token浪费 | 按功能区域按需加载上下文 |
| 通用套话 | 使用具体模式:如"使用Zod校验、Prisma事务" |