Please read the project's README.md, package.json, and main directories to help me understand the project's architecture and tech stack, but don't write any code yet.
Please help me create a detailed CLAUDE.md file that includes project architecture description, common commands, coding standards, and development environment configuration.
Please check the project's environment configuration, ensure all dependencies are correctly installed, and run initialization scripts. If there are any issues, please tell me how to resolve them.
I need to develop [feature description]. Please follow these steps:
1. First read relevant code to understand existing architecture
2. Create a detailed implementation plan
3. Implement core functionality
4. Write tests
5. Update documentation
Pause and wait for my confirmation after each step.
I want to implement [feature description]. Please first write test cases based on expected inputs and outputs, ensure tests fail, then implement the feature code to make tests pass.
Please help me design and implement [API description] interface, including:
- Route definition
- Request parameter validation
- Business logic implementation
- Response format definition
- Error handling
- API documentation
Please help me create a [component name] component with requirements:
- Follow existing component patterns in the project
- Include TypeScript type definitions
- Support [specific functional requirements]
- Write corresponding test files
I encountered this error: [error message]. Please help me analyze the cause and provide a fix. Let me know if you need to see related code.
Please analyze performance issues in [file/feature] and provide optimization suggestions. Focus on:
- Execution efficiency
- Memory usage
- Loading speed
- User experience
Please refactor [function/class] in [filename], with goals to:
- Improve code readability
- Reduce duplicate code
- Follow best practices
- Maintain functionality unchanged
Please analyze existing code first, then provide a refactoring plan.
Please review [file/feature] code, focusing on:
- Code standards
- Security issues
- Performance issues
- Best practices
- Potential bugs
Please write comprehensive test cases for [function/class/component], including:
- Normal case tests
- Boundary condition tests
- Error case tests
- Mock dependencies
Several tests are failing, please analyze the failure reasons and fix them. The test command is: [test command]
Please analyze current test coverage and add test cases for areas with insufficient coverage.
Please implement UI component based on this design: [upload design]
Requirements:
- Responsive design
- Support dark mode
- Accessibility support
- Comply with design specifications
Please optimize styles for [component/page] to achieve:
- [specific style requirements]
- Maintain consistency with overall design
- Ensure proper display on different devices
Please implement state management for [feature], including:
- State structure design
- Action definitions
- Reducer implementation
- Async operation handling
Please design database table structure for [feature], including:
- Table structure definition
- Index design
- Relationship constraints
- Migration scripts
Please implement a [middleware name] middleware with features:
- [specific functional requirements]
- Error handling
- Logging
- Performance monitoring
Please help me integrate [third-party service], including:
- SDK configuration
- API call encapsulation
- Error handling
- Unit tests
Please generate API documentation for the project, including:
- Interface list
- Request parameter descriptions
- Response format examples
- Error code descriptions
Please add detailed code comments to [file/function], including:
- Function description
- Parameter descriptions
- Return value description
- Usage examples
Please update the project's README.md file to ensure it includes:
- Project introduction
- Installation instructions
- Usage methods
- Contribution guidelines
Please review current changes, write appropriate commit messages and commit the code. Commit messages should follow the project's commit conventions.
Please create a Pull Request, including:
- Clear title and description
- Summary of changes
- Test plan
- Related Issue links
Please help me create a new feature branch [branch name] and switch to it to start development.
I need to implement [large feature description]. Please help me break it down into multiple small tasks, each including:
- Task description
- Estimated time
- Dependencies
- Acceptance criteria
Please help me create a project development plan, including:
- Feature module division
- Development priorities
- Time schedule
- Risk assessment
For [project requirements], please help me analyze technology selection, compare pros and cons of different solutions, and recommend the most suitable tech stack.
Please analyze project dependencies, check for:
- Redundant dependencies
- Security vulnerabilities
- Version updates needed
- Alternative solutions
Please analyze the overall project architecture, evaluate:
- Clear module responsibilities
- Reasonable coupling
- Extensibility
- Areas for improvement
Please provide project code statistics, including:
- Lines of code
- Number of files
- Tech stack distribution
- Test coverage
Please help me configure the development environment, including:
- Install necessary dependencies
- Configure environment variables
- Set up development tools
- Verify environment is working
Please configure CI/CD pipeline for the project, including:
- Automated testing
- Code quality checks
- Automated deployment
- Notification mechanisms
Please create Docker configuration for the project, including:
- Dockerfile
- docker-compose.yml
- Environment variable configuration
- Deployment instructions
Please perform [operation] on all [file type] files in the project, ensuring:
- Operation consistency
- No breaking existing functionality
- Compliance with project standards
Please create an automation script to [task description], the script should:
- Support command-line arguments
- Include error handling
- Provide detailed logging
- Be easy to maintain
Please generate corresponding code files based on [configuration/template], including:
- [specific file types]
- Follow project conventions
- Include necessary comments
- Pass basic tests
Describe requirements in detail, avoid vague expressions
Split complex tasks into multiple steps
Clarify what to do and what not to do
Provide necessary background information
Require confirmation before continuing important steps
"Please first analyze...": Require Claude to understand before acting
"Don't do... yet": Set clear boundaries
"Pause after each step": Control execution pace
"Follow existing project...": Maintain consistency
"Refer to existing patterns...": Reuse existing patterns
"Comply with project standards...": Follow conventions
"If needed... please tell me": Active communication
"Stop if you encounter issues": Timely feedback
"Ask when uncertain": Avoid incorrect assumptions
@src/components/Button.tsx directly references file content
Press Shift+TAB twice to enter PLAN mode for planning
Use /clear and /compact to manage conversation history
Define common commands in .claude/commands/ directory
Process multiple similar tasks at once for efficiency
💡 Tip: These prompt templates can be adjusted according to specific project needs. It's recommended to bookmark this article as a daily development reference and gradually master efficient communication with Claude Code.
I'm getting an error when running npm test:
"TypeError: Cannot read property 'map' of undefined at UserList.tsx:45"
Please:
1. Analyze the error cause
2. Provide a fix
3. Explain why this problem occurred
4. Suggest how to avoid similar issues
Users report the list page loads slowly, please:
1. Analyze performance bottlenecks in @src/pages/UserList.tsx
2. Optimize using React DevTools Profiler results
3. Implement virtual scrolling or pagination
4. Add loading states and error handling
5. Ensure functionality works after optimization
I need to add Excel export functionality:
1. First check existing table component implementation
2. Design the export feature interface
3. Implement frontend export logic
4. Add export button and progress indicator
5. Handle batch export for large data
6. Write corresponding test cases
By using these carefully designed prompts, you'll be able to better leverage Claude Code's powerful capabilities and significantly improve development efficiency and code quality.