AgentSkillsCN

Preflight

在提交之前,运行所有质量检查(格式化、Lint检查、类型检查、测试、拼写检查、Knip检查)

SKILL.md
--- frontmatter
description: Run all quality checks (format, lint, typecheck, tests, spellcheck, knip) before committing

Preflight Checks

Run comprehensive quality checks before committing or pushing code.

Usage

cursor
/preflight

Steps

  1. Run all checks

    • Execute pnpm preflight which runs:
      • format:check - Verify all files are formatted
      • lint - Check for lint errors (Biome + ESLint)
      • typecheck - Validate TypeScript types (tsc + Astro check)
      • test:run - Run all unit tests (Vitest)
      • spellcheck - Check spelling in code and docs
      • knip - Find unused exports and dependencies
  2. Report results

    • If all checks pass: Confirm code is ready for commit
    • If any check fails: Report specific failures with file locations
  3. Suggest fixes

    • For formatting issues: Suggest pnpm format
    • For lint errors: Suggest pnpm lint:fix
    • For type errors: Review the specific TypeScript issues
    • For test failures: Review failing test cases and fix implementation
    • For spelling: Add words to cspell.json or fix typos
    • For unused exports: Remove unused code or add to knip ignore

When to Use

  • Before creating a commit
  • Before pushing to remote
  • Before creating a pull request
  • After completing a significant feature
  • When you want comprehensive validation

Quick Checks

For faster feedback during development, use:

  • /format - Format and verify formatting only
  • Hook automatically runs format + typecheck after agent completion