ワンクリックで
ui-template-with-cotton-or-partials
Creates Django template UI using Cotton components and/or Django partials for DRY, reusable code.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Creates Django template UI using Cotton components and/or Django partials for DRY, reusable code.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Creates a new app from a template if present and adds it to settings and URLs
Use feature switches to control introduction of new functionality and regressions with Django Waffle
| name | ui-template-with-cotton-or-partials |
| description | Creates Django template UI using Cotton components and/or Django partials for DRY, reusable code. |
| allowed-tools | Read, Grep, Glob, Bash(bash scripts/*), Bash(git clone:*github.com/wrabit/django-cotton*) |
https://github.com/wrabit/django-cotton
To use documentation make sure that Cotton's documentation is present and has been updated in the last two weeks. Use scripts/update_cotton_documentation.bash for this, it is idempotent and can be run before consulting documentation.
Documentation for cotton is available in the "documentation" directory.
Documentation for Django's templates is available in reference/django_template_partial.md
Create DRY code with regards to template UI so that when we change elements there will not be inconsistencies. Also reuse UI code to have the same UI elements within the application
If pip is used:
pip install django-cotton
If uv is used:
uv add django-cotton
In settings.py make sure that INSTALLED_APPS contains 'django_cotton'.
Create UI elements per usual for Django. Then for each one which is used more than once contemplate if it should be abstracted to a partial or to a Cotton component as described above.
Check if Tailwind CSS is present in the project. If so, use it as much as you can while creating UI code. Check for existing CSS, usually an input.css in the project which may contain classes and definitions of the project; use those everywhere you can on generated code.
Request the user to have Django 5.2+ installed to be able to use partials. Install Cotton if it is not there. Write cotton components in the appropriate directory for the module, "COTTON_DIR" in settings or default to "cotton". Refer to the documentation for tool's usage.
Do not suggest to create cotton components in layout files inherited from other templates.