[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M76XB458BXHZJGK7N4HDGS5T":3,"skill-same:01M76XB458BXHZJGK7N4HDGS5T":58},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":35,"commitSha":36,"skillDirectory":37,"forksCount":38,"repositoryHtmlUrl":39,"repositoryHomepageUrl":6,"ownerHtmlUrl":40,"ownerBlogUrl":41,"ownerDescription":42,"updatedAt":43,"install":44,"resources":57},"01M76XB458BXHZJGK7N4HDGS5T","drf",null,"Django REST Framework scaffolding best practices, and gotchas.","javimosch\u002Fopen-claw-skills","javimosch","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F12900508?v=4","01M6D3F2AS6PV75ET9PZ1QGP8J","Javier Leandro Arancibia","01M75B8NCTAJG9WH5YNZH7C3D8",0,"MIT","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpradeepcep\u002Fdrf\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: drf\ndescription: Django REST Framework scaffolding best practices, and gotchas.\nhomepage: \"https:\u002F\u002Fgithub.com\u002Fpradeepcep\u002Fopenclaw-drf\"\nmetadata: {\"clawdbot\":{\"emoji\":\"🔥\",\"requires\":{\"bins\":[\"python3\"]},\"os\":[\"linux\",\"darwin\",\"win32\"]}}\n\n---\n\n# Django REST Framework\n\nThis skill details how to generate, configure, and enhance REST APIs using **Django + Django REST Framework (DRF)**. It includes instructions on project setup, API structure, serializers, viewsets, routing, authentication, performance optimization, testing, and common pitfalls.\n\n\n## Overview\n\nUse this skill when you:\n\n-   Start a Django + Django REST Framework (DRF) project\n-   Work on a Django project that uses Django REST Framework (DRF)\n-   Work on a Python project that lists `djangorestframework` in its `requirements.txt` or `pyproject.toml`\n-   Create REST API endpoints in a Django project\n-   Add, modify, or apply best practices for serializers, views, viewsets, permissions, authentication, pagination, filtering in a Django project\n-   Optimize database queries and API performance in a Django project\n\n\n## Start a Project\n\n### 1. Create & Activate Virtual Environment\n\n``` bash\npython3 -m venv .venv\nsource .venv\u002Fbin\u002Factivate\npip install django djangorestframework\ndjango-admin startproject project .\n```\n\n### 2. Create an App\n\n``` bash\npython manage.py startapp [appname or \"api\"]\n```\n\n### 3. Configure Django REST Framework\n\nAdd to `settings.py`:\n\n``` python\nINSTALLED_APPS = [\n    \"rest_framework\",\n    appname or \"api\",\n]\n\nREST_FRAMEWORK = {\n    \"DEFAULT_PERMISSION_CLASSES\": [\n        \"rest_framework.permissions.IsAuthenticated\",\n    ],\n    \"DEFAULT_RENDERER_CLASSES\": [\n        \"rest_framework.renderers.JSONRenderer\",\n    ],\n    \"DEFAULT_FILTER_BACKENDS\": [\n        \"django_filters.rest_framework.DjangoFilterBackend\",\n    ],\n    \"DEFAULT_PAGINATION_CLASS\": \"rest_framework.pagination.LimitOffsetPagination\",\n    \"PAGE_SIZE\": 10,\n}\n```\n\n\n## Core Principles\n\n### Serializers\n\n-   Prefer `ModelSerializer` to reduce boilerplate.\n-   Keep serializers focused on **validation and representation**.\n-   Use separate serializers for:\n    -   list vs detail\n    -   read vs write\n    -   public vs internal APIs\n-   Add serializers to a `serializers.py` file inside the appropriate Django app\n\nExample:\n\n``` python\n# File: accounts\u002Fserializers.py\nclass UserSerializer(serializers.ModelSerializer):\n    class Meta:\n        model = User\n        fields = [\"id\", \"username\", \"email\"]\n```\n\n### Views & ViewSets\n\n-   Use `ViewSet` or `ModelViewSet` for standard CRUD APIs.\n-   Override `get_queryset()` instead of filtering in the serializer.\n-   Keep views thin, and use features from DRF parent classes as much as possible\n-   Always return responses in the configured format (fallback to json)\n-   Always put views in the `views.py` file inside the appropriate Django app\n\nExample:\n\n``` python\n# File: accounts\u002Fviews.py\nclass UserViewSet(ModelViewSet):\n    serializer_class = UserSerializer\n\n    def get_queryset(self):\n        return User.objects.filter(is_active=True)\n```\n\n### Routing\n\n-   Use DRF routers for consistency and discoverability.\n-   Avoid deeply nested URLs unless strictly necessary.\n-   Put routers in a `urls.py` file inside the appropriate Django app\n-   Make sure the `urls.py` inside the Django app is included in the main `urls.py`\n\nExample:\n\n``` python\n# File: accounts\u002Furls.py\nrouter = DefaultRouter()\nrouter.register(\"users\", UserViewSet)\nurlpatterns = router.urls\n```\n\nExample:\n```python\n# File: project\u002Furls.py\n\nurlpatterns = [\n    path(\"\", include(\"accounts.urls\")),\n]\n```\n\n## Authentication & Permissions\n\n### Authentication\n\n-   Prefer stateless authentication for APIs.\n-   Token-based or JWT authentication is recommended.\n-   Never rely on session authentication for public APIs unless\n    explicitly required.\n\n### Permissions\n\n-   Always define explicit permissions.\n-   Default to secure (`IsAuthenticated`) rather than open.\n-   Use custom permission classes for fine-grained control.\n-   Create custom permissions inside a `permissions.py` file inside the appropriate Django app.\n\nExample:\n\n``` python\npermission_classes = [IsAuthenticated]\n```\n\n\n## Pagination, Filtering & Throttling\n\n### Pagination\n\n-   Always paginate list endpoints.\n-   Avoid returning unbounded querysets.\n\n### Filtering\n\n-   Filter in `get_queryset()` using request parameters.\n-   Validate query params explicitly.\n\n### Throttling\n\nProtect APIs from abuse:\n\n``` python\nREST_FRAMEWORK = {\n    \"DEFAULT_THROTTLE_CLASSES\": [\n        \"rest_framework.throttling.AnonRateThrottle\",\n        \"rest_framework.throttling.UserRateThrottle\",\n    ],\n    \"DEFAULT_THROTTLE_RATES\": {\n        \"anon\": \"100\u002Fday\",\n        \"user\": \"1000\u002Fday\",\n    },\n}\n```\n\n\n## Performance Best Practices\n\n### Query Optimization\n\n-   Always inspect query counts in list views.\n-   Use `select_related()` for foreign keys.\n-   Use `prefetch_related()` for many-to-many and reverse relations.\n\nExample:\n\n``` python\n# File: orders\u002Fviews.py\ndef get_queryset(self):\n    return Order.objects.select_related(\"customer\").prefetch_related(\"items\")\n```\n\n\n### Caching\n\n-   Cache expensive read-heavy endpoints.\n-   Use Redis or Memcached.\n-   Never cache user-specific responses globally.\n\n\n## Testing\n\n-   Write tests for:\n    -   serializers\n    -   permissions\n    -   edge cases\n-   Use `APITestCase` and `APIClient`.\n-   Test both success and failure paths.\n\n\n## Common Gotchas & Pitfalls\n\n### Bulky Views \u002F Bulky Serializers\n\nAvoid putting business logic inside:\n    - serializers\n    - views\n    - permission classes\n\nInstead, use:\n    - service modules\n    - domain logic in models\n    - reusable helper functions\n\n### N+1 Query Problems\n\nDRF does **not** optimize queries automatically. Missing\n`select_related()` or `prefetch_related()` will silently destroy\nperformance.\n\n### Silent Security Bugs\n\nCommon mistakes:\n    - Forgetting permission classes\n    - Allowing unauthenticated access by default\n    - Exposing writeable fields unintentionally\n    - Exposing passwords or secret fields in response\n\nAlways audit:\n    - serializer `fields`\n    - permission classes\n    - allowed HTTP methods\n\n\n### Assuming Async Behavior\n\nDjango REST Framework is **primarily synchronous**.\n\nDo not assume:\n    - async views improve performance automatically\n    - background tasks belong in request\u002Fresponse cycles\n\nUse task queues (Celery etc.) for long-running work.\n\n\n## Example Commands\n\n``` bash\npython manage.py makemigrations\npython manage.py migrate\npython manage.py createsuperuser\npython manage.py runserver\n```\n\n## 📝 References\n\n-   Django documentation\n-   Django REST Framework documentation\n-   Real-world production DRF patterns\n","# Django REST Framework\n\nThis skill details how to generate, configure, and enhance REST APIs using **Django + Django REST Framework (DRF)**. It includes instructions on project setup, API structure, serializers, viewsets, routing, authentication, performance optimization, testing, and common pitfalls.\n\n\n## Overview\n\nUse this skill when you:\n\n-   Start a Django + Django REST Framework (DRF) project\n-   Work on a Django project that uses Django REST Framework (DRF)\n-   Work on a Python project that lists `djangorestframework` in its `requirements.txt` or `pyproject.toml`\n-   Create REST API endpoints in a Django project\n-   Add, modify, or apply best practices for serializers, views, viewsets, permissions, authentication, pagination, filtering in a Django project\n-   Optimize database queries and API performance in a Django project\n\n\n## Start a Project\n\n### 1. Create & Activate Virtual Environment\n\n``` bash\npython3 -m venv .venv\nsource .venv\u002Fbin\u002Factivate\npip install django djangorestframework\ndjango-admin startproject project .\n```\n\n### 2. Create an App\n\n``` bash\npython manage.py startapp [appname or \"api\"]\n```\n\n### 3. Configure Django REST Framework\n\nAdd to `settings.py`:\n\n``` python\nINSTALLED_APPS = [\n    \"rest_framework\",\n    appname or \"api\",\n]\n\nREST_FRAMEWORK = {\n    \"DEFAULT_PERMISSION_CLASSES\": [\n        \"rest_framework.permissions.IsAuthenticated\",\n    ],\n    \"DEFAULT_RENDERER_CLASSES\": [\n        \"rest_framework.renderers.JSONRenderer\",\n    ],\n    \"DEFAULT_FILTER_BACKENDS\": [\n        \"django_filters.rest_framework.DjangoFilterBackend\",\n    ],\n    \"DEFAULT_PAGINATION_CLASS\": \"rest_framework.pagination.LimitOffsetPagination\",\n    \"PAGE_SIZE\": 10,\n}\n```\n\n\n## Core Principles\n\n### Serializers\n\n-   Prefer `ModelSerializer` to reduce boilerplate.\n-   Keep serializers focused on **validation and representation**.\n-   Use separate serializers for:\n    -   list vs detail\n    -   read vs write\n    -   public vs internal APIs\n-   Add serializers to a `serializers.py` file inside the appropriate Django app\n\nExample:\n\n``` python\n# File: accounts\u002Fserializers.py\nclass UserSerializer(serializers.ModelSerializer):\n    class Meta:\n        model = User\n        fields = [\"id\", \"username\", \"email\"]\n```\n\n### Views & ViewSets\n\n-   Use `ViewSet` or `ModelViewSet` for standard CRUD APIs.\n-   Override `get_queryset()` instead of filtering in the serializer.\n-   Keep views thin, and use features from DRF parent classes as much as possible\n-   Always return responses in the configured format (fallback to json)\n-   Always put views in the `views.py` file inside the appropriate Django app\n\nExample:\n\n``` python\n# File: accounts\u002Fviews.py\nclass UserViewSet(ModelViewSet):\n    serializer_class = UserSerializer\n\n    def get_queryset(self):\n        return User.objects.filter(is_active=True)\n```\n\n### Routing\n\n-   Use DRF routers for consistency and discoverability.\n-   Avoid deeply nested URLs unless strictly necessary.\n-   Put routers in a `urls.py` file inside the appropriate Django app\n-   Make sure the `urls.py` inside the Django app is included in the main `urls.py`\n\nExample:\n\n``` python\n# File: accounts\u002Furls.py\nrouter = DefaultRouter()\nrouter.register(\"users\", UserViewSet)\nurlpatterns = router.urls\n```\n\nExample:\n```python\n# File: project\u002Furls.py\n\nurlpatterns = [\n    path(\"\", include(\"accounts.urls\")),\n]\n```\n\n## Authentication & Permissions\n\n### Authentication\n\n-   Prefer stateless authentication for APIs.\n-   Token-based or JWT authentication is recommended.\n-   Never rely on session authentication for public APIs unless\n    explicitly required.\n\n### Permissions\n\n-   Always define explicit permissions.\n-   Default to secure (`IsAuthenticated`) rather than open.\n-   Use custom permission classes for fine-grained control.\n-   Create custom permissions inside a `permissions.py` file inside the appropriate Django app.\n\nExample:\n\n``` python\npermission_classes = [IsAuthenticated]\n```\n\n\n## Pagination, Filtering & Throttling\n\n### Pagination\n\n-   Always paginate list endpoints.\n-   Avoid returning unbounded querysets.\n\n### Filtering\n\n-   Filter in `get_queryset()` using request parameters.\n-   Validate query params explicitly.\n\n### Throttling\n\nProtect APIs from abuse:\n\n``` python\nREST_FRAMEWORK = {\n    \"DEFAULT_THROTTLE_CLASSES\": [\n        \"rest_framework.throttling.AnonRateThrottle\",\n        \"rest_framework.throttling.UserRateThrottle\",\n    ],\n    \"DEFAULT_THROTTLE_RATES\": {\n        \"anon\": \"100\u002Fday\",\n        \"user\": \"1000\u002Fday\",\n    },\n}\n```\n\n\n## Performance Best Practices\n\n### Query Optimization\n\n-   Always inspect query counts in list views.\n-   Use `select_related()` for foreign keys.\n-   Use `prefetch_related()` for many-to-many and reverse relations.\n\nExample:\n\n``` python\n# File: orders\u002Fviews.py\ndef get_queryset(self):\n    return Order.objects.select_related(\"customer\").prefetch_related(\"items\")\n```\n\n\n### Caching\n\n-   Cache expensive read-heavy endpoints.\n-   Use Redis or Memcached.\n-   Never cache user-specific responses globally.\n\n\n## Testing\n\n-   Write tests for:\n    -   serializers\n    -   permissions\n    -   edge cases\n-   Use `APITestCase` and `APIClient`.\n-   Test both success and failure paths.\n\n\n## Common Gotchas & Pitfalls\n\n### Bulky Views \u002F Bulky Serializers\n\nAvoid putting business logic inside:\n    - serializers\n    - views\n    - permission classes\n\nInstead, use:\n    - service modules\n    - domain logic in models\n    - reusable helper functions\n\n### N+1 Query Problems\n\nDRF does **not** optimize queries automatically. Missing\n`select_related()` or `prefetch_related()` will silently destroy\nperformance.\n\n### Silent Security Bugs\n\nCommon mistakes:\n    - Forgetting permission classes\n    - Allowing unauthenticated access by default\n    - Exposing writeable fields unintentionally\n    - Exposing passwords or secret fields in response\n\nAlways audit:\n    - serializer `fields`\n    - permission classes\n    - allowed HTTP methods\n\n\n### Assuming Async Behavior\n\nDjango REST Framework is **primarily synchronous**.\n\nDo not assume:\n    - async views improve performance automatically\n    - background tasks belong in request\u002Fresponse cycles\n\nUse task queues (Celery etc.) for long-running work.\n\n\n## Example Commands\n\n``` bash\npython manage.py makemigrations\npython manage.py migrate\npython manage.py createsuperuser\npython manage.py runserver\n```\n\n## 📝 References\n\n-   Django documentation\n-   Django REST Framework documentation\n-   Real-world production DRF patterns\n",{"name":5,"homepage":24,"metadata":25,"description":7},"https:\u002F\u002Fgithub.com\u002Fpradeepcep\u002Fopenclaw-drf",{"clawdbot":26},{"os":27,"emoji":31,"requires":32},[28,29,30],"linux","darwin","win32","🔥",{"bins":33},[34],"python3","main","f9d3fe7cf9ac8f1ea63a0d96e98e1f510a3814db","skills\u002Fpradeepcep\u002Fdrf",1,"https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills","https:\u002F\u002Fgithub.com\u002Fjavimosch","intrane.fr","Building robust, open-source infrastructure for the commons. AI-leveraged, self-hosted, built to last.","2026-06-07 03:34:58",{"source":8,"skillName":5,"commands":45,"prompt":55,"zipAvailable":56},[46,49,52],{"tool":47,"command":48},"npx","npx skills add javimosch\u002Fopen-claw-skills --skill drf",{"tool":50,"command":51},"bunx","bunx skills add javimosch\u002Fopen-claw-skills --skill drf",{"tool":53,"command":54},"pnpm","pnpm dlx skills add javimosch\u002Fopen-claw-skills --skill drf","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fpradeepcep\u002Fdrf\u002FSKILL.md",true,[],[59,67,74,81,88,95],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":66},"01M778GGXG2VQ0YF31W2MKGMQZ","crowd-prompting","A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzzadrian\u002Fcrowd-prompting\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":66},"01M778G7BH8SBJ9FJ6C3G7CB1K","ceaser","Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir\u002FUltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":66},"01M778FYCJQZWFKKX5FYMK3S47","ceaser-send","Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp \u003Csubcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir\u002FUltraHonk zero-knowledge proofs.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyra-v21\u002Fceaser-send\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":66},"01M778FQQNSEYA3HJKZBPQ4M9Z","dilemm-ai","Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyori\u002Fdilemm-ai\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":66},"01M778FGVZX7QA2TF9BFMM37FY","moldium","Post and manage content on the Moldium blog platform. Triggered by \"post to Moldium\", \"write a blog post\", \"publish an article\", etc.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzyom45\u002Fmoldium\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":66},"01M778F88D8PQ9MQ0KNW2TJ8ZH","arxiv-paper-reviews","Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date\u002Fcategory\u002Finterest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http:\u002F\u002Fweakaccept.top:8000\u002F.","https:\u002F\u002Fgithub.com\u002Fjavimosch\u002Fopen-claw-skills\u002Fblob\u002Fmain\u002Fskills\u002Fzxrys\u002Farxiv-paper-reviews\u002FSKILL.md",[],[]]