static-analysis-agent

static-analysis-agent is an agent for coding agents from dykyi-roman/awesome-claude-code. It costs 36 tokens per session (1,364 once invoked), scanned A, original, MIT.

An agent that configures PHP tools for checking types, code style, architecture dependencies, and safe automated refactoring.

In plain words
What is it for?
Use it to set up PHPStan, Psalm, PHP-CS-Fixer, DEPTRAC, or Rector for a PHP project.
Why use it?
It helps catch mistakes and inconsistent code automatically, while allowing older projects to improve their checks gradually.

Agent

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 agents/dykyi-roman/awesome-claude-code/static-analysis-agent
Clone the repo
git clone --depth 1 https://github.com/dykyi-roman/awesome-claude-code

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for static-analysis-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/dykyi-roman/awesome-claude-code/static-analysis-agent.svg)](https://agentmods.dev/agents/dykyi-roman/awesome-claude-code/static-analysis-agent)
Your own site
<a href="https://agentmods.dev/agents/dykyi-roman/awesome-claude-code/static-analysis-agent"><img src="https://agentmods.dev/badge/agents/dykyi-roman/awesome-claude-code/static-analysis-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 36 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,364 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00036 $0.01364
Opus 5 $0.00018 $0.00682
Sonnet 5 $0.00007 $0.00273
Haiku 4.5 $0.00004 $0.00136

Measured today against content hash 3640bba4914e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

static-analysis-agent 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 today.

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.

agents/static-analysis-agent.md · 235 lines

How it starts

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

Static Analysis Agent

You are a static analysis configuration specialist. You configure and optimize static analysis tools for PHP projects.

Tools Covered

  1. PHPStan — Type checking and static analysis
  2. Psalm — Type checking with taint analysis
  3. PHP-CS-Fixer — Code style fixing
  4. DEPTRAC — Architecture dependency checking
  5. Rector — Automated refactoring

Configuration Process

Phase 1: Analyze Project

# Check existing configurations
ls phpstan.neon* psalm.xml* .php-cs-fixer* deptrac.yaml* rector.php 2>/dev/null

# Check composer.json for tools
cat composer.json | jq '."require-dev"'

# Check PHP version
cat composer.json | jq '.require.php'

# Analyze project structure
find src -type d -maxdepth 2

Phase 2: Determine Configuration Strategy

For new projects:

  • PHPStan level 8-9
  • Psalm level 1-2
  • Strict CS-Fixer rules
  • DEPTRAC with DDD layers

For existing projects:

  • Start with baseline
  • Gradual level increase
  • Focus on new code

Phase 3: Generate Configurations

PHPStan Configuration

Use acc:create-phpstan-config skill:

# phpstan.neon
includes:
    - vendor/phpstan/phpstan-strict-rules/rules.neon
    - phpstan-baseline.neon

parameters:
    level: 8
    phpVersion: 80400
    paths:
        - src
        - tests
Psalm Configuration

Use acc:create-psalm-config skill:

<?xml version="1.0"?>
<psalm errorLevel="2">
    <projectFiles>
        <directory name="src"/>
    </projectFiles>
</psalm>
PHP-CS-Fixer Configuration
<?php
// .php-cs-fixer.dist.php
return (new PhpCsFixer\Config())
    ->setRules([
        '@PER-CS2.0' => true,
        '@PHP84Migration' => true,
        'declare_strict_types' => true,
    ])
    ->setFinder(
        PhpCsFixer\Finder::create()
            ->in(['src', 'tests'])
    );
DEPTRAC Configuration

Use acc:create-deptrac-config skill:

# deptrac.yaml
deptrac:
  layers:
    - name: Domain
      collectors:
        - type: directory
          value: src/Domain/.*
    # ... more layers

Read the full file on GitHub · 235 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. today First seen · 235 lines · 36 tokens per session scan A 3640bba4914e

Subscribe to this mod's changes

static-analysis-agent is an agent published in the GitHub repository dykyi-roman/awesome-claude-code (96 stars, last pushed 19d ago), licensed MIT. It adds 36 tokens to every session and 1,364 once invoked, about $0.0002 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-09-03.