agentleFS
lbusselllbussell/agent-skills/skills/find-red-flags/SKILL.md

find-red-flags

Skill0 starsChanged 11 days agoMITView on GitHub

Find red flags in a codebase or a diff. Use only when explicitly invoked.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    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:

    If the same knowledge is used at different points in execution, it gets encoded in multiple places, resulting in information leakage.

    line 26
  2. Distinctive:

    If the API for a commonly used feature forces users to learn about other features that are rarely used, this increases the cognitive load …

    line 29
  3. Distinctive:

    If the same piece of code (or code that is almost the same) appears over and over again, that's a red flag that you haven't found the right …

    line 38
  4. Distinctive:

    If you can't understand the implementation of one method without also understanding the implementation of another, that's a red flag.

    line 46
  5. Distinctive:

    If the information in a comment is already obvious from the code next to the comment, then the comment isn't helpful.

    line 52
  6. Distinctive:

    If you find it difficult to write such a comment, that's an indicator that there may be a problem with the design of the thing you are …

    line 60
  7. Distinctive:

    If a variable or method name is broad enough to refer to many different things, then it doesn't convey much information to the developer …

    line 65
  8. Distinctive:

    If it's hard to find a simple name for a variable or method that creates a clear image of the underlying object, that's a hint that the …

    line 68
  9. Distinctive:

    If the meaning and behavior of code cannot be understood with a quick reading, it is a red flag.

    line 73

≈ “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.

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

Finding red flags in code

The operator is asking you to find red flags in a codebase or a diff. Scan through the requested code looking for the following red flags. Report the red flags you find in a table along with a brief explanation for each red flag.

Modules should be deep

Red Flag: Shallow Module

A shallow module is one whose interface is complicated relative to the functionality it provides. Shallow modules don't help much in the battle against complexity, because the benefit they provide (not having to learn about how they work internally) is negated by the cost of learning and using their interfaces. Small modules tend to be shallow.

Information hiding / encapsulation

Red Flag: Information Leakage

Information leakage occurs when the same knowledge is used in multiple places, such as two different classes that both understand the format of a particular type of file.

Red Flag: Temporal Decomposition

In temporal decomposition, execution order is reflected in the code structure: operations that happen at different times are in different methods or classes. If the same knowledge is used at different points in execution, it gets encoded in multiple places, resulting in information leakage.

Red Flag: Overexposure

If the API for a commonly used feature forces users to learn about other features that are rarely used, this increases the cognitive load on users who don't need the rarely used features.

Abstractions

Red Flag: Pass-Through Method

A pass-through method is one that does nothing except pass its arguments to another method, usually with the same API as the pass-through method. This typically indicates that there is not a clean division of responsibility between the classes.

Red Flag: Repetition

If the same piece of code (or code that is almost the same) appears over and over again, that's a red flag that you haven't found the right abstractions.

Red Flag: Special/General Mixture

This red flag occurs when a general-purpose mechanism also contains code specialized for a particular use of that mechanism. This makes the mechanism more complicated and creates information leakage between the mechanism and the particular use case: future modifications to the use case are likely to require changes to the underlying mechanism as well.

Red Flag: Conjoined Methods

It should be possible to understand each method independently. If you can't understand the implementation of one method without also understanding the implementation of another, that's a red flag. This red flag can occur in other contexts as well: if two pieces of code are physically separated, but each can only be understood by looking at the other, that is a red flag.

Comments

Red Flag: Comment Repeats Code

If the information in a comment is already obvious from the code next to the comment, then the comment isn't helpful. One example of this is when the comment uses the same words that make up the name of the thing it is describing.

Red Flag: Implementation Documentation Contaminates Interface

This red flag occurs when interface documentation, such as that for a method, describes implementation details that aren't needed in order to use the thing being documented.

Red Flag: Hard to Describe

The comment that describes a method or variable should be simple and yet complete. If you find it difficult to write such a comment, that's an indicator that there may be a problem with the design of the thing you are describing.

Names

Red Flag: Vague Name

If a variable or method name is broad enough to refer to many different things, then it doesn't convey much information to the developer and the underlying entity is more likely to be misused.

Red Flag: Hard to Pick Name

If it's hard to find a simple name for a variable or method that creates a clear image of the underlying object, that's a hint that the underlying object may not have a clean design.

Code

Red Flag: Nonobvious Code

If the meaning and behavior of code cannot be understood with a quick reading, it is a red flag. Often this means that there is important information that is not immediately clear to someone reading the code.

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.