mcpField
S
static-code-analysis

static-code-analysis

github.com/aj-geddesTesting & quality373619 installsUpdated 34w ago
Repository

About static-code-analysis

static-code-analysis is a guide to analyzing code without executing it, for developers seeking to catch bugs, security issues, and style violations early. It covers tool configuration and automation practices.

Key features

  1. 01ESLint configuration guidance
  2. 02Python code linting
  3. 03Pre-commit hook setup
  4. 04SonarQube integration guidance
  5. 05Security scanning and AST analysis

Use cases

  1. 01Run code checks in CI/CD
  2. 02Set up pre-commit checks
  3. 03Automate code review and security detection

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill static-code-analysis

After installing, type/static-code-analysisin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
custom-ast-analysis.md
eslint-configuration.md
pre-commit-hooks.md
python-linting-pylint-mypy.md
security-scanning.md
sonarqube-integration.md
scripts/
security-checklist.sh

Details

From the project README

Static Code Analysis

Table of Contents

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:

// .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:

GuideContents
ESLint ConfigurationESLint Configuration
Python Linting (pylint + mypy)Python Linting (pylint + mypy)
Pre-commit HooksPre-commit Hooks
SonarQube IntegrationSonarQube Integration
Custom AST AnalysisCustom AST Analysis
Security ScanningSecurity 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

Comments

Markdown supported