agentleFS
swestfall21swestfall21/claude-skills/code-like-a-local/SKILL.md

code-like-a-local

Skill0 starsChanged 4 months agoMITView on GitHub

How to write code that blends into an existing codebase — matching idiom, naming, and comment discipline. Use before writing or editing any code in a project you didn't create this session.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    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:

    Before writing, read enough neighboring code to absorb:

    line 12
  2. Distinctive:

    Idiom: if the file uses early returns, don't introduce nested conditionals.

    line 15
  3. Distinctive:

    Structure: put new code where analogous code lives, not where it's convenient.

    line 17
  4. Distinctive:

    Dependencies: use the libraries already in the project.

    line 18
  5. Distinctive:

    When your instinct conflicts with the codebase's convention, the codebase wins — flag the concern in your message to the user if it …

    line 20
  6. Distinctive:

    Write a comment only to state a constraint the code itself cannot show — a non-obvious invariant, an external requirement, a deliberate …

    line 24
  7. Distinctive:

    Never write comments that:

    line 26

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

Write code that reads like the surrounding code

The goal of a change is that a reviewer can't tell where the existing code ends and yours begins. Style consistency is correctness of a kind: it's what keeps a codebase navigable.

Match before you write

Before writing, read enough neighboring code to absorb:

  • Naming: getUser vs fetchUser vs user() — use whichever this codebase uses.
  • Idiom: if the file uses early returns, don't introduce nested conditionals; if it uses a result type, don't throw.
  • Comment density: a file with three comments in 400 lines should not gain twelve from your 40-line change.
  • Structure: put new code where analogous code lives, not where it's convenient.
  • Dependencies: use the libraries already in the project. Never add a dependency for something the existing ones do.

When your instinct conflicts with the codebase's convention, the codebase wins — flag the concern in your message to the user if it matters, don't fix it silently in passing.

Comment discipline

Write a comment only to state a constraint the code itself cannot show — a non-obvious invariant, an external requirement, a deliberate deviation ("intentionally not cached: upstream invalidation is unreliable").

Never write comments that:

  • Narrate the next line (// increment the counter)
  • Explain where the change came from (// added per user request)
  • Justify the change to a reviewer (// this fixes the race condition — that's the commit message's job)
  • Mark your edits (// updated, // new code below)

That last category is you talking to the reviewer, not to the next reader — it's noise the moment the change merges.

Scope discipline

Change what the task requires and nothing else. No drive-by reformatting, no renaming things you didn't need to touch, no "while I was here" refactors — they bloat the diff and hide the real change. If you notice something worth fixing, say so in your report instead of fixing it silently.

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.