detect-ai-smells

detect-ai-smells is a skill for Claude Code from krokoko/cairn. It costs 73 tokens per session (2,185 once invoked), scanned A, original, Apache-2.0.

A code-review skill that checks whether a codebase can catch common problems in AI-generated code, such as made-up logic, weak error handling, and tests that prove nothing.

In plain words
What is it for?
Use it to assess AI-code quality gates, produce a gap report, and recommend automated checks and review questions.
Why use it?
AI-written code can look reasonable while missing important checks or edge cases. This identifies which safeguards are missing and what human reviewers should look for.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the software-verification plugin — 3 skills shipped together

Good fit Use it to assess AI-code quality gates, produce a gap report, and recommend automated checks and review questions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/krokoko/cairn/detect-ai-smells
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 krokoko/cairn --skill detect-ai-smells
Clone the repo
git clone --depth 1 https://github.com/krokoko/cairn

Made for: Claude Code.

Or install software-verification, the plugin that ships this one along with the rest of its 3 skills.

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 detect-ai-smells

README.md
[![agentmods](https://agentmods.dev/badge/skills/krokoko/cairn/detect-ai-smells/github.svg)](https://agentmods.dev/skills/krokoko/cairn/detect-ai-smells)
Your own site
<a href="https://agentmods.dev/skills/krokoko/cairn/detect-ai-smells"><img src="https://agentmods.dev/badge/skills/krokoko/cairn/detect-ai-smells/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for detect-ai-smells

Your own site · 80×15
<a href="https://agentmods.dev/skills/krokoko/cairn/detect-ai-smells"><img src="https://agentmods.dev/badge/skills/krokoko/cairn/detect-ai-smells.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,185 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.00073 $0.02185
Opus 5 $0.00036 $0.01092
Sonnet 5 $0.00015 $0.00437
Haiku 4.5 $0.00007 $0.00218

Measured 9d ago against content hash 6d8e181e705d, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

detect-ai-smells 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 9d 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.

plugins/software-verification/skills/detect-ai-smells/SKILL.md · 161 lines

How it starts

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

Assess AI Smell Detection Gates

Assess whether a codebase has gates in place to catch AI-generated code smells — patterns indicating output was produced for plausibility rather than understanding. Produce an ai-smells-gates-report.md with coverage of the 11 AI smell categories, gap analysis, recommendations for missing gates, and human review heuristics for what automation can't catch.

Workflow

Step 1: Load smell taxonomy

Load references/ai-smells-taxonomy.md for the 11 AI smell categories and their detection approaches.

These are the categories of AI-generated quality problems the codebase should be protected against:

  1. Plausible Fabrication
  2. Cargo-Cult Patterns
  3. Architecture Astronaut
  4. Shallow Error Handling (including silent success masking and missing boundary validation)
  5. Tests Mirroring Implementation
  6. Symmetry Without Substance
  7. Local Reasoning Violations (including hard-coded magic values)
  8. Implicit Drift (unpinned references that silently resolve differently over time)
  9. Happy-Path-Only Coverage (success path tested; error/edge/boundary paths unexercised)
  10. Vacuous Tests (tests that execute code but verify nothing falsifiable)
  11. Vacuous Formal Specs (formal specs, invariants, or gate configs that constrain nothing)

Step 2: Inventory existing gates

Search for mechanisms that would catch AI smells:

Static analysis rules:

  • Custom semgrep rules: .semgrep/, semgrep.yml, semgrep configs in CI
  • Custom lint rules: eslint plugins, ruff extensions, custom clippy lints
  • Complexity checkers: cognitive complexity limits, import depth limits
  • Architecture enforcement: dependency-cruiser, ArchUnit, deptry, import-linter

CI quality gates:

  • Test coverage thresholds that would catch "tests mirroring implementation" (mutation testing is stronger signal)
  • Mutation testing: stryker, mutmut, cargo-mutants (catches AI005 — tests mirroring implementation)
  • Dead code detection: knip, ts-prune, vulture (catches AI002/AI003 — unnecessary abstractions)
  • Duplication detection: jscpd, cpd, dupfinder (catches AI006 — symmetry without substance)

Read the full file on GitHub · 161 lines

Files

What ships with it

7 files 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. 9d ago First seen · 161 lines · 73 tokens per session scan A 6d8e181e705d

Subscribe to this mod's changes

detect-ai-smells is a skill published in the GitHub repository krokoko/cairn (14 stars, last pushed 5d ago), licensed Apache-2.0. It adds 73 tokens to every session and 2,185 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-30.