static-code-analysis — Claude Code skill: how to install
Implements static code analysis with linters and security scanners to find bugs before runtime. Useful for enforcing standards and automating reviews.
npx skills add aj-geddes/useful-ai-prompts --skill static-code-analysis -a claude-codeWhat static-code-analysis does
The skill provides reference setups and templates for analyzing source code without executing it. It covers ESLint for JavaScript and TypeScript, Python type checking with pylint and mypy, SonarQube integration, and custom AST analysis.
It also details pipeline automation with pre-commit hooks and CI/CD checks. Overly strict rules from day one hurt productivity, so the skill recommends enabling rules incrementally. Custom lint rules should always have clear documentation for the team.
What it helps with
- set up ESLint rules to block dangerous patterns like
evaland object injection - configure Python static analysis with pylint and strict mypy type checking
- prevent committing broken syntax or style issues using pre-commit hooks
- integrate automated vulnerability scanning into CI/CD pipelines
- build custom AST analysis scripts to check project-specific architecture rules
Example prompts for the agent
- "Generate an
.eslintrc.jsconfig with TypeScript and security plugins following the skill" - "Set up mypy and pylint configuration files for a Python project"
- "Create a pre-commit config to run linters automatically before git commit"
How to install static-code-analysis
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill static-code-analysis -a claude-code2Manually: put the files in place
~/.claude/skills/static-code-analysis/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/static-code-analysis/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill static-code-analysis -a codex2Manually: put the files in place
.agents/skills/static-code-analysis/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill static-code-analysis -a cursor2Manually: put the files in place
.cursor/skills/static-code-analysis/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install aj-geddes/useful-ai-prompts static-code-analysis2Manually: put the files in place
.github/skills/static-code-analysis/SKILL.md1Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill static-code-analysis -a gemini-cli2Platform CLI
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/static-code-analysisManually: put the files in place
.devin/skills/static-code-analysis/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add aj-geddes/useful-ai-prompts --skill static-code-analysis -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about static-code-analysis
How to install static-code-analysis in Claude Code?
Run npx skills add aj-geddes/useful-ai-prompts --skill static-code-analysis -a claude-code in your terminal. Alternatively, save the file to ~/.claude/skills/static-code-analysis/SKILL.md.
What does static-code-analysis do?
It provides practical configurations for linters, formatters, and security scanners to inspect source code without running it.
Which linters and tools are covered in the guides?
The reference guides cover ESLint, Python linting with pylint and mypy, SonarQube, pre-commit hooks, and custom AST analysis.
Source text
SKILL.md · MIT
---
name: static-code-analysis
description: >
Implement static code analysis with linters, formatters, and security scanners
to catch bugs early. Use when enforcing code standards, detecting security
vulnerabilities, or automating code review.
---
# Static Code Analysis
## Table of Contents
- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)
## Overview
Use automated tools to analyze code without executing it, catching bugs, security issues, and style violations early.
## When to Use
- Enforcing coding standards
- Security vulnerability detection
- Bug prevention
- Code review automation
- CI/CD pipelines
- Pre-commit hooks
- Refactoring assistance
## Quick Start
Minimal working example:
```javascript
// .eslintrc.js
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:security/recommended",
],
plugins: ["@typescript-eslint", "security", "import"],
rules: {
"no-console": ["warn", { allow: ["error", "warn"] }],
"no-unused-vars": "error",
"prefer-const": "error",
eqeqeq: ["error", "always"],
"no-eval": "error",
"security/detect-object-injection": "warn",
"security/detect-non-literal-regexp": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/explicit-function-return-type": "error",
"import/order": [
"error",
{
groups: [
"builtin",
"external",
"internal",
// ... (see reference guides for full implementation)
```
## Reference Guides
Detailed implementations in the `references/` directory:
| Guide | Contents |
|---|---|
| [ESLint Configuration](references/eslint-configuration.md) | ESLint Configuration |
| [Python Linting (pylint + mypy)](references/python-linting-pylint-mypy.md) | Python Linting (pylint + mypy) |
| [Pre-commit Hooks](references/pre-commit-hooks.md) | Pre-commit Hooks |
| [SonarQube Integration](references/sonarqube-integration.md) | SonarQube Integration |
| [Custom AST Analysis](references/custom-ast-analysis.md) | Custom AST Analysis |
| [Security Scanning](references/security-scanning.md) | Security Scanning |
## Best Practices
### ✅ DO
- Run linters in CI/CD
- Use pre-commit hooks
- Configure IDE integration
- Fix issues incrementally
- Document custom rules
- Share configuration across team
- Automate security scanning
### ❌ DON'T
- Ignore all warnings
- Skip linter setup
- Commit lint violations
- Use overly strict rules initially
- Skip security scans
- Disable rules without reason
© aj-geddes · MIT · aj-geddes/useful-ai-prompts