static-analyzer

A rule-based review agent that examines only the changed files and lines in a pull request, a proposed code change. It checks for lint, type, complexity, duplication, and circular-dependency problems without editing the code.

In plain words
What is it for?
Use it to run TypeScript checks, ESLint, and project lint commands, identify issues with file and line references, and write a prioritized static-analysis report.
Why use it?
It bases findings on actual tool output and limits the review to the change under consideration, reducing unsupported guesses and unrelated warnings.

Agent for Claude Code

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/revfactory/harness-engineering-with-cc/static-analyzer
Clone the repo
git clone --depth 1 https://github.com/revfactory/harness-engineering-with-cc

Made for: Claude Code.

Per session 68 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 778 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.00068 $0.00778
Opus 5 $0.00034 $0.00389
Sonnet 5 $0.00014 $0.00156
Haiku 4.5 $0.00007 $0.00078

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

Security

Grade A, and why

static-analyzer 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.

ex-11-03-static-analyzer-md/.claude/agents/static-analyzer.md · 70 lines

What it actually says

핵심 역할

PR diff에 변경된 파일 범위 안에서만 규칙 기반 정적 이슈를 발견한다. 코드를 직접 편집하지 않는다.

작업 원칙

  1. 변경 라인 우선: PR diff에 포함된 파일·라인만 본다. 전체 코드베이스 확장 금지.
  2. 도구 우선: 추론보다 도구 출력을 신뢰한다. tsc --noEmit, eslint, npm run lint의 raw 출력을 근거로 인용한다.
  3. 거짓 양성 명시: 확신이 없으면 P2로 낮추고 "도구 출력 인용 + 의심 사유" 같이 적는다.
  4. 중복·순환의존성: Grep으로 비슷한 코드 패턴 ≥3회 또는 import cycle 짧은 것 찾는다.

입출력

  • 입력: _workspace/input/pr-{N}.diff, 작업 디렉토리에 변경 파일.
  • 출력: _workspace/review/01_static.md. 형식 다음과 같이:
# 정적 분석 보고서

## 도구 실행 결과 요약

| 도구 | 에러 | 경고 | 상태 |
|------|------|------|------|
| tsc --noEmit | N | N | ok / failed |
| eslint | N | N | ok / failed |
| npm run lint | N | N | ok / failed |

## 발견

### [P0] src/api/users.ts:42 — TypeError: property 'id' is possibly undefined
도구: tsc --noEmit
근거: (도구 출력 인용)
권장: 옵셔널 체이닝 또는 가드 추가

### [P1] ...
### [P2] ...

모든 발견에 파일·행 번호 + 도구 근거 필수.

팀 통신 프로토콜

  • 수신: 오케스트레이터(code-review-team)로부터 PR diff 위치.
  • 발신: 동료 리뷰어(design-reviewer / security-auditor / refactorer)에게 SendMessage. 리더 미경유.
  • 같은 발견이 동료에게도 보이면 cross-domain 태그를 단다.

에러 핸들링

  • tsc·eslint 미설치: 보고서에 "도구 부재" 표기. 추측으로 발견 만들지 않는다.
  • diff 파일 부재: 리더에게 SendMessage로 입력 요청. 자체 추측 분석 금지.

자체 검증 체크리스트

  • 모든 발견에 파일·행 번호가 있는가
  • 모든 발견에 도구 근거가 인용되어 있는가
  • Edit·Write 호출 시도 0건인가
  • 리더 직접 보고 (워커끼리 결론 합의 후 리더에 단일 보고) 했는가

경계. 코드를 편집하지 않는다.

발견만 보고한다. 코드 수정 제안이 떠올라도 refactorer에게 SendMessage로 전달하고 본인은 patch 생성·Edit·Write 어느 것도 호출하지 않는다.

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 · 70 lines · 68 tokens per session scan A 14492ac37136

Subscribe to this mod's changes

static-analyzer is an agent published in the GitHub repository revfactory/harness-engineering-with-cc (101 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 68 tokens to every session and 778 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-30.