django-patterns
Skill8 starsChanged 19 days agoMITView on GitHub
Django app-layer and ORM conventions. Use when editing models, views, serializers, admin, managers, signals, migrations, or querysets.
29 other projects use a version of this.
Adopted by
Most recently taken up by
- Rojios/everything-claude-codetheir own version, first seen Nov 8, 2026
- GstMirabal/Token-Optimized-Agent-Pipelinetheir own version, first seen Nov 8, 2026
- ControllableModel/SWE-Skills-Benchtheir own version, first seen Nov 8, 2026
- pankaj-mahaur/Agent-Daemontheir own version, first seen Nov 6, 2026
- ku5ic/claude-kittheir own version, first seen Nov 4, 2026
- TsinHzl/claude-code-configtheir own version, first seen Nov 1, 2026
Used with
Projects with it also use django-tdd, springboot-tdd and 6 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.
FaisalAlqarniSkilldjango-tdd
Django testing strategies with pytest-django, TDD methodology, factory_boy, mocking, coverage, and testing Django REST Framework APIs.
Also in 6 projects that use this
AshfaqbsSkillspringboot-tdd
Test-driven development for Spring Boot using JUnit 5, Mockito, MockMvc, Testcontainers, and JaCoCo. Use when adding features, fixing bugs, or refactoring.
Also in 4 projects that use this
seikaikyoSkillfastapi-patterns
FastAPI + SQLModel + Neon PostgreSQL 後端開發最佳實踐。適用於 Render 部署的 API 服務。涵蓋路由設計、資料庫操作、錯誤處理、認證授權。
Also in 3 projects that use this
royaluniondesign-sysSkilldeployment-patterns
Deployment workflows, CI/CD pipeline patterns, Docker containerization, health checks, rollback strategies, and production readiness checklists for web applications.
Also in 3 projects that use this
lodetomasiSkilltdd-workflow
Test-Driven Development workflow with red-green-refactor pattern and best practices
Also in 5 projects that use this
OpenAISkillsecurity-scan
Use for a standard, single-pass security audit of an entire repository or a scoped path, package, folder, or submodule with no diff to review. This is the default repository scan. Do not use for PR, commit, branch, or working-tree diffs, or for deep, multi-pass scans.
Also in 4 projects that use this
Other versions29 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 29
- loulanyue/awesome-claude-notes★ 272same name
- tranhieutt/software_development_department★ 71same name
- Fmarzochi/EGC★ 61same name
- skateddu/claude-code-python-setup★ 28same name
- FaisalAlqarni/sp-ecc★ 9same name
- ControllableModel/SWE-Skills-Bench★ 8same name
- gongyijie85/dsh-ecc★ 8same name
- Lukasbrujula/claude-code-framework★ 4same name
- theyoungastronauts/polaris★ 4same name
- peopleforrester/claude-dotfiles★ 3same name
19 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.
- CLAUDE.mdCLAUDE.md
- home/CLAUDE.mdCLAUDE.md
- run-claude-code-configSkill
- adrSkill
- api-designSkill
- commitSkill
- docker-patternsSkill
- eow-reviewSkill
- git-workflowSkill
- hotfixSkill
- infrastructureSkill
- laterSkill
- mkdocs-styleSkill
- project-setupSkill
- prSkill
- refinementSkill
- security-patternsSkill
- standupSkill
- statusSkill
- testing-patternsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
20 rules. 0 are common, 6 are distinctive, and 14 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
14
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Put business logic in model methods, not views
- Distinctive: line 12
Use model methods for validation, state transitions, and computed properties
- Very specific: line 13
Use @property for derived attributes that don't need arguments
- Very specific: line 17
Use custom managers for reusable query logic (objects = MyManager())
- Distinctive: line 20
Never put raw SQL in views -- encapsulate in manager methods
- Very specific: line 24
Always use select_related() for ForeignKey/OneToOne joins
- Very specific: line 25
Always use prefetch_related() for ManyToMany/reverse FK
- Very specific: line 26
Use only() / defer() to limit fetched columns when appropriate
- Very specific: line 27
Use values() / values_list() for read-only aggregation queries
- Very specific: line 29
Use django-debug-toolbar or EXPLAIN to verify query plans
- Distinctive: line 33
Avoid signals for business logic -- prefer explicit method calls
- Very specific: line 35
Always use dispatch_uid to prevent duplicate registration
- Distinctive: line 36
Keep signal handlers small and fast -- offload heavy work to tasks
- Distinctive: line 37
Document which signals exist and what they do
- Very specific: line 42
Use RunPython with both forward and reverse functions
- Very specific: line 44
Always test migrations with --plan before applying
- Very specific: line 45
Use AddIndex / RemoveIndex separately from schema changes for zero-downtime
- Very specific: line 51
Use list_select_related to avoid N+1 in admin list views
- Very specific: line 52
Use raw_id_fields for ForeignKey fields with many options
- Very specific: line 53
Add readonly_fields for computed or audit fields
“Common” is measured: kept by at least 6 in 10 of the 4 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
Django Patterns
Fat Models, Thin Views
- Put business logic in model methods, not views
- Views should handle HTTP concerns only: parse request, call model/service, return response
- Use model methods for validation, state transitions, and computed properties
- Use
@propertyfor derived attributes that don't need arguments
Custom Managers and QuerySets
- Use custom managers for reusable query logic (
objects = MyManager()) - Define custom QuerySet classes and use
as_manager()for chainable filters - Common patterns:
active(),for_user(user),with_related() - Never put raw SQL in views -- encapsulate in manager methods
Query Optimization
- Always use
select_related()for ForeignKey/OneToOne joins - Always use
prefetch_related()for ManyToMany/reverse FK - Use
only()/defer()to limit fetched columns when appropriate - Use
values()/values_list()for read-only aggregation queries - Watch for N+1 queries in serializers and templates
- Use
django-debug-toolbarorEXPLAINto verify query plans
Signals
- Avoid signals for business logic -- prefer explicit method calls
- Acceptable uses: audit logging, cache invalidation, denormalization
- Always use
dispatch_uidto prevent duplicate registration - Keep signal handlers small and fast -- offload heavy work to tasks
- Document which signals exist and what they do
Migration Patterns
- One migration per logical change -- don't combine unrelated changes
- Use
RunPythonwith both forward and reverse functions - For large tables, consider batched data migrations
- Always test migrations with
--planbefore applying - Use
AddIndex/RemoveIndexseparately from schema changes for zero-downtime - Name migrations descriptively:
0042_add_user_email_verified_field
Admin Configuration
- Register all models with at least
list_displayandsearch_fields - Use
list_select_relatedto avoid N+1 in admin list views - Use
raw_id_fieldsfor ForeignKey fields with many options - Add
readonly_fieldsfor computed or audit fields
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.

