ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 14px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">这份提示词出自作者 Chris Dzombak,他使用 Claude Code 在短时间内开发了 12 个应用,从而总结了这样一份提示词。 你可以把这份提示词放到全局的ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-feature-settings: normal;font-variation-settings: normal;font-size: 12.6px;text-align: left;line-height: 1.75;color: rgb(221, 17, 68);background: rgba(27, 31, 35, 0.05);padding: 3px 5px;border-radius: 4px;">~/.claude/CLAUDE.md文件中,Cursor 也支持配置全局的 Rules。ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 14px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">当然你也可以ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: inherit;color: rgb(85, 201, 234);">根据实际情况选取部分提示词,或者放到你的项目 Rules 中。原文提示词放在了结尾。ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;display: table;padding: 0px 0.2em;color: rgb(255, 255, 255);background: rgb(85, 201, 234);">提示词解析ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 14px;letter-spacing: 0.1em;color: rgb(63, 63, 63);">以下是提示的中文解析,我永远鼓励你根据情况增删提示词,比如你可能不需要测试用例、你可能不需要让它做过多的事情。ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;padding-left: 8px;color: rgb(63, 63, 63);">理念ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;color: rgb(85, 201, 234);">核心信念ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 14px;color: rgb(63, 63, 63);" class="list-paddingleft-1">ingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;font-size: 14px;text-indent: -1em;display: block;margin: 0.2em 8px;color: rgb(63, 63, 63);">•增量式进展优于“大爆炸”式开发- 编译并通过测试的小变更•清晰的意图优于巧妙的代码- 保持代码的“无聊”和“显而易见”简单性意味着- • 不要使用巧妙的技巧 - 选择“无聊”的解决方案
流程1. 规划与分阶段将复杂的工作分解为 3-5 个阶段。在IMPLEMENTATION_PLAN.md中记录: ## 阶段 N: [Name]
**目标**: [具体可交付成果] **成功标准**: [可测试的结果] **测试**: [具体的测试用例] **状态**: [未开始|进行中|已完成]
2. 实现流程
3. 遇到困难时(尝试了 3 次后)严重警告: 每个问题最多尝试 3 次,然后停止。
技术标准架构原则代码质量错误处理决策框架当存在多种有效方法时,基于以下几点进行选择:
项目集成学习代码库工具质量关卡完成的定义测试准则重要提醒NEVER: ALWAYS: 提示词原文
# Development Guidelines
## Philosophy
### Core Beliefs
- **Incremental progress over big bangs** - Small changes that compile and pass tests - **Learning from existing code** - Study and plan before implementing - **Pragmatic over dogmatic** - Adapt to project reality - **Clear intent over clever code** - Be boring and obvious
### Simplicity Means
- Single responsibility per function/class - Avoid premature abstractions - No clever tricks - choose the boring solution - If you need to explain it, it's too complex
## Process
### 1. Planning & Staging
Break complex work into 3-5 stages. Document in `IMPLEMENTATION_PLAN.md`:
\`\`\`markdown ## Stage N: [Name] **Goal**: [Specific deliverable] **Success Criteria**: [Testable outcomes] **Tests**: [Specific test cases] **Status**: [Not Started|In Progress|Complete] \`\`\` - Update status as you progress - Remove file when all stages are done
### 2. Implementation Flow
1. **Understand** - Study existing patterns in codebase 2. **Test** - Write test first (red) 3. **Implement** - Minimal code to pass (green) 4. **Refactor** - Clean up with tests passing 5. **Commit** - With clear message linking to plan
### 3. When Stuck (After 3 Attempts)
**CRITICAL**: Maximum 3 attempts per issue, then STOP.
1. **Document what failed**: - What you tried - Specific error messages - Why you think it failed
2. **Research alternatives**: - Find 2-3 similar implementations - Note different approaches used
3. **Question fundamentals**: - Is this the right abstraction level? - Can this be split into smaller problems? - Is there a simpler approach entirely?
4. **Try different angle**: - Different library/framework feature? - Different architectural pattern? - Remove abstraction instead of adding?
## Technical Standards
### Architecture Principles
- **Composition over inheritance** - Use dependency injection - **Interfaces over singletons** - Enable testing and flexibility - **Explicit over implicit** - Clear data flow and dependencies - **Test-driven when possible** - Never disable tests, fix them
### Code Quality
- **Every commit must**: - Compile successfully - Pass all existing tests - Include tests for new functionality - Follow project formatting/linting
- **Before committing**: - Run formatters/linters - Self-review changes - Ensure commit message explains "why"
### Error Handling
- Fail fast with descriptive messages - Include context for debugging - Handle errors at appropriate level - Never silently swallow exceptions
## Decision Framework
When multiple valid approaches exist, choose based on:
1. **Testability** - Can I easily test this? 2. **Readability** - Will someone understand this in 6 months? 3. **Consistency** - Does this match project patterns? 4. **Simplicity** - Is this the simplest solution that works? 5. **Reversibility** - How hard to change later?
## Project Integration
### Learning the Codebase
- Find 3 similar features/components - Identify common patterns and conventions - Use same libraries/utilities when possible - Follow existing test patterns
### Tooling
- Use project's existing build system - Use project's test framework - Use project's formatter/linter settings - Don't introduce new tools without strong justification
## Quality Gates
### Definition of Done
- [ ] Tests written and passing - [ ] Code follows project conventions - [ ] No linter/formatter warnings - [ ] Commit messages are clear - [ ] Implementation matches plan - [ ] No TODOs without issue numbers
### Test Guidelines
- Test behavior, not implementation - One assertion per test when possible - Clear test names describing scenario - Use existing test utilities/helpers - Tests should be deterministic
## Important Reminders
**NEVER**: - Use `--no-verify` to bypass commit hooks - Disable tests instead of fixing them - Commit code that doesn't compile - Make assumptions - verify with existing code
**ALWAYS**: - Commit working code incrementally - Update plan documentation as you go - Learn from existing implementations - Stop after 3 failed attempts and reassess
总结这个提示词不仅仅适用于 AI,也是我们一份给开发实践指南。
|