backend-orm-review
FreeNo executable scriptsNot checkedUse before reviewing Django ORM usage in backend/**, such as queries, bulk writes, GraphQL optimization, migrations, and test data.
by City-of-Helsinki★ 26 GitHub starsAbout this skill
Read the rules in .agents/docs/backend-orm.md.
Steps
- Find the target. If
backend-reviewcalled this skill, use its target. Otherwise, use the same order asbackend-review: what the user said, then uncommitted changes, then committed changes on this branch up to its merge base. - Trace every call. For each changed line that can reach the database, follow each call into our code
(
tilavarauspalvelu/andutils/). This includes methods, properties, lookup properties,actions,validators, serializers, permission checks, and signal receivers intilavarauspalvelu/signals.py. The step is done when every call path ends in a known query or in code that does not touch the database. - Measure. When a finding depends on the number of queries, write a throwaway test and run it.
See
Throwaway tests. Delete the test file when you have the numbers. - Report. Apply every rule in
.agents/docs/backend-orm.mdto the target. Number each finding (#1,#2,#3, ...). State one issue per finding. Link to the file and line. Order findings by importance, most important first. Give the measured query count when you have one. Ifbackend-reviewcalled this skill, add the findings to its list instead.
Throwaway tests
- Put the test in
tests/test_orm_review_tmp.py. Run only that file withpoetry run pytest. - Count queries with the
query_counterfixture (len(counter.queries),counter.log). For GraphQL, uselen(response.queries)andresponse.query_log. - To find an N+1, run the same code with 2 rows and then with 3 rows. If the count grows with the rows, the code makes queries in a loop.
- When a hot path has a fixed query count, suggest a real test that asserts it with
response.assert_query_count(). Admin pages havetests/test_admin/test_admin_query_counts.pyfor this.
Install backend-orm-review in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
FAQ
What does the backend-orm-review skill do?
Use before reviewing Django ORM usage in backend/**, such as queries, bulk writes, GraphQL optimization, migrations, and test data.
How do I install the backend-orm-review skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the backend-orm-review skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
by Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
by Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
by Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
by Anthropic