一键导入
code-quality
Linting and formatting across tools. Trigger: When configuring linters, formatters, enforcing code quality, or fixing style issues.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Linting and formatting across tools. Trigger: When configuring linters, formatters, enforcing code quality, or fixing style issues.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Paste-ready session summary for context transfer to a new chat. Trigger: User says 'context handoff', 'start fresh', or session needs to continue.
One-at-a-time questioning to fully profile a goal before acting. Trigger: User says 'grill me', goal is vague, or clarification is needed first.
Batch execution with checkpoints. Trigger: When executing plans with batched tasks.
Universal coding principles: DRY, security by default, null guards, and YAGNI. Trigger: When writing or reviewing code in any language or technology.
Accessibility guide (WCAG 2.1/2.2, Level A–AAA). Trigger: When building UI components, interactive elements, or auditing accessibility compliance.
Astro quality patterns: island philosophy, SEO by page type, and Core Web Vitals. Trigger: When reviewing Astro site quality or hydration decisions.
| name | code-quality |
| description | Linting and formatting across tools. Trigger: When configuring linters, formatters, enforcing code quality, or fixing style issues. |
| license | Apache 2.0 |
| metadata | {"version":"1.1","type":"domain"} |
Unified guidance for linting and formatting across ESLint, Prettier, Biome, and oxc. Context-aware: uses your project's existing tools.
Don't use when:
Always check what tools the project uses before recommending:
// Step 1: Check AGENTS.md for installed skills
// Step 2: Check package.json for installed tools
// Step 3: Check config files (.eslintrc*, .prettierrc*, biome.json)
// Step 4: Use existing tools, DON'T force new ones
// ✅ CORRECT: Context-aware
// If project has ESLint → use ESLint patterns
// If project has Prettier → use Prettier patterns
// If project has Biome → use Biome patterns
// If project has ESLint + Prettier → use both (with eslint-config-prettier)
// ❌ WRONG: Force new tool
// "Let's switch to Biome" when project uses ESLint + Prettier
// "Add Prettier" when project uses Biome (already handles formatting)
// ✅ CORRECT: Start from recommended (any tool)
// ESLint
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"]
// Biome
{ "linter": { "rules": { "recommended": true } } }
// ❌ WRONG: Starting from scratch
rules: { /* manually defining hundreds of rules */ }
Regardless of tool, enforce these rules:
1. No any type (TypeScript)
2. No unused variables
3. No variable shadowing
4. Consistent type imports (import type)
5. No duplicate imports
6. Strict equality (===)
7. Prefer const over let/var
8. Import organization (external → internal → types)
{
"scripts": {
"lint": "<tool-specific-command>",
"format": "<tool-specific-command>",
"check": "npm run lint && npm run format -- --check"
}
}
Configure format-on-save and lint-on-save for immediate feedback. See tool-specific references for editor setup.
Project has quality tools configured?
→ Yes: Check package.json and config files
→ ESLint installed? → See references/eslint.md
→ Prettier installed? → See references/prettier.md
→ Biome installed? → See references/biome.md
→ oxc installed? → See references/oxc.md
→ ESLint + Prettier? → Use both with eslint-config-prettier
→ No: Recommend modern default
New project (no tools)?
→ Small/medium project: Biome (all-in-one, fast)
→ Large/enterprise: ESLint + Prettier (mature ecosystem, more plugins)
→ Performance-critical CI: Consider Biome or oxc
TypeScript project?
→ ESLint: Use @typescript-eslint/parser + @typescript-eslint/recommended
→ Biome: Built-in TypeScript support (no extra config)
React project?
→ ESLint: Add plugin:react/recommended + plugin:react-hooks/recommended
→ Biome: Built-in React support
Formatting only?
→ Prettier or Biome (both handle formatting)
→ DON'T use ESLint for formatting alone
Linting only?
→ ESLint or Biome (both handle linting)
→ DON'T use Prettier for linting (it only formats)
ESLint conflicts with Prettier?
→ Install eslint-config-prettier (disables conflicting rules)
→ Or migrate to Biome (single tool, no conflicts)
Context-aware quality setup:
// Check package.json:
// "biome": "^2.0.0"
//
// → Use Biome patterns (single tool for linting + formatting)
// biome.json
{
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"linter": {
"enabled": true,
"rules": { "recommended": true }
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2
}
}
Multiple tools: Some projects use ESLint for linting + Prettier for formatting. Use eslint-config-prettier to prevent conflicts.
Monorepo: Use root config with per-package overrides. Both ESLint and Biome support this.
Legacy to modern migration: Migrate one tool at a time. Biome has biome migrate for ESLint/Prettier migration.
Pre-commit hooks: Use husky + lint-staged (ESLint/Prettier) or Biome's built-in staged files support.
| Reference | When to Read |
|---|---|
| references/eslint.md | Using ESLint for linting |
| references/prettier.md | Using Prettier for formatting |
| references/biome.md | Using Biome (linter + formatter) |
| references/oxc.md | Using oxc (experimental, fast) |
See references/README.md for complete navigation.