npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@cherishxn/agent-scaffold

v1.1.0

Published

Deterministic project scaffolding for coding agents

Readme

Agent Scaffold

面向 Codex、Claude Code、Grok Build 的项目脚手架。四套技术栈(React + FastAPI、React + Spring Boot、React + NestJS、Next.js)各支持 shadcn/ui 和 Ant Design,共八个组合。生成应用包含登录和个人记录 CRUD,默认不含 AI。

选择技术栈

| 已有偏好 | 建议起点 | 额外运行环境 | | --- | --- | --- | | Python 后端 | React + FastAPI | Python 3.12、uv、Bun | | Java / Spring 团队 | React + Spring Boot | JDK 17 或更高版本、pnpm 10;自带 Maven Wrapper | | 前后端都用 TypeScript,独立 API | React + NestJS | pnpm 10 | | 一个 TypeScript 全栈工程 | Next.js | pnpm 10 |

都需要 Node.js 24 和 Docker。没有既定偏好时可从 Next.js + shadcn 开始;两种 UI 的设计意图和业务能力保持一致,按组件库偏好选择。

本地使用

需要 Node.js 24:

npx @cherishxn/agent-scaffold@latest init

交互创建收集中文名称、英文名称、简介、技术栈和 UI;确认前不写项目文件。也可创建 spec.json:

{"schemaVersion":1,"nameZh":"客户服务平台","nameEn":"customer-service","description":"客户资料和服务记录管理","template":"react-fastapi","ui":"shadcn"}
npx @cherishxn/agent-scaffold@latest templates --json
npx @cherishxn/agent-scaffold@latest init --help --json
npx @cherishxn/agent-scaffold@latest plan --spec spec.json --out plan.json --json
npx @cherishxn/agent-scaffold@latest init --plan plan.json --json

1.1.0 候选支持 plan --spec spec.json --json 的零写入预览;只有提供 --out 才保存计划。预览与创建使用同一精确 CLI 版本,计划绑定模板摘要。当前公开版与候选验收状态见 验证记录。

也可直接 init --spec spec.json --json。命令返回安装步骤和工作目录,不自动安装依赖或启动服务。进入生成目录后:

npm run setup
npm run dev

开发账号与随机密码写入被 Git 忽略的 .scaffold-local-credentials。FastAPI 需要 Python 3.12、uv、Bun;Spring 需要 Java 17 和 pnpm;Nest/Next 需要 pnpm。数据库使用 Docker。具体版本锁定在模板中。

检查与报告

1.1.0 候选提供安装前工具检查 doctor --dir . --tools-only --json,失败项会说明修复方法;默认 doctor 同时检查项目依赖。它只诊断,不安装工具或启动服务。

新生成项目的 npm run check 按类型、Lint、构建顺序执行,遇到失败即停止,适合日常反馈;它不替代以下真实业务验证。

npx @cherishxn/agent-scaffold@latest doctor --dir . --json
npx @cherishxn/agent-scaffold@latest verify --dir . --json
npx @cherishxn/agent-scaffold@latest report --dir . --json

verify 启动独立 PostgreSQL,运行类型、Lint、构建、迁移、种子数据、原生测试、API 和浏览器测试,并清理本次容器。不会使用开发环境的数据库连接。结果保存于 .scaffold-runs,包含内容摘要和原生报告引用;代码变化后 report 标记 STALE。失败、空测试、缺前置与中断不会标为 PASS。生成项目的 verify 会执行该项目脚本,仅对自己信任的项目运行。

视觉设计

八组合默认使用从 CleerScience 提炼的深色科技视觉:近黑蓝底、冷白文字、冰蓝强调与直角面板。可独立复用的 通用 DESIGN.md 区分官网实测与产品适配;生成项目的根 DESIGN.md 是当前 UI 的实际规范。

设计采用四层分离:共享 design/ 规范、语义 Widget 契约、组件库适配层、独立业务模型。design:sync 生成 DESIGN.md、CSS 和运行时规范;design:check 检测漂移;design:verify 验证全部组件状态及页面在桌面/移动端的几何、颜色、圆角和图标。位置容差 0.6px,其余指定属性严格相等。生成项目内置三宿主可发现的 design-contract Skill。根目录 npm run design:verify 运行全部八种组合并比较跨模板测量;单个生成项目仅验证已选适配器。

Agent 入口

打包后的 CLI 包含 skills/scaffold-use/SKILL.md。按当前宿主约定,把该目录复制到发起创建的工作目录:Codex 使用 .agents/skills/scaffold-use,Claude Code 使用 .claude/skills/scaffold-use,Grok Build 使用 .grok/skills/scaffold-use。这一步由使用者或已获授权的 Agent 执行;CLI 不改全局配置。

生成项目自带 AGENTS.md、薄 CLAUDE.md,以及上述三个原生目录下同源的 project-work Skill。docs/PROJECT.md 的任务表按实际技术栈指向 API、认证、迁移、设计和测试入口。切换到新工程后核对规则与 Skill 是否加载。具体宿主兼容范围以交付记录为准。

开发与分发

npm run check
npm run test:interactive
npm run test:package
npm run test:onboarding
npm run matrix
npm pack

源码仓库保持私有,CLI 按发布白名单分发至 npm 公共包。npm pack 构建包含八套模板与锁文件的本地安装包。模板源码位于 template-src;templates 是可重新生成的产物。普通模板层只允许添加文件,路径冲突会停止构建;生成文件或锁文件替换由 materialize 脚本显式完成。更新依赖后运行 scripts/lock-templates.mjs 并重新验证受影响矩阵。

开发计划 · 验证记录 · 设计基线 v0.5 · 来源与许可证

运行测试通过不代表生产部署或产品/PM 业务验收完成。

本轮选择性学习 VibeStart 的预览、Agent 指引、快速反馈与模板文件归属机制;具体采用项和保留边界见 源码研究与采纳映射。实现沿用本项目架构,未引入其技术栈或全量源码。

验证反馈与接口一致性

verify 保留原退出码和报告字段,失败分项新增 diagnostic(code、retryable、nextAction),evidence 指向脱敏日志及 JUnit。端口冲突、连接拒绝、主机解析失败、启动失败、超时与缺测试证据分开;未知错误保持 UNKNOWN_FAILURE,不自动重试或修改运行环境。API/浏览器测试采集服务 stdout/stderr。

生成项目提供 npm run api:check:在系统临时目录生成类型并比较 docs/api.d.ts,检查不回写源码;有意修改 docs/openapi.json 后运行 npm run api:generate。check/verify 自动运行此门禁,真实 HTTP 回归按契约检查响应状态和结构。

Codex 接手开发的固定题库、运行方法与局限见 评测说明。这与模板本身的八组合业务矩阵分别留证。