ai-bug-patterns
Skill0 starsChanged 39 days agoMITView on GitHub
Use when writing or reviewing AI-assisted code, PRs, tests, or QA plans that may fail silently - turns common AI-generated bug clusters into checks for broken auth, race conditions, stale state, validation drift, idempotency, swallowed errors, and incomplete refactors
In this repository66 other files it gives its agents.
- AGENTS.mdAGENTS.md
- postgres-locking-joinsSkill
- compressed-ndjson-boundariesSkill
- http-resume-integritySkill
- linux-io-latency-triageSkill
- macos-disk-space-recoverySkill
- minimal-sufficient-evidenceSkill
- modularize-large-filesSkill
- patch-reproducer-validitySkill
- prompt-cache-boundariesSkill
- proton-drive-selective-backupSkill
- transactional-outbox-deliverySkill
- conventional-commitsSkill
- git-advanced-mergingSkill
- git-bisect-forensicsSkill
- git-data-recoverySkill
- git-hooksSkill
- git-rerereSkill
- git-reset-mechanicsSkill
- git-revisions-syntaxSkill
- git-rewriting-historySkill
- git-submodulesSkill
- git-worktreesSkill
- github-ssh-keysSkill
- npm-publish-ci-pitfallsSkill
- sapling-stacked-pr-workflowSkill
- go-concurrency-patternsSkill
- go-data-idiomsSkill
- go-error-handlingSkill
- go-interfaces-embeddingSkill
- go-pprof-profilingSkill
- marketing-funnel-diagnosisSkill
- marketing-geo-experimentsSkill
- marketing-incrementalitySkill
- marketing-positioning-testsSkill
- python-descriptors-mroSkill
- python-logging-cookbookSkill
- python-scaling-regression-testsSkill
- python-unicode-gotchasSkill
- rust-compile-time-invariantsSkill
- rust-deterministic-concurrency-testsSkill
- rust-error-identity-boundariesSkill
- rust-regex-search-contractsSkill
- rust-runtime-bug-classesSkill
- rust-tokio-actor-deliverySkill
- rust-tokio-cancellation-safetySkill
- sales-discovery-qualificationSkill
- sales-mutual-action-plansSkill
- sales-pipeline-forecast-calibrationSkill
- sales-value-negotiationSkill
- ai-triage-evaluationSkill
- container-image-patchingSkill
- dependency-artifact-integritySkill
- dnssec-sentinel-diagnosticsSkill
- iam-policy-change-replaySkill
- rbvm-applicabilitySkill
- rbvm-asset-evidenceSkill
- rbvm-guarded-remediationSkill
- rbvm-priority-decisionsSkill
- rbvm-risk-exceptionsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Use this skill when AI-assisted code passes happy-path tests but could be silently wrong.
- Distinctive: line 18
Check whether omission fails closed.
- Distinctive: line 20
Ask for pre-production evidence: negative, cross-tenant, concurrent, retry, cache-invalidation, or startup checks.
- Distinctive: line 46
Prefer designs where omission fails loudly:
- Distinctive: line 50
Use database constraints, transactions, unique keys, and idempotency keys.
- Distinctive: line 51
Treat caches and derived state as dependencies with owners and invalidators.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI Bug Patterns
Use this skill when AI-assisted code passes happy-path tests but could be silently wrong. These bugs return clean responses with the wrong access, state, timing, or data source.
Working rule
Review the negative space, not just the feature path:
- Name who must be denied, what state must stay synchronized, and which operations must be atomic, cancel-safe, or idempotent.
- Check whether omission fails closed. Missing auth, scope, config, or validation should block work, not allow it.
- Ask for pre-production evidence: negative, cross-tenant, concurrent, retry, cache-invalidation, or startup checks.
Scan these clusters
| Cluster | Ask |
| Authorization, access control, query scope, credentials, tokens | Can one user, tenant, org, role, or token see or mutate another context's data? Is scope enforced at the backend boundary? |
| TOCTOU, partial updates, async completion, cancellation, non-atomic operations | Can state change between check and use? Can a late response, failed second step, or cancellation leave inconsistent state? |
| Webhook, retry, dedup, and idempotency failures | Can duplicate delivery or retry charge, send, grant, import, or mutate twice? Is uniqueness enforced by storage? |
| Stale derived state, stale cache, unsynced code paths, inconsistent data source | After a mutation, do API, worker, admin, UI, cache, and reporting paths agree on the source of truth? |
| Startup/config validation, input validation, validation drift, fuzzy matching, boundary errors | Can bad config boot? Can one path accept what another rejects? Are limits, rounding, normalization, and matching explicit? |
| Swallowed errors, incomplete refactors, stale constants, null dereferences, UI/accessibility gaps | Does failure become success, empty data, wrong status, unreachable UI, or old behavior that survived a rename? |
Evidence to request
- Auth: denied-user, cross-tenant, wrong-audience, expired-token, and missing-scope tests.
- Races: transaction, rollback, out-of-order completion, and replay-the-same- event-twice tests.
- State: mutate, then read through every cache, derived state, and data source.
- Validation/refactor: fails-fast startup, boundary inputs, shared validator, and old-name search evidence.
Make bugs legible
Prefer designs where omission fails loudly:
- Deny by default; require explicit grants.
- Centralize scope filters and validation at trust boundaries.
- Use database constraints, transactions, unique keys, and idempotency keys.
- Treat caches and derived state as dependencies with owners and invalidators.
- Log and propagate unexpected errors; ignore only named, safe cases.
Pitfalls
- Reviewing only the generated diff; inspect adjacent endpoints, jobs, and alternate callers that share the invariant.
- Accepting a passing happy-path test as evidence for authorization, retries, concurrency, or cache behavior.
- Treating null dereferences as the main AI risk. They are visible; silent access, race, state, and validation bugs are more likely to escape.
Source: Detail blog.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

