Check

From uxname/liteend · View interactive version

Check is an AI agent skill from the GitHub repository uxname/liteend. Run the full code quality pipeline (TypeScript + Biome + Knip), fix all issues, and clean up comments in changed code.

How to use this skill

Skill file

This skill is the central entry point for fixing any CI/CD or pre-commit hook failures. Invoke this skill whenever a build or validation step fails.

The user wants to verify and fix all code quality issues in the project.

What the pipeline checks

npm run check runs three tools in parallel via run-p:

  1. tsc --noEmit — TypeScript type checking
  2. biome check --write — Linting + formatting with auto-fix
  3. knip --production — Unused exports, files, and dependencies

Pre-commit hook (lefthook) runs the same pipeline automatically on every commit.

Running the check

npm run check

To run tools individually for targeted diagnosis:

npm run ts:check      # TypeScript only
npm run lint:fix      # Biome with auto-fix
npm run knip          # Knip unused code analysis

Fixing common errors

TypeScript errors

Missing type on Prisma-generated code:

declare keyword on GraphQL InputType fields:

The project uses declare to re-declare Zod DTO fields with GraphQL decorators (see profile-update.input.ts):

@InputType()
export class MyInput extends MyZodDto {
  @Field(() => String, { nullable: true })
  declare myField?: string;
}

See the /add-graphql-type skill for full details on integrating Zod with GraphQL InputTypes.

Import path errors:

Biome errors

Biome auto-fixes most issues with --write. Common remaining issues:

Knip errors

Knip flags exports that are not imported anywhere in production code (--production excludes test files).

Common false positives to investigate:

When Knip flags something legitimately unused:

Comment cleanup

After fixing tool errors, review all changed/created code for comment quality:

  1. Remove unnecessary comments — commented-out dead code, obvious statements (e.g. // call the function), outdated TODOs
  2. Ensure remaining comments are in English — translate or rewrite any non-English comment; if it adds no real value, remove it instead

Workflow

  1. Run npm run check and capture the full output
  2. Report what was found (errors by tool + comment issues)
  3. Fix TypeScript errors first (they often cascade)
  4. Biome fixes are mostly automatic — review the diff
  5. For Knip warnings, investigate each flagged export before removing
  6. Clean up comments in changed/created files
  7. Re-run npm run check until clean

Fallback Strategy (Circuit Breaker)

CRITICAL: Do not enter an infinite loop of fixing. If you attempt to fix a check error and the EXACT SAME error persists after 3 attempts, STOP.

  1. Undo the specific change that caused the unresolvable error.
  2. Stop the workflow.
  3. Explain the underlying issue to the user and ask for human guidance.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.