python-coding
Skill4 starsChanged 5 months agoMITView on GitHub
Enforces Python 3.14 code style, logging rules, type annotations, design patterns, testing strategy, and clean code principles for the appkit project. Apply automatically whenever writing, reviewing, or refactoring Python code, creating new modules, or adding tests.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- fclabs/skillstheir own version, first seen Sep 3, 2026
- Himeyama/DESIGNtheir own version, first seen Aug 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- fclabs/skills★ 1same name
- Himeyama/DESIGN★ 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 repository28 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- llms.txtllms.txt
- appkit-commonsSkill
- boostSkill
- code-cleanupSkill
- commit-msgSkill
- create-readmeSkill
- docker-multi-stageSkill
- frontend-designSkill
- github-actions-cicdSkill
- python-clean-codeSkill
- reflex-docsSkill
- reflex-state-and-architectureSkill
- reflex-testing-stateSkill
- releaseSkill
- runic-migrateSkill
- runic-ogmSkill
- terraform-azure-verified-modulesSkill
- terraform-refactor-moduleSkill
- terraform-run-acceptance-testsSkill
- terraform-search-importSkill
- terraform-stacksSkill
- terraform-style-guideSkill
- terraform-testSkill
- appkit-commonsSkill
- appkit-mantine-referenceSkill
- appkit-userSkill
The file
We split this skill into the rules it gives an agent
11 rules. About 0 are common, 4 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Python 3.14: only; deps via uv; line length 88 chars (Ruff/Black).
- Very specific: line 37
Never use print or printf.
- Very specific: line 48
Do not mix Literal[...] with str — pick one.
- Distinctive: line 49
Remove unused imports immediately (F401).
- Very specific: line 50
Remove unused args or prefix with _ (ARG001).
- Distinctive: line 68
No Python file may exceed 1000 lines.
- Very specific: line 86
No credentials in code/history.
- Very specific: line 89
Use appkit_commons.database.session_manager.get_session_manager().session() for DB access outside Reflex handlers (not rx.session()).
- Very specific: line 104
Do NOT use --autogenerate for Alembic migrations.
- Distinctive: line 110
Read the docs first: If something isn't working, use Context7 or DuckDuckGo to verify the correct API — never guess or change code blindly.
- Very specific: line 111
Write or adjust tests first (tests/test_*.py).
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.
Files
Writing Python Code
Quick reference
- Python 3.14 only; deps via uv; line length 88 chars (Ruff/Black).
- No f-strings in logger calls — use
log.info("x: %s", val). - Type annotations on every function and method.
- Files ≤ 1000 lines — refactor via Extract Class, Mixins, Strategy, etc.
- Coverage ≥ 80% for non-Reflex classes and Reflex State classes.
- Task runner:
task format,task lint,task test(notmake).
Code style
Logging
import logging
log = logging.getLogger(__name__)
log.info("Loaded items: %d", count) # ✅ parameterized
# log.info(f"Loaded items: {count}") # ❌ f-stringNever use print or printf. Log levels: debug → internal state (default), info → milestones, warning → recoverable, error → serious.
Type hints
def process(data: dict[str, Any], count: int = 0) -> list[str]: ...
async def handler(value: str) -> AsyncGenerator[Any, Any]:
yield- Do not mix
Literal[...]withstr— pick one. - Remove unused imports immediately (F401).
- Remove unused args or prefix with
_(ARG001).
Imports & formatting
- Ruff handles lint + format; run
task formatbefore committing. - Break long calls/strings to fit 88 chars.
Ruff rules to watch (project-specific)
| Code | Rule | Fix |
| UP031 | No %-formatting outside logger calls — use f-strings | Replace "x %s" % val with f"x {val}" |
| I001 | Import order | Auto-fixed by task format |
| PLC0415 | No local imports inside functions or test methods | Move to top of file |
| B017 | pytest.raises(Exception) too broad | Use specific exception, e.g. pytest.raises(ValidationError) |
File size rule
No Python file may exceed 1000 lines. When approaching the limit, apply clean code refactoring strategies.
Design patterns & refactoring strategies: See skill python-clean-code.
Testing
Coverage target: ≥ 80% for services, repositories, models, utilities, and Reflex State classes. UI component rendering is best-effort.
task test # full suite with coverage
uv run pytest tests -k assistant # targeted
uv run pytest tests -x # stop on first failureTest patterns, fixtures, Reflex State testing: See references/testing.md.
Security & config
- No credentials in code/history; use
.envlocally, Key Vault in prod. - Access Pydantic
SecretStrvia.get_secret_value(). - Parameterized logs; avoid sensitive values.
- Use
appkit_commons.database.session_manager.get_session_manager().session()for DB access outside Reflex handlers (notrx.session()).
Database operations
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
async def get_user(session: AsyncSession, user_id: int) -> User | None:
result = await session.execute(
select(User).where(User.id == user_id)
)
return result.scalar_one_or_none()- Do NOT use
--autogeneratefor Alembic migrations; write them manually. - BaseRepository methods must not commit; transaction boundaries are owned by the caller.
Workflow
task syncto install/update deps.- Read the docs first. If something isn't working, use Context7 or DuckDuckGo to verify the correct API — never guess or change code blindly.
- Write or adjust tests first (
tests/test_*.py). - Implement minimal diff.
task format && task lint && task test.- Conventional Commits:
feat:,fix:,refactor:,test:,chore:.
Pre-commit checklist
- Tests pass (
task test) - Coverage ≥ 80%
- Lint/format clean (
task format && task lint) - No file exceeds 1000 lines
- No secrets in code
- Logging uses parameterized formatting
- All functions have type annotations
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.

