agentleFS
jmylchreestjmylchreest/aide/skills/patterns/SKILL.md

patterns

Skill19 starsChanged 3 months agoMITView on GitHub

Analyze codebase patterns, detect anti-patterns, and surface static analysis findings

15 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • VercelSkill

    setup

    Set up Vercel CLI and project configuration. Use when the user says "set up Vercel", "configure Vercel", "link to Vercel", or "vercel init".

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 1 is distinctive, and 6 are very specific to this project.

  • 0

    Common

    Most of the 11 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run findings_search analyzer="complexity" severity="critical" to find the most complex functions

    line 107
  2. Distinctive:

    Read the flagged functions directly using the finding locations

    line 108
  3. Very specific:

    Run findings_list analyzer="clones" to see detected code clones

    line 115
  4. Very specific:

    Use Read to compare the duplicated sections

    line 117
  5. Very specific:

    Run findings_search analyzer="coupling" to see import fan-out/fan-in issues

    line 122
  6. Very specific:

    Run findings_list analyzer="secrets" severity="critical" for confirmed secrets

    line 129
  7. Very specific:

    Run findings_list analyzer="secrets" for all potential secrets (including unverified)

    line 130

“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “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

Pattern Analysis

Recommended model tier: balanced (sonnet) - this skill combines search with structured analysis

Analyze codebase patterns using static analysis findings. Surface complexity hotspots, code duplication, coupling issues, and potential secrets. Use this skill to understand code health and identify areas that need attention.

Prerequisites

Findings must be generated first by running analyzers via the CLI:

# Run all analyzers
./.aide/bin/aide findings run --path .

# Run specific analyzers
./.aide/bin/aide findings run --path . --analyzer complexity
./.aide/bin/aide findings run --path . --analyzer coupling
./.aide/bin/aide findings run --path . --analyzer secrets
./.aide/bin/aide findings run --path . --analyzer clones

Binary location: The aide binary is at .aide/bin/aide. If it's on your $PATH, you can use aide directly.

Available Tools

1. Search Findings (mcp__plugin_aide_aide__findings_search)

Full-text search across all findings. Supports Bleve query syntax for advanced searches.

Parameters:

  • query (required) — Search term or Bleve query
  • analyzer (optional) — Filter to one analyzer: complexity, coupling, secrets, clones
  • severity (optional) — Filter by severity: info, warning, critical
  • file (optional) — Filter by file path substring
  • limit (optional) — Max results (default 20)

Example usage:

Search for: "high complexity"
-> findings_search query="complexity" severity="warning"
-> Returns: functions with high cyclomatic complexity, with file:line

2. List Findings (mcp__plugin_aide_aide__findings_list)

List findings with filters. Use when you want to browse rather than search.

Parameters:

  • analyzer (optional) — Filter to one analyzer
  • severity (optional) — Filter by severity
  • file (optional) — Filter by file path substring
  • limit (optional) — Max results (default 20)
  • offset (optional) — Pagination offset

Example usage:

List all critical findings
-> findings_list severity="critical"
-> Returns: all critical-severity findings across all analyzers

3. Findings Statistics (mcp__plugin_aide_aide__findings_stats)

Get aggregate counts by analyzer and severity. Use as a starting point to understand overall code health before drilling into specifics.

Example usage:

How healthy is the codebase?
-> findings_stats
-> Returns: counts per analyzer, counts per severity, total findings

Workflow

Quick Health Check

  1. Get overview — Use findings_stats to see counts by analyzer and severity
  2. Triage critical — Use findings_list severity="critical" to review highest-priority items
  3. Drill into areas — Use findings_search with file or query filters for specific concerns

Complexity Analysis

  1. Run findings_search analyzer="complexity" severity="critical" to find the most complex functions
  2. Read the flagged functions directly using the finding locations
  3. Examine surrounding code as needed; use code_outline when unfamiliar large-file structure would help, or read the full file when small or mostly relevant
  4. Recommend decomposition strategies

Duplication Analysis

  1. Run findings_list analyzer="clones" to see detected code clones
  2. Each finding includes the clone pair — both file locations and line ranges
  3. Use Read to compare the duplicated sections
  4. Recommend extraction into shared functions or modules

Coupling Analysis

  1. Run findings_search analyzer="coupling" to see import fan-out/fan-in issues
  2. High fan-out means a file imports too many things (potential god module)
  3. High fan-in means many files depend on one (fragile dependency)
  4. Cycle findings indicate circular dependency chains

Secret Detection

  1. Run findings_list analyzer="secrets" severity="critical" for confirmed secrets
  2. Run findings_list analyzer="secrets" for all potential secrets (including unverified)
  3. Each finding includes the secret category (e.g., AWS, GitHub, generic API key)
  4. Snippets are redacted for safety — use Read to examine context around the finding

Anti-Pattern Identification

Beyond the automated analyzers, look for these patterns using findings as starting points:

FindingLikely Anti-PatternAction
Complexity > 20God functionDecompose into smaller functions
Fan-out > 15Kitchen sink moduleSplit responsibilities
Fan-in > 20Fragile dependencyConsider interface/abstraction
Multiple clonesCopy-paste programmingExtract shared utility
Import cycleCircular dependencyRestructure module boundaries

Output Format

## Code Health Report

### Overview

- Total findings: X (Y critical, Z warnings)
- Top concern: [area/file with most issues]

### Hotspots

1. **`file:line`** - [description] (severity)
   - Impact: [why this matters]
   - Recommendation: [what to do]

### Patterns Detected

- [List of anti-patterns found with evidence]

### Recommendations

1. [Prioritized action items]

Failure Handling

  1. No findings data — Tell user to run analyzers first: ./.aide/bin/aide findings run --path .
  2. Stale findings — Findings reflect the state at last analyzer run; recommend re-running if code changed significantly
  3. False positives — Secret detection may flag test fixtures or example configs; note when findings appear to be in test/example code

Verification Criteria

  • Checked findings_stats for overall picture
  • Reviewed critical findings
  • Cross-referenced findings with the relevant source code
  • Provided actionable recommendations with file:line references
  • Noted any false positives or findings that need manual verification

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.