Loading...
Loading...
Compare original and translation side by side
| Cursor 模式 | Claude Code 模式 | 说明 |
|---|---|---|
| | Agent 配置文件 |
| | 配置目录 |
| 内联规则 | 渐进式披露 | 配置文件指向详细文档 |
| 单一规则文件 | 层次化文档体系 | 配置 + 规则 + 文档 |
| 隐式知识 | 显式知识库 | AGENTS.md 经验沉淀 |
| Cursor Mode | Claude Code Mode | Description |
|---|---|---|
| | Agent configuration file |
| | Configuration directory |
| Inline Rules | Progressive Disclosure | Configuration files point to detailed documents |
| Single Rule File | Hierarchical Document System | Configuration + Rules + Documentation |
| Implicit Knowledge | Explicit Knowledge Base | Experience accumulation in AGENTS.md |
Task: Explore subagent_type=Explore
探索当前项目:
- 技术栈和框架类型
- 目录结构和模块划分
- 现有的配置文件(.cursorrules, .cursor/ 等)
- 文档体系完整性
返回:项目结构报告和现有配置清单Task: Explore subagent_type=Explore
分析现有开发规范:
- 代码风格规则
- 架构模式和约定
- 测试策略
- Git 工作流
返回:现有规范摘要和改进建议Task: Grep pattern="TODO|FIXME|HACK|NOTE"
搜索代码中的隐性知识:
- 注释中的临时方案
- 需要文档化的陷阱
- 团队约定(命名、模式等)
返回:隐性知识清单和分类Task: Explore subagent_type=Explore
Explore the current project:
- Tech stack and framework types
- Directory structure and module division
- Existing configuration files (.cursorrules, .cursor/, etc.)
- Completeness of documentation system
Return: Project structure report and existing configuration listTask: Explore subagent_type=Explore
Analyze existing development specifications:
- Code style rules
- Architecture patterns and conventions
- Testing strategies
- Git workflows
Return: Summary of existing specifications and improvement suggestionsTask: Grep pattern="TODO|FIXME|HACK|NOTE"
Extract implicit knowledge from code:
- Temporary solutions in comments
- Pitfalls requiring documentation
- Team conventions (naming, patterns, etc.)
Return: Implicit knowledge list and classificationTask: Write file CLAUDE.md
内容结构:
## 项目概述 (WHAT)
- 技术栈:[框架] + [语言] + [数据库] + [其他关键依赖]
- 关键目录:src/, tests/, docs/ 等的职责说明
## 核心架构决策 (WHY)
- 为什么选择这个架构?
- 哪些是历史债务?
- 哪些设计决策需要 Agent 遵守?
## 开发工作流 (HOW)
- 如何运行项目?
- 如何测试?
- 如何验证改动?
## 核心约束 (5-10 条)
- 最关键的规则(带 CRITICAL 标记)
- 每条规则指向详细文档
## 详细文档索引
- 按主题分类的文档链接Task: Edit/Migrate
将 .cursorrules 内容迁移到:
- CLAUDE.md(简述)
- rules/(详细文档)
- agent_docs/(技术文档)
遵循渐进式披露原则Task: Write files in rules/
为每条核心规则创建独立文档:
- 规则名称.md
- 问题描述和重要性
- 正反例对比
- 常见错误
- 参考代码(使用 file:line 引用)Task: General-purpose
验证配置迁移质量:
- CLAUDE.md 行数 < 500
- 所有规则都有详细文档
- 文档间引用正确
- 运行时无配置错误Task: Write file CLAUDE.md
Content structure:
## Project Overview (WHAT)
- Tech stack: [Framework] + [Language] + [Database] + [Other key dependencies]
- Key directories: Responsibilities of src/, tests/, docs/, etc.
## Core Architecture Decisions (WHY)
- Why was this architecture chosen?
- What are the technical debts?
- Which design decisions must Agents follow?
## Development Workflow (HOW)
- How to run the project?
- How to test?
- How to verify changes?
## Core Constraints (5-10 items)
- Most critical rules (marked with CRITICAL)
- Each rule links to detailed documentation
## Detailed Document Index
- Themed document linksTask: Edit/Migrate
Migrate .cursorrules content to:
- CLAUDE.md (brief description)
- rules/ (detailed documentation)
- agent_docs/ (technical documentation)
Follow the principle of progressive disclosureTask: Write files in rules/
Create independent documents for each core rule:
- rule-name.md
- Problem description and importance
- Comparison of correct and incorrect examples
- Common mistakes
- Reference code (using file:line references)Task: General-purpose
Verify configuration migration quality:
- CLAUDE.md has < 500 lines
- All rules have detailed documentation
- Cross-document references are correct
- No configuration errors during runtimeTask: Write file AGENTS.md
内容结构:
## 代码风格
- 命名约定
- 导入顺序
- 语言特性偏好
## 已知陷阱
- 常见错误模式
- 必须避免的做法
- 框架特定陷阱
## 成功模式
- 标准工作流
- 可复用模板
- 最佳实践示例
## 复利效应实践
- Bug 修复后的改进清单
- 代码审查后的规范更新Task: Grep + Read
从代码历史和注释中提取:
- Git commit 历史中的修复记录
- 代码审查中的常见问题
- 注释中的"为什么"
- 团队约定和模式
分类整理到 AGENTS.mdTask: General-purpose
验证经验沉淀质量:
- AGENTS.md 覆盖主要陷阱
- 每个陷阱有具体代码示例
- 成功模式可操作
- 复利效应清单完整Task: Write file AGENTS.md
Content structure:
## Code Style
- Naming conventions
- Import order
- Language feature preferences
## Known Pitfalls
- Common error patterns
- Practices to avoid
- Framework-specific pitfalls
## Success Patterns
- Standard workflows
- Reusable templates
- Best practice examples
## Compounding Engineering Practices
- Improvement checklist after bug fixes
- Specification updates after code reviewsTask: Grep + Read
Extract from code history and comments:
- Fix records in Git commit history
- Common issues in code reviews
- "Why" explanations in comments
- Team conventions and patterns
Classify and organize into AGENTS.mdTask: General-purpose
Verify experience accumulation quality:
- AGENTS.md covers major pitfalls
- Each pitfall has specific code examples
- Success patterns are actionable
- Compounding engineering checklist is completeagent_docs/
├── architecture/ # 架构文档
│ ├── overview.md # 系统架构概览
│ ├── modules.md # 模块划分和职责
│ └── decisions.md # 架构决策记录 (ADR)
├── workflows/ # 工作流程
│ ├── development.md # 开发流程
│ ├── testing.md # 测试流程
│ └── deployment.md # 部署流程
├── troubleshooting.md # 故障排除
└── api/ # API 文档(如需要)
└── README.md
rules/
├── rule-1.md # 核心规则详细说明
├── rule-2.md
└── ...Task: Write + Explore
生成架构文档:
- 系统层次结构
- 模块依赖关系
- 数据流图
- 技术选型理由Task: Write
标准化工作流程:
- 添加新功能流程
- Bug 修复流程
- 代码审查流程
- 发布流程Task: Write
常见问题解决:
- 环境配置问题
- 依赖问题
- 性能问题
- 调试技巧agent_docs/
├── architecture/ # Architecture documentation
│ ├── overview.md # System architecture overview
│ ├── modules.md # Module division and responsibilities
│ └── decisions.md # Architecture decision records (ADR)
├── workflows/ # Workflows
│ ├── development.md # Development process
│ ├── testing.md # Testing process
│ └── deployment.md # Deployment process
├── troubleshooting.md # Troubleshooting guide
└── api/ # API documentation (if needed)
└── README.md
rules/
├── rule-1.md # Detailed explanation of core rules
├── rule-2.md
└── ...Task: Write + Explore
Generate architecture documentation:
- System hierarchy
- Module dependencies
- Data flow diagrams
- Reasons for technology selectionTask: Write
Standardize workflows:
- New feature addition process
- Bug fix process
- Code review process
- Release processTask: Write
Resolve common issues:
- Environment configuration problems
- Dependency issues
- Performance issues
- Debugging techniquesTask: Edit CLAUDE.md
确保配置文件:
- 行数 < 500(越短越好)
- 只包含普遍适用的内容
- 详细内容指向独立文档
- 避免代码风格指南(交给 linter)Task: Reorganize docs/
实现三级加载:
1. CLAUDE.md(元数据,自动加载)
2. rules/(规则详细说明,按需加载)
3. agent_docs/(技术文档,深度查阅)Task: Edit all .md files
统一使用 file:line 引用:
- 不复制代码片段
- 使用 "详见 src/module/file.ts:123"
- 保持文档与代码同步主控 Agent 策略:
- 单对话 < 100K token 时继续
- 完成子任务后开新对话
- Agent 出现"醉酒"症状时重置
- 把"开新对话"视为正常工作流Task: Edit CLAUDE.md
Ensure configuration files:
- Have < 500 lines (the shorter the better)
- Only contain universally applicable content
- Detailed content links to independent documents
- Avoid code style guidelines (leave to linters)Task: Reorganize docs/
Implement three-level loading:
1. CLAUDE.md (metadata, automatically loaded)
2. rules/ (detailed rule explanations, loaded on demand)
3. agent_docs/ (technical documentation, for in-depth reference)Task: Edit all .md files
Uniformly use file:line references:
- Do not copy code snippets
- Use "See src/module/file.ts:123"
- Keep documentation synchronized with codeMain Agent Strategy:
- Continue when single conversation < 100K tokens
- Start new conversations after completing subtasks
- Reset when Agent shows "drunk" symptoms
- Treat "starting new conversations" as normal workflowTask: Write scripts/
创建自动化脚本:
- pre-commit: 检查文档更新
- commit-msg: 验证提交格式
- post-merge: 提醒更新文档Task: Write templates/
标准化改进流程:
- Bug 修复报告模板
- 代码审查反馈模板
- 新规范提案模板Task: Write CHECKLIST.md
每次改动后检查:
- [ ] 是否发现新陷阱?
- [ ] 是否总结新模式?
- [ ] 是否需要更新规范?
- [ ] 是否添加测试防止回归?Task: Write scripts/
Create automation scripts:
- pre-commit: Check document updates
- commit-msg: Verify commit message format
- post-merge: Remind to update documentsTask: Write templates/
Standardize improvement processes:
- Bug fix report template
- Code review feedback template
- New specification proposal templateTask: Write CHECKLIST.md
Check after each change:
- [ ] Have new pitfalls been discovered?
- [ ] Have new patterns been summarized?
- [ ] Do specifications need to be updated?
- [ ] Have tests been added to prevent regression?undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined1. 主控 Agent 思考需求
↓
2. 拆分为 SubAgent 任务
↓
3. 并行执行多个 Task
↓
4. 汇总结果并分析
↓
5. 开启验证 Task 检查
↓
6. 根据反馈调整
↓
7. 继续下一阶段1. Main Agent analyzes requirements
↓
2. Split into SubAgent tasks
↓
3. Execute multiple Tasks in parallel
↓
4. Summarize and analyze results
↓
5. Initiate Verification Task for inspection
↓
6. Adjust based on feedback
↓
7. Proceed to the next phaseTask: General-purpose
最终验证:
1. 文档结构完整性
- CLAUDE.md, AGENTS.md 存在
- rules/ 和 agent_docs/ 组织合理
- 所有引用可访问
2. 内容质量检查
- 规则有正反例
- 陷阱有具体代码
- 工作流可操作
3. 实用性验证
- 新开发者能快速上手
- Agent 能理解规范
- 知识可复用
4. 复利效应验证
- Bug 修复流程包含文档更新
- 代码审查包含规范提取
- 经验有沉淀机制Task: General-purpose
Final Verification:
1. Documentation structure completeness
- CLAUDE.md and AGENTS.md exist
- rules/ and agent_docs/ are well-organized
- All references are accessible
2. Content quality check
- Rules have correct and incorrect examples
- Pitfalls have specific code examples
- Workflows are actionable
3. Practicality verification
- New developers can get started quickly
- Agents can understand specifications
- Knowledge is reusable
4. Compounding engineering verification
- Bug fix process includes document updates
- Code reviews include specification extraction
- Experience accumulation mechanism existsCLAUDE.md.templateAGENTS.md.templaterules/agent_docs/CLAUDE.md.templateAGENTS.md.templaterules/agent_docs/context-engineering-best-practices.mdcompounding-engineering.mddocumentation-structure.mdcontext-engineering-best-practices.mdcompounding-engineering.mddocumentation-structure.mdanalyze_project.pyvalidate_migration.pycheck_docs_consistency.pyanalyze_project.pyvalidate_migration.pycheck_docs_consistency.py