check-code-for-obvious-flaws

check-code-for-obvious-flaws is a skill for Claude Code from alivirgo/Major-AI-Skills. It costs 28 tokens per session (1,253 once invoked), scanned C, original, MIT.

A pre-run checklist for reviewing AI-generated code for invented package functions, security leaks, crashes, and unusual input cases.

In plain words
What is it for?
Use it to inspect generated code for invalid library calls, missing error handling, hardcoded secrets, concurrency mistakes, and SQL or shell injection risks.
Why use it?
It helps catch problems before code reaches testing or production, where failures and exposed secrets are harder to diagnose and fix.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Codex.

Part of the major-ai-skills plugin — 147 skills, 8 plugins shipped together

Good fit Use it to inspect generated code for invalid library calls, missing error handling, hardcoded secrets, concurrency mistakes, and SQL or shell injection risks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/alivirgo/major-ai-skills/check-code-for-obvious-flaws
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 alivirgo/Major-AI-Skills --skill check-code-for-obvious-flaws
Clone the repo
git clone --depth 1 https://github.com/alivirgo/Major-AI-Skills

Made for: Claude Code.

Or install major-ai-skills, the plugin that ships this one along with the rest of its 147 skills, 8 plugins.

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 check-code-for-obvious-flaws

README.md
[![agentmods](https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/check-code-for-obvious-flaws/github.svg)](https://agentmods.dev/skills/alivirgo/major-ai-skills/check-code-for-obvious-flaws)
Your own site
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/check-code-for-obvious-flaws"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/check-code-for-obvious-flaws/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 check-code-for-obvious-flaws

Your own site · 80×15
<a href="https://agentmods.dev/skills/alivirgo/major-ai-skills/check-code-for-obvious-flaws"><img src="https://agentmods.dev/badge/skills/alivirgo/major-ai-skills/check-code-for-obvious-flaws.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,253 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00028 $0.01253
Opus 5.5 $0.00011 $0.00501
Sonnet 5.5 $0.00006 $0.00251
Haiku 4.5 $0.00003 $0.00125

Measured 2mo ago against content hash dc3539764712, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

check-code-for-obvious-flaws scanned grade C with 1 finding 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 2mo 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

[ ] 4. DESTRUCTIVE ACTIONS: Does the script contain `rm -rf`, `DROP TABLE`, or unconfirmed delete API calls?
skills/check-code-for-obvious-flaws/SKILL.md · 141 lines

How it starts

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

Check Code for Obvious Flaws (Zero-Trust Code Audit) (AI Skill)

Overview

AI coding assistants are brilliant at scaffolding boilerplate and common algorithms, but they frequently generate code with invisible runtime flaws: deprecated library methods, unhandled null/undefined values, unbounded memory allocations, and hardcoded security assumptions.

The Zero-Trust Code Audit Protocol provides a structured pre-execution gate to catch syntax errors, security vulnerabilities, and logic flaws before deploying to staging or production.


The 5 Most Dangerous AI Code Traps

┌─────────────────────────────────────────────────────────────┐
│                 The Top 5 AI Code Pitfalls                  │
│                                                             │
│  1. Hallucinated APIs     ──► Invented package methods/flags│
│  2. Unhandled Exceptions  ──► Crashes on 404, null, or empty│
│  3. Hardcoded Secrets     ──► API keys or local paths leaked│
│  4. Concurrency Bugs      ──► Race conditions in async/locks│
│  5. Security Injections   ──► Raw string SQL/Bash injection │
└─────────────────────────────────────────────────────────────┘

The Pre-Execution Sanity Checklist

Before running any AI-generated script on your local machine or server:

[ ] 1. PACKAGE CHECK: Are all imported libraries real and installed via your package manager?
[ ] 2. INJECTION CHECK: Are database queries parameterized (no f-string or string concat SQL)?
[ ] 3. NULL SAFETY: Does the code guard against None, undefined, or missing dictionary keys?
[ ] 4. DESTRUCTIVE ACTIONS: Does the script contain `rm -rf`, `DROP TABLE`, or unconfirmed delete API calls?
[ ] 5. MOCK TEST: Can you run it on sample data or in a Docker sandbox before production?

Master Code Audit Prompt Templates

Pattern 1: The Automated Flaw & Edge-Case Scanner

Use this immediately after an AI writes code:

Act as a Principal Staff Security Engineer and SRE.
Critically review the code above for production readiness.

Audit specifically for:
1. **API Validity**: Are any function signatures or methods deprecated or invented?
2. **Failure Modes**: What happens when network timeouts, 500 errors, or corrupt JSON payloads occur?
3. **Security Vulnerabilities**: Check for injection risks, unsanitized inputs, or plain-text credentials.
4. **Boundary Conditions**: Test mentally with empty inputs (`[]`, `""`, `None`, `0`).

Provide the revised, hardened version with comprehensive `try/catch` error handling and type hints.

Read the full file on GitHub · 141 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. 2mo ago Changed · -15 tokens per session scan B → C dc3539764712
  2. 2mo ago First seen · 141 lines · 43 tokens per session scan B ef4a76428124

Subscribe to this mod's changes

check-code-for-obvious-flaws is a skill published in the GitHub repository alivirgo/Major-AI-Skills (6 stars, last pushed today), licensed MIT. It adds 28 tokens to every session and 1,253 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

check-code-for-obvious-flaws compared with skills from other repositories

check-code-for-obvious-flaws next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
check-code-for-obvious-flawsalivirgo/Major-AI-SkillsSkill6todayMITC28Claude Code
agenttrace-session-auditsickn33/agentic-awesome-skillsSkill51ktodayMITA34Claude Code
code-review-graphtirth8205/code-review-graphSkill33k14d agoMITA84Codex
code-reviewphuryn/pm-skillsSkill28k22d agoMITA58Claude Code
code-reviewpromptfoo/promptfooSkill28ktodayMITA11Claude Code
systemic-issue-triageGentleman-Programming/gentle-aiSkill9.7ktodayMITA57Claude Code, Codex
issue-root-resolutionGentleman-Programming/gentle-aiSkill9.7ktodayMITA45Claude Code, Codex