add-field
Add a new field to a Django model and propagate to admin, serializer, and factory. Use when adding model fields or database columns.
- License 许可
- MIT
- 最近更新
- 2026-04-10
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- name
- add-field
- description
- Add a new field to a Django model and propagate to admin, serializer, and factory. Use when adding model fields or database columns.
02 资源文件 6
- 参考文档recipe.yaml1.3 KB
- 其他templates/admin_field.j227 B
- 其他templates/factory_field.j244 B
- 其他templates/model_field.j264 B
- 其他templates/serializer_field.j231 B
- 参考文档templates/vars.tmpl.json183 B
03 SKILL.md 正文
Add Field
Add a field to a Django model and propagate it to admin, serializer, and factory.
Template-First Mode
This variant is template-first. Start by using template files as the source of truth:
templates/model_field.j2templates/admin_field.j2templates/serializer_field.j2templates/factory_field.j2templates/vars.tmpl.json
Map the user request into the vars shape, then apply the corresponding edits directly.
Variables
- model_name: Model class name (e.g.
Reservation) - field_name: New field name (e.g.
loyalty_tier) - field_type: Django field type (e.g.
CharField) - field_args: Field arguments (e.g.
max_length=20, default=\"bronze\") - factory_default: Factory default value (e.g.
\"bronze\")
Rendered Example For This Task
Given:
model_name=Reservationfield_name=loyalty_tierfield_type=CharFieldfield_args=max_length=20, default="bronze"factory_default="bronze"
Render to these exact line shapes:
- model line:
loyalty_tier = models.CharField(max_length=20, default="bronze") - admin list_display entry:
"loyalty_tier", - serializer fields entry:
"loyalty_tier", - factory line:
loyalty_tier = "bronze"
Gotchas
- Keep variable normalization consistent with
templates/vars.tmpl.json. - Keep indentation exactly as shown by each template snippet.
- Add only the required field propagation edits; avoid unrelated refactors.
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
暂无简介