check-file — Claude Code command: analysis and setup
This command reviews a file for code quality issues, security risks, bottlenecks, and missing tests. It fits JavaScript and TypeScript reviews.
npx claude-code-templates@latest --command utilities/check-fileWhat check-file does
check-file reads the target file, examines its structure, and reviews complexity, maintainability, duplication, naming, and type safety. It also checks input handling, authentication and authorization patterns, exposed sensitive data, and common issues such as XSS or injection.
The review covers imports and dependency use, bundle-size effects, runtime bottlenecks, memory patterns, lazy loading, and code splitting. It then returns concrete suggestions for refactoring, error handling, logging, and tests.
The command includes checks for JavaScript and TypeScript patterns and can account for React, Vue, and Angular practices. That makes the result more focused for those stacks; some checks will not apply to files written in other languages.
What it helps with
- review a file’s complexity and maintainability
- spot XSS, injection, and data exposure risks
- inspect imports and dependency usage
- find performance bottlenecks and bundle-size issues
- identify missing tests and coverage gaps
Example prompts for the agent
- Review
src/auth.tsfor security risks, complexity, and missing tests. - Analyze
components/UserList.tsxand suggest fixes for performance issues. - Check
api/users.jsfor dependency problems, error handling, and input validation.
How to install check-file
1claude-code-templates
npx claude-code-templates@latest --command utilities/check-file2Manually: put the files in place
.claude/commands/check-file.mdCall it with /check-file. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/check-file.mdCall it with /prompts:check-file. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/check-file.prompt.mdManually: put the files in place
.gemini/commands/check-file.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about check-file
How do I install check-file in Claude Code?
Run npx claude-code-templates@latest --command utilities/check-file, then place the command file at .claude/commands/check-file.md.
What does check-file do?
It reviews a target file for code quality problems, security vulnerabilities, performance concerns, dependency issues, and missing tests. The command then provides specific improvement suggestions.
Which files does check-file support best?
The command focuses on JavaScript and TypeScript and includes patterns for React, Vue, and Angular. Checks outside those stacks may be less relevant.
Source text
check-file.md · MIT
--- description: "Perform comprehensive analysis of $ARGUMENTS to identify code quality issues, security vulnerabilities, and optimization opportunities." --- # File Analysis Tool Perform comprehensive analysis of $ARGUMENTS to identify code quality issues, security vulnerabilities, and optimization opportunities. ## Task I'll analyze the specified file and provide detailed insights on: 1. Code quality metrics and maintainability 2. Security vulnerabilities and best practices 3. Performance bottlenecks and optimization opportunities 4. Dependency usage and potential issues 5. TypeScript/JavaScript specific patterns and improvements 6. Test coverage and missing tests ## Process I'll follow these steps: 1. Read and parse the target file 2. Analyze code structure and complexity 3. Check for security vulnerabilities and anti-patterns 4. Evaluate performance implications 5. Review dependency usage and imports 6. Provide actionable recommendations for improvement ## Analysis Areas ### Code Quality - Cyclomatic complexity and maintainability metrics - Code duplication and refactoring opportunities - Naming conventions and code organization - TypeScript type safety and best practices ### Security Assessment - Input validation and sanitization - Authentication and authorization patterns - Sensitive data exposure risks - Common vulnerability patterns (XSS, injection, etc.) ### Performance Review - Bundle size impact and optimization opportunities - Runtime performance bottlenecks - Memory usage patterns - Lazy loading and code splitting opportunities ### Best Practices - Framework-specific patterns (React, Vue, Angular) - Modern JavaScript/TypeScript features usage - Error handling and logging practices - Testing patterns and coverage gaps I'll provide specific, actionable recommendations tailored to your project's technology stack and architecture.
© davila7 · MIT · davila7/claude-code-templates