AgentSkillsCN

coding-guidelines

提供适用于 TypeScript/JavaScript、Rust 以及前端框架的编码模式与最佳实践指南。当您编写 TypeScript/JavaScript 或 Rust 代码,或在 SolidJS、Tailwind CSS、daisyUI、React Native、Expo 或 NativeWind 等环境中进行开发时,可使用此技能。它将为您提供符合语言习惯的编码模式与行业最佳实践。

SKILL.md
--- frontmatter
name: coding-guidelines
description: Coding patterns and guidelines for TypeScript/JavaScript, Rust, and frontend frameworks. Use this skill when writing TypeScript/JavaScript or Rust code, or working with SolidJS, Tailwind CSS, daisyUI, React Native, Expo, or NativeWind. Provides idiomatic patterns and best practices.

This 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)

References

TechnologyReferenceLoad When
TypeScript/JSreferences/typescript.mdWriting TypeScript or JavaScript code
Rustreferences/rust.mdWriting Rust code
SolidJSreferences/solidjs.mdWriting SolidJS components or JSX with SolidJS patterns
Tailwind CSSreferences/tailwind.mdUsing Tailwind utility classes
daisyUIreferences/daisyui.mdUsing daisyUI component classes
React Nativereferences/react-native.mdWriting React Native components (View, Text, etc.)
Exporeferences/expo.mdUsing Expo Router, Expo packages, or app.json config
NativeWindreferences/nativewind.mdUsing className prop in React Native

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

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