Token导航 LogoToken导航

Agent Skill · 前端设计

scaffold(scaffold 搜索)

用于辅助 Python 项目开发、测试、依赖管理和常见框架工作流。它适合让 Agent 阅读 Python 代码、定位测试问题、整理运行命令、生成脚本或分析数据处理逻辑。使用时需要确认项目虚拟环境、依赖版本和测试入口;涉及执行脚本、读写文件、访问数据库或调用外部 API 时,应先明确运行目录和输入输出范围,避免误改生产数据。

scaffold 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 9,066。

总安装 240周安装 10GitHub Stars 101下载 80核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:scaffold(scaffold 搜索)
来源仓库:https://github.com/dvf/opinionated-django
仓库路径:skills/scaffold
安装命令:
npx skills add https://github.com/dvf/opinionated-django --skill scaffold
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/dvf/opinionated-django --skill scaffold

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

scaffold 初始化 op-django 项目结构,适配绿色场或现有工程两种情况。适用于新项目启动或迁移至标准架构前的准备工作。自动创建 src/project/ 目录并整合 uv 依赖管理。使用前需判断项目现状,选择对应初始化路径避免重复劳动。建议保留原始 manage.py 入口直至确认新结构可用。

来源仓库内路径:skills/scaffold

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/dvf/opinionated-django --skill scaffold;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要执行命令,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

scaffold 怎么安装?

在终端执行 npx skills add https://github.com/dvf/opinionated-django --skill scaffold。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

scaffold 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

scaffold 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/dvf/opinionated-django --skill scaffold 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

scaffold 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

scaffold 用的人多吗?

公开数据是累计安装 240 次,近一周安装 10 次,下载 80 次,GitHub 101 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

scaffold 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
scaffold

scaffold 搜索 · 本页

240101执行命令未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Scaffold an op-django Project

You are preparing a Django project to use the op-django patterns. After this skill runs, the architecture and signals skills can add features on top without any further setup.

BEFORE WRITING CODE

Figure out which situation you're in:

  • Greenfield — no Django project exists yet. You will run uv init and django-admin startproject, then transform the result.
  • Existing Django project — a manage.py, settings.py, and at least one app already exist. You will add the src/project/ shell alongside what's there and relocate files only if asked.

Read pyproject.toml (if present) and locate manage.py and settings.py so you know the project's current layout. Confirm with the user before moving any existing files.

Target Layout

src/
  manage.py
  project/
    __init__.py
    settings.py
    urls.py
    wsgi.py
    asgi.py
    api/
      __init__.py   # NinjaAPI() instance, exception handlers, mounts all resource routers
      <resource>/
        __init__.py  # re-exports router
        routes.py    # handler functions
        schemas.py   # ninja.Schema input types
    types.py        # AuthedRequest and other shared typing aliases
    ids.py          # prefixed ULID generators
    services.py    # svcs registry + get() helper
    signals.py     # ReliableSignal base + send_reliable machinery
  <app>/
    __init__.py
    apps.py
    admin.py
    models/
      __init__.py
      <entity>.py
    dtos/
      __init__.py
      <entity>.py
    repositories/
      __init__.py
      <entity>.py
    services/
      __init__.py
      <entity>.py
    signals.py      # optional, defines ReliableSignal instances
    receivers.py    # optional, @receiver handlers — must be idempotent
tests/
  <app>/
    test_repo.py
    test_service.py
    test_api.py
pyproject.toml

Per-app models/, dtos/, repositories/, services/ are packages, not single files — one module per entity.

Step 1: Dependencies

Use uv for everything. Never pip or poetry.

uv add 'django>=6.0' 'django-ninja>=1.6' 'pydantic>=2.0' 'svcs>=25.1' \
       'python-ulid>=3.0' 'celery>=5.4' python-decouple
uv add --dev ruff 'pyrefly>=0.42' django-stubs pytest pytest-django

Pyrefly auto-recognizes Django constructs as long as django-stubs is installed — no plugin, no mypy_django_plugin-style config. See pyrefly.org/en/docs/django for the current support matrix.

Step 2: src/project/ids.py

from ulid import ULID

def prefixed_ulid(prefix: str) -> str:
    return f"{prefix}_{str(ULID()).lower()}"

