darjss/alchemy-skill/alchemy
Claude Code and agent skill by darjss/alchemy-skill
- community
Checking that the SKILL.md file is still in the repository.
Alchemy v2 (alchemy.run), Infrastructure-as-Effects on Effect 4. Use when a project has `alchemy.run.ts` or imports `alchemy` or `@alchemy.run/*`, or when you write Stacks, Resources, Workers, Lambdas and their bindings, Config secrets or stages, or run `alchemy dev`, `deploy` or `destroy`. For v2 only, not v1's `await alchemy(...)`.
Install
npx vskill@latest install darjss/alchemy-skill/alchemySKILL.md
The same SKILL.md was published earlier as darjss/alchemy-skill/alchemy.
Alchemy v2
Check the version first
This skill matches alchemy@2.0.0-beta.84, checked against the alchemy source on main at commit cb4ec94 (2026-10-22), which carries the beta.84 release notes ahead of the tag. Read the project's package.json before you write code:
@alchemy.run/<provider>dependencies (@alchemy.run/cloudflare,@alchemy.run/aws) mean beta.84 or later. Everything here applies as written.alchemy/Cloudflareoralchemy/AWSimports mean beta.83 or earlier. The model and the APIs are the same, with these differences:- Providers ship inside
alchemy. Importalchemy/Cloudflare,alchemy/AWS,alchemy/Neon, and read source undernode_modules/alchemy/src/Cloudflare/. - The state store bootstraps with
alchemy provider cloudflare bootstrap. - The CLI needs Node 24.11.1+ or Bun.
- A
vite.config.tsthat keepscloudflare()from@cloudflare/vite-pluginmust drop it whileprocess.env.ALCHEMY_CLOUDFLARE_VITE_INJECTED === "1", or dev starts two workerd runtimes and only one has bindings. - Upgrading means installing each
@alchemy.run/<provider>, rewriting imports and bumpingeffectto^4.0.5. The full list is in the beta.84 notes. await alchemy("app")andasyncresources mean v1, a different API documented at v1.alchemy.run. Use this skill there only to port the project, with /migrating-from-v1.
The installed source wins over this skill and over the website. Every package ships src/, so check an API by searching one file with rg -n: core in node_modules/alchemy/src/, a provider in node_modules/@alchemy.run/<provider>/src/<Service>/. The where to look table names the file.
Provider depth lives in references. Read the one you need before you add or change a resource or binding:
- references/cloudflare.md: Workers, every common binding, Website.Vite, D1 migrations, Durable Objects, local emulation.
- references/aws.md: Lambda Functions and Web Functions,
...Httpbinding layers, event sources, credentials, local emulation. - Any other provider (GCP, Fly, Neon, PlanetScale, Stripe, GitHub, Docker, Kubernetes and the rest): find the closest example in alchemy-run/alchemy/examples (
<provider>-<thing>, such asneon-website-viteorgcp-pubsub-worker), then read the package'ssrc/index.tsand the docs athttps://alchemy.run/<provider>.
Mental model
- A Stack is the program in
alchemy.run.ts.Alchemy.Stack(name, { providers, state, secrets? }, Effect.gen(...))yields resources and returns outputs.providersandstateare Layers, one per provider package (Cloudflare.providers(),AWS.state()). - A Resource is a value you
yield*. Declaring one is lazy, soexport const Files = Cloudflare.R2.Bucket("Files")at module scope is fine. The first argument is the logical ID, which keys state. - An Output is a resource attribute that resolves during deploy, like
worker.urlorfn.functionName. Pass it into other props to create a dependency edge. - A Platform is a resource that carries code: a Cloudflare Worker, an AWS Lambda Function, a Durable Object. Its Effect has two phases. Construction is the outer
Effect.gen. It runs at plan time to discover bindings and again at every cold start. Runtime is the handler it returns (fetch, a queue consumer). It runs per invocation and never at plan time. - A Binding is a
yield*inside Construction, likeyield* Cloudflare.D1.QueryDatabase(Db)oryield* AWS.S3.PutObject(bucket). It wires the permission or native binding into the Platform and returns a typed client. You also provide an implementation Layer, picked by where the code runs:...Bindingis a native Cloudflare binding and works only on a Worker,...Httpcalls the provider's API with scoped credentials and works from any host (an AWS...Httpon a Worker creates an IAM user and role), and...Localuses your own credentials, for Actions. A missing Layer shows up as an unsatisfied requirement type error. - Client methods need
RuntimeContext, which only Runtime has. The type system rejects calling them in Construction. Capture the client in Construction, call it in Runtime.
Stack file
The same shape on AWS is AWS.Lambda.Function<Api>()("Api", { main: import.meta.url, functionUrl: true }, ...) with AWS.providers() and AWS.state(). See references/aws.md.
- Props are a plain object or an Effect of props, so they can depend on the stage:
Stack.useSync((stack) => ({ main: import.meta.url, memorySize: stack.stage === "prod" ? 1024 : 512 })), withStackfromalchemy/Stack. - Several providers merge with
Layer.mergeAll(Cloudflare.providers(), AWS.providers()). - A
fetchhandler is anHttpEffect(alchemy/Http). Its error channel allows onlyHttpServerError | HttpBodyError, so catch domain errors (Effect.catchTag,Effect.orDie) before you return it. const Announce = Alchemy.Action("Announce", (input) => effect)defines a deploy-time step with no cloud object behind it. Call it in the Stack,yield* Announce({ url: api.url }). Its body runs when the input changes or under--force.
Config, secrets and Outputs in props
- Read env values with
effect/Configin Construction:Config.Redacted("KEY"),Config.String,Config.schema(Schema.URLFromString, "APP_URL"). Alchemy reads the value at deploy time and binds it to the Platform, and the sameConfigreads the binding at runtime. AConfigyielded only inside a handler is never discovered and never bound. - A
Configyielded in Construction always binds as a secret (secret_texton Cloudflare), whichever constructor you used. The raw source is bound. Combinators such asConfig.withDefaultrun again at runtime, and a default is never bound. - Unwrap with
Redacted.value(secret)at the call site. `Bearer ${secret}sends the literal<redacted>`. - Without a
secretsoption, the CLI reads.envfrom the working directory into EffectConfigonly, not intoprocess.env. Shell values beat.env. With--env-file paththe file beats the shell. Code inalchemy.run.tsthat readsprocess.envneedsprocess.loadEnvFile(...)under Node. Under Bun, which the CLI switches to insidebun run, Bun itself also loads.envintoprocess.env. - The Stack's
secretsoption picks sources in order, later ones winning, with the shell implicitly last:secrets: ({ stage }) => stage === "prod" ? Doppler.Secrets({ project: "app", config: "prod" }) : Secrets.DotEnv(), withSecretsfromalchemy. Doppler and Infisical ship as@alchemy.run/dopplerand@alchemy.run/infisical. A stack withsecretsrejects--env-file. - A prop value can be a literal, an
Output, aConfig, orOutput.fromEffect(effect). A bareEffectnested in props passes through unresolved and ships as a serialized Effect object. Wrap it:allowedOrigins: [Output.fromEffect(appOrigin.pipe(Effect.orDie))]. The Effect must not fail, soorDieit. - Combine Outputs with
Output.map,Output.all(a, b)and `Output.interpolatehttps://${host}fromalchemy/Output`. Random("Id")fromalchemymints a value once and keeps it in state..textis aRedacted<string>.
Stages, names and removal
- The stage comes from
--stage, then$ALCHEMY_STAGE(shell,--env-fileor.env), thenlive_$USERfor deploy, plan, destroy, logs and drift, anddev_$USERforalchemy dev. Names match[a-z0-9][-_a-z0-9]*, case-insensitive. - During plan, read it with
(yield* Stack).stage(Stackfromalchemy/Stack) oryield* Stagefromalchemy/Stage. A deployed Worker has noStageservice. Cloudflare bindsALCHEMY_STAGEas plain text, so code that runs in both phases usesEffect.serviceOption(Stage)and falls back toConfig.String("ALCHEMY_STAGE"). - Physical names default to
${stack}-${logicalId}-${stage}-${16-char suffix}. The suffix comes from the instance ID in state, so names stay stable across deploys. Providers sanitize and lowercase where the cloud requires it. Passnameto pin one. - Renaming a logical ID plans a delete and a create.
.pipe(Alchemy.renamedFrom("OldId"))moves the state row instead, and the cloud object stays. .pipe(RemovalPolicy.retain())(alchemy/RemovalPolicy) keeps the cloud object on destroy or when you delete the declaration. Alchemy drops the state row and skips the provider's delete.retain(stack.stage === "prod")orretain(effectOfBoolean)makes it per stage. A policy change plans as a no-op and still takes effect on the next deploy. A few types default to retain, such asCloudflare.ZoneandGitHub.Repository. PipeRemovalPolicy.destroy()to let Alchemy delete them.
State and credentials
stateis required. Each provider ships a remote store:Cloudflare.state()is a Worker with a Durable Object on your account, andAWS.state()is an account-regional S3 bucket.Alchemy.localState()writes.alchemy/state/<stack>/<stage>/on disk.Cloudflare.state({ name: "team-a" })picks a named store.- Create a store ahead with
alchemy state bootstrap --backend cloudflare [--name team-a]. In CI, a missing or outdated store fails unless you pass--yes. - Pick local state under dev only:
Layer.unwrap(AlchemyContext.pipe(Effect.map(({ dev }) => dev ? Alchemy.localState() : Cloudflare.state()))), withAlchemyContextfromalchemy/AlchemyContext. - Inspect with
alchemy state listandalchemy state read <path>.alchemy state deletedrops records and leaves the cloud object alive. - Credentials come from profiles:
alchemy profile edit --add Cloudflare(orAWS) saves to~/.alchemy/profiles.json, and--profile <name>picks one. A provider's full set of env vars (CLOUDFLARE_API_TOKENwithCLOUDFLARE_ACCOUNT_ID, or the AWS keys withAWS_REGION) beats any profile, CI or not, and that includes values in.env. WithCI=true, env vars are the only source.
alchemy dev
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/alchemy/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/darjss/alchemy-skill/alchemy)