Static code analysis

From aj-geddes/useful-ai-prompts · View interactive version

Static code analysis is an AI agent skill from the GitHub repository aj-geddes/useful-ai-prompts. 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.

How to use this skill

Skill file

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

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:

| Guide | Contents |

|---|---|

| ESLint Configuration | ESLint Configuration |

| Python Linting (pylint + mypy) | Python Linting (pylint + mypy) |

| Pre-commit Hooks | Pre-commit Hooks |

| SonarQube Integration | SonarQube Integration |

| Custom AST Analysis | Custom AST Analysis |

| Security Scanning | Security Scanning |

Best Practices

✅ DO

❌ DON'T

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.