workflow-guide — Claude Code skill: what it does, how to install
Reference rules for writing durable, replay-safe Notion workflows with typed triggers and idempotent steps.
npx skills add makenotion/notion-cookbook --skill workflow-guide -a claude-codeWhat workflow-guide does
This skill guides agents when editing src/workflows/*.ts files that export createWorkflow(...). The file name defines the workflow key. It requires wrapping external effects into context.step, covering Notion API requests, network calls, random IDs, timestamps, and mutable state reads. Pure, deterministic logic stays outside steps.
Completed steps replay previously saved outputs on retries. Mutating in-memory variables inside a step breaks this execution model. Every step needs a stable display name and JSON-serializable return values. For looped operations, instead of interpolating an index into the name, it enforces composite keys like { key: ["process-page", page.id] }.
Network calls can succeed before the runner saves the step result. Because retries might repeat an effect, the skill instructs the agent to pass the step callback ID as an idempotency key or use upserts when external APIs lack native support.
What it helps with
- Structure files in
src/workflows/using default-exportedcreateWorkflow - Isolate Notion API interactions and non-deterministic operations inside
context.step - Configure composite keys and idempotency identifiers for iterated steps
- Prevent state corruption across workflow retries and step replaying
Example prompts for the agent
- Create a workflow in
src/workflows/sync-pages.tsthat updates Notion database entries viacontext.step - Refactor this workflow loop to use composite keys and idempotency tokens for each step
- Review
src/workflows/notifications.tsfor replay safety and non-deterministic logic outside steps
How to install workflow-guide
1Skills CLI (Vercel)
npx skills add makenotion/notion-cookbook --skill workflow-guide -a claude-code2Manually: put the files in place
~/.claude/skills/workflow-guide/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/workflow-guide/
1Skills CLI (Vercel)
npx skills add makenotion/notion-cookbook --skill workflow-guide -a codex2Manually: put the files in place
.agents/skills/workflow-guide/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add makenotion/notion-cookbook --skill workflow-guide -a cursor2Manually: put the files in place
.cursor/skills/workflow-guide/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install makenotion/notion-cookbook workflow-guide2Manually: put the files in place
.github/skills/workflow-guide/SKILL.md1Skills CLI (Vercel)
npx skills add makenotion/notion-cookbook --skill workflow-guide -a gemini-cli2Platform CLI
gemini skills install https://github.com/makenotion/notion-cookbook --path workers/agents/skills/workflow-guideManually: put the files in place
.devin/skills/workflow-guide/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add makenotion/notion-cookbook --skill workflow-guide -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about workflow-guide
How to install workflow-guide in Claude Code?
Run npx skills add makenotion/notion-cookbook --skill workflow-guide -a claude-code. You can also place the file directly at ~/.claude/skills/workflow-guide/SKILL.md.
What does workflow-guide do?
It instructs coding agents on workflow development patterns, step isolation, and replay safety for Notion Cookbook projects.
How should repeated steps be configured in loops?
Do not interpolate IDs into the step label. Provide a fixed display name along with a composite key option, such as { key: ["process-page", page.id] }.
Source text
SKILL.md · MIT
---
name: workflow-guide
description: Reference for typed triggers, durable steps, replay-safe data flow, and idempotent Workflow effects.
user-invocable: false
---
# Workflow guide
Each direct `src/workflows/*.ts` file must default-export `createWorkflow(...)`.
The file name becomes its Workflow key.
Use a step for every result that can change and every external effect. This
includes network and Notion API calls, mutable state reads, timestamps, random
values, generated IDs, messages, creates, and updates. Keep deterministic
transforms of the event and completed step results outside a step.
Completed steps can replay saved results. Do not rely on in-memory mutations
inside a step. Return the values required by later code. Keep calls in a stable
order and give every step a stable display name. The name is also the replay
key by default. For a repeated step, do not interpolate an item ID or loop
index into the name; pass a stable composite key instead:
```ts
await context.step(
"Process page",
{ key: ["process-page", page.id] },
async ({ id }) => processPage(page, { idempotencyKey: id })
)
```
Keys must be stable across retries and unique within one workflow run.
Retries can repeat an external effect when it succeeds before its step result
is saved. Pass the callback `id` as an idempotency key. Use a stable external
ID, an upsert, or a duplicate check when the service lacks native support.
Return JSON-serializable values. Throw on failed requests and missing required
configuration. Do not log secrets or private payloads.
© makenotion · MIT · makenotion/notion-cookbook