coding-guidelines
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseThis skill provides coding patterns. Load references based on what you're working with.
本技能提供编码模式支持。可根据你正在使用的技术加载对应的参考内容。
Formatting
格式规范
Detect project formatter from config files (biome.json, .prettierrc, .eslintrc, pyproject.toml, rustfmt.toml, etc.) and follow its conventions.
General rules:
- Empty line at end of files
- Whitespace between logical blocks
- Property ordering: alphabetical by default (primitives first, then nested for mixed objects)
从配置文件(biome.json、.prettierrc、.eslintrc、pyproject.toml、rustfmt.toml等)中识别项目的格式化工具,并遵循其约定。
通用规则:
- 文件末尾保留空行
- 逻辑代码块之间保留空白
- 属性排序:默认按字母顺序(基本类型在前,混合对象中的嵌套类型在后)
References
参考内容
| Technology | Reference | Load When |
|---|---|---|
| TypeScript/JS | references/typescript.md | Writing TypeScript or JavaScript code |
| Rust | references/rust.md | Writing Rust code |
| SolidJS | references/solidjs.md | Writing SolidJS components or JSX with SolidJS patterns |
| Tailwind CSS | references/tailwind.md | Using Tailwind utility classes |
| daisyUI | references/daisyui.md | Using daisyUI component classes |
| React Native | references/react-native.md | Writing React Native components (View, Text, etc.) |
| Expo | references/expo.md | Using Expo Router, Expo packages, or app.json config |
| NativeWind | references/nativewind.md | Using className prop in React Native |
| 技术栈 | 参考链接 | 加载时机 |
|---|---|---|
| TypeScript/JavaScript | references/typescript.md | 编写TypeScript或JavaScript代码时 |
| Rust | references/rust.md | 编写Rust代码时 |
| SolidJS | references/solidjs.md | 编写SolidJS组件或使用SolidJS模式的JSX时 |
| Tailwind CSS | references/tailwind.md | 使用Tailwind工具类时 |
| daisyUI | references/daisyui.md | 使用daisyUI组件类时 |
| React Native | references/react-native.md | 编写React Native组件(View、Text等)时 |
| Expo | references/expo.md | 使用Expo Router、Expo包或配置app.json时 |
| NativeWind | references/nativewind.md | 在React Native中使用className属性时 |
When to Load References
何时加载参考内容
Load a reference when:
- The code you're writing uses that technology
- You see imports or patterns from that framework
- The user mentions working with that technology
Each reference contains:
- Core principles for that framework
- Research guidance (use context7 to query current docs)
- Research checklist before implementing
满足以下条件时加载参考内容:
- 你编写的代码使用了对应技术
- 代码中包含该框架的导入语句或模式
- 用户提到正在使用该技术
每个参考内容包含:
- 对应框架的核心原则
- 调研指南(使用context7查询最新文档)
- 实现前的调研检查清单
Research-First Approach
调研优先方法
These frameworks evolve - class names, APIs, and patterns change between versions. Each reference emphasizes:
- Principles over specific syntax
- Research checklists to verify current behavior
- context7 for querying up-to-date documentation
这些框架一直在演进——类名、API和模式会随版本变化。每个参考内容都强调:
- 原则优先于特定语法
- 使用调研检查清单验证当前特性
- 使用context7查询最新文档