def _make_generator(prefix: str):
    def generate() -> str:
        return prefixed_ulid(prefix)

    generate.__name__ = f"generate_{prefix}_id"
    generate.__qualname__ = f"generate_{prefix}_id"
    return generate

# Add one generator per aggregate root, with a unique 3-4 char prefix.
# Example:
# generate_prd_id = _make_generator("prd")

Step 3: src/project/services.py

import svcs

registry = svcs.Registry()

# Register repositories and services here as the project grows.
# Example:
# from products.repositories.product import ProductRepository
# from products.services.product import ProductService
#
# registry.register_factory(ProductRepository, ProductRepository)
#
# def _product_service_factory(container: svcs.Container) -> ProductService:
#     return ProductService(container.get(ProductRepository))
#
# registry.register_factory(ProductService, _product_service_factory)

def get[T](service_type: type[T]) -> T:
    """Get a service from the registry. Works anywhere — views, tasks, commands."""
    return svcs.Container(registry).get(service_type)

Step 4a: src/project/types.py

Narrows request.user to a guaranteed-authenticated Django User so handlers don't have to deal with AnonymousUser unions.

from django.contrib.auth.models import User
from django.http import HttpRequest

class AuthedRequest(HttpRequest):
    """
    An HttpRequest whose `user` attribute is guaranteed to be an authenticated User.

    Use as the first-argument annotation on any django-ninja handler that requires
    auth. The narrowing is a contract, not runtime enforcement — pair this with
    ninja's `auth=` on the router or a middleware that rejects anonymous requests.
    """
    user: User  # type: ignore[assignment]

Step 4b: src/project/api/ package

The API lives in a package, not a single file. src/project/api/__init__.py owns the NinjaAPI() instance and central exception handlers, and mounts one router per resource subpackage. Each resource subpackage (src/project/api/<resource>/) contains routes.py (handler functions), schemas.py (ninja Schema input types), and an __init__.py that re-exports the router.

src/project/api/__init__.py:

from ninja import NinjaAPI

# Import resource routers and mount them below.
# from project.api.products import router as products_router

api = NinjaAPI()

# api.add_router("/products", products_router)

@api.exception_handler(ValueError)
def on_value_error(request, exc: ValueError):
    return api.create_response(request, {"detail": str(exc)}, status=400)

@api.exception_handler(LookupError)
def on_lookup_error(request, exc: LookupError):
    return api.create_response(request, {"detail": str(exc)}, status=404)

@api.exception_handler(PermissionError)
def on_permission_error(request, exc: PermissionError):
    return api.create_response(request, {"detail": str(exc)}, status=403)

Example resource subpackage — src/project/api/products/routes.py:

from typing import List

from ninja import Router

from products.dtos.product import ProductDTO
from products.services.product import ProductService
from project.services import get
from project.types import AuthedRequest

from .schemas import CreateProductIn

router = Router()

@router.get("/", response=List[ProductDTO])
def list_products(request: AuthedRequest):
    return get(ProductService).list_products()

src/project/api/products/schemas.py:

from decimal import Decimal

from ninja import Schema

class CreateProductIn(Schema):
    name: str
    price: Decimal
    stock: int

src/project/api/products/__init__.py:

from .routes import router

__all__ = ["router"]

To add a new resource router: (a) create src/project/api/<resource>/ with routes.py, schemas.py, and __init__.py, then (b) import and mount the router in src/project/api/__init__.py via api.add_router("/<resource>", <resource>_router).

Wire api.urls into src/project/urls.py:

from django.contrib import admin
from django.urls import path
from project.api import api

urlpatterns = [
    path("admin/", admin.site.urls),
    path("api/", api.urls),
]

Step 5: src/project/signals.py — Reliable Signals

This module provides the ReliableSignal base that apps import. Receivers run asynchronously via Celery, and send_reliable() enqueues them inside the current DB transaction so rollbacks are respected.

import json

from celery import shared_task
from django.db import transaction
from django.dispatch import Signal
from django.utils.module_loading import import_string

@shared_task
def _dispatch_reliable_receiver(receiver_path: str, kwargs_json: str) -> None:
    receiver = import_string(receiver_path)
    receiver(**json.loads(kwargs_json))

