static-code-analysis

A setup guide for static code analysis, which checks source code for likely errors, bad patterns, and style problems without running the program.

In plain words
What is it for?
Use it to add linting, configure rules, connect checks to CI, fix current findings, or set up pre-commit checks. It supports TypeScript/JavaScript, Go, Python, PHP, and Rust projects.
Why use it?
It removes the guesswork from choosing and configuring a checking tool for each programming language. It also covers bringing existing violations under control and running checks automatically before code is committed or in CI.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/soulcodex/agentic/static-code-analysis
Any agent
npx skills add soulcodex/agentic --skill static-code-analysis
Clone the repo
git clone --depth 1 https://github.com/soulcodex/agentic

Made for: Claude Code, Codex.

Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,007 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00065 $0.01007
Opus 5 $0.00032 $0.00504
Sonnet 5 $0.00013 $0.00201
Haiku 4.5 $0.00006 $0.00101

Measured 2d ago against content hash 8a3ec286c269, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

static-code-analysis scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/development/static-code-analysis/SKILL.md · 148 lines

How it starts

The opening of the file, as written. The whole thing — 148 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Static Code Analysis Skill

Step 1 — Detect Language and Choose Tool

Language Recommended tool Config file
TypeScript / JavaScript ESLint + typescript-eslint (+ eslint-plugin-import if using import/* rules) eslint.config.ts
Go golangci-lint .golangci.yml
Python Ruff ruff.toml or pyproject.toml
PHP PHPStan phpstan.neon
Rust Clippy (built-in) clippy.toml

If a tool is already present, audit its configuration before making changes.

Step 2 — Configure Rules

Apply a strict baseline. If you use import/* rules, ensure eslint-plugin-import is installed and configured.

TypeScript (ESLint)

{
  "rules": {
    "@typescript-eslint/no-explicit-any": "error",
    "@typescript-eslint/no-unused-vars": "error",
    "import/no-commonjs": "error",
    "no-console": "warn",
    "eqeqeq": ["error", "always"]
  }
}

Go (golangci-lint)

linters:
  enable:
    - errcheck
    - gosimple
    - govet
    - ineffassign
    - staticcheck
    - unused
linters-settings:
  govet:
    enable-all: true

Python (Ruff)

[tool.ruff]
select = ["E", "F", "I", "N", "UP", "S", "B"]
ignore = []
line-length = 100

Step 3 — Integrate with CI

Add a lint job that runs before tests and fails on any error (exit code 1):

# .github/workflows/ci.yml
lint:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
    - name: Run linter
      run: <lint-command>   # e.g., pnpm lint, golangci-lint run, ruff check .

Do not suppress errors with continue-on-error: true — violations must be fixed.

Step 4 — Fix Existing Violations

Run the auto-fixer first to resolve stylistic issues without manual effort:

# TypeScript
pnpm eslint . --fix

# Python
ruff check . --fix

# Go (no auto-fix in golangci-lint; use gofmt + goimports)
gofmt -w .
goimports -w .

Then address remaining violations manually. Prioritise error-level findings. Document any intentional rule suppression inline with a comment explaining why:

Read the full file on GitHub · 148 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 148 lines · 65 tokens per session scan A 8a3ec286c269

Subscribe to this mod's changes

static-code-analysis is a skill published in the GitHub repository soulcodex/agentic (10 stars, last pushed 2d ago), licensed MIT. It adds 65 tokens to every session and 1,007 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

code-review

AI-powered code review and PR analysis. Performs systematic reviews covering security vulnerabilities, code quality, style compliance, architectural integrity, test coverage, and performance considerations. Works with PR diffs, commit ranges, file changes, or raw code snippets. Primary keyword clusters: AI code review…

JPeetz/agent-skills · 137 tokens

research-repository

Build a repository that makes findings findable, reusable, and cumulative across teams. Use when the same research keeps getting redone. For synthesising one study, use affinity-diagram.

Owl-Listener/designer-skills · 43 tokens

survey-design

Design unbiased survey instruments — question wording, scales, and sampling — to measure attitudes at scale. Use when you need quantitative breadth. For behavioural experiments, use a-b-test-design (prototyping-testing).

Owl-Listener/designer-skills · 47 tokens

localization-design

Design for multiple languages, writing directions, and cultural contexts — text expansion, RTL mirroring, and locale formats. Use when shipping beyond one locale. For the words themselves, use ux-writing (designer-toolkit).

Owl-Listener/designer-skills · 49 tokens

design-negotiation

Advocate for design quality, scope, and timeline with partners and leadership using evidence and shared goals. Use in the conversation itself. For the commercial vocabulary behind it, use business-design (ux-strategy).

Owl-Listener/designer-skills · 48 tokens

design-debt-audit

Inventory and prioritise accumulated design inconsistencies across a product. Use when drift has built up over time. For token coverage specifically use design-token-audit (designer-toolkit); for WCAG gaps use accessibility-audit (design-systems).

Owl-Listener/designer-skills · 59 tokens