detective

A codebase health auditor that examines testing, security, documentation, architecture, and Git practices, then produces an evidence-backed report with scores and recommendations.

In plain words
What is it for?
Use it to assess an unfamiliar project, find quality gaps, and prioritize improvements using file paths, line numbers, and metrics.
Why use it?
It helps you see which problems matter most instead of sorting through separate tool outputs without context.

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/nxtg-ai/forge-plugin/detective
Clone the repo
git clone --depth 1 https://github.com/nxtg-ai/forge-plugin
Per session 0 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,969 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.00000 $0.01969
Opus 5 $0.00000 $0.00984
Sonnet 5 $0.00000 $0.00394
Haiku 4.5 $0.00000 $0.00197

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

Security

Grade A, and why

detective 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.

docs/agents/detective.md · 132 lines

How it starts

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

Detective

Sherlock Holmes for codebases -- performs deep project analysis, technology detection, gap analysis, and health scoring across five quality dimensions.

Level L1 Vibe Coder
Category Governance & Analysis
Model Sonnet

What It Does

The Detective is a forensic analyst for your codebase. It does not fix things -- it finds things. When invoked, it performs a structured investigation across five dimensions (testing, security, documentation, architecture, git practices) and produces a scored health report with prioritized recommendations. Every finding is backed by evidence: file paths, line numbers, specific metrics.

What separates the Detective from running npm audit and eslint yourself is synthesis. It does not just list problems -- it weighs them. A codebase with 95% test coverage but three hardcoded API keys gets a different priority ranking than one with zero vulnerabilities but 40% coverage. The Detective calculates a weighted health score (Testing 30%, Security 25%, Architecture 20%, Documentation 15%, Git Practices 10%) and presents a single number (0-100) that captures your project's overall health. More importantly, it ranks the recommended actions by impact, so you know what to fix first.

The Detective also handles technology stack detection. Hand it an unfamiliar codebase and it identifies languages, frameworks, databases, external services, build tools, and development patterns. It checks against best-practice checklists for each detected stack (Python projects should have type hints and pytest; TypeScript projects should have strict mode and ESLint) and reports gaps. This makes it the ideal first agent to run on a new project or when onboarding.

When to Use It

  • Evaluating a new codebase: When you inherit a project or join a team and need to understand what you are working with -- tech stack, quality level, architectural patterns, and where the skeletons are buried.
  • Running a health check: When the Orchestrator delegates Option 4 (Health Check) and you need a comprehensive quality assessment across all dimensions.
  • Before a major refactoring: When you need hard data about current code quality, complexity hotspots, and test coverage gaps to justify and scope a refactoring effort.
  • Investigating a vague problem: When something feels wrong -- "the code is slow" or "things keep breaking" -- but you cannot pinpoint why. The Detective's structured analysis finds the patterns.

Read the full file on GitHub · 132 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 · 132 lines · 0 tokens per session scan A 1d3343ad405d

Subscribe to this mod's changes

detective is an agent published in the GitHub repository nxtg-ai/forge-plugin (5 stars, last pushed 13d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,969 tokens. 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 agents, from other repositories