一键导入
mkfast-env-init
Initialize environment variables for this mkfast-template repository and forks derived from it.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Initialize environment variables for this mkfast-template repository and forks derived from it.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
使用 Spaceship API 注册域名并接入 Cloudflare。凡是用户想查询域名可用性、购买或注册域名、创建 Spaceship 联系人、把域名加入 Cloudflare、把注册商 nameserver 切到 Cloudflare,或等待 Cloudflare 激活时,都应使用这个 skill。对于“帮我查这个域名能不能买”“把这个域名接到 Cloudflare”“更新 Spaceship nameserver”这类只覆盖部分流程的请求,也应触发这个 skill。
CLI tool for the `ship` command wrapping aidirs.org and backlinkdirs.com submission APIs. Use when the user needs to login, submit a URL, preview site metadata, check CLI version, or self-update the CLI from terminal. Supports browser login, per-site token storage, submit/fetch commands, version checks, and self-update.
Release workflow for the ship-skills repository. Use when the user says release, 发布, bump version, publish skills, push a new skill version, or update marketplace metadata for this repo.
| name | mkfast-env-init |
| description | Initialize environment variables for this mkfast-template repository and forks derived from it. |
Set up environment variables for this repository without inventing new keys, mixing build-time and runtime config, or overwriting existing secrets.
At the time this skill was written, the template defaults are:
cloudflare provider.resend provider.discord provider.r2 provider.VITE_PAYMENT_PROVIDER is set to stripe or creem.Do not assume those defaults are still true. Re-check src/config/website.ts on every run and adapt.
.env.local or .env.production. Append missing keys instead of replacing known values.wrangler.jsonc.Before any file changes, ask the user for:
Do not ask for the project name. Use the current folder name as the project name.
If the domain is missing, stop and ask before continuing. Do not guess.
Use the project name to update:
package.json → namewrangler.jsonc → top-level namewrangler.jsonc → d1_databases[0].database_nameUse the domain to update:
.env.production → VITE_BASE_URLwrangler.jsonc → routes[0].patternUse the bundled helper before env initialization:
node .agents/skills/template-env-init/scripts/init-env.mjs --sync-project-metadata
node .agents/skills/template-env-init/scripts/init-env.mjs --domain your-domain
Domain handling rule:
https://example.com, write it directly to VITE_BASE_URL and write
example.com to routes[0].patternexample.com, write https://example.com to VITE_BASE_URL and write
example.com to routes[0].pattern.env.example to .env.local and .env.productionStart by syncing both local and production env files from .env.example. Use the bundled helper to create the target
file if it does not exist, or to append missing keys without overwriting existing values:
node .agents/skills/template-env-init/scripts/init-env.mjs --target .env.local
node .agents/skills/template-env-init/scripts/init-env.mjs --target .env.production
If the user explicitly asks for a different target file, pass it with --target.
After syncing the env files, read these values from the current process environment and write them into the target env files:
CLOUDFLARE_ACCOUNT_IDCLOUDFLARE_API_TOKENGOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETDISCORD_WEBHOOK_URL when availableFAL_KEY when availableUse the bundled helper in --fill-cloudflare mode:
node .agents/skills/template-env-init/scripts/init-env.mjs --target .env.local --fill-cloudflare
node .agents/skills/template-env-init/scripts/init-env.mjs --target .env.production --fill-cloudflare
On Windows, if the current process does not already contain these variables, the helper should fall back to the user's
persistent User env vars first, then Machine env vars.
If any required process env value is missing, stop immediately and tell the user which variable is missing. Do not
continue with a partial setup. Optional values such as DISCORD_WEBHOOK_URL and FAL_KEY should be written when
present but should not block the rest of the setup when absent.
Map the task to one of these scopes:
.env.local.env.production and deployment notesIf the user says only "initialize env", default to creating both .env.local and .env.production, then provide a
short production checklist.
After project metadata has been set, create the remote D1 database using the already configured database name from
wrangler.jsonc:
node .agents/skills/template-env-init/scripts/init-env.mjs --create-d1
The helper should run wrangler d1 create <name> using that existing database_name, then capture the created
database_id and write it to:
.env.local → CLOUDFLARE_DATABASE_ID.env.production → CLOUDFLARE_DATABASE_IDwrangler.jsonc → d1_databases[0].database_idSafety rule:
database_id values in env files and
wrangler.jsoncBETTER_AUTH_SECRETIf BETTER_AUTH_SECRET is empty in the target env file, generate a secret with:
openssl rand -base64 32
Then write the generated value back into the target env file. If BETTER_AUTH_SECRET already has a non-empty value,
preserve it.
Always set this build-time value in the target env files:
VITE_PLAUSIBLE_SCRIPT=https://plausible.allinaigc.org/js/script.jsThis value is fixed for this repository and should be written even if the placeholder in .env.example is empty.
Decide which variables actually matter by combining:
src/env/client.ts and src/env/server.tssrc/config/website.tsdocs/env.md, wrangler.jsonc, and .github/workflows/deploy.ymlFor the current template defaults, the usual checklist is:
VITE_BASE_URLBETTER_AUTH_SECRETCLOUDFLARE_ACCOUNT_IDCLOUDFLARE_API_TOKENRESEND_API_KEYDISCORD_WEBHOOK_URLFAL_KEYImportant nuance:
storage.provider = 'r2' uses the BUCKET binding from wrangler.jsonc, not an env var.DB is a D1 binding, not an env var.CLOUDFLARE_DATABASE_ID is for tooling or CI, not normal request-time app logic.Do not generate fake API keys for third-party services.
After the remote D1 database has been created and CLOUDFLARE_DATABASE_ID has been written into env files, initialize
the actual databases with migrations. Choose the command based on the scope from step 4:
pnpm db:migrate:local
pnpm db:migrate:remote
Use the bundled helper for this explicit step:
node .agents/skills/template-env-init/scripts/init-env.mjs --db-migrate-local
node .agents/skills/template-env-init/scripts/init-env.mjs --db-migrate-remote
node .agents/skills/template-env-init/scripts/init-env.mjs --db-migrate-all
Rules for this step:
pnpm db:migrate:localpnpm db:migrate:remoteWhy:
pnpm db:migrate:local initializes the local D1 database used by wrangler devpnpm db:migrate:remote initializes the remote Cloudflare D1 database and records migration history in
d1_migrationsThe remote migration step should provide CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN, and CLOUDFLARE_DATABASE_ID
to the migration command from the current runtime env and/or the generated env files.
After .env.production has been fully populated, run these deployment sync commands in order:
pnpm sync-github-secrets
pnpm sync-worker-secrets
Use the bundled helper for this final explicit step:
node .agents/skills/template-env-init/scripts/init-env.mjs --sync-secrets
This step pushes local configuration to external systems, so it should only run when the user intends to update GitHub Actions secrets and Cloudflare Worker secrets.
If auth.enable = true and auth.enableGoogleLogin = true in src/config/website.ts, finish by reminding the user to
update the Google OAuth client configuration in Cloud Console:
https://console.cloud.google.com/auth/clients/482192285256-d7jfri07n54ss8q8gav695lu4517qh25.apps.googleusercontent.com?project=saasstarter-xyzhttps://mkfast.allinaigc.org<normalized-base-url>/api/auth/callback/google, for example
https://mkfast.allinaigc.org/api/auth/callback/googleUse the same normalized domain handling as step 1:
https://example.com, use that exact value as the origin and
https://example.com/api/auth/callback/google as the redirect URIexample.com, use https://example.com as the origin and
https://example.com/api/auth/callback/google as the redirect URIDo not skip this reminder when Google login is enabled, even if the env vars have already been filled successfully.
When you use this skill, finish with:
https://console.cloud.google.com/auth/clients/482192285256-d7jfri07n54ss8q8gav695lu4517qh25.apps.googleusercontent.com?project=saasstarter-xyzKeep the report practical and short.
Example 1 Input: "Initialize .env.local for this template so I can start local dev." Behavior: sync .env.local
from .env.example, keep payment vars blank if payment is disabled, generate BETTER_AUTH_SECRET, and call out the
remaining third-party values still needed for enabled providers.
Example 2 Input: "List which env vars belong in Cloudflare and which belong in GitHub Actions for this repo."
Behavior: separate VITE_* build env from Worker runtime secrets, mention CLOUDFLARE_DATABASE_ID as tooling/CI-only,
and avoid treating D1/R2 bindings as env vars.
Example 3 Input: "I do not want Google login or payments yet. Give me the smallest env setup." Behavior: keep the env setup minimal, and explicitly suggest disabling the corresponding feature flags if the current config would otherwise expect them.