Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

backend-orm-review

FreeNo executable scriptsNot checked

Use before reviewing Django ORM usage in backend/**, such as queries, bulk writes, GraphQL optimization, migrations, and test data.

City-of-Helsinkiby City-of-Helsinki★ 26 GitHub stars

About this skill

Read the rules in .agents/docs/backend-orm.md.

Steps

  1. Find the target. If backend-review called this skill, use its target. Otherwise, use the same order as backend-review: what the user said, then uncommitted changes, then committed changes on this branch up to its merge base.
  2. Trace every call. For each changed line that can reach the database, follow each call into our code (tilavarauspalvelu/ and utils/). This includes methods, properties, lookup properties, actions, validators, serializers, permission checks, and signal receivers in tilavarauspalvelu/signals.py. The step is done when every call path ends in a known query or in code that does not touch the database.
  3. 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.
  4. Report. Apply every rule in .agents/docs/backend-orm.md to 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. If backend-review called 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 with poetry run pytest.
  • Count queries with the query_counter fixture (len(counter.queries), counter.log). For GraphQL, use len(response.queries) and response.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 have tests/test_admin/test_admin_query_counts.py for 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
Sign up freeI already have an account

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

Compare backend-orm-review with