원클릭으로
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.