Red flags

From codybrom/clairvoyance · View interactive version

Red flags is an AI agent skill from the GitHub repository codybrom/clairvoyance. Scans code against 17 design smells (the book's 14 named Red Flags plus 3 process-stage signals) and produces a structured diagnostic report. Use when the user asks for a red flags or design smell scan, asks to check code against a checklist, is evaluating unfamiliar code, or asks open-endedly wheth

How to use this skill

Skill file

Red Flags Diagnostic

When invoked with $ARGUMENTS, scope the scan to the specified file or directory. Read the target code first, then run every flag below against it. Each flag points to a deeper lens from Clairvoyance (https://clairvoyance.fyi). This skill works best when the full collection is installed.

A red flag is a signal, not a diagnosis. It tells you something is wrong but not why. Each flag below points to a deeper lens that identifies the root cause.

When to Apply

The Red Flags

Structural (4)

1. Shallow Module

Interface isn't much simpler than implementation.

2. Pass-Through Method

Method forwards arguments to another with a similar signature, adding zero logic.

3. Conjoined Methods

Two separate pieces of code that can only be understood together.

4. Temporal Decomposition

Structure follows execution order, not knowledge ownership.

Boundary (4)

5. Information Leakage

When a design decision leaks across module boundaries, changing that decision often forces changes in every module that knows about it. The most dangerous leaks are invisible, where two modules share knowledge but no interface acknowledges the dependency.

6. Overexposure

API forces callers to handle things they almost never need.

7. Repetition

Same logic appears in multiple places. The next change of this type will require edits everywhere.

8. Special-General Mixture

General mechanism contains knowledge specific to one use case.

Documentation (2)

9. Comment Repeats Code

All information in the comment is obvious from the adjacent code.

10. Implementation Documentation Contaminates Interface

Interface comment describes implementation details. Signals a leaky abstraction.

Naming & Abstraction (4)

11. Vague Name

Name so imprecise it doesn't convey useful information.

12. Hard to Pick Name

Struggling to find a precise name isn't a vocabulary problem. It's design feedback.

13. Hard to Describe

Complete documentation must be long and qualified. Short descriptions come from well-designed abstractions.

14. Non-obvious Code

This is the meta-flag because every other flag on this list is a specific cause of non-obvious code. When someone reads the code for the first time, they might not be able to tell what it does or why it does it.

Process (3)

15. No Alternatives Considered

Design chosen without comparing meaningfully different approaches.

16. Tactical Momentum

Changes optimize for speed over design quality.

17. Catch-and-Ignore

Error handling that suppresses or discards errors without meaningful action.

Canary Flags

_Hard to Pick Name_, _Hard to Describe_, _Non-obvious Code_ and _No Alternatives Considered_ surface during writing, before code review. Catch them early and the structural flags never materialize.

Review Process

  1. Identify scope: file, module, PR diff, or class
  2. Scan all flags: For each: CLEAR, TRIGGERED, or N/A. If triggered: location, principle violated, candidate fix
  3. Structure a report: Group findings by category (Structural, Boundary, Documentation, Naming/Abstraction, Process). Summarize flags triggered, critical issues and recommended actions.
  4. Follow the arrows: For each triggered flag, pull in the indicated lens for deeper analysis
  5. Check for syndromes: Multiple triggered flags may share a root cause. See references/flag-interaction-map.md for named clusters. A syndrome points at an architectural issue. Fixing the root cause resolves all flags in the cluster.
  6. Prioritize: Boundary flags compound over time and infect adjacent code, so fix those first. Canary flags are the cheapest to act on. Structural flags require refactoring but affect a bounded area.
  7. Recommend: Create a report with prioritized, actionable fixes tied to specific principles.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.