This skill provides multi-language code standard guidance to help write high-quality code that follows best practices.
Usage scenarios
Refer to the corresponding language's standards when performing the following tasks:
- Writing new code - When creating new functions, classes, or modules
- Refactoring code - When improving existing code structure and quality
- Code review - When checking whether code conforms to standards
- Adding features - When extending functionality on top of existing code
- Fixing bugs - When modifying code to solve problems
Language standard mapping
Select the corresponding standard file based on the file extension:
| File type | Reference document | Key principles |
|---|---|---|
.py |
py-principles.md | Type safety, modern syntax, immutability, exception handling |
.rs |
rust-principles.md | Ownership safety, zero-cost abstractions, idiomatic syntax, concurrency safety |
.ts, .tsx, .js, .jsx |
ts-principles.md | Type safety, modern JS/TS, React best practices, accessibility |
Core principles
Training data becomes outdated. When in doubt about framework usage, API features, or best practices, consult official documentation first rather than making decisions from memory.
Workflow
- Identify the language - Determine the target language based on the file path
- Read the standard - Use the Read tool to read the corresponding reference file
- Apply the principles - Based on the standard, ensure the code meets requirements such as type safety, error handling, and naming conventions
- Self-check - Before completion, check whether it conforms to the language's best practices
Core checkpoints
Focus dimensions common to all languages:
- Type annotations/signatures are complete and accurate
- Error handling is appropriate (catch specific exceptions, do not ignore errors)
- Naming is clear, intent is explicit
- Functions have a single responsibility and controllable complexity
- No obvious performance or security issues
Framework/library-specific code must reference official documentation; see the "Reference when uncertain" subsection of each language file for details.