zilmate 1.9.3 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/ad-creative/SKILL.md +362 -0
- package/.agents/skills/ad-creative/evals/evals.json +90 -0
- package/.agents/skills/ad-creative/references/generative-tools.md +637 -0
- package/.agents/skills/ad-creative/references/platform-specs.md +213 -0
- package/.agents/skills/ai-seo/SKILL.md +489 -0
- package/.agents/skills/ai-seo/evals/evals.json +90 -0
- package/.agents/skills/ai-seo/references/content-patterns.md +285 -0
- package/.agents/skills/ai-seo/references/content-types.md +71 -0
- package/.agents/skills/ai-seo/references/okf.md +104 -0
- package/.agents/skills/ai-seo/references/platform-ranking-factors.md +154 -0
- package/.agents/skills/clerk-backend-api/SKILL.md +426 -0
- package/.agents/skills/clerk-backend-api/evals/evals.json +87 -0
- package/.agents/skills/clerk-backend-api/scripts/api-specs-context.sh +30 -0
- package/.agents/skills/clerk-backend-api/scripts/execute-request.sh +88 -0
- package/.agents/skills/clerk-backend-api/scripts/extract-endpoint-detail.sh +165 -0
- package/.agents/skills/clerk-backend-api/scripts/extract-tag-endpoints.sh +208 -0
- package/.agents/skills/clerk-backend-api/scripts/extract-tags.js +14 -0
- package/.agents/skills/copy-editing/SKILL.md +457 -0
- package/.agents/skills/copy-editing/evals/evals.json +89 -0
- package/.agents/skills/copy-editing/references/checklist.md +66 -0
- package/.agents/skills/copy-editing/references/content-refresh.md +38 -0
- package/.agents/skills/copy-editing/references/plain-english-alternatives.md +394 -0
- package/.agents/skills/hyperframes/SKILL.md +163 -0
- package/.agents/skills/hyperframes-cli/SKILL.md +109 -0
- package/.agents/skills/hyperframes-cli/references/doctor-browser.md +45 -0
- package/.agents/skills/hyperframes-cli/references/init-and-scaffold.md +51 -0
- package/.agents/skills/hyperframes-cli/references/lambda.md +132 -0
- package/.agents/skills/hyperframes-cli/references/lint-validate-inspect.md +121 -0
- package/.agents/skills/hyperframes-cli/references/preview-render.md +109 -0
- package/.agents/skills/hyperframes-cli/references/upgrade-info-misc.md +75 -0
- package/.agents/skills/hyperframes-media/SKILL.md +97 -0
- package/.agents/skills/hyperframes-media/assets/sfx/CREDITS.md +35 -0
- package/.agents/skills/hyperframes-media/assets/sfx/manifest.json +97 -0
- package/.agents/skills/hyperframes-media/references/bgm.md +72 -0
- package/.agents/skills/hyperframes-media/references/captions/authoring.md +159 -0
- package/.agents/skills/hyperframes-media/references/captions/motion.md +87 -0
- package/.agents/skills/hyperframes-media/references/captions/transcript-handling.md +97 -0
- package/.agents/skills/hyperframes-media/references/remove-background.md +143 -0
- package/.agents/skills/hyperframes-media/references/requirements.md +29 -0
- package/.agents/skills/hyperframes-media/references/sfx.md +42 -0
- package/.agents/skills/hyperframes-media/references/transcribe.md +52 -0
- package/.agents/skills/hyperframes-media/references/tts-to-captions.md +24 -0
- package/.agents/skills/hyperframes-media/references/tts.md +135 -0
- package/.agents/skills/hyperframes-media/scripts/audio.mjs +282 -0
- package/.agents/skills/hyperframes-media/scripts/heygen-tts.mjs +121 -0
- package/.agents/skills/hyperframes-media/scripts/lib/bgm.mjs +235 -0
- package/.agents/skills/hyperframes-media/scripts/lib/heygen.mjs +131 -0
- package/.agents/skills/hyperframes-media/scripts/lib/sfx.mjs +128 -0
- package/.agents/skills/hyperframes-media/scripts/lib/tts.mjs +220 -0
- package/.agents/skills/hyperframes-media/scripts/lyria-recipe.py +128 -0
- package/.agents/skills/hyperframes-media/scripts/wait-bgm.mjs +167 -0
- package/.agents/skills/hyperframes-registry/SKILL.md +101 -0
- package/.agents/skills/hyperframes-registry/examples/add-block.md +51 -0
- package/.agents/skills/hyperframes-registry/examples/add-component.md +73 -0
- package/.agents/skills/hyperframes-registry/references/contributing.md +166 -0
- package/.agents/skills/hyperframes-registry/references/demo-html-pattern.md +54 -0
- package/.agents/skills/hyperframes-registry/references/discovery.md +215 -0
- package/.agents/skills/hyperframes-registry/references/install-locations.md +45 -0
- package/.agents/skills/hyperframes-registry/references/templates.md +417 -0
- package/.agents/skills/hyperframes-registry/references/wiring-blocks.md +61 -0
- package/.agents/skills/hyperframes-registry/references/wiring-components.md +39 -0
- package/.agents/skills/marketing-psychology/SKILL.md +455 -0
- package/.agents/skills/marketing-psychology/evals/evals.json +88 -0
- package/.agents/skills/mintlify/SKILL.md +328 -0
- package/.agents/skills/product-launch-video/SKILL.md +206 -0
- package/.agents/skills/product-launch-video/references/cut-catalog.md +220 -0
- package/.agents/skills/product-launch-video/references/motion-language.md +156 -0
- package/.agents/skills/product-launch-video/references/story-design.md +373 -0
- package/.agents/skills/product-launch-video/references/visual-design.md +126 -0
- package/.agents/skills/product-launch-video/scripts/assemble-index.mjs +570 -0
- package/.agents/skills/product-launch-video/scripts/audio.mjs +253 -0
- package/.agents/skills/product-launch-video/scripts/build-frame.mjs +536 -0
- package/.agents/skills/product-launch-video/scripts/captions.mjs +508 -0
- package/.agents/skills/product-launch-video/scripts/lib/assets.mjs +55 -0
- package/.agents/skills/product-launch-video/scripts/lib/dimensions.mjs +45 -0
- package/.agents/skills/product-launch-video/scripts/lib/storyboard.mjs +249 -0
- package/.agents/skills/product-launch-video/scripts/lib/tokens.mjs +204 -0
- package/.agents/skills/product-launch-video/scripts/lib/transition-registry.mjs +38 -0
- package/.agents/skills/product-launch-video/scripts/lib/transitions.json +71 -0
- package/.agents/skills/product-launch-video/scripts/stage-assets.mjs +39 -0
- package/.agents/skills/product-launch-video/scripts/transitions.mjs +320 -0
- package/.agents/skills/product-launch-video/sub-agents/frame-worker.md +74 -0
- package/.agents/skills/prompt-engineering-patterns/SKILL.md +144 -0
- package/.agents/skills/prompt-engineering-patterns/assets/few-shot-examples.json +106 -0
- package/.agents/skills/prompt-engineering-patterns/assets/prompt-template-library.md +264 -0
- package/.agents/skills/prompt-engineering-patterns/references/chain-of-thought.md +412 -0
- package/.agents/skills/prompt-engineering-patterns/references/details.md +338 -0
- package/.agents/skills/prompt-engineering-patterns/references/few-shot-learning.md +386 -0
- package/.agents/skills/prompt-engineering-patterns/references/prompt-optimization.md +428 -0
- package/.agents/skills/prompt-engineering-patterns/references/prompt-templates.md +484 -0
- package/.agents/skills/prompt-engineering-patterns/references/system-prompts.md +195 -0
- package/.agents/skills/prompt-engineering-patterns/scripts/optimize-prompt.py +279 -0
- package/.agents/skills/remotion-to-hyperframes/SKILL.md +127 -0
- package/.agents/skills/remotion-to-hyperframes/assets/.gitkeep +0 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/run.sh +249 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/README.md +41 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/expected.json +26 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/hf-src/index.html +61 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/package.json +14 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/remotion.config.ts +13 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/src/Root.tsx +13 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/src/TitleCard.tsx +34 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/src/index.ts +4 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/tsconfig.json +15 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/README.md +54 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/expected.json +29 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/hf-src/index.html +118 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/package.json +14 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/remotion.config.ts +13 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/src/MultiScene.tsx +105 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/src/Root.tsx +13 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/src/index.ts +4 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/tsconfig.json +15 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/setup.sh +34 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/README.md +85 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/expected.json +41 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/hf-src/index.html +269 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/package.json +15 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/remotion.config.ts +13 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/Root.tsx +27 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/Stargazed.tsx +37 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/components/AnimatedNumber.tsx +23 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/components/StatCard.tsx +59 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/components/UnderlinedText.tsx +47 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/index.ts +4 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/scenes/OutroScene.tsx +18 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/scenes/StatsScene.tsx +34 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/scenes/TitleScene.tsx +55 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/tsconfig.json +15 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/README.md +51 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/01-use-state.tsx +29 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/02-use-effect-deps.tsx +29 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/03-async-metadata.tsx +39 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/04-third-party-react.tsx +30 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/05-lambda-config.tsx +38 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/06-warnings-only.tsx +36 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/07-custom-hook.tsx +28 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/08-mixed.tsx +41 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/expected.json +85 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/validate.sh +110 -0
- package/.agents/skills/remotion-to-hyperframes/references/api-map.md +142 -0
- package/.agents/skills/remotion-to-hyperframes/references/escape-hatch.md +115 -0
- package/.agents/skills/remotion-to-hyperframes/references/eval.md +140 -0
- package/.agents/skills/remotion-to-hyperframes/references/fonts.md +112 -0
- package/.agents/skills/remotion-to-hyperframes/references/limitations.md +136 -0
- package/.agents/skills/remotion-to-hyperframes/references/lottie.md +121 -0
- package/.agents/skills/remotion-to-hyperframes/references/media.md +149 -0
- package/.agents/skills/remotion-to-hyperframes/references/parameters.md +167 -0
- package/.agents/skills/remotion-to-hyperframes/references/sequencing.md +195 -0
- package/.agents/skills/remotion-to-hyperframes/references/timing.md +165 -0
- package/.agents/skills/remotion-to-hyperframes/references/transitions.md +114 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/.gitkeep +0 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/frame_strip.sh +107 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/lint_source.py +358 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/render_diff.sh +103 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/tests/fixtures/blocker.tsx +50 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/tests/fixtures/clean.tsx +46 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/tests/smoke.sh +90 -0
- package/.agents/skills/seo-audit/SKILL.md +497 -0
- package/.agents/skills/seo-audit/evals/evals.json +136 -0
- package/.agents/skills/seo-audit/references/ai-writing-detection.md +200 -0
- package/.agents/skills/seo-audit/references/international-seo.md +230 -0
- package/README.md +4 -2
- package/SDK.md +64 -1
- package/dist/agents/coding.agent.d.ts +632 -0
- package/dist/agents/coding.agent.d.ts.map +1 -1
- package/dist/agents/coding.agent.js +11 -3
- package/dist/agents/coding.agent.js.map +1 -1
- package/dist/agents/developer-helper.agent.d.ts +704 -0
- package/dist/agents/developer-helper.agent.d.ts.map +1 -1
- package/dist/agents/developer-helper.agent.js +6 -0
- package/dist/agents/developer-helper.agent.js.map +1 -1
- package/dist/agents/manager.d.ts +1009 -4
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/manager.js +16 -5
- package/dist/agents/manager.js.map +1 -1
- package/dist/agents/security.agent.d.ts +157 -3
- package/dist/agents/security.agent.d.ts.map +1 -1
- package/dist/agents/security.agent.js +3 -0
- package/dist/agents/security.agent.js.map +1 -1
- package/dist/agents/swarm/main.js +1 -1
- package/dist/agents/swarm/main.js.map +1 -1
- package/dist/agents/swarm/registry.d.ts.map +1 -1
- package/dist/agents/swarm/registry.js +232 -26
- package/dist/agents/swarm/registry.js.map +1 -1
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +32 -10
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/doctor.d.ts +14 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +91 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/format.d.ts +1 -0
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +68 -14
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/menu.d.ts.map +1 -1
- package/dist/cli/menu.js +102 -0
- package/dist/cli/menu.js.map +1 -1
- package/dist/cli/setup.d.ts +10 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +187 -3
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/update.d.ts +2 -0
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +89 -1
- package/dist/cli/update.js.map +1 -1
- package/dist/config/env.d.ts +12 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +19 -5
- package/dist/config/env.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -5
- package/dist/index.js.map +1 -1
- package/dist/jobs/trigger-orchestrator.d.ts +5 -1
- package/dist/jobs/trigger-orchestrator.d.ts.map +1 -1
- package/dist/jobs/trigger-orchestrator.js +29 -9
- package/dist/jobs/trigger-orchestrator.js.map +1 -1
- package/dist/jobs/trigger-router.d.ts.map +1 -1
- package/dist/jobs/trigger-router.js +3 -2
- package/dist/jobs/trigger-router.js.map +1 -1
- package/dist/memory/corporate-wiki.d.ts +15 -0
- package/dist/memory/corporate-wiki.d.ts.map +1 -0
- package/dist/memory/corporate-wiki.js +152 -0
- package/dist/memory/corporate-wiki.js.map +1 -0
- package/dist/observability/doctor.d.ts.map +1 -1
- package/dist/observability/doctor.js +12 -4
- package/dist/observability/doctor.js.map +1 -1
- package/dist/pre-init.d.ts +2 -0
- package/dist/pre-init.d.ts.map +1 -0
- package/dist/pre-init.js +3 -0
- package/dist/pre-init.js.map +1 -0
- package/dist/runtime/chat-bridge.d.ts.map +1 -1
- package/dist/runtime/chat-bridge.js +33 -2
- package/dist/runtime/chat-bridge.js.map +1 -1
- package/dist/runtime/swarm.d.ts +0 -1
- package/dist/runtime/swarm.d.ts.map +1 -1
- package/dist/runtime/swarm.js +26 -15
- package/dist/runtime/swarm.js.map +1 -1
- package/dist/safety/approvals.d.ts +2 -2
- package/dist/safety/approvals.d.ts.map +1 -1
- package/dist/safety/approvals.js +47 -1
- package/dist/safety/approvals.js.map +1 -1
- package/dist/safety/redaction.d.ts.map +1 -1
- package/dist/safety/redaction.js +10 -0
- package/dist/safety/redaction.js.map +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/cloud.tool.d.ts +394 -0
- package/dist/tools/cloud.tool.d.ts.map +1 -0
- package/dist/tools/cloud.tool.js +784 -0
- package/dist/tools/cloud.tool.js.map +1 -0
- package/dist/tools/computer-use.tool.d.ts +6 -6
- package/dist/tools/corporate-wiki.tool.d.ts +22 -0
- package/dist/tools/corporate-wiki.tool.d.ts.map +1 -0
- package/dist/tools/corporate-wiki.tool.js +39 -0
- package/dist/tools/corporate-wiki.tool.js.map +1 -0
- package/dist/tools/desktop.tool.d.ts +96 -0
- package/dist/tools/desktop.tool.d.ts.map +1 -1
- package/dist/tools/desktop.tool.js +439 -0
- package/dist/tools/desktop.tool.js.map +1 -1
- package/dist/tools/devops.tool.d.ts +162 -0
- package/dist/tools/devops.tool.d.ts.map +1 -0
- package/dist/tools/devops.tool.js +377 -0
- package/dist/tools/devops.tool.js.map +1 -0
- package/dist/tools/multimedia.tool.d.ts +126 -0
- package/dist/tools/multimedia.tool.d.ts.map +1 -0
- package/dist/tools/multimedia.tool.js +533 -0
- package/dist/tools/multimedia.tool.js.map +1 -0
- package/dist/tools/osint.tool.d.ts +6 -6
- package/dist/tools/sandbox-dev.tool.d.ts +15 -0
- package/dist/tools/sandbox-dev.tool.d.ts.map +1 -0
- package/dist/tools/sandbox-dev.tool.js +139 -0
- package/dist/tools/sandbox-dev.tool.js.map +1 -0
- package/dist/tools/setup-assistant.tool.d.ts +1 -1
- package/dist/tools/shell.tool.d.ts +82 -0
- package/dist/tools/shell.tool.d.ts.map +1 -1
- package/dist/tools/shell.tool.js +192 -1
- package/dist/tools/shell.tool.js.map +1 -1
- package/dist/tools/swarm-ops.tool.d.ts +14 -0
- package/dist/tools/swarm-ops.tool.d.ts.map +1 -1
- package/dist/tools/swarm-ops.tool.js +44 -0
- package/dist/tools/swarm-ops.tool.js.map +1 -1
- package/dist/tools/sysops.tool.d.ts +157 -0
- package/dist/tools/sysops.tool.d.ts.map +1 -0
- package/dist/tools/sysops.tool.js +643 -0
- package/dist/tools/sysops.tool.js.map +1 -0
- package/dist/voice/cascade.d.ts +1 -0
- package/dist/voice/cascade.d.ts.map +1 -1
- package/dist/voice/cascade.js +16 -1
- package/dist/voice/cascade.js.map +1 -1
- package/dist/voice/deepgram.d.ts.map +1 -1
- package/dist/voice/deepgram.js +34 -2
- package/dist/voice/deepgram.js.map +1 -1
- package/dist/voice/terminal.d.ts +1 -0
- package/dist/voice/terminal.d.ts.map +1 -1
- package/dist/voice/terminal.js +28 -0
- package/dist/voice/terminal.js.map +1 -1
- package/dist/voice/types.d.ts +2 -0
- package/dist/voice/types.d.ts.map +1 -1
- package/package.json +9 -1
- package/scripts/release-github.mjs +23 -18
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: clerk-backend-api
|
|
3
|
+
description: "Clerk Backend REST API explorer and executor. Browse tags, inspect endpoint schemas, and execute authenticated requests. Use when listing users, managing organizations, or calling any Clerk API endpoint."
|
|
4
|
+
allowed-tools: Bash, Read, Grep, Skill, WebFetch
|
|
5
|
+
license: MIT
|
|
6
|
+
compatibility: Requires CLERK_SECRET_KEY (sk_*) for Backend API calls.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Options context
|
|
10
|
+
|
|
11
|
+
User Prompt: $ARGUMENTS
|
|
12
|
+
|
|
13
|
+
## CRITICAL: Mandatory checks before EVERY write request
|
|
14
|
+
|
|
15
|
+
Before ANY POST / PATCH / PUT / DELETE, you MUST do ALL of the following in your response:
|
|
16
|
+
|
|
17
|
+
1. **Check CLERK_SECRET_KEY** — verify it is set:
|
|
18
|
+
```bash
|
|
19
|
+
echo $CLERK_SECRET_KEY | head -c 10
|
|
20
|
+
```
|
|
21
|
+
If empty, stop and ask the user. Do not proceed without a valid key.
|
|
22
|
+
|
|
23
|
+
2. **Check CLERK_BAPI_SCOPES** — run:
|
|
24
|
+
```bash
|
|
25
|
+
echo $CLERK_BAPI_SCOPES
|
|
26
|
+
```
|
|
27
|
+
Inspect the output. If scopes are missing or do not include the required write permission, tell the user: *"This is a write operation and your current scopes may not allow it. Rerun with --admin to bypass?"* Do NOT attempt the request and fail — ask first.
|
|
28
|
+
|
|
29
|
+
3. **For DELETE requests:** warn explicitly that the action is **IRREVERSIBLE** and list exactly what data will be permanently destroyed (user record, all sessions, all memberships, all associated data). Require explicit confirmation before proceeding. This warning is MANDATORY — never skip it.
|
|
30
|
+
|
|
31
|
+
4. **For metadata operations:** always explain which metadata type is being used and why (see Metadata types section below).
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## FAST PATH: Common operations (use directly, no spec fetching needed)
|
|
36
|
+
|
|
37
|
+
For the operations below, skip spec fetching and execute immediately using these exact templates. Substitute `$CLERK_SECRET_KEY`, `$USER_ID`, `$ORG_ID`, `$EMAIL` as needed from the user's context.
|
|
38
|
+
|
|
39
|
+
### Create organization + invite member (two-step)
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Step 1 — Create organization
|
|
43
|
+
ORG=$(curl -s -X POST "https://api.clerk.com/v1/organizations" \
|
|
44
|
+
-H "Authorization: Bearer $CLERK_SECRET_KEY" \
|
|
45
|
+
-H "Content-Type: application/json" \
|
|
46
|
+
-d "{\"name\": \"Acme Corp\", \"created_by\": \"$USER_ID\"}")
|
|
47
|
+
echo "$ORG" | python3 -c "import sys,json; d=json.load(sys.stdin); print(json.dumps(d, indent=2))"
|
|
48
|
+
|
|
49
|
+
# Step 2 — Extract org ID
|
|
50
|
+
ORG_ID=$(echo "$ORG" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
|
51
|
+
|
|
52
|
+
# Step 3 — Invite member with role
|
|
53
|
+
curl -s -X POST "https://api.clerk.com/v1/organizations/${ORG_ID}/invitations" \
|
|
54
|
+
-H "Authorization: Bearer $CLERK_SECRET_KEY" \
|
|
55
|
+
-H "Content-Type: application/json" \
|
|
56
|
+
-d "{\"email_address\": \"user@example.com\", \"role\": \"org:admin\"}" \
|
|
57
|
+
| python3 -c "import sys,json; print(json.dumps(json.load(sys.stdin), indent=2))"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Roles:** use `"org:admin"` or `"org:member"` (always prefix with `org:`).
|
|
61
|
+
|
|
62
|
+
### SDK equivalent (for Next.js / TypeScript projects with `@clerk/nextjs` or `@clerk/backend`)
|
|
63
|
+
|
|
64
|
+
```typescript
|
|
65
|
+
import { clerkClient } from '@clerk/nextjs/server'
|
|
66
|
+
// OR if using @clerk/backend directly:
|
|
67
|
+
// import { createClerkClient } from '@clerk/backend'
|
|
68
|
+
// const clerkClient = createClerkClient({ secretKey: process.env.CLERK_SECRET_KEY })
|
|
69
|
+
|
|
70
|
+
// Step 1: Create organization
|
|
71
|
+
const org = await clerkClient.organizations.createOrganization({
|
|
72
|
+
name: 'Acme Corp',
|
|
73
|
+
createdBy: userId, // required — the ID of the user creating the org
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
// Step 2: Invite member to the org
|
|
77
|
+
const invitation = await clerkClient.organizations.createOrganizationInvitation({
|
|
78
|
+
organizationId: org.id,
|
|
79
|
+
emailAddress: 'user@example.com',
|
|
80
|
+
role: 'org:admin', // or 'org:member'
|
|
81
|
+
})
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Update user metadata
|
|
85
|
+
|
|
86
|
+
**Always explain the three metadata types before asking which to use:**
|
|
87
|
+
|
|
88
|
+
| Type | Field | Readable by | Writable by | Use for |
|
|
89
|
+
|------|-------|-------------|-------------|---------|
|
|
90
|
+
| Public | `public_metadata` | Client + Server | **Server only** | Plan tier, roles, feature flags the frontend reads |
|
|
91
|
+
| Private | `private_metadata` | **Server only** | **Server only** | Stripe IDs, compliance flags, internal identifiers |
|
|
92
|
+
| Unsafe | `unsafe_metadata` | Client + Server | Client + Server | Ephemeral UI state, onboarding steps (client-writable — avoid sensitive data) |
|
|
93
|
+
|
|
94
|
+
**For `plan: 'pro'` and `onboarded: true` — use `public_metadata`** (frontend-readable, server-writable):
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
curl -s -X PATCH "https://api.clerk.com/v1/users/${USER_ID}" \
|
|
98
|
+
-H "Authorization: Bearer $CLERK_SECRET_KEY" \
|
|
99
|
+
-H "Content-Type: application/json" \
|
|
100
|
+
-d '{"public_metadata": {"plan": "pro", "onboarded": true}}' \
|
|
101
|
+
| python3 -c "import sys,json; d=json.load(sys.stdin); print(f'Updated user {d[\"id\"]}: public_metadata={d.get(\"public_metadata\")}')"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**SDK equivalent:**
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
import { clerkClient } from '@clerk/nextjs/server'
|
|
108
|
+
// OR: import { createClerkClient } from '@clerk/backend'
|
|
109
|
+
|
|
110
|
+
await clerkClient.users.updateUser(userId, {
|
|
111
|
+
publicMetadata: { plan: 'pro', onboarded: true }, // readable by client, writable server-only
|
|
112
|
+
// privateMetadata: { stripeId: 'cus_xxx' }, // server-only read AND write
|
|
113
|
+
// unsafeMetadata: { step: 'welcome' }, // client-writable, avoid sensitive data
|
|
114
|
+
})
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Note:** REST API uses `snake_case` (`public_metadata`). SDK uses `camelCase` (`publicMetadata`).
|
|
118
|
+
|
|
119
|
+
### List users (last 7 days)
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
curl -s "https://api.clerk.com/v1/users?limit=100&offset=0&order_by=-created_at&created_at=gt:$(date -d '7 days ago' +%s 2>/dev/null || date -v-7d +%s)000" \
|
|
123
|
+
-H "Authorization: Bearer $CLERK_SECRET_KEY" \
|
|
124
|
+
| python3 -c "
|
|
125
|
+
import sys, json
|
|
126
|
+
data = json.load(sys.stdin)
|
|
127
|
+
if isinstance(data, list):
|
|
128
|
+
print(f'Found {len(data)} users:')
|
|
129
|
+
for u in data:
|
|
130
|
+
print(f' {u[\"id\"]}: {u.get(\"email_addresses\", [{}])[0].get(\"email_address\", \"no email\")}')
|
|
131
|
+
else:
|
|
132
|
+
print(json.dumps(data, indent=2))
|
|
133
|
+
"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Delete user (confirm required)
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# ONLY run after explicit user confirmation
|
|
140
|
+
curl -s -X DELETE "https://api.clerk.com/v1/users/${USER_ID}" \
|
|
141
|
+
-H "Authorization: Bearer $CLERK_SECRET_KEY" \
|
|
142
|
+
| python3 -c "import sys,json; d=json.load(sys.stdin); print(f'Deleted: {d}')"
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## Clerk Backend API — Full Endpoint Reference
|
|
148
|
+
|
|
149
|
+
Base URL: `https://api.clerk.com/v1`
|
|
150
|
+
Auth: `Authorization: Bearer $CLERK_SECRET_KEY` on every request.
|
|
151
|
+
|
|
152
|
+
### Users
|
|
153
|
+
|
|
154
|
+
**List users**
|
|
155
|
+
```
|
|
156
|
+
GET /v1/users
|
|
157
|
+
Query params: limit (max 500, default 10), offset, order_by (+/-created_at, +/-updated_at, +/-email_address, +/-web3wallet, +/-first_name, +/-last_name, +/-phone_number, +/-username, +/-last_active_at, +/-last_sign_in_at), email_address[], phone_number[], username[], web3wallet[], user_id[], query, created_at (ISO 8601 range: gt:TIMESTAMP or lt:TIMESTAMP in Unix ms)
|
|
158
|
+
Returns: array of User objects
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Get user**
|
|
162
|
+
```
|
|
163
|
+
GET /v1/users/{user_id}
|
|
164
|
+
Returns: User object
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
**Update user**
|
|
168
|
+
```
|
|
169
|
+
PATCH /v1/users/{user_id}
|
|
170
|
+
Body (JSON, snake_case): { public_metadata, private_metadata, unsafe_metadata, first_name, last_name, username, ... }
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**Delete user — IRREVERSIBLE**
|
|
174
|
+
```
|
|
175
|
+
DELETE /v1/users/{user_id}
|
|
176
|
+
Destroys: user record, all sessions, all memberships, all associated data
|
|
177
|
+
Returns: { id, object, deleted: true }
|
|
178
|
+
```
|
|
179
|
+
Always warn the user this is permanent and confirm before proceeding.
|
|
180
|
+
|
|
181
|
+
### Organizations
|
|
182
|
+
|
|
183
|
+
**Create organization**
|
|
184
|
+
```
|
|
185
|
+
POST /v1/organizations
|
|
186
|
+
Body: { name: string, created_by: string (user_id), public_metadata?, private_metadata?, max_allowed_memberships? }
|
|
187
|
+
Returns: Organization object with { id, name, slug, ... }
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**List organizations**
|
|
191
|
+
```
|
|
192
|
+
GET /v1/organizations
|
|
193
|
+
Query params: limit, offset, query, order_by
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Invite member**
|
|
197
|
+
```
|
|
198
|
+
POST /v1/organizations/{organization_id}/invitations
|
|
199
|
+
Body: { email_address: string, role: string ("org:admin" or "org:member"), public_metadata?, private_metadata? }
|
|
200
|
+
Returns: OrganizationInvitation object
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## How to execute requests
|
|
206
|
+
|
|
207
|
+
**ALWAYS execute requests with direct `curl` commands.** Use the spec-extraction scripts (`api-specs-context.sh`, `extract-tags.js`, `extract-endpoint-detail.sh`) to discover endpoints, but make actual API calls with `curl`. Do NOT use `scripts/execute-request.sh` — it's a local dev helper, not for agent use.
|
|
208
|
+
|
|
209
|
+
Template for GET requests:
|
|
210
|
+
```bash
|
|
211
|
+
curl -s "https://api.clerk.com/v1${PATH}${QUERY_STRING}" \
|
|
212
|
+
-H "Authorization: Bearer $CLERK_SECRET_KEY"
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Template for POST/PATCH requests:
|
|
216
|
+
```bash
|
|
217
|
+
curl -s -X ${METHOD} "https://api.clerk.com/v1${PATH}" \
|
|
218
|
+
-H "Authorization: Bearer $CLERK_SECRET_KEY" \
|
|
219
|
+
-H "Content-Type: application/json" \
|
|
220
|
+
-d '${BODY_JSON}'
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Template for DELETE requests:
|
|
224
|
+
```bash
|
|
225
|
+
curl -s -X DELETE "https://api.clerk.com/v1${PATH}" \
|
|
226
|
+
-H "Authorization: Bearer $CLERK_SECRET_KEY"
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**After getting the response:** Parse and display it clearly. Use `python3 -c "import sys,json; data=json.load(sys.stdin); print(json.dumps(data, indent=2))"` to pretty-print JSON. Extract key fields (id, email, name, etc.) and summarize them for the user.
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## API specs context
|
|
234
|
+
|
|
235
|
+
Before doing anything outside the FAST PATH, fetch the available spec versions and tags by running:
|
|
236
|
+
```bash
|
|
237
|
+
bash scripts/api-specs-context.sh
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
Use the output to determine the latest version and available tags.
|
|
241
|
+
|
|
242
|
+
**Caching:** If you already fetched the spec context earlier in this conversation, do NOT fetch it again. Reuse the version and tags from the previous call.
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Rules
|
|
247
|
+
|
|
248
|
+
- For common operations (list users, create org, invite, update metadata, delete user): use the FAST PATH above — do NOT fetch specs first.
|
|
249
|
+
- Always disregard endpoints/schemas related to `platform`.
|
|
250
|
+
- Always confirm before performing write requests (POST/PUT/PATCH/DELETE).
|
|
251
|
+
- For DELETE operations, always warn the user that the action is **irreversible** and mention what data will be lost (user record, sessions, memberships). This warning is MANDATORY — never skip it.
|
|
252
|
+
- For write operations (POST/PUT/PATCH/DELETE), check `CLERK_BAPI_SCOPES` before attempting the request. If missing or insufficient, ask the user upfront. Do NOT attempt and fail — ask before executing. This check is MANDATORY.
|
|
253
|
+
- For metadata operations, always explain all three types (public, private, unsafe) and recommend the appropriate one.
|
|
254
|
+
- Pagination: always use `limit` + `offset` and mention that results may be paginated for large datasets.
|
|
255
|
+
- Use direct curl commands for all API calls — never use `scripts/execute-request.sh`.
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Rate Limits & Gotchas
|
|
260
|
+
|
|
261
|
+
### Rate Limits
|
|
262
|
+
|
|
263
|
+
| Environment | Limit |
|
|
264
|
+
|-------------|-------|
|
|
265
|
+
| Production | 1,000 requests / 10 seconds |
|
|
266
|
+
| Development | 100 requests / 10 seconds |
|
|
267
|
+
| Single invitations | 100 / hour |
|
|
268
|
+
| Bulk invitations | 25 / hour |
|
|
269
|
+
| Org invitations | 250 / hour |
|
|
270
|
+
| Frontend API sign-in creation | 5 / 10 seconds |
|
|
271
|
+
| Frontend API sign-in attempts | 3 / 10 seconds |
|
|
272
|
+
| List users max per page | 500 |
|
|
273
|
+
|
|
274
|
+
`currentUser()` makes a real API call that counts against rate limits. Use `auth()` for just the session claims — it reads from the token without an API call.
|
|
275
|
+
|
|
276
|
+
### Metadata Overwrites (Not Merges)
|
|
277
|
+
|
|
278
|
+
`updateUser({ publicMetadata: { role: 'admin' } })` REPLACES all public metadata, not merges. To add a field without losing existing data: read first, spread, then write.
|
|
279
|
+
|
|
280
|
+
Wrong:
|
|
281
|
+
```typescript
|
|
282
|
+
await clerkClient.users.updateUser(userId, { publicMetadata: { newField: 'value' } })
|
|
283
|
+
```
|
|
284
|
+
This DELETES all other `publicMetadata` fields.
|
|
285
|
+
|
|
286
|
+
Right:
|
|
287
|
+
```typescript
|
|
288
|
+
const user = await clerkClient.users.getUser(userId)
|
|
289
|
+
await clerkClient.users.updateUser(userId, {
|
|
290
|
+
publicMetadata: { ...user.publicMetadata, newField: 'value' },
|
|
291
|
+
})
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## Modes
|
|
297
|
+
|
|
298
|
+
Determine the active mode based on the user prompt in [Options context](#options-context):
|
|
299
|
+
|
|
300
|
+
| Mode | Trigger | Behavior |
|
|
301
|
+
|------|---------|----------|
|
|
302
|
+
| `help` | Prompt is empty, or contains only `help` / `-h` / `--help` | Print usage examples (step 0) |
|
|
303
|
+
| `browse` | Prompt is `tags`, or a tag name (e.g. `Users`) | List all tags or endpoints for a tag |
|
|
304
|
+
| `execute` | Specific endpoint (e.g. `GET /users`) or natural language action (e.g. "get user john_doe") | Look up endpoint, execute request |
|
|
305
|
+
| `detail` | Endpoint + `help` / `-h` / `--help` (e.g. `GET /users help`) | Show endpoint schema, don't execute |
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## Your Task
|
|
310
|
+
|
|
311
|
+
Use the **LATEST VERSION** from [API specs context](#api-specs-context) by default. If the user specifies a different version (e.g. `--version 2024-10-01`), use that version instead.
|
|
312
|
+
|
|
313
|
+
Determine the active mode, then follow the applicable steps below.
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
### 0. Print usage
|
|
318
|
+
|
|
319
|
+
**Modes:** `help` only — **Skip** for `browse`, `execute`, and `detail`.
|
|
320
|
+
|
|
321
|
+
Print the following examples to the user verbatim:
|
|
322
|
+
|
|
323
|
+
```
|
|
324
|
+
Browse
|
|
325
|
+
/clerk-backend-api tags — list all tags
|
|
326
|
+
/clerk-backend-api Users — browse endpoints for the Users tag
|
|
327
|
+
/clerk-backend-api Users version 2025-11-10.yml — browse using a different version
|
|
328
|
+
|
|
329
|
+
Execute
|
|
330
|
+
/clerk-backend-api GET /users — fetch all users
|
|
331
|
+
/clerk-backend-api get user john_doe — natural language works too
|
|
332
|
+
/clerk-backend-api POST /invitations — create an invitation
|
|
333
|
+
|
|
334
|
+
Inspect
|
|
335
|
+
/clerk-backend-api GET /users help — show endpoint schema without executing
|
|
336
|
+
/clerk-backend-api POST /invitations -h — view request/response details
|
|
337
|
+
|
|
338
|
+
Options
|
|
339
|
+
--admin — bypass scope restrictions for write/delete
|
|
340
|
+
--version [date], version [date] — use a specific spec version
|
|
341
|
+
--help, -h, help — inspect endpoint instead of executing
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
Stop here.
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
### 1. Fetch tags
|
|
349
|
+
|
|
350
|
+
**Modes:** `browse` (when prompt is `tags` or no tag specified) — **Skip** for `help`, `execute`, and `detail`.
|
|
351
|
+
|
|
352
|
+
If using a non-latest version, fetch tags for that version:
|
|
353
|
+
```bash
|
|
354
|
+
curl -s https://raw.githubusercontent.com/clerk/openapi-specs/main/bapi/${version_name} | node scripts/extract-tags.js
|
|
355
|
+
```
|
|
356
|
+
Otherwise, use the **TAGS** already in [API specs context](#api-specs-context).
|
|
357
|
+
|
|
358
|
+
Share tags in a table and prompt the user to select a query.
|
|
359
|
+
|
|
360
|
+
---
|
|
361
|
+
|
|
362
|
+
### 2. Fetch tag endpoints
|
|
363
|
+
|
|
364
|
+
**Modes:** `browse` (when a tag name is provided) — **Skip** for `help`, `execute`, and `detail`.
|
|
365
|
+
|
|
366
|
+
Fetch all endpoints for the identified tag:
|
|
367
|
+
```bash
|
|
368
|
+
curl -s https://raw.githubusercontent.com/clerk/openapi-specs/main/bapi/${version_name} | bash scripts/extract-tag-endpoints.sh "${tag_name}"
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
Share the results (endpoints, schemas, parameters) with the user.
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
### 3. Fetch endpoint detail
|
|
376
|
+
|
|
377
|
+
**Modes:** `execute`, `detail` — **Skip** for `help` and `browse`.
|
|
378
|
+
|
|
379
|
+
For natural language prompts in `execute` mode, first check if the operation matches a FAST PATH entry above. If it does, skip this step and proceed directly to step 4 using the FAST PATH template.
|
|
380
|
+
|
|
381
|
+
For other endpoints, identify the matching endpoint by searching the tags in context. Fetch tag endpoints if needed to resolve the exact path and method.
|
|
382
|
+
|
|
383
|
+
Extract the full endpoint definition:
|
|
384
|
+
```bash
|
|
385
|
+
curl -s https://raw.githubusercontent.com/clerk/openapi-specs/main/bapi/${version_name} | bash scripts/extract-endpoint-detail.sh "${path}" "${method}"
|
|
386
|
+
```
|
|
387
|
+
- `${path}` — e.g. `/users/{user_id}`
|
|
388
|
+
- `${method}` — lowercase, e.g. `get`
|
|
389
|
+
|
|
390
|
+
**`detail` mode:** Share the endpoint definition and schemas with the user. Stop here.
|
|
391
|
+
|
|
392
|
+
**`execute` mode:** Continue to step 4.
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
### 4. Execute request
|
|
397
|
+
|
|
398
|
+
**Modes:** `execute` only.
|
|
399
|
+
|
|
400
|
+
1. Run the **mandatory checks** from the CRITICAL section above.
|
|
401
|
+
2. Identify required and optional parameters from the spec (step 3) or FAST PATH.
|
|
402
|
+
3. Ask the user for any required path/query/body parameters that weren't provided.
|
|
403
|
+
4. Build and execute a **direct curl command** (see How to execute requests above). Do NOT use `scripts/execute-request.sh`.
|
|
404
|
+
5. Parse the JSON response and display it clearly. Extract and summarize key fields for the user.
|
|
405
|
+
|
|
406
|
+
**Example — list users and parse response:**
|
|
407
|
+
```bash
|
|
408
|
+
RESPONSE=$(curl -s "https://api.clerk.com/v1/users?limit=10" \
|
|
409
|
+
-H "Authorization: Bearer $CLERK_SECRET_KEY")
|
|
410
|
+
echo "$RESPONSE" | python3 -c "
|
|
411
|
+
import sys, json
|
|
412
|
+
data = json.load(sys.stdin)
|
|
413
|
+
if isinstance(data, list):
|
|
414
|
+
print(f'Found {len(data)} users:')
|
|
415
|
+
for u in data:
|
|
416
|
+
print(f' {u[\"id\"]}: {u.get(\"email_addresses\", [{}])[0].get(\"email_address\", \"no email\")}')
|
|
417
|
+
else:
|
|
418
|
+
print(json.dumps(data, indent=2))
|
|
419
|
+
"
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
## See Also
|
|
423
|
+
|
|
424
|
+
- `clerk-setup` - Initial Clerk install
|
|
425
|
+
- `clerk-orgs` - Manage organizations via API
|
|
426
|
+
- `clerk-webhooks` - Real-time event sync
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
{
|
|
2
|
+
"skill_name": "clerk-backend-api",
|
|
3
|
+
"evals": [
|
|
4
|
+
{
|
|
5
|
+
"id": 1,
|
|
6
|
+
"prompt": "i need to get all users who signed up in the last 7 days from clerk's backend API. show me how",
|
|
7
|
+
"expected_output": "REST API call to GET /v1/users with date filter, Bearer token auth using CLERK_SECRET_KEY, response parsing and pagination handling",
|
|
8
|
+
"scaffold": "nextjs-basic-auth",
|
|
9
|
+
"files": [],
|
|
10
|
+
"expectations": [
|
|
11
|
+
"Uses GET /v1/users endpoint",
|
|
12
|
+
"Includes a created_at or date-based filter query parameter to narrow to last 7 days",
|
|
13
|
+
"Sets CLERK_SECRET_KEY as Bearer token in the Authorization header",
|
|
14
|
+
"Parses the JSON response array of user objects",
|
|
15
|
+
"Handles or mentions pagination via limit and offset parameters"
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": 2,
|
|
20
|
+
"prompt": "use the clerk backend api to create a new organization called 'Acme Corp' and invite user@example.com as an admin",
|
|
21
|
+
"expected_output": "Two API calls: POST /v1/organizations to create org, then POST /v1/organizations/{id}/invitations to invite with admin role",
|
|
22
|
+
"scaffold": "nextjs-basic-auth",
|
|
23
|
+
"files": [],
|
|
24
|
+
"expectations": [
|
|
25
|
+
"Uses POST /v1/organizations to create the organization with name 'Acme Corp'",
|
|
26
|
+
"Uses POST /v1/organizations/{id}/invitations to send the invitation",
|
|
27
|
+
"Sets the role to admin (or org:admin) in the invitation payload",
|
|
28
|
+
"Authenticates both API calls using CLERK_SECRET_KEY in the Authorization header",
|
|
29
|
+
"Extracts the organization ID from the first response and uses it in the invitation request"
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": 3,
|
|
34
|
+
"prompt": "i need to set custom metadata on a user via clerk's backend api. set their plan to 'pro' and onboarded to true",
|
|
35
|
+
"expected_output": "PATCH /v1/users/{user_id} with public_metadata or private_metadata body, explanation of metadata types and when to use each",
|
|
36
|
+
"scaffold": "nextjs-basic-auth",
|
|
37
|
+
"files": [],
|
|
38
|
+
"expectations": [
|
|
39
|
+
"Uses PATCH /v1/users/{user_id} endpoint",
|
|
40
|
+
"Sets the metadata in the correct field: public_metadata, private_metadata, or unsafe_metadata",
|
|
41
|
+
"Explains the difference between metadata types (client-readable vs server-only vs client-writable)",
|
|
42
|
+
"Includes a properly formed JSON body with the plan and onboarded fields",
|
|
43
|
+
"Mentions checking write permissions before executing the update"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": 4,
|
|
48
|
+
"prompt": "remove a user with id user_abc123 from our clerk instance using the backend api",
|
|
49
|
+
"expected_output": "DELETE /v1/users/{user_id} call with warning about irreversibility, CLERK_BAPI_SCOPES check, and CLERK_SECRET_KEY auth",
|
|
50
|
+
"scaffold": "nextjs-basic-auth",
|
|
51
|
+
"files": [],
|
|
52
|
+
"expectations": [
|
|
53
|
+
"Uses DELETE /v1/users/{user_id} endpoint with the correct user ID",
|
|
54
|
+
"Warns that the action is destructive and irreversible",
|
|
55
|
+
"Requires or recommends explicit confirmation before executing the delete",
|
|
56
|
+
"Includes CLERK_SECRET_KEY as Bearer token in the Authorization header",
|
|
57
|
+
"Mentions implications such as loss of user data, sessions, and associated records"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"id": 5,
|
|
62
|
+
"prompt": "i'm updating user metadata to add a 'plan' field but it keeps deleting the existing 'role' field. what am i doing wrong?",
|
|
63
|
+
"expected_output": "Metadata updates overwrite not merge. Read existing metadata first, spread it, then write back.",
|
|
64
|
+
"scaffold": "nextjs-basic-auth",
|
|
65
|
+
"expectations": [
|
|
66
|
+
"Explains that updateUser publicMetadata replaces all existing metadata, not merges",
|
|
67
|
+
"Shows reading the existing user first with getUser(userId)",
|
|
68
|
+
"Spreads existing metadata before adding new fields ({ ...user.publicMetadata, plan: 'pro' })",
|
|
69
|
+
"Calls updateUser with the merged metadata object",
|
|
70
|
+
"Warns that this applies to publicMetadata, privateMetadata, and unsafeMetadata equally"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"id": 6,
|
|
75
|
+
"prompt": "my clerk backend api calls are failing with 429 errors in development. what are the rate limits?",
|
|
76
|
+
"expected_output": "Development has 100 req/10s limit (vs 1000/10s in production). Batch operations or reduce call frequency.",
|
|
77
|
+
"scaffold": "nextjs-basic-auth",
|
|
78
|
+
"expectations": [
|
|
79
|
+
"States the development rate limit (100 requests per 10 seconds)",
|
|
80
|
+
"States the production rate limit (1000 requests per 10 seconds)",
|
|
81
|
+
"Suggests batching operations or reducing call frequency",
|
|
82
|
+
"Mentions that currentUser() counts as an API call against the limit",
|
|
83
|
+
"Recommends using auth() instead of currentUser() when only session claims are needed"
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Fetches all available BAPI spec versions, determines the latest,
|
|
4
|
+
# and extracts tags from it. Output is used as skill context.
|
|
5
|
+
|
|
6
|
+
set -euo pipefail
|
|
7
|
+
|
|
8
|
+
API_URL="https://api.github.com/repos/clerk/openapi-specs/contents/bapi"
|
|
9
|
+
RAW_BASE="https://raw.githubusercontent.com/clerk/openapi-specs/main/bapi"
|
|
10
|
+
|
|
11
|
+
# Fetch version list, parse dates, sort, pick latest
|
|
12
|
+
versions=$(curl -s "$API_URL" | node -e "
|
|
13
|
+
let d='';
|
|
14
|
+
process.stdin.on('data',c=>d+=c);
|
|
15
|
+
process.stdin.on('end',()=>{
|
|
16
|
+
const items = JSON.parse(d)
|
|
17
|
+
.map(i=>i.name)
|
|
18
|
+
.filter(n=>/^\d{4}-\d{2}-\d{2}\.yml$/.test(n))
|
|
19
|
+
.sort();
|
|
20
|
+
items.forEach(n=>console.log(n));
|
|
21
|
+
});
|
|
22
|
+
")
|
|
23
|
+
|
|
24
|
+
latest=$(echo "$versions" | tail -1)
|
|
25
|
+
|
|
26
|
+
echo "AVAILABLE VERSIONS: $(echo "$versions" | tr '\n' ' ')"
|
|
27
|
+
echo "LATEST VERSION: $latest"
|
|
28
|
+
echo ""
|
|
29
|
+
echo "TAGS:"
|
|
30
|
+
curl -s "${RAW_BASE}/${latest}" | node "$(dirname "$0")/extract-tags.js"
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
# Execute a Clerk Backend API request with scope enforcement.
|
|
4
|
+
#
|
|
5
|
+
# Usage: bash execute-request.sh [--admin] <METHOD> <PATH> [BODY]
|
|
6
|
+
#
|
|
7
|
+
# Scope enforcement:
|
|
8
|
+
# GET — always allowed
|
|
9
|
+
# POST, PUT, PATCH — requires CLERK_BAPI_SCOPES="write" or --admin flag
|
|
10
|
+
# DELETE — requires CLERK_BAPI_SCOPES="write,delete" or --admin flag
|
|
11
|
+
|
|
12
|
+
set -euo pipefail
|
|
13
|
+
|
|
14
|
+
# Walk up from $PWD to find .env/.env.local (mirrors Clerk CLI behavior).
|
|
15
|
+
# Stops at the first directory that provides CLERK_SECRET_KEY.
|
|
16
|
+
_dir="$PWD"
|
|
17
|
+
while true; do
|
|
18
|
+
for _envfile in "$_dir/.env" "$_dir/.env.local"; do
|
|
19
|
+
if [[ -f "$_envfile" ]]; then
|
|
20
|
+
set -a
|
|
21
|
+
source "$_envfile"
|
|
22
|
+
set +a
|
|
23
|
+
fi
|
|
24
|
+
done
|
|
25
|
+
[[ -n "${CLERK_SECRET_KEY:-}" ]] && break
|
|
26
|
+
_parent="$(dirname "$_dir")"
|
|
27
|
+
[[ "$_parent" == "$_dir" ]] && break
|
|
28
|
+
_dir="$_parent"
|
|
29
|
+
done
|
|
30
|
+
unset _dir _parent _envfile
|
|
31
|
+
|
|
32
|
+
# Parse --admin flag
|
|
33
|
+
ADMIN=false
|
|
34
|
+
if [[ "${1:-}" == "--admin" ]]; then
|
|
35
|
+
ADMIN=true
|
|
36
|
+
shift
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
METHOD="${1:?Usage: execute-request.sh [--admin] <METHOD> <PATH> [BODY]}"
|
|
40
|
+
PATH_ARG="${2:?Usage: execute-request.sh [--admin] <METHOD> <PATH> [BODY]}"
|
|
41
|
+
BODY="${3:-}"
|
|
42
|
+
|
|
43
|
+
METHOD_UPPER=$(echo "$METHOD" | tr '[:lower:]' '[:upper:]')
|
|
44
|
+
SCOPES="${CLERK_BAPI_SCOPES:-}"
|
|
45
|
+
|
|
46
|
+
# Scope check
|
|
47
|
+
if [[ "$ADMIN" == false ]]; then
|
|
48
|
+
case "$METHOD_UPPER" in
|
|
49
|
+
GET)
|
|
50
|
+
;; # always allowed
|
|
51
|
+
POST|PUT|PATCH)
|
|
52
|
+
if [[ "$SCOPES" != *"write"* ]]; then
|
|
53
|
+
echo "ERROR: $METHOD_UPPER requests require CLERK_BAPI_SCOPES=\"write\" or --admin flag." >&2
|
|
54
|
+
echo "Current CLERK_BAPI_SCOPES: \"$SCOPES\"" >&2
|
|
55
|
+
exit 1
|
|
56
|
+
fi
|
|
57
|
+
;;
|
|
58
|
+
DELETE)
|
|
59
|
+
if [[ "$SCOPES" != *"write"* ]] || [[ "$SCOPES" != *"delete"* ]]; then
|
|
60
|
+
echo "ERROR: DELETE requests require CLERK_BAPI_SCOPES=\"write,delete\" or --admin flag." >&2
|
|
61
|
+
echo "Current CLERK_BAPI_SCOPES: \"$SCOPES\"" >&2
|
|
62
|
+
exit 1
|
|
63
|
+
fi
|
|
64
|
+
;;
|
|
65
|
+
*)
|
|
66
|
+
echo "ERROR: Unknown HTTP method: $METHOD_UPPER" >&2
|
|
67
|
+
exit 1
|
|
68
|
+
;;
|
|
69
|
+
esac
|
|
70
|
+
fi
|
|
71
|
+
|
|
72
|
+
# Base URL: use CLERK_REST_API_URL if set, otherwise default to production
|
|
73
|
+
BASE_URL="${CLERK_REST_API_URL:-https://api.clerk.com}"
|
|
74
|
+
|
|
75
|
+
# Build curl command
|
|
76
|
+
CURL_ARGS=(
|
|
77
|
+
-s
|
|
78
|
+
-X "$METHOD_UPPER"
|
|
79
|
+
"${BASE_URL}/v1${PATH_ARG}"
|
|
80
|
+
-H "Authorization: Bearer ${CLERK_SECRET_KEY:?CLERK_SECRET_KEY is not set}"
|
|
81
|
+
-H "Content-Type: application/json"
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
if [[ -n "$BODY" ]]; then
|
|
85
|
+
CURL_ARGS+=(-d "$BODY")
|
|
86
|
+
fi
|
|
87
|
+
|
|
88
|
+
curl "${CURL_ARGS[@]}"
|