跳到正文
cccskills
免费在 GitHub 公开

db-clone

Copy one Cloudflare D1 database into another of the same app's environments — refresh STAGING from prod, seed a PREVIEW from staging, or (guarded) push staging up to prod. Full mirror via scripts/db-clone.mjs. Use when asked to "clone a db", "refresh staging from prod", "copy prod data to staging", "seed a preview db", or to reconstitute a wiped staging DB. NOT for per-collection seeding (use the app's seedData/seed endpoints) or for schema migrations (use db-migrations).

中文简介正在准备中。当前显示原文说明。

集成工具Cloudflare
查看安装方法

包含的文件(1)

  • SKILL.md4.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

db-clone — mirror one D1 database into another

Wraps scripts/db-clone.mjs (pnpm db:clone): exports a source Cloudflare D1 database and imports it into a target, making the target an exact mirror (every target table dropped, then re-imported). Database names are discovered from each app's wrangler.jsonc, so it works for any app + any pair of its environments.

node scripts/db-clone.mjs --app <app> --from <env> --to <env> [--dry-run] [--yes]
# or: pnpm db:clone --app <app> --from <env> --to <env>

<env> is prod (the wrangler.jsonc top level) or any key under env.* (staging, preview, …).

Mobile / no-laptop: there's also a db-clone GitHub Action (.github/workflows/db-clone.yml) — Actions → Run workflow → app/from/to from the GitHub app. It reuses the repo's CLOUDFLARE_* secrets (no Cloudflare site needed); a prod target requires the confirm_target_db input (passed as --confirm), and the pre-clone backup is uploaded as an artifact. For non-interactive runs the script takes --confirm <db> in place of the typed prompt.

When to use this — and when NOT to

SituationUse
"Is the data still there?" / "how many rows / bookings / users" — check before cloningpnpm db:counts --app <app> --env <env> (read-only) or the db-counts Action
"Make staging look exactly like prod" / "refresh staging" / "seed a preview from staging"this skill
"Reconstitute the wiped staging DB" (and prod still has the data)this skill (--from prod --to staging)
Load a specific org / CSV import into a fresh DBthe app's seedData/ + seed endpoints — NOT this
The source/target data is gone everywherere-seed from seedData/, don't clone
Add/alter a table (schema change)the db-migrations skill

A clone copies all data as-is; it is not a substitute for seeding curated fixtures or for migrations.

Hard rules (the judgment this skill encodes)

  1. Always --dry-run first. Read back the resolved names (e.g. velo-db → velo-staging-db) and the ordered plan before doing anything real. The dry run needs no Cloudflare credentials.
  2. Cloning OVERWRITES the target. Confirm the direction out loud (--from = the keeper, --to = the one wiped). Source == target is refused.
  3. Prod-as-target is the dangerous path — treat it like the "never deploy to prod casually" rule. The script forces a typed confirmation (retype the target db name) and takes a timestamped backup to .db-backups/ first. Don't pass --yes to a prod target unless the human explicitly asked for an unattended run. The default direction is prod → staging, never the reverse.
  4. A real run needs creds in the env: CLOUDFLARE_ACCOUNT_ID + CLOUDFLARE_API_TOKEN (account → D1 Edit). Without them, only --dry-run works. wrangler whoami should resolve before a real run.
  5. Verify after. Once imported, confirm with a row count, e.g. npx wrangler d1 execute <target> --remote --command "SELECT (SELECT COUNT(*) FROM user) users, (SELECT COUNT(*) FROM organization) orgs".

Flow

  1. --dry-run to confirm names + direction.
  2. (prod target only) typed confirmation + automatic backup to .db-backups/.
  3. Export source → drop all target tables → import dump.
  4. Row-count check on the target.

See writeups/guides/db-clone-guide.md for the full reference.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

a11y

免费

Accessibility review for Vue surfaces — the code-cleaning analog of /code-review and /simplify, pointed at WCAG/ARIA. Reviews just your diff (or a package/file), rates findings by severity, and either comments inline on the PR (--comment) or applies the safe fixes for you (--fix). Steers the depth-aware `a11y` subagent. Use when asked to "check accessibility", "a11y this", "audit ARIA/keyboard", or run /a11y.

中文简介正在准备中。当前显示原文说明。

FriendlyInternet/nuxt-crouton102026年10月18日 更新

ask-human

免费

Emit a blocking question the owner can read in ~10 seconds and answer in one reply — the scannable, recommendation-first handoff every agent posts when it hits a fork it can't own. Leads with the one decision + a recommendation, carries the 🤖 provenance header, doubles as the

中文简介正在准备中。当前显示原文说明。

FriendlyInternet/nuxt-crouton102026年10月18日 更新

audit

免费

Audit packages for documentation completeness, detect drift between code and docs, and maintain documentation quality across the monorepo. Use when checking package docs, running audits, or reviewing documentation health.

中文简介正在准备中。当前显示原文说明。

FriendlyInternet/nuxt-crouton102026年10月18日 更新

Author a placeable layout block that looks right at ANY pane size. The one hard rule — size to the PANE with container queries (@container), never the viewport — plus list/form playbooks and the sizing contract (minWidth etc.) the viability metric reads. Use when adding/converting a croutonLayoutBlocks block, or when a block overflows/breaks in a narrow pane.

中文简介正在准备中。当前显示原文说明。

FriendlyInternet/nuxt-crouton102026年10月18日 更新

When a bug or regression is reported, the FIRST step — before fixing — is to research how and when it was introduced (git archaeology), then record that finding on the tracking issue/PR. Use the moment a bug, error, broken build, or "this used to work" is reported, before writing a fix. Produces a first-bad-commit (or "not a code regression") note you paste onto the issue.

中文简介正在准备中。当前显示原文说明。

FriendlyInternet/nuxt-crouton102026年10月18日 更新

commit

免费

Smart, granular git commits following monorepo conventions. Analyzes changes, filters to session-relevant files, groups by intent, and uses conventional commit format. Use when committing code changes.

中文简介正在准备中。当前显示原文说明。

FriendlyInternet/nuxt-crouton102026年10月18日 更新

查看 FriendlyInternet 的全部技能

报告此技能的问题