agentleFS
fernandoxavier02fernandoxavier02/engineering-context/skills/mine-anti-patterns/SKILL.md

mine-anti-patterns

Skill0 starsChanged 7 months agoMITView on GitHub

This skill should be used when the user asks to 'scan for anti-patterns', 'find code smells', 'detect anti-patterns', 'mine anti-patterns', or 'check for common errors'. Scans the codebase for anti-patterns and generates a catalog of real issues found.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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
  1. Distinctive:

    Search for common issues across any codebase using Grep:

    line 12
  2. Distinctive:

    Create an entry for each issue found:

    line 58
  3. Distinctive:

    Only include issues ACTUALLY found in the codebase.

    line 64

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Mine Anti-Patterns

Scan the codebase for anti-patterns and generate a catalog of real issues.

Step 1: Generic Scan

Search for common issues across any codebase using Grep:

Anti-patternDetection Pattern
Print/logging in productionprint(, console.log(
Hardcoded secretsapi_key = ", password = ", secret = "
God files (over 300 lines)Files with > 300 lines
Empty error handlingexcept:, catch {}, bare except
Duplicated constantsSame name in 2+ files
Business logic in wrong layerDomain terms in UI/infra code

Step 2: Language-Specific Scan

Based on PROJECT_PROFILE language:

Python

  • except Exception: or except: (bare catch)
  • import * (wildcard imports)
  • Mutable default arguments (def f(x=[]))
  • Missing type hints on public functions

TypeScript

  • any type usage
  • @ts-ignore or @ts-expect-error
  • Non-null assertions (!.)
  • Missing return types on exports

Go

  • panic() in library code
  • Exported functions without doc comments
  • Naked goroutines without error handling

Ruby

  • Monkey-patching (reopening core classes)
  • eval() usage
  • Global variables ($var)

Step 3: Architecture-Specific Scan

Based on ARCHITECTURE_MAP:

  • Cross-layer imports (violating dependency rules)
  • Business logic in entry points
  • Missing mandatory flow steps (e.g., bypassing RiskEngine)

Step 4: Build Catalog

Create an entry for each issue found:

#Anti-patternWhat happenedHow to avoid
1[name][specific instance with file:line][concrete fix]

Only include issues ACTUALLY found in the codebase. Do NOT invent hypothetical issues.

Output Format

ANTI_PATTERN_CATALOG:
  total_found: [N]
  by_severity:
    critical: [list]
    warning: [list]
    info: [list]
  entries:
    - id: [N]
      name: [anti-pattern name]
      description: [what was found]
      location: [file:line or "general"]
      severity: [critical | warning | info]
      fix: [how to avoid]

Detailed Detection Patterns

Full patterns by language and severity are in references/catalog.md.

Integration

The anti-pattern catalog feeds into generate-rules (rule 53) and validate-context.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.