clean-code

Format and statically check changed JavaScript/TypeScript files using detected tools.

Updated Aug 14, 2025
One-click install
npx skills add https://github.com/kaikojima05/ai-agent-rules --skill clean-code-kaikojima05
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code
Source: https://github.com/kaikojima05/ai-agent-rules/tree/main/skills/clean-code
Command: npx skills add https://github.com/kaikojima05/ai-agent-rules --skill clean-code-kaikojima05

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

After implementing changes, codebases often drift in style and accumulate lint issues that slow reviews and increase defects, especially when formatting and static checks are forgotten.

Core Features & Use Cases

  • Formatter selection by project config: Runs Prettier when supported, otherwise runs Biome formatting when biome.json is present.
  • Deterministic linting and fixes: Applies ESLint autofixes when ESLint config exists, otherwise runs Biome lint with apply; falls back to TypeScript type-checking via tsc --noEmit when only tsconfig.json is available.
  • DB schema formatting for Prisma: Formats prisma/schema.prisma to keep schema style consistent.
  • Use Case: After pushing feature code to a JavaScript/TypeScript repository, invoke this skill to automatically format files and apply safe lint/type/schema fixes before review.

Quick Start

Ask your agent to run the clean-code skill to format and lint the repository based on the detected tool configuration files.

Frequently Asked Questions about clean-code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automatically format and lint changed files in a JavaScript or TypeScript project?

To automatically format and lint changed files, you can run a post-implementation cleanup that detects your project's configuration and applies the corresponding formatter and lint commands. This ensures newly implemented code is reformatted and statically checked to maintain repository style.

Does the clean-code skill work with both Prettier and Biome for code formatting?

Yes, code formatting works with both Prettier and Biome. The skill runs Prettier when supported, otherwise it automatically runs Biome formatting if a `biome.json` configuration file is present in the repository.

Can I use ESLint autofixes alongside TypeScript type-checking for static code analysis?

Yes, you can apply ESLint autofixes when an ESLint config exists. If ESLint is absent, the skill falls back to TypeScript type-checking via `tsc --noEmit` when only a `tsconfig.json` file is available.

What is the best way to format a Prisma schema to keep database style consistent?

The best way to format a Prisma schema is to run a cleanup workflow that specifically targets `prisma/schema.prisma`. This applies dedicated schema formatting to keep your database schema style consistent across updates.

How does post-implementation code cleanup detect which linting and formatting tools to run?

Post-implementation code cleanup detects which tools to run by checking for conditional configuration files in the repository. It looks for Prettier, Biome, ESLint, or `tsconfig.json` files and executes the matching formatter and lint commands.

Are there limitations to running static checks and formatting only on changed files?

Yes, the limitation of running static checks on changed files is that the scope is intentionally limited. This prevents touching unrelated code and keeps reviews focused, but it means pre-existing lint issues outside the changed files will remain unresolved.