code-structure
Skill0 starsChanged 2 months agoMITView on GitHub
Use when a function is too long, nests too deep, or mixes themes. Extracts helpers that earn their names.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- imornar/skillstheir own version, first seen Sep 17, 2026
- Nagacash/nagacodex-factory-skilltheir own version, first seen Sep 15, 2026
- michaelshimeles/skillstheir own version, first seen Sep 4, 2026
- voundbrand/overnighttheir own version, first seen Sep 3, 2026
- Spardutti/claude-skillstheir own version, first seen Aug 31, 2026
- kellykampen/agent-skillstheir own version, first seen Jul 28, 2026
Used with
Projects with it also use evidence-driven-testing, greploop-apps and 3 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.
kellykampenSkillevidence-driven-testing
Records visual proof while testing UI behavior — screen recording with structured test/assertion annotations — then posts the video and a results summary to the PR and tracker issue. Use whenever a UI change needs verifiable evidence that it works, instead of prose claims.
Also in 4 projects that use this
michaelshimelesSkillgreploop-apps
Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments. Identical to greploop, but triggers reviews by tagging @greptile-apps, which bypasses Greptile's file-count limit on huge PRs that the plain @greptile mention refuses to review. Use when the user wants to fully optimize a large PR/MR/CL against Greptile's code review standards.
Also in 3 projects that use this
VercelSkillbefore-and-after
Add existing screenshots or screen recordings to a GitHub pull request as a before/after or preview block. Use when a PR needs visual media attached to its description. Browser navigation and capture belong to agent-browser.
Also in 3 projects that use this
undeadlistSkillnew-feature
Develop new features with test-first approach (TDD)
Also in 3 projects that use this
MicrosoftSkillunslop
Cut AI tells from any writing. Must always apply.
Also in 3 projects that use this
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- michaelshimeles/skills★ 1.2ksame name
- Spardutti/claude-skills★ 3same name
- kellykampen/agent-skills★ 2same name
- nitikeshq/skills★ 2same name
- voundbrand/overnight★ 2same name
- Nagacash/nagacodex-factory-skill★ 1same name
- IcodeNet/agent-skills★ 0same name
- imornar/skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- artifact-handoffSkill
- catalogSkill
- changelog-qualitySkill
- change-splittingSkill
- comment-qualitySkill
- evidence-disciplineSkill
- factual-integritySkill
- language-style-samplingSkill
- llm-tellsSkill
- plan-iteration-gateSkill
- pre-commit-checkSkill
- project-discoverySkill
- repo-hygieneSkill
- self-review-gateSkill
- skill-authoringSkill
- socratic-specSkill
- systematic-debuggingSkill
- upstream-hygieneSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 8 edited versions we read keep these.
3
Distinctive
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
- Distinctive: line 21
If split introduced a dep chain, order: preparatory helper before patch that needs it, or split to separate commit with "No change in …
- Distinctive: line 22
When a hunk unrelated to patch's purpose rides along, split it out: "this doesn't affect any functionality before nor after the core of …
- Distinctive: line 28
If series grows a function across patches without anyone acting because "already long before this patch", that series still owns growth — …
- Very specific: line 41
Prefer intent-revealing local name over generic tmp, ret2.
- Very specific: line 51
Run: git log --oneline -- <file> | head -n 20 + grep same file for sister pattern.
“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Structure
<!-- GC-40 --> Prefer minimal obvious fix. Do not duplicate to rename; rename is its own change when safe.GC-41 — Extract by logical theme, helper has intent name
- One helper = one theme. Name by what it means, not how it's implemented.
- If split introduced a dep chain, order: preparatory helper before patch that needs it, or split to separate commit with "No change in behavior" or "Prepare for..." if upstream allows preparatory trailers.
- When a hunk unrelated to patch's purpose rides along, split it out: "this doesn't affect any functionality before nor after the core of this patch" — separate commit.
GC-42 — Function length signal (not hard gate)
- Aim: majority functions ≤20 lines. Hard smell: >40 lines → examine for extractable logical pieces.
- Size alone doesn't reveal seam; look for: mechanical conversion vs behavioral change; moved unchanged vs rewritten; case already correct just needing result reported differently vs genuinely new algorithm; helper extracted vs its first caller.
- If series grows a function across patches without anyone acting because "already long before this patch", that series still owns growth — extract at point of addition, not retrofit later (retrofit forces re-derivation of every later patch and introduces resolution errors).
GC-43 — Guard early return over goto-ladder, bare {} scoping
- Flatten via early returns. Exception: real cleanup path that
goto out;genuinely unifies — keep when saves duplication. - Bare
{}blocks to limit scope → declare at function top instead, or extract helper.
GC-44 — Predicate bools should_ / is_ / has_ / can_ / needs_ / try_
static bool helper that only tests state (even with guard flag) should use should_/is_/etc, not action verbs like drain/claim/flush/schedule. Bad: bool flush_cache(), Good: bool should_flush_cache().
GC-45 — Locals naming, MIN macro over ternary
- Prefer intent-revealing local name over generic
tmp,ret2. - Clamp → use language's
min/MIN/clampmacro or stdlib, not hand-rolled ternary. Avoids future bugs.
GC-46 — Ownership + caller clear, bool ownership intent explicit
- Who allocates → who frees? If ownership transfers, comment at transfer point and at definition, not just at call site.
- Functions that conditionally take ownership use name + bool/param that makes intent obvious, or separate try/ensure helpers.
GC-47 — When in doubt, check existing codebase style first
Run: git log --oneline -- <file> | head -n 20 + grep same file for sister pattern. Match whatever codebase already does over "textbook ideal".
GC-48 — One literal, one home
When the same list, path set, or magic value appears in two or more places, hoist it to a single named definition and reference it. Duplicated literals diverge silently — copies added to one site but not the others, with no gate complaining. Applies to data (paths, IDs, thresholds), not just logic; if two copies cannot share a definition, that is a seam worth naming, not an excuse for two copies.
Related — what belongs elsewhere
- Security invariants in comment: see
comment-qualityGC-22. - Numbers/perf deltas: see
factual-integrity. - Multi-file splitting and bisectable units: see
change-splittingGC-30..GC-35. - Strict-project worked example:
references/kernel-style-as-example.md.
Verification checklist
- Every new function has one theme + intent name.
- Bool helper is predicate-named (GC-44) or renamed in same commit.
- No bare
{}block unless justified. - Function >40 lines: seams named + reason to keep together if not split.
- Early return flattened where possible, goto kept only when cleanup truly unified.
- No hand-rolled
a < b ? a : b.
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
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.

