query-layer-discipline
Keep reads in selectors/querysets and keep write logic in services without using jig.
- License 许可
- MIT
- 最近更新
- 2026-04-10
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- query-layer-discipline
- description
- Keep reads in selectors/querysets and keep write logic in services without using jig.
03 SKILL.md 正文
Query Layer Discipline (Control)
Use this skill when introducing new read patterns. Implement the file edits directly. Do not return a checklist-only response.
Required Variables
model_namequeryset_namemanager_nameselector_nameselector_fileview_name
Required Output Contract
- Modify
models.py,selectors.py, andviews.py. - In
models.py, defineclass EntityQuerySet(models.QuerySet)with anactive(self)method returningself.filter(status="active"). - In
models.py, defineclass EntityManager(models.Manager)with:
get_queryset(self)returningEntityQuerySet(self.model, using=self._db)active(self)returningself.get_queryset().active()
- In
class Entity(models.Model), assignobjects = EntityManager()before the field declarations. - In
selectors.py, importEntityfrom.models. - In
selectors.py, definedef select_active_entities():returning a parenthesized chained expression:
Entity.objects.active().select_related()
- In
views.py, importselect_active_entitiesfrom.selectors. - In
entity_list, assignrecords = select_active_entities()and preservereturn {"results": []}.
Guardrails
- Avoid query logic scattered in views.
- Use the exact identifiers provided in the required variables.
- Do not introduce additional selector helpers or unrelated view changes.
04 同仓库更多 Skills
velocity
Systematic DX improvement hunt — find friction, inconsistency, and missing abstractions across PRs, code, or tickets, then feed findings into /improve. Use when looking for ways to accelerate development or compound Claude Code's utility.
upgrade
Upgrade an existing skill or agent by auditing it, gathering user references, and rewriting it with real content. Use when a skill is thin, sloppy, missing gotchas, or needs improvement. Different from /improve which creates new extensions.
improve
Deliberately improve Claude Code by creating or updating skills, agents, hooks, rules, or MCP servers. Use when Claude keeps making the same mistake, a workflow is tedious, a new pattern needs enforcement, or you want to compound Claude's utility.
clean-copy
Recreate the current branch with a clean, narrative commit history. Use before creating a PR from a messy development branch, after exploratory coding with WIP commits, or when commit history is hard to review.
audit
Audit installed skills and agents against best practices. Use when reviewing skill quality, checking for common problems, or before upgrading existing skills. Read-only — produces a report, changes nothing.
typescript-update-model
暂无简介