agentleFS
LucaDominiciLucaDominici/arbiter/.claude/skills/clean-code/SKILL.md

clean-code

Skill0 starsChanged 54 days agoApache-2.0View on GitHub

Gate-map for code quality — which gate mechanically enforces each limit (jscpd/knip/madge/complexity/ratchet). Use when reviewing code quality or before adding code that might duplicate or over-complicate.

108 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use intelligent-routing, nextjs-react-expert and 10 more.

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.
  • SKB3002Skill

    intelligent-routing

    Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.

    Also in 5 projects that use this

  • SKB3002Skill

    nextjs-react-expert

    React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.

    Also in 3 projects that use this

  • xfstudioSkill

    bash-pro

    Master of defensive Bash scripting for production automation, CI/CD

    Also in 4 projects that use this

  • xfstudioSkill

    code-refactoring-tech-debt

    You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create acti

    Also in 4 projects that use this

  • flying-diceSkill

    clean-code-review

    Multi-agent clean code audit — each principle gets its own agent

    Also in 3 projects that use this

  • goca-seSkill

    batch-operations

    Apply a change safely across many files — refactors touching more than 5 files, library or API migrations, project-wide renames of symbols/imports/paths, or adding boilerplate to many files. Use when "do it all at once" risks context overflow or silent failures.

    Also in 3 projects that use this

  • +4 more from xfstudio

The file

Files
SKILL.md

Clean Code

This skill is a gate-map, not a lecture. Every limit below is mechanically enforced — the gate is the source of truth. When in doubt, run the gate; don't argue the principle.

Limits → enforcing gate

ConcernLimitEnforced by
DRY / duplicationclones below threshold; no copy-pastejscpd (CANON-22) + debt ratchet — no net increase (Lehman entropy)
Complexity (KISS)cyclomatic ≤ 10 per functioneslint complexity rule + debt ratchet
No dead code (YAGNI)no unused files/exportsknip
No cyclesno circular importsmadge --circular
No bloatfile / LOC ceilingsbloat ratchet + debt ratchet

When a gate fires

Fix the root cause — extract the shared helper, simplify the function, delete the dead branch — or run arbiter lifecycle record-debt with a rationale. A symptom patch over a flagged smell is a stop condition (see 90-exec-protocol.md → Root-Cause Discipline). Juergens'09: an inconsistent clone (duplicated, then edited in one copy only) is a latent bug — dedup before it diverges.

Naming & extraction (review heuristic — not gated)

  • Names reveal intent: verb+noun functions (getUserById); is/has/can booleans; no cryptic abbreviations.
  • Repeated block → extract function. Long if/else on a type → polymorphism. One-liner wrapper that adds no clarity → inline. Complex expression → extract variable.
  • TypeScript: no any (use unknown and narrow — enforced by the check-no-any hook, INV-04); const over let; discriminated unions over nullable fields.

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.