一键导入
add-test
Write tests for the secret-vault Worker and hfs CLI. Use when adding test coverage, fixing bugs with regression tests, or validating behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Write tests for the secret-vault Worker and hfs CLI. Use when adding test coverage, fixing bugs with regression tests, or validating behavior.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Add a new CLI command to the hfs tool. Use when adding user-facing commands, subcommands, or flags to the CLI.
Create a new D1 database migration for the secret-vault. Use when adding tables, columns, or indexes to the vault's schema.
Review code changes for security issues specific to this encrypted secret vault. Use when modifying auth, encryption, scope enforcement, or any data-access paths.
Diagnose and fix issues with the secret-vault Worker, hfs CLI, D1 database, Cloudflare Access auth, and encryption. Use when something is broken, returning errors, or behaving unexpectedly.
Add a new API endpoint to the secret-vault Cloudflare Worker. Use when creating new routes, resources, or API functionality in the vault.
Define API endpoints with Zod schemas and auto-generated OpenAPI specs using @hono/zod-openapi. Use when adding, modifying, or documenting API routes.
| name | add-test |
| description | Write tests for the secret-vault Worker and hfs CLI. Use when adding test coverage, fixing bugs with regression tests, or validating behavior. |
28 tests exist across Worker (23) and CLI (5). Tests run in CI (ci.yml) and release (release.yml) workflows. This covers patterns and guidance for adding more.
cd secret-vault
npm install -D vitest @cloudflare/vitest-pool-workers
// secret-vault/vitest.config.ts
import { defineWorkersConfig } from "@cloudflare/vitest-pool-workers/config";
export default defineWorkersConfig({
test: {
poolOptions: {
workers: {
wrangler: { configPath: "./wrangler.jsonc" },
miniflare: {
d1Databases: ["DB"],
bindings: {
ENCRYPTION_KEY: "a".repeat(64),
ALLOWED_EMAILS: "test@example.com",
TEAM_DOMAIN: "https://test.cloudflareaccess.com",
POLICY_AUD: "test-aud",
},
},
},
},
},
});
"export" and "import" rejected on PUT (400)cd hfs && npm install -D vitest
resolveAuth() returns correct mode for each env var combinationresolveAuth() throws on partial service token env varsresolveAuth() throws on expired JWTstoreJwt() rejects malformed JWT