@basenative/claude-config

中文文档
3.3.0发布于 2026/11/03Apache-2.0ES Module零依赖构建来源已验证近 30 天下载 2355

Bundled Claude Code subagents, skills, slash commands, hooks, and settings for DuganLabs / BaseNative projects. Drop in via bn-claude install.

原始使用文档
文档目录11 节
  1. Install
  2. What's inside
  3. Agents ( .claude/agents/ )
  4. Skills ( .claude/skills/ )
  5. Slash commands ( .claude/commands/ )
  6. Hooks ( .claude/hooks/ )
  7. Settings ( .claude/settings.json )
  8. CLI reference
  9. Extending
  10. CLAUDE.md template
  11. License

@basenative/claude-config

Bundled Claude Code subagents, skills, slash commands, hooks, and settings for DuganLabs / BaseNative projects.

Every DuganLabs project should make the most of Claude Code. This package is the canonical bundle of agents, skills, commands, hooks, and settings — drop it into any repo with one command and you get the same tight workflow everywhere.

Install

In any project that should get the BaseNative Claude Code config:

npx @basenative/claude-config install

It writes into .claude/ (creating it if missing). Existing files are preserved unless you pass --force or confirm overwrite at the prompt. settings.json is never overwritten — only created if missing.

When BaseNative ships new templates, refresh:

npx @basenative/claude-config update

Verify and list:

bn-claude verify
bn-claude list

What's inside

Agents (.claude/agents/)

AgentWhen to invoke
basenative-package-authorDesigning or scaffolding a new @basenative/* package — produces package.json, project.json, src/index.js, test skeleton, README.
prd-authorWriting a PRD from a fresh idea — interviews the user one question at a time, writes docs/PRD.md.
speckit-spec-authorScaffolding a github/spec-kit style spec at specs/NNN-slug/spec.md with FR/NFR IDs and Given/When/Then scenarios.
cf-deploy-doctorDiagnosing Cloudflare deploy failures — names the cause (binding, env, migration, secret) and gives the exact fix.
og-image-designerComposing OG share images using the @basenative/og-image preset DSL — proposes 3 variants.
auth-migration-plannerPlanning a phased migration from express-session / NextAuth / Lucia / Clerk to @basenative/auth-webauthn.

Skills (.claude/skills/)

SkillTrigger
basenative-pattern"Is there a BaseNative pattern for X?" — searches packages/* and answers with a working snippet or "no, here's the gap."
prd-driven-issueTurn a PRD section into ready-to-paste GitHub issue bodies.
dl-doppler-setupWalk through Doppler setup for a project — login, project, configs, npm script wiring, CF bridge.
dl-cf-bindingAdd a Cloudflare binding (D1/KV/R2/DO/Queue/Service) to wrangler.toml correctly the first time.
dl-wcag-auditDrive Claude Preview / Chrome MCP to inject axe-core, run an audit, produce docs/a11y-audit-YYYY-MM-DD.md.

Slash commands (.claude/commands/)

CommandWhat it does
/bn-init <name>Scaffold a new BaseNative project + install this config.
/bn-prdInvoke the prd-author subagent.
/bn-spec <slug>Invoke the speckit-spec-author subagent.
/bn-doctorRun bn doctor and propose fixes.
/bn-deploy [--env]Gated deploy with explicit confirmation and post-deploy log tail.

Hooks (.claude/hooks/)

HookWired asPurpose
pre-commit-secret-scan.shUserPromptSubmitBlock commits containing AWS / GitHub / Stripe / Anthropic / Slack / Doppler secrets.
post-tool-edit-format.shPostToolUse (Edit|Write)Run prettier on the file just edited.
pre-bash-deploy-confirm.shPreToolUse (Bash)Block any wrangler deploy / wrangler secret put / destructive D1 SQL until re-confirmed.

Settings (.claude/settings.json)

The template:

  • Allows safe operations (ls, rg, git status/diff/log, pnpm test/lint/build, wrangler whoami, gh pr list).
  • Asks for risky ones (git push, pnpm publish, wrangler deploy, wrangler secret put, gh pr create/merge).
  • Denies catastrophic ones (rm -rf /, git push --force, curl | sh).
  • Wires the three hooks above.

Edit .claude/settings.local.json for personal tweaks — settings.json is the team contract.

CLI reference

bn-claude install [--root DIR] [--force] [--dry-run] [--quiet]
bn-claude update  [--root DIR]               # alias for install --force
bn-claude verify  [--root DIR]
bn-claude list    [--root DIR]
bn-claude help

Zero runtime dependencies. Pure Node parseArgs, ANSI codes inline.

Extending

To add a new agent / skill / command:

  1. Drop a markdown file with YAML frontmatter into the appropriate directory in this package.
  2. Bump the version, pnpm publish.
  3. Consumers run bn-claude update.

For agent/skill/command formatting conventions, see Anthropic's docs:

CLAUDE.md template

CLAUDE.md.tmpl is included for projects that don't have a memory file yet. bn-claude install drops it as CLAUDE.md (only if missing). Fill in {{PROJECT_NAME}}, {{ONE_LINE_PITCH}}, etc.

License

Apache-2.0. Built with BaseNative — basenative.dev

版本与发布记录

@basenative/claude-config 共发布 14 个版本,首次发布于 2026/10/18;过去 12 个月发布了 14 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.3.0latest2026/11/034 天前
3.2.02026/11/035 天前
3.1.02026/11/017 天前
3.0.02026/10/317 天前
2.4.02026/10/2613 天前
2.3.22026/10/2216 天前

关于 @basenative/claude-config 的常见问题

@basenative/claude-config 是什么?

Bundled Claude Code subagents, skills, slash commands, hooks, and settings for DuganLabs / BaseNative projects. Drop in via bn-claude install.

如何安装 @basenative/claude-config?

在项目目录运行 npm install @basenative/claude-config,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 bn-claude,可以用 npx bn-claude 直接运行。

@basenative/claude-config 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/basenative__claude-config 是否存在。

@basenative/claude-config 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@basenative/claude-config 可以商用吗?

@basenative/claude-config 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@basenative/claude-config 的下载量有多少?

根据 npm 官方下载统计,@basenative/claude-config 在 2026/10/08 – 2026/11/06 这 30 天内被下载 2,355 次,日均约 79 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@basenative/claude-config 还在维护吗?

最新版本 3.3.0 发布于 2026/11/03(4 天前);至今共发布 14 个版本,其中过去 12 个月发布了 14 个;首次发布于 2026/10/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。