python
Skill1 starsChanged 5 days agoMITView on GitHub
If there can be many misses, sometimes dict.setdefault() or defaultdict is better.
54 other projects use a version of this.
Adopted by
Most recently taken up by
- Tom-Willemsen/claude-skillstheir own version, first seen Nov 29, 2026
- kevinreber/claude-code-configstheir own version, first seen Nov 29, 2026
- fmind/dotfilestheir own version, first seen Nov 29, 2026
- fmind/dottheir own version, first seen Nov 29, 2026
- martinholovsky/claude-skills-generatortheir own version, first seen Nov 29, 2026
- niksavis/basiclytheir own version, first seen Nov 27, 2026
Used with
Projects with it also use android-kotlin, java 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.
alinaqiSkillandroid-kotlin
Android Kotlin development with Coroutines, Jetpack Compose, Hilt, and MockK testing
Also in 4 projects that use this
testdino-hqSkilljava
Google's official Java style guide. Covers 2-space indentation, 100-char line limit, naming conventions, braces, imports, Javadoc, exception handling, lambdas, and streams. Enforces @Override annotations and specific imports.
Also in 6 projects that use this
testdino-hqSkillcpp
Google's official C++ style guide. Covers headers, naming conventions, formatting, classes, memory management, RAII, smart pointers, and modern C++ features.
Also in 5 projects that use this
ffsshhttiikkSkillflutter
Flutter cross-platform framework
Also in 4 projects that use this
mcollinaSkillnode
Provides domain-specific best practices for Node.js development with TypeScript, covering type stripping, async patterns, error handling, streams, modules, testing, performance, caching, logging, and more. Use when setting up Node.js projects with native TypeScript support, configuring type stripping (--experimental-strip-types), writing Node 22+ TypeScript without a build step, or when the user mentions 'native TypeScript in Node', 'strip types', 'Node 22 TypeScript', '.ts files without compilation', 'ts-node alternative', or needs guidance on error handling, graceful shutdown, flaky tests, profiling, or environment configuration in Node.js. Helps configure tsconfig.json for type stripping, set up package.json scripts, handle module resolution and import extensions, and apply robust patterns across the full Node.js stack.
Also in 4 projects that use this
VercelSkillreact
React renderer for json-render that turns JSON specs into React components. Use when working with @json-render/react, building React UIs from JSON, creating component catalogs, or rendering AI-generated specs.
Also in 7 projects that use this
- +1 more from testdino-hq
Other versions54 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 54
- alinaqi/maggy★ 712same name
- alinaqi/claude-bootstrap★ 708same name
- Mindrally/skills★ 275same name
- kid-sid/claude-spellbook★ 190same name
- hass-energy/haeo★ 81same name
- martinholovsky/claude-skills-generator★ 48same name
- nimadorostkar/Claude-Skills-collection★ 41same name
- G1Joshi/Agent-Skills★ 15same name
- kissgyorgy/coding-agents★ 15same name
- maroffo/claude-forge★ 15same name
44 more not listed
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.
- writingSkill
- audit-conversationSkill
- codebase-designSkill
- code-reviewSkill
- developerSkill
- dev-workflowSkill
- explainerSkill
- pm-discoverySkill
- PR-code-reviewSkill
- principle-redesign-from-first-principlesSkill
- productMangerSkill
- prototypeSkill
- retroSkill
- sherlock-holmesSkill
- testerSkill
- programming-theory-builderSkill
- to-specSkill
- unit-test-unslopSkill
- unslopSkill
- wayfinderSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
78 rules. 0 are common, 50 are distinctive, and 28 are very specific to this project.
0
Common
Most of the 47 edited versions we read keep these.
50
Distinctive
This author's own choices. Worth a look.
28
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 4
Use clear names and focused functions.
- Distinctive: line 5
Follow PEP 8 and type hints where they improve maintenance.
- Distinctive: line 6
Add tests before optimizing.
- Very specific: line 7
Use cProfile, time, tracemalloc, or benchmark tools to find real bottlenecks.
- Very specific: line 11
Membership testing: use set or frozenset, not repeatedly searching a list.
- Very specific: line 12
Key/value lookup: use dict.
- Very specific: line 13
Append and pop from the end: use list.
- Very specific: line 14
Frequent insert/remove at both ends: use deque.
- Very specific: line 15
Unique and order-independent values: use set.
- Very specific: line 16
Immutable sequence: consider tuple.
- Very specific: line 17
Large text built repeatedly: use "".join(parts), not repeated +=.
- Very specific: line 23
Use functools.lru_cache or functools.cache only for genuinely cacheable pure functions.
- Very specific: line 24
Avoid recalculating len(), attribute values or method calls in a tight loop.
- Very specific: line 38
Prefer built-in functions such as sum(), any(), all(), min(), max(), sorted(), enumerate() and zip().
- Distinctive: line 51
Use list, dict and set comprehensions for simple transformations.
- Distinctive: line 52
Avoid deeply nested comprehensions.
- Very specific: line 53
Use map() or filter() only if they are clearer or faster in context.
- Very specific: line 61
Use break to stop early.
- Distinctive: line 62
Avoid checking each item separately when vectorized or built-in operations exist.
- Distinctive: line 64
Use a copy or a separate result collection when values change.
- Very specific: line 74
Use with for files, locks, sockets and database connections.
- Distinctive: line 85
Avoid creating temporary lists when a generator is sufficient.
- Distinctive: line 88
Use slices carefully; slicing creates a new object.
- Distinctive: line 89
Prefer tuple unpacking and generator expressions for short-lived values.
- Distinctive: line 99
Put exception handling around only the potentially failing operation.
- Very specific: line 108
If there can be many misses, sometimes dict.setdefault() or defaultdict is better.
- Distinctive: line 112
Use f-strings for readable formatting.
- Distinctive: line 113
Use prefix/suffix checks and membership efficiently.
- Distinctive: line 114
Avoid parsing or splitting the same text repeatedly.
- Very specific: line 116
Use bytes only when binary data is intentional.
- Distinctive: line 124
Use connection pools for database or network resources.
- Distinctive: line 125
Avoid holding large resources inside loops.
- Distinctive: line 126
Use buffering for repeated file operations.
- Distinctive: line 127
Do not perform network requests in nested loops unless necessary.
- Distinctive: line 130
Use threading for I/O-bound tasks.
- Distinctive: line 131
Use multiprocessing for CPU-bound parallel work.
- Distinctive: line 133
Use async I/O for high-concurrency network or file tasks.
- Distinctive: line 135
Prefer queues and messages over shared mutable objects.
- Distinctive: line 139
Avoid global mutable state.
- Very specific: line 140
Avoid excessive reflection or dynamic exec.
- Very specific: line 141
Avoid repeated import calls inside loops.
- Distinctive: line 157
Avoid shallow assumptions about object copy behavior.
- Distinctive: line 158
Avoid long chains of attribute lookup when used repeatedly.
- Distinctive: line 161
Remove large references when no longer needed.
- Distinctive: line 162
Use generators for large sequences.
- Distinctive: line 164
Use weak references for optional object tracking.
- Very specific: line 165
Call gc.collect() manually only for specialized needs, not routinely.
- Distinctive: line 166
Avoid creating large temporary objects in comprehensions.
- Very specific: line 167
Use __slots__ only after measurement if many instances are created.
- Distinctive: line 179
Keep classes focused and small.
- Distinctive: line 180
Use properties when access behavior is truly needed.
- Distinctive: line 181
Avoid dynamic attribute lookup in hot loops.
- Distinctive: line 182
Prefer composition over complex inheritance.
- Distinctive: line 183
Use dataclasses for simple immutable or mutable data records.
- Very specific: line 184
Consider NamedTuple for lightweight, fixed records.
- Distinctive: line 196
Use generators for lazy processing.
- Distinctive: line 197
Avoid materializing a large iterator unless it must be reused.
- Very specific: line 202
Use assert only for internal invariants.
- Very specific: line 203
Never use assert for input validation.
- Distinctive: line 204
Use explicit exceptions for bad user or API input.
- Very specific: line 206
Avoid catching Exception unless the code can handle or re-raise it correctly.
- Very specific: line 207
Avoid swallowing KeyboardInterrupt and SystemExit.
- Distinctive: line 210
Add annotations to public APIs and complex functions.
- Very specific: line 212
Prefer precise types over Any.
- Very specific: line 213
Use typing.Protocol for structural interfaces.
- Very specific: line 214
Run mypy, pyright, or another checker consistently.
- Distinctive: line 218
Add unit tests for public behavior.
- Distinctive: line 219
Add regression tests for bugs.
- Distinctive: line 221
Test large inputs and boundary cases.
- Distinctive: line 222
Run tests under standard and free-threaded builds when relevant.
- Distinctive: line 223
Avoid micro-optimizations that make code harder to read without measurable benefit.
- Distinctive: line 226
Import only modules needed at startup.
- Distinctive: line 227
Use lazy imports for optional or rarely used dependencies.
- Distinctive: line 228
Avoid work at module import time.
- Distinctive: line 229
Use logging rather than print statements in libraries.
- Distinctive: line 230
Use a virtual environment for dependencies.
- Distinctive: line 232
Keep platform-specific code isolated.
- Distinctive: line 236
Before merging a performance-sensitive piece of code:
“Common” is measured: kept by at least 6 in 10 of the 47 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
Python Efficiency Checklist
1. Start with correctness
- Use clear names and focused functions.
- Follow PEP 8 and type hints where they improve maintenance.
- Add tests before optimizing.
- Use
cProfile,time,tracemalloc, or benchmark tools to find real bottlenecks. - Don’t optimize code until a benchmark proves it is slow.
2. Choose the right data structure
- Membership testing: use
setorfrozenset, not repeatedly searching a list. - Key/value lookup: use
dict. - Append and pop from the end: use
list. - Frequent insert/remove at both ends: use
deque. - Unique and order-independent values: use
set. - Immutable sequence: consider
tuple. - Large text built repeatedly: use
"".join(parts), not repeated+=.
3. Avoid repeated work
- Move constant work outside loops.
- Cache repeated function calls or expensive calculations.
- Reuse a regex compiled with
re.compile(). - Use
functools.lru_cacheorfunctools.cacheonly for genuinely cacheable pure functions. - Avoid recalculating
len(), attribute values or method calls in a tight loop.
# Avoid
for item in items:
result.append(process(item))
# Prefer if process() is expensive only for certain items
for item in eligible_items:
result.append(process(item))4. Use local variables and built-ins
- CPython local-variable access is faster than repeated global or attribute lookup.
- Prefer built-in functions such as
sum(),any(),all(),min(),max(),sorted(),enumerate()andzip().
# Less efficient
for i in range(len(items)):
print(i, items[i])
# More efficient
for i, item in enumerate(items):
print(i, item)5. Prefer comprehensions when they improve clarity
- Use list, dict and set comprehensions for simple transformations.
- Avoid deeply nested comprehensions.
- Use
map()orfilter()only if they are clearer or faster in context.
# Clear and usually efficient
names = [item.name for item in items if item.active]6. Be careful with loops
- Use
breakto stop early. - Avoid checking each item separately when vectorized or built-in operations exist.
- Don’t modify a list, set or dict while iterating over it.
- Use a copy or a separate result collection when values change.
result = []
for item in items:
if item.valid:
result.append(item.value)7. Use context managers and resources
- Use
withfor files, locks, sockets and database connections. - Close resources explicitly or let a context manager close them.
- Stream large files instead of reading everything into memory.
with open("data.txt", encoding="utf-8") as file:
for line in file:
process(line)8. Avoid unnecessary allocations
- Avoid creating temporary lists when a generator is sufficient.
- Don’t convert iterables to lists unless indexing or reuse requires it.
- Reuse immutable objects where practical.
- Use slices carefully; slicing creates a new object.
- Prefer tuple unpacking and generator expressions for short-lived values.
# Generator; no intermediate list is allocated
sum(value * 2 for value in values)9. Handle exceptions efficiently
- Exceptions should represent exceptional cases, not normal control flow.
- Catch specific exceptions.
- Put exception handling around only the potentially failing operation.
try:
value = mapping[key]
except KeyError:
value = defaultIf there can be many misses, sometimes dict.setdefault() or defaultdict is better.
10. Avoid common string costs
- Join strings instead of repeatedly concatenating.
- Use f-strings for readable formatting.
- Use prefix/suffix checks and membership efficiently.
- Avoid parsing or splitting the same text repeatedly.
- Normalize text once if it must be reused.
- Use
bytesonly when binary data is intentional.
text = "".join(parts)11. Optimize I/O
- Batch database writes or reads.
- Use connection pools for database or network resources.
- Avoid holding large resources inside loops.
- Use buffering for repeated file operations.
- Do not perform network requests in nested loops unless necessary.
12. Control concurrency correctly
- Use threading for I/O-bound tasks.
- Use multiprocessing for CPU-bound parallel work.
- Don’t assume threading will speed up Python CPU calculations in a standard GIL build.
- Use async I/O for high-concurrency network or file tasks.
- Protect shared mutable state with locks or synchronization primitives.
- Prefer queues and messages over shared mutable objects.
- Don’t create one lock or thread unnecessarily for every small operation.
13. Avoid unsafe or slow patterns
- Avoid global mutable state.
- Avoid excessive reflection or dynamic
exec. - Avoid repeated
importcalls inside loops. - Don’t use mutable defaults:
# Avoid
def add(item, items=[]):
...# Prefer
def add(item, items=None):
if items is None:
items = []- Avoid shallow assumptions about object copy behavior.
- Avoid long chains of attribute lookup when used repeatedly.
14. Memory management
- Remove large references when no longer needed.
- Use generators for large sequences.
- Be cautious with caches—they can grow indefinitely.
- Use weak references for optional object tracking.
- Call
gc.collect()manually only for specialized needs, not routinely. - Avoid creating large temporary objects in comprehensions.
- Use
__slots__only after measurement if many instances are created.
class Point:
__slots__ = ("x", "y")
def __init__(self, x, y):
self.x = x
self.y = y15. Classes and objects
- Keep classes focused and small.
- Use properties when access behavior is truly needed.
- Avoid dynamic attribute lookup in hot loops.
- Prefer composition over complex inheritance.
- Use dataclasses for simple immutable or mutable data records.
- Consider
NamedTuplefor lightweight, fixed records.
from dataclasses import dataclass
@dataclass(frozen=True, slots=True)
class Point:
x: float
y: float16. Generators and iterators
- Use generators for lazy processing.
- Avoid materializing a large iterator unless it must be reused.
- Remember that generators execute only when consumed.
- Close generators if they hold resources.
17. Debugging and safety
- Use
assertonly for internal invariants. - Never use
assertfor input validation. - Use explicit exceptions for bad user or API input.
- Return clear values or raise meaningful exceptions.
- Avoid catching
Exceptionunless the code can handle or re-raise it correctly. - Avoid swallowing
KeyboardInterruptandSystemExit.
18. Type hints
- Add annotations to public APIs and complex functions.
- Don’t spend effort annotating every trivial local.
- Prefer precise types over
Any. - Use
typing.Protocolfor structural interfaces. - Run
mypy,pyright, or another checker consistently. - Type hints should describe the program, not change runtime behavior.
19. Testing
- Add unit tests for public behavior.
- Add regression tests for bugs.
- Benchmark before and after optimization.
- Test large inputs and boundary cases.
- Run tests under standard and free-threaded builds when relevant.
- Avoid micro-optimizations that make code harder to read without measurable benefit.
20. Packaging and startup
- Import only modules needed at startup.
- Use lazy imports for optional or rarely used dependencies.
- Avoid work at module import time.
- Use logging rather than print statements in libraries.
- Use a virtual environment for dependencies.
- Pin dependencies for reproducible deployments.
- Keep platform-specific code isolated.
Practical review sequence
Before merging a performance-sensitive piece of code:
- Is it correct and readable?
- Are tests adequate?
- Are data structures appropriate?
- Are there unnecessary repeated loops or allocations?
- Are I/O and external calls batched?
- Are exceptions used for exceptional cases?
- Is there actual profiling evidence showing the current bottleneck?
- Does the optimization still make the code easier to maintain?
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.

