Agents Markdown

安装

npx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/agents-markdown
yarn dlx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/agents-markdown
pnpx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/agents-markdown
bunx shadcn@latest add https://ssp-ui-registry-staging.sh3.agoralab.co/r/agents-markdown

文件说明

  • agents.md:为 Codex / Cursor 提供的统一工程规范,可根据任务选择 Lite / Standard / Advanced 版本说明。
  • 下载后将文件放置到仓库根目录(或代理要求的位置),必要时改名为 AGENTS.md

在 shadcn CLI 中接入 @ssp-ui

  1. 打开项目根目录的 components.json,确保包含最新 shadcn schema:
{
  "$schema": "https://ui.shadcn.com/schema/components.json",
  "...": "..."
}
  1. 在文件底部新增 registries 配置,指向 SSP Registry:
{
  "registries": [
    {
      "handle": "@ssp-ui",
      "url": "https://ssp-ui-registry-staging.sh3.agoralab.co/r/registry.json"
    }
  ]
}

若已有其它自定义 registry,可继续追加到 registries 数组中。handle 决定后续 npx shadcn add @ssp-ui/xxx 的命名空间。

  1. 重新执行 npx shadcn@latest init(如需要)或直接运行:
npx shadcn@latest add @ssp-ui/agents-markdown

如此即可像官方组件一样安装 @ssp-ui/biome, @ssp-ui/make-api-request, @ssp-ui/zustand 等能力模块。

最佳实践

  1. 选择版本
    • Lite:仅做 UI/样式修复。
    • Standard:常规功能开发,必须与 services / store / registry 目录协同。
    • Advanced:涉及 Recharts、Framer Motion 或对话式 API 的复杂场景。
  2. 复用 Registry 能力
    • @ssp-ui/biome:统一 Lint/Format。
    • @ssp-ui/make-api-request:API 请求模板。
    • @ssp-ui/zustand:全局状态管理。
  3. 交付检查
    • 运行 bun lint(或 bun run check)后再提交。
    • 对 Codex/Cursor 说明目录结构、命名规则和禁用事项,确保执行一致。