class ReliableSignal(Signal):
    """A Django Signal whose receivers run asynchronously via Celery.

    - `send_reliable()` must be called inside a `transaction.atomic()` block.
    - Receiver tasks are enqueued on transaction commit, so rollbacks are respected.
    - Delivery is at-least-once. Every receiver MUST be idempotent.
    - Arguments MUST be JSON-serializable (pass IDs, never model instances).
    """

    def send_reliable(self, sender, **kwargs) -> None:
        payload = json.dumps(kwargs)
        for _, receiver in self._live_receivers(sender):
            path = f"{receiver.__module__}.{receiver.__qualname__}"
            transaction.on_commit(
                lambda p=path: _dispatch_reliable_receiver.delay(p, payload)
            )

This is a minimal implementation — feel free to harden it (dead-letter queue, replay tooling, explicit retry policy) as the project matures.

Step 6: Celery

Create src/project/celery.py:

import os

from celery import Celery

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project.settings")

app = Celery("project")
app.config_from_object("django.conf:settings", namespace="CELERY")
app.autodiscover_tasks()

In src/project/__init__.py:

from .celery import app as celery_app

__all__ = ("celery_app",)

Step 7: Settings

Hand off to the settings skill to lay out settings.py with banner sections. At minimum it must include:

  • INSTALLED_APPS with each project app as "<app>.apps.<App>Config"
  • CELERY_BROKER_URL and CELERY_RESULT_BACKEND (read via python-decouple)
  • DEFAULT_AUTO_FIELD is irrelevant — all PKs are ULID CharFields

Step 8: Tooling config in pyproject.toml

[tool.ruff]
line-length = 100
target-version = "py312"

[tool.pyrefly]
project-includes = ["src"]
python-version = "3.12"

[tool.pytest.ini_options]
DJANGO_SETTINGS_MODULE = "project.settings"
python_files = ["test_*.py"]
pythonpath = ["src"]

Pyrefly + Django caveats (from pyrefly.org/en/docs/django):

  • Pyrefly has built-in Django support. Install django-stubs and it just works — no plugin to enable, no extra [tool.pyrefly] keys required.
  • Reverse relations are not yet supported. Accessing user.order_set (the implicit reverse manager Django generates from a ForeignKey) will flag as an attribute error. Work around it in the repository layer by either (a) querying the child model directly — OrderRepository().list_for_user(user_id) — or (b) using an explicit related_name and a narrow cast / # type: ignore[attr-defined] at the call site. Do not paper over this in services or DTOs; push it down to the repo.
  • ManyRelatedManager is generic over [Parent, Model] rather than the concrete child type (unlike mypy's django-plugin). For DTO coercion this doesn't matter — the coerce_related_manager validator handles it — but don't rely on pyrefly to catch mistyped M2M targets.
  • Django's QuerySet typing beyond .all() is still thin. Keep chained queryset expressions inside the repository where you can annotate the return type as list[SomeDTO] and let the caller rely on that.
  • Pyrefly's Django support is actively evolving; re-check the docs when upgrading pyrefly and remove workarounds as they become unnecessary.

Step 9: Verify

uv run python src/manage.py check
uv run ruff check src
uv run ruff format --check src
uv run pyrefly check src
uv run pytest

All five must pass. Fix any issue rather than silencing it.

COMPLETION CHECKLIST

  • Dependencies added via uv add
  • src/project/ids.py with _make_generator helper
  • src/project/services.py with registry and get()
  • src/project/types.py with AuthedRequest
  • src/project/api/__init__.py with NinjaAPI instance (per-resource routers live in src/project/api/<resource>/ subpackages)
  • Central exception handlers registered (ValueError → 400, LookupError → 404, PermissionError → 403)
  • src/project/signals.py with ReliableSignal base
  • src/project/celery.py + __init__.py export
  • urls.py mounts api.urls
  • Settings organized via the settings skill
  • pyproject.toml has ruff / pyrefly / pytest config
  • django check, ruff, pyrefly, pytest all pass

Once this checklist is complete, the architecture and signals skills can build features on top without any extra setup.

平台分布

Codex

34.34%
按下载量换算27

Claude

29.27%
按下载量换算23

Cursor

17.98%
按下载量换算14

Gemini CLI

9.12%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/dvf/opinionated-django --skill scaffold 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills