AgentSkillsCN

validate

当用户提出“验证代码库”“运行所有检查”“检查错误”“验证类型与测试”“/validate”,或希望在提交代码前确保代码质量时,应使用此技能。

SKILL.md
--- frontmatter
name: validate
description: >-
  This skill should be used when the user asks to "validate the codebase",
  "run all checks", "check for errors", "verify types and tests",
  "/validate", or wants to ensure code quality before committing.

Validate Codebase

Run TypeScript type checking, tests, and build across the meditations monorepo and report a pass/fail summary.

Default Behavior

Run all three checks in order. Stop and report on first failure.

  1. Typespnpm lint (runs tsc --noEmit via turbo)
  2. Testspnpm test (runs vitest run via turbo)
  3. Buildpnpm build (compiles all packages via turbo)

Scoped Validation

$ARGUMENTS can scope what gets validated:

  • Package filter: shared, api-client, server — run checks only on that package
  • Check filter: types, tests, build — run only that check type
  • Combination: shared types — run only type checking on the shared package

How to Run

Execute the validation script from the project root:

bash
.claude/skills/validate/scripts/validate.sh $ARGUMENTS

The script accepts [package] [check-type] arguments and handles filtering automatically.

Commands Reference

CheckFull commandFiltered by package
Typespnpm lintpnpm --filter @meditations/<pkg> lint
Testspnpm testpnpm --filter @meditations/<pkg> test
Buildpnpm buildpnpm --filter @meditations/<pkg> build

Output Format

Report each check as PASS or FAIL. On failure, include the relevant error output.

After all checks complete, print a summary line: === Summary: N passed, M failed ===

Post-Validation

  • If all checks pass, report success.
  • If any fail, suggest fixes based on the error output.