scan-for-defects-mechanical

scan-for-defects-mechanical is a skill for Claude Code, Codex from HuginnIndustries/CodeCartographer. It costs 88 tokens per session (953 once invoked), scanned A, original, MIT.

An early code review that checks local problems in logic, correctness, error handling, resilience, configuration, and the runtime environment.

In plain words
What is it for?
It helps inspect an unfamiliar codebase for control-flow mistakes, missing error handling, and configuration hazards after its architecture is mapped.
Why use it?
It catches straightforward defects before later reviews that need detailed knowledge of the system’s contracts and state changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps inspect an unfamiliar codebase for control-flow mistakes, missing error handling, and configuration hazards after its architecture is mapped.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/huginnindustries/codecartographer/defect-scan-mechanical
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.

Any agent
npx skills add HuginnIndustries/CodeCartographer --skill defect-scan-mechanical
Clone the repo
git clone --depth 1 https://github.com/HuginnIndustries/CodeCartographer

Made for: Claude Code, Codex.

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 scan-for-defects-mechanical

README.md
[![agentmods](https://agentmods.dev/badge/skills/huginnindustries/codecartographer/defect-scan-mechanical.svg)](https://agentmods.dev/skills/huginnindustries/codecartographer/defect-scan-mechanical)
Your own site
<a href="https://agentmods.dev/skills/huginnindustries/codecartographer/defect-scan-mechanical"><img src="https://agentmods.dev/badge/skills/huginnindustries/codecartographer/defect-scan-mechanical.svg" alt="Measured on agentmods" height="20"></a>
Per session 88 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 953 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00088 $0.00953
Opus 5 $0.00044 $0.00477
Sonnet 5 $0.00018 $0.00191
Haiku 4.5 $0.00009 $0.00095

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

Security

Grade A, and why

scan-for-defects-mechanical 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.

.codecarto/findings/defect-scan-mechanical/SKILL.md · 62 lines

How it starts

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

Scan For Defects — Mechanical Pass

This phase runs the early, mechanical half of the defect-scan methodology. It catches the bugs that are visible from local code reading without needing the contracts or protocols phases to be done first. The deeper passes (concurrency, security, API contract violations) live in the later defect-scan-semantic phase.

The source code to analyze is in the parent directory (../ relative to .codecarto/).

Prerequisites

Required:

  • findings/architecture/architecture-map.md — for the layer map and public surfaces.

You do not need contracts or protocols for this phase. If those exist already, skim them as bonus context, but do not block on them — the mechanical pass is by design context-light.

Pass Execution Order

Run these three passes sequentially. Read the pass file, scan the source, record findings, then move to the next pass. Each pass file is the same one used by the legacy defect-scan phase — only the subset is different.

Pass File Focus
1 findings/defect-scan/passes/01-logic-and-correctness.md Dead code, boundary errors, null handling, boolean logic, control flow
2 findings/defect-scan/passes/02-error-handling.md Swallowed errors, missing cleanup, uncaught exceptions, retry gaps
6 findings/defect-scan/passes/06-config-and-environment.md Hardcoded values, missing validation, dangerous defaults, OS assumptions

Passes 3, 4, and 5 are deferred to defect-scan-semantic because they benefit from contracts/protocols context.

Prioritization

Use the architecture map to decide emphasis:

  • Pure library with no config? Skim pass 6.
  • Heavy generic-types or branching logic? Spend extra time on pass 1.
  • No surfaced error model in architecture? Pass 2 may surface that gap as a finding.

Evidence and Severity Classification

Use the same scheme as the legacy defect-scan SKILL:

  • Evidence levels: observed fact, strong inference, external-behavior claim, open question.
  • Severity: critical, high, medium, low.
  • Action (pre-porting pipelines): fix before porting, port differently, leave behind, verify at runtime.
  • Pairing rule: open question or external-behavior claim evidence takes verify at runtime or port differently, never fix before porting, and the finding also appears in the report's Open Questions table. Validation checks this on the findings tables.

Read the full file on GitHub · 62 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 Changed · +1 lines 610fbe4bf54d
  2. 7d ago First seen · 61 lines · 88 tokens per session scan A 575ecd5727ae

Subscribe to this mod's changes

scan-for-defects-mechanical is a skill published in the GitHub repository HuginnIndustries/CodeCartographer (4 stars, last pushed today), licensed MIT. It adds 88 tokens to every session and 953 once invoked, about $0.0004 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

dx-audit

Audits libraries, CLIs, and SDKs using 38 rules for public contracts, package exports, piped output, errors, and configuration. Use when asked to "audit my CLI", "review my SDK", "make this agent-friendly", or diagnose package type resolution. For agentic product trust use ax-audit; for docs use docs-writing.

mblode/agent-skills · 76 tokens

vibedrift-drift-check

Use when writing or changing code in an existing repository to keep new code consistent with the repo's own conventions and avoid duplicating code that already exists. Checks a proposed function against the repo's dominant patterns and existing functions BEFORE it lands, turning drift detection into drift prevention.…

VibeDrift/VibeDrift · 74 tokens

perf

Performance optimizer for loops, DB queries, rendering, and batch operations. Catches N+1 queries, missing indexes, and unnecessary re-renders.

epicsagas/epic-harness · 32 tokens

knip

Find dead code, unused files, unused exports, and unused dependencies in a JavaScript/TypeScript project using knip. Use before a refactor, before a PR, or when the user asks to clean up bloat, remove unused deps, or shrink the codebase.

LFTPadilla/agent-dev-kit · 59 tokens

proactive-analysis

Automatically run a tech-debt scan before opening a pull request, after large refactors, or when the user asks for a code review — surface actionable findings without being asked.

PierreJanineh/TechDebtMCP · 39 tokens

edge-case-hunter

Exhaustive edge-case review that traces branching paths and boundary conditions in a diff or code sample and reports only unhandled cases. Use when the user asks to hunt edge cases, boundary conditions, missing guards, or wants an edge-case-focused review.

harshitsinghbhandari/domain-expansion · 55 tokens