python
Skill20 starsChanged 7 months agoMITView on GitHub
Apply when writing Python code. Type hints, error handling, mutable defaults, async patterns, and packaging conventions.
26 other projects use a version of this.
Adopted by
Most recently taken up by
- niksavis/basiclytheir own version, first seen Oct 5, 2026
- lgzarturo/codeconductortheir own version, first seen Sep 30, 2026
- kissgyorgy/coding-agentstheir own version, first seen Sep 20, 2026
- jdharmon/skillstheir own version, first seen Sep 8, 2026
- erikhoward/agent-toolstheir own version, first seen Sep 7, 2026
- jawwad-ali/claude-code-skillstheir own version, first seen Sep 5, 2026
Used with
Projects with it also use cicd, security and 4 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.
ffsshhttiikkSkillcicd
Continuous integration and delivery pipelines
Also in 3 projects that use this
0xSeroSkillsecurity
Also in 7 projects that use this
shanggqmSkilldata-analysis
数据分析技能,提供结构化的数据查询、统计分析和报告生成工作流。当用户需要查询数据库、进行数据统计分析、生成分析报告时使用。按规范输出原始数据、计算结果、Markdown报告和HTML可视化报告。
Also in 3 projects that use this
AnthropicSkilldocumentation
Write and maintain technical documentation. Trigger with "write docs for", "document this", "create a README", "write a runbook", "onboarding guide", or when the user needs help with any form of technical writing — API docs, architecture docs, or operational runbooks.
Also in 3 projects that use this
MicrosoftSkillskill-creator
Guide for creating effective GitHub Copilot skills (.github/skills/) in this repository. Use when creating a new skill, updating an existing skill, or when asked about skill structure, format, or best practices for the vscode-documentdb project.
Also in 5 projects that use this
VercelSkillfrontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
Also in 3 projects that use this
Other versions26 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 26
- alinaqi/maggy★ 707same name
- Mindrally/skills★ 266same name
- martinholovsky/claude-skills-generator★ 47same name
- neuron-one/GODMODE★ 33same name
- nimadorostkar/Claude-Skills-collection★ 28same name
- siviter-xyz/dot-agent★ 22same name
- alexander-danilenko/cortex-ai-skills★ 16same name
- kissgyorgy/coding-agents★ 15same name
- jnotsknab/mux-swarm★ 9same name
- Cogni-AI-OU/cogni-ai-agent-skills★ 4same name
16 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 repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/brainstorming.mdcCursor rule
- .cursor/rules/branch-finishing.mdcCursor rule
- .cursor/rules/code-quality.mdcCursor rule
- .cursor/rules/db-schema.mdcCursor rule
- .cursor/rules/debugging.mdcCursor rule
- .cursor/rules/docker.mdcCursor rule
- .cursor/rules/domain-template.mdcCursor rule
- .cursor/rules/drawio.mdcCursor rule
- .cursor/rules/error-log.mdcCursor rule
- .cursor/rules/fastapi.mdcCursor rule
- .cursor/rules/git-conventions.mdcCursor rule
- .cursor/rules/github-cli.mdcCursor rule
- .cursor/rules/implementation-plan.mdcCursor rule
- .cursor/rules/langchain.mdcCursor rule
- .cursor/rules/python.mdcCursor rule
- .cursor/rules/react.mdcCursor rule
- .cursor/rules/review-deployment.mdcCursor rule
- .cursor/rules/security-review.mdcCursor rule
- .cursor/rules/self-extension-workflow.mdcCursor rule
- .cursor/rules/shell-scripting.mdcCursor rule
- .cursor/rules/svg-check.mdcCursor rule
- .cursor/rules/tdd.mdcCursor rule
- .cursor/rules/typescript.mdcCursor rule
- skill-everythingSkill
- brainstormingSkill
- branch-finishingSkill
- code-qualitySkill
- db-schemaSkill
- debuggingSkill
- dockerSkill
- domain-templateSkill
- drawioSkill
- error-logSkill
- fastapiSkill
- git-conventionsSkill
- github-cliSkill
- implementation-planSkill
- langchainSkill
- reactSkill
- review-deploymentSkill
- security-reviewSkill
- self-extension-workflowSkill
- shell-scriptingSkill
- svg-checkSkill
- tddSkill
- <kebab-case-name>Skill
- typescriptSkill
The file
We split this skill into the rules it gives an agent
4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Where these rules don't strictly apply: test fixtures, generated code, throwaway scripts, REPL exploration, and tutorial snippets may …
- Very specific: line 41
AVOID:
Anyas a shortcut: If the type is genuinely unknown, document why with a comment. - Very specific: line 65
SHOULD: Raise with context when re-raising: Use raise NewError("msg") from original_error to preserve the traceback chain, not raise …
- Very specific: line 89
MUST: Use
withfor file handles, sockets, and locks: Never open a file without a context manager.
“Common” is measured: kept by at least 6 in 10 of the 24 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
Sub-Skill: Python Best Practices
<!-- target: ~2200 tokens (real tiktoken count) | 20 rules with severity classification -->Purpose: Prevents the Python-specific mistakes LLMs make on autopilot — mutable defaults, bare excepts, missing guards, and subtle performance traps that pass review but break in production.
Rule classification
- MUST — load-bearing. Violating causes bugs, security issues, or invisible failures. Never break.
- SHOULD — default behavior. Deviation needs a documented reason in the code or PR.
- AVOID — usually wrong; documented exception inline where needed.
Where these rules don't strictly apply: test fixtures, generated code, throwaway scripts, REPL exploration, and tutorial snippets may legitimately differ. The rules below apply to production code paths and reusable libraries.
Rules
Type Hints
- SHOULD: Annotate function signatures with types.
def process(data)tells callers nothing. Usedef process(data: list[str]) -> dict[str, int]:. Return typeNoneshould be explicit too. Exception: lambdas and short generator helpers in private scope. - SHOULD: Use built-in lowercase generics for Python 3.9+.
list[str],dict[str, int],tuple[int, ...]rather thanList,Dict,Tuplefromtyping. - MUST: Use
Optional[X]orX | Nonefor nullable parameters, never a bare default ofNonewithout a type annotation.def find(id: int) -> User | None:notdef find(id):. - AVOID:
Anyas a shortcut. If the type is genuinely unknown, document why with a comment.Anysilences the type checker and hides bugs. Exception: third-party libraries without stubs and explicit dynamic-data boundaries (e.g. JSON decode at the API edge).
Error Handling
MUST: Never use bare
except:. It catchesSystemExit,KeyboardInterrupt, andGeneratorExit. Always catchexcept Exception:at minimum, or a specific exception class.# Wrong try: risky() except: pass # Correct try: risky() except ValueError as e: logger.warning("Invalid value: %s", e)- MUST: Never silently swallow exceptions with
pass. At minimum log the error. Silent failures produce ghost bugs that are impossible to trace. - SHOULD: Raise with context when re-raising. Use
raise NewError("msg") from original_errorto preserve the traceback chain, notraise NewError("msg")alone.
Common Pitfalls
MUST: Never use mutable default arguments. Python evaluates defaults once at function definition, not per call. The list or dict is shared across all calls.
# Wrong — items accumulates across calls def append_item(val, items=[]): items.append(val) return items # Correct def append_item(val, items=None): if items is None: items = [] items.append(val) return items- MUST: Guard script entry points with
if __name__ == "__main__":. Without it, importing the module executes top-level code, breaking tests and imports. MUST: Use
withfor file handles, sockets, and locks. Never open a file without a context manager.f = open(...)withoutwithleaks handles on exceptions.# Wrong f = open("data.txt") data = f.read() f.close() # Correct with open("data.txt") as f: data = f.read()AVOID: String concatenation in loops. Each
+=on a string creates a new object. Collect into a list and call"".join(parts)at the end.# Wrong — O(n^2) memory result = "" for word in words: result += word + " " # Correct result = " ".join(words)SHOULD: Use f-strings for string interpolation in Python 3.6+. Avoid
%formatting or"Hello " + name. F-strings are faster, safer, and readable.# Avoid msg = "User %s has %d items" % (name, count) # Prefer msg = f"User {name} has {count} items"- AVOID:
dict()constructor when a literal suffices.{}is faster and more idiomatic.dict(key=value)is only justified when keys are dynamic or come from variables.
Performance
SHOULD: Use list comprehensions or generator expressions instead of
map/filterwithlambda. Comprehensions are more readable and equally fast. Use generators when the full list is not needed at once.# Avoid result = list(map(lambda x: x * 2, items)) # Prefer result = [x * 2 for x in items] # For large data, use a generator total = sum(x * 2 for x in items)SHOULD: Use a
setfor membership lookups, not alist.x in listis O(n).x in setis O(1). Convert once, query many times.# Wrong for repeated lookups valid_ids = [1, 2, 3, ...] if user_id in valid_ids: # O(n) every call # Correct valid_ids = {1, 2, 3, ...} if user_id in valid_ids: # O(1)
Testing
- SHOULD: Name test functions to describe the scenario, not just the function under test.
test_process_returns_empty_dict_on_empty_inputnottest_process. - MUST: Never use
assertstatements in production code for validation.assertis stripped withpython -O. Use explicitifchecks withraise ValueError(...)for runtime validation. MUST: Use
pytest.raisesas a context manager to assert exceptions, never wrap in try/except inside a test. A bare try/except can mask a missing exception.# Wrong def test_bad_input(): try: process(None) except ValueError: pass # test passes even if no exception is raised # Correct def test_bad_input(): with pytest.raises(ValueError, match="input cannot be None"): process(None)- SHOULD: Use
@pytest.mark.parametrizeto test the same logic with multiple inputs. Write one parameterized test instead of duplicating test functions for each case. - SHOULD: Place shared fixtures in
conftest.pyat the nearest common ancestor directory. Do not scatter fixtures across individual test files. Pytest auto-discoversconftest.pyat every level. - MUST: Never return mutable objects directly from a pytest fixture. Each test must receive a fresh instance. Use factory fixtures that return a callable creating fresh objects. Reference: ERR-2026-014.
- AVOID: Fixtures with side effects (network, DB) without explicit scope. Use
scope="session"orscope="module"for expensive shared resources with proper teardown viayield. - SHOULD: Use the
tmp_pathfixture for filesystem tests instead of manual temporary directories. It auto-cleans and is process-safe.
Packaging
- SHOULD: Include
__init__.pyin every package directory. Without it, Python 3 treats the directory as a namespace package, which breaks relative imports and tool discovery in many environments. Exception: explicit namespace packages (PEP 420) where the omission is documented intent. - AVOID: Imports from
__init__.pyinside the same package's submodules. This creates circular imports. Keep__init__.pyas a re-export surface only, not a logic file. - SHOULD: Use
pyproject.tomlas the single source of project metadata. Avoidsetup.pyandsetup.cfgfor new projects. Modern tooling (pip, build, hatch, uv) all readpyproject.tomlnatively. - MUST: Pin exact versions in lock files but use ranges in
pyproject.tomldependencies. Lock files (uv.lock,poetry.lock) ensure reproducibility; flexible ranges in project metadata allow resolver to find compatible versions. - SHOULD: Define CLI entry points in
[project.scripts]instead of relying onpython -mpatterns. Entry points generate proper executables and integrate with system PATH.
Why This Sub-Skill Earns Stars
These rules target the exact failure modes that appear in LLM-generated Python:
- Mutable defaults and missing
__main__guards are invisible bugs that only surface at runtime. - Bare
except:and silentpassblocks make debugging take 10x longer. - String concatenation in loops and list membership checks are performance traps that scale badly.
- Missing type annotations and
Anyshortcuts defeat the entire value of static analysis. - Skipping
withfor file handles causes resource leaks under load.
None of these are caught by syntax checkers. All of them appear in production incidents. The MUST/SHOULD/AVOID classification means the security/correctness rules are strict and the stylistic rules respect context.
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.

