code-generator
Original:🇨🇳 Chinese
Translated
Provides comprehensive guidance for code generation including template-based generation, code scaffolding, and automated code creation. Use when the user asks about code generation, needs to generate code from templates, create code scaffolds, or automate code creation.
4installs
Added on
NPX Install
npx skill4agent add partme-ai/full-stack-skills code-generatorTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →Code Generation Skill
Overview
This skill helps you generate high-quality code, supports multiple programming languages, and adheres to best practices and design patterns.
Keywords: Code Generation, Programming, Functions, Classes, Modules, Project Development, Code Examples
Core Features
1. Function and Class Generation
- Generate standardized functions and classes
- Add comprehensive documentation comments
- Implement error handling and boundary checks
- Adhere to language-specific best practices
2. Module and Package Development
- Create structured modules and packages
- Design clear API interfaces
- Implement dependency management between modules
- Create configuration files and initialization code
3. Project Scaffolding
- Generate complete project structures
- Create configuration files (package.json, requirements.txt, etc.)
- Set up build and testing environments
- Add README and documentation
4. Code Optimization and Refactoring
- Optimize code performance and readability
- Apply design patterns and best practices
- Refactor code structure
- Add unit tests
Usage Guidelines
Code Generation Principles
- Clarity: Code should be clear and easy to understand, with standardized naming
- Maintainability: Well-structured, easy to modify and extend
- Robustness: Includes error handling and boundary checks
- Documentation: Provide complete comments and documentation
- Testability: Code should be easy to test
Supported Programming Languages
- Python
- JavaScript/TypeScript
- Java
- Go
- Rust
- Other common programming languages
Code Structure Requirements
- Imports: Clear import statements
- Docstrings: Documentation for functions and classes
- Implementation Code: Core logic implementation
- Test Code: Unit tests (if required)
- Example Code: Usage examples (if required)
Output Format
Generated code should include:
- Code Files: Complete source code files
- Documentation Comments: Documentation for functions, classes, and modules
- Usage Examples: Code usage examples
- Dependency Instructions: Required dependencies and versions
- Test Code: Relevant test cases
Best Practices
- Follow language coding standards and style guides
- Use meaningful variable and function names
- Add type hints (where applicable)
- Implement appropriate error handling
- Write clear documentation comments
- Consider performance and scalability
- Adhere to SOLID principles and design patterns