agentleFS
YehudaFrankelYehudaFrankel/clankbrain/.claude/skills/scan-conventions/SKILL.md

scan-conventions

Skill16 starsChanged 7 months agoMITView on GitHub

Scans a real codebase and writes coding-conventions.md from what it actually finds — variable style, SQL patterns, error handling, INSERT strategy, naming. Run once on any new project to bootstrap the convention system. Triggers on "scan conventions", "generate conventions", "bootstrap conventions", "extract conventions from code", "what are the conventions".

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If unclear, ask the user: "Where are the main source files?

    line 21
  2. Distinctive:

    Read actual methods. Look for:

    line 27
  3. Very specific:

    Write to coding-conventions.md in the project memory or root:

    line 75
  4. Distinctive:

    Ask: "Does this match what you know?

    line 129
  5. Very specific:

    After the first real coding session, run /learn to add project-specific nuances

    line 136
  6. Distinctive:

    Run again after a major refactor to catch convention drift

    line 137

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

Skill: scan-conventions

Reads real code from the target codebase and extracts the actual conventions in use. Writes coding-conventions.md from evidence, not assumptions.


Step 1 — Locate the codebase

Look for:

  • Primary language files (Java/JS/Python/TS — whatever the project uses)
  • Main entry point or router file
  • A utility/helper file with 5+ methods

If unclear, ask the user: "Where are the main source files? Any primary utility class I should read?"


Step 2 — Sample 3-5 real methods

Read actual methods. Look for:

Variable declarations:

  • Declared at top of method or inline?
  • Declared then assigned, or declaration + assignment combined?

SQL / DB patterns (if applicable):

  • SQL assigned to a variable before passing to a query method?
  • Parameterized queries? String concatenation? ORM?
  • Specific quoting helpers (e.g. fmtCondition, fAddQuotes)?

Error handling:

  • What does a failure return? "Error: ..." string? Exception? null?
  • Specific error-check helpers (e.g. UFmt.containsError)?

Naming:

  • camelCase, snake_case, PascalCase?
  • Variable names include type prefix or drop it?

Control flow:

  • Braces on every if/else, or omitted for single-statement bodies?
  • Ternary operators used or avoided?
  • Early returns or single-exit?

String comparison (Java/JS):

  • var.equalsIgnoreCase("value") or "value".equalsIgnoreCase(var)?

Step 3 — Sample JS/frontend (if applicable)

  • var vs let/const?
  • Arrow functions vs function() {}?
  • Template literals vs concatenation?
  • DOM: getElementById vs querySelector vs $('#id')?
  • Named params object before API call vs inline?

Step 4 — Identify INSERT strategy (if DB-heavy)

Grep for INSERT statements. Do any tables use auto-increment/IDENTITY? List them — they may need special handling (e.g. no explicit ID in INSERT).


Step 5 — Write coding-conventions.md

Write to coding-conventions.md in the project memory or root:

# Coding Conventions — [Project Name]
> Generated by /scan-conventions on [date].
> Based on [N] methods sampled from [files]. Review and correct anything that looks wrong.

## [Language] Conventions

### Variable Declarations
[finding]

### Error Handling
[finding]

### SQL / DB Pattern
[finding — or "N/A"]

### INSERT Strategy
[finding — list IDENTITY tables if found]

### Naming
[finding]

### Control Flow
[finding]

### String Comparison
[finding]

## JavaScript / Frontend (if applicable)

### Syntax
[finding]

### DOM Access
[finding]

### API Calls
[finding]

## ⚠️ Ambiguous — needs manual confirmation
[anything found with mixed usage — e.g. "Found both var and let — which is standard?"]

Step 6 — Report

Tell the user:

  • Files sampled
  • Key patterns confirmed
  • Anything ambiguous that needs manual review

Ask: "Does this match what you know? Anything to correct before I treat this as authoritative?"


Notes

  • This is a starting point, not a finished document
  • Ambiguous patterns must be flagged — never assumed
  • After the first real coding session, run /learn to add project-specific nuances
  • Run again after a major refactor to catch convention drift

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.