sim / rules
Cursor rule30k starsChanged 5 days agoApache-2.0View on GitHub
Workflows and workspaces as code (workflow source, workspace source, the workflow SDK, the Code tab)
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about simstudioai/sim
- WorldofAI“Sim AI: Easily Create AI Agents That Can Automate Anything! Opensource n8n Alternative!”YouTube · Aug 29, 2025 · 43k views
- Fahd Mirza“Install Sim Locally with Ollama: AI Agent Workflow Builder”YouTube · Aug 27, 2025 · 12k views
- Codedigipt“Build FREE AI Agent Using SIM AI (N8N Alternative & Open Source)”YouTube · Sep 8, 2025 · 9.6k views
- Sim AI“Sim Studio Product Hunt Demo”YouTube · May 19, 2025 · 6k views
- Sim AI“The fastest way to build production AI agents”YouTube · May 6, 2025 · 1.9k views
The biggest 5 of 111 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 111
Talked about on GitHub, Bluesky, YouTube, Hacker News and the web (111 times).
On GitHub · 50
- Aug 28, 2025Markdown (links) in description not rendered correctly in link list — Kovah/LinkAce1 reaction
- Nov 29, 2026claude-code-plugins.github.simstudioai.sim: 0.9.68 → 0.9.70 — sudosubin/agents.nix0 reactions
- Nov 29, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.68 → 0.9.69 — sudosubin/agents.nix0 reactions
- Nov 29, 2026agent-skills.github.simstudioai.sim: 0.9.68 → 0.9.69 — sudosubin/agents.nix0 reactions
- Nov 28, 2026claude-code-plugins.github.simstudioai.sim: 0.9.67 → 0.9.68 — sudosubin/agents.nix0 reactions
45 more on GitHub
- Nov 28, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.67 → 0.9.68 — sudosubin/agents.nix0 reactions
- Nov 28, 2026agent-skills.github.simstudioai.sim: 0.9.67 → 0.9.68 — sudosubin/agents.nix0 reactions
- Nov 28, 2026claude-code-plugins.github.simstudioai.sim: 0.9.66 → 0.9.67 — sudosubin/agents.nix0 reactions
- Nov 28, 2026agent-skills.github.simstudioai.sim: 0.9.66 → 0.9.67 — sudosubin/agents.nix0 reactions
- Nov 28, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.66 → 0.9.67 — sudosubin/agents.nix0 reactions
- Nov 23, 2026agent-skills.github.simstudioai.sim: 0.9.65 → 0.9.66 — sudosubin/agents.nix0 reactions
- Nov 23, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.65 → 0.9.66 — sudosubin/agents.nix0 reactions
- Nov 23, 2026claude-code-plugins.github.simstudioai.sim: 0.9.63 → 0.9.66 — sudosubin/agents.nix0 reactions
- Nov 23, 2026agent-skills.github.simstudioai.sim: 0.9.63 → 0.9.65 — sudosubin/agents.nix0 reactions
- Nov 23, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.63 → 0.9.65 — sudosubin/agents.nix0 reactions
- Nov 19, 2026claude-code-plugins.github.simstudioai.sim: 0.9.62 → 0.9.63 — sudosubin/agents.nix0 reactions
- Nov 19, 2026agent-skills.github.simstudioai.sim: 0.9.62 → 0.9.63 — sudosubin/agents.nix0 reactions
- Nov 19, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.62 → 0.9.63 — sudosubin/agents.nix0 reactions
- Nov 18, 2026agent-skills.github.simstudioai.sim: 0.9.61 → 0.9.62 — sudosubin/agents.nix0 reactions
- Nov 18, 2026claude-code-plugins.github.simstudioai.sim: 0.9.61 → 0.9.62 — sudosubin/agents.nix0 reactions
- Nov 18, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.61 → 0.9.62 — sudosubin/agents.nix0 reactions
- Nov 17, 2026claude-code-plugins.github.simstudioai.sim: 0.9.59 → 0.9.61 — sudosubin/agents.nix0 reactions
- Nov 17, 2026agent-skills.github.simstudioai.sim: 0.9.59 → 0.9.61 — sudosubin/agents.nix0 reactions
- Nov 17, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.59 → 0.9.61 — sudosubin/agents.nix0 reactions
- Nov 17, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.58 → 0.9.59 — sudosubin/agents.nix0 reactions
- Nov 17, 2026agent-skills.github.simstudioai.sim: 0.9.58 → 0.9.59 — sudosubin/agents.nix0 reactions
- Nov 17, 2026claude-code-plugins.github.simstudioai.sim: 0.9.58 → 0.9.59 — sudosubin/agents.nix0 reactions
- Nov 15, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.57 → 0.9.58 — sudosubin/agents.nix0 reactions
- Nov 15, 2026claude-code-plugins.github.simstudioai.sim: 0.9.57 → 0.9.58 — sudosubin/agents.nix0 reactions
- Nov 15, 2026agent-skills.github.simstudioai.sim: 0.9.57 → 0.9.58 — sudosubin/agents.nix0 reactions
- Nov 14, 2026feat: Voyage AI channel (embeddings, contextualized and multimodal embeddings, rerank) — QuantumNous/new-api0 reactions
- Nov 14, 2026agent-skills.github.simstudioai.sim: 0.9.56 → 0.9.57 — sudosubin/agents.nix0 reactions
- Nov 14, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.56 → 0.9.57 — sudosubin/agents.nix0 reactions
- Nov 14, 2026claude-code-plugins.github.simstudioai.sim: 0.9.56 → 0.9.57 — sudosubin/agents.nix0 reactions
- Nov 13, 2026agent-skills.github.simstudioai.sim: 0.9.55 → 0.9.56 — sudosubin/agents.nix0 reactions
- Nov 13, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.55 → 0.9.56 — sudosubin/agents.nix0 reactions
- Nov 13, 2026claude-code-plugins.github.simstudioai.sim: 0.9.55 → 0.9.56 — sudosubin/agents.nix0 reactions
- Nov 13, 2026agent-skills.github.simstudioai.sim: 0.9.54 → 0.9.55 — sudosubin/agents.nix0 reactions
- Nov 13, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.54 → 0.9.55 — sudosubin/agents.nix0 reactions
- Nov 13, 2026claude-code-plugins.github.simstudioai.sim: 0.9.54 → 0.9.55 — sudosubin/agents.nix0 reactions
- Nov 12, 2026claude-code-plugins.github.simstudioai.sim: 0.9.53 → 0.9.54 — sudosubin/agents.nix0 reactions
- Nov 12, 2026agent-skills.github.simstudioai.sim: 0.9.53 → 0.9.54 — sudosubin/agents.nix0 reactions
- Nov 12, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.53 → 0.9.54 — sudosubin/agents.nix0 reactions
- Nov 11, 2026agent-skills.github.simstudioai.sim: 0.9.52 → 0.9.53 — sudosubin/agents.nix0 reactions
- Nov 11, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.52 → 0.9.53 — sudosubin/agents.nix0 reactions
- Nov 11, 2026claude-code-plugins.github.simstudioai.sim: 0.9.52 → 0.9.53 — sudosubin/agents.nix0 reactions
- Nov 10, 2026agent-skills.github.simstudioai.sim: 0.9.51 → 0.9.52 — sudosubin/agents.nix0 reactions
- Nov 10, 2026claude-code-marketplaces.github.simstudioai.sim: 0.9.51 → 0.9.52 — sudosubin/agents.nix0 reactions
- Nov 10, 2026claude-code-plugins.github.simstudioai.sim: 0.9.51 → 0.9.52 — sudosubin/agents.nix0 reactions
- Oct 27, 2026[catalog-candidate] sim-ai-self-hosted — ePlus-DEV/free-tier-hub0 reactions · 3 comments
On Bluesky · 32
- Oct 6, 2025Crea y despliega Agentes de IA sin depender de OpenAI. Sim es una alternativa open source a n8n. ✓ Next.js + Bun + PostgreSQL + Zustand ✓… — @midu.dev8 likes and reposts · 1 reply
- Jan 10, 2026Todo el mundo habla de n8n pero... ojo con Sim. Crea agentes de IA con esta plataforma Open Source: ✓ Usa Next.js + Bun + PostgreSQL +… — @midu.dev5 likes and reposts
- Jul 27, 2026wire up an ai agent visually. Sim: open-source canvas to build, deploy and run AI agents. 1,000+ integrations, any LLM, self-host free.… — @epicvibecoder.bsky.social4 likes and reposts
- Jan 23, 2026Sim : une alternative open-source à n8n Créez des workflows d'agents visuellement sur une interface : connectez agents, outils et blocs,… — @camilleroux.com4 likes and reposts
- Dec 14, 2025n8n代替のオープンソース実装らしい。Copilot APIが利用できるほか、Ollamaと接続してローカル完結も可能。 — @matsuu.bsky.social3 likes and reposts
27 more on Bluesky
- Nov 8, 2025📦 simstudioai / sim ⭐ 17,554 (+37) 🗒 TypeScript Open-source platform to build and deploy AI agent workflows. — @github-trending.bsky.social3 likes and reposts · 1 reply
- Sep 16, 2025🔗 Liens utiles Sim : 👉 Le projet : github.com/simstudio... 👉 En savoir plus : https://www.sim.ai/ — @bearstech.com3 likes and reposts
- Aug 5, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 simstudioai / sim ⭐ 6,451 (+102) 🗒 TypeScript Sim is an open-source AI agent workflow builder. Sim… — @github-trending-js.bsky.social3 likes and reposts
- Apr 3, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 simstudioai / sim ⭐ 27,481 (+105) 🗒 TypeScript Build, deploy, and orchestrate AI agents. Sim is the… — @github-trending-js.bsky.social2 likes and reposts
- Jan 11, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 simstudioai / sim ⭐ 25,307 (+145) 🗒 TypeScript Open-source platform to build and deploy AI agent… — @github-trending.bsky.social2 likes and reposts
- Dec 17, 2025💎 Hidden Gem! 💎 (1000+ new stars) 📦 simstudioai / sim ⭐ 22,527 (+1,401) 🗒 TypeScript Open-source platform to build and deploy AI agent… — @github-trending-js.bsky.social2 likes and reposts · 1 reply
- Nov 11, 2025📦 simstudioai / sim ⭐ 17,926 (+33) 🗒 TypeScript Open-source platform to build and deploy AI agent workflows. — @github-trending-js.bsky.social2 likes and reposts
- Nov 8, 2025📦 simstudioai / sim ⭐ 17,554 (+37) 🗒 TypeScript Open-source platform to build and deploy AI agent workflows. — @github-trending-js.bsky.social2 likes and reposts
- Aug 20, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 simstudioai / sim ⭐ 7,807 (+334) 🗒 TypeScript Sim is an open-source AI agent workflow builder. Sim… — @github-trending-js.bsky.social2 likes and reposts
- Jul 20, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 simstudioai / sim ⭐ 5,114 (+177) 🗒 TypeScript Sim Studio is an open-source AI agent workflow builder.… — @github-trending-js.bsky.social2 likes and reposts
- Apr 28, 2025Show HN: Sim Studio – Open-Source Agent Workflow GUI | Discussion — @hackernewsbot.bsky.social2 likes and reposts
- May 1, 2026今日のGitHubトレンド simstudioai/sim AIエージェントを構築し運用するためのオープンソースプラットフォームです。 1,000以上の外部連携やLLMを組み合わせて、エージェントのワークフローを視覚的なキャンバスで設計できます。… — @dailygithubtrends.bsky.social1 likes and repost
- Feb 20, 2026📦 simstudioai / sim ⭐ 26,489 (+31) 🗒 TypeScript Build, deploy, and orchestrate AI agents. Sim is the central intelligence layer for your… — @github-trending-js.bsky.social1 likes and repost
- Jan 25, 2026simstudioai/sim Open-source platform to build and deploy AI agent workflows. Build and deploy AI agent workflows in minutes. Build… — @postgresql.activitypub.awakari.com.ap.brid.gy1 likes and repost
- Jan 11, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 simstudioai / sim ⭐ 25,307 (+145) 🗒 TypeScript Open-source platform to build and deploy AI agent… — @github-trending-js.bsky.social1 likes and repost
- Dec 13, 2025🎉 Celebrating! 🎉 (500+ new stars) 📦 simstudioai / sim ⭐ 19,357 (+516) 🗒 TypeScript Open-source platform to build and deploy AI agent… — @github-trending.bsky.social1 likes and repost · 1 reply
- Dec 13, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 simstudioai / sim ⭐ 19,214 (+459) 🗒 TypeScript Open-source platform to build and deploy AI agent… — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Nov 20, 2025License: Apache 2.0 🦄 Source code: github.com/simstudioai/... — @ramikrispin.bsky.social1 likes and repost
- Oct 2, 2025SIM is an open-source platform to build and deploy AI agent workflows. github.com/simstudioai/... #ai #oss #platform #workflow #low-code… — @yohann.ciurlik.fr1 likes and repost
- Oct 2, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 simstudioai / sim ⭐ 15,973 (+229) 🗒 TypeScript Open-source platform to build and deploy AI agent… — @github-trending.bsky.social1 likes and repost
- Aug 24, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 simstudioai / sim ⭐ 11,775 (+306) 🗒 TypeScript Sim is an open-source AI agent workflow builder.… — @github-trending.bsky.social1 likes and repost
- Aug 24, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 simstudioai / sim ⭐ 11,775 (+306) 🗒 TypeScript Sim is an open-source AI agent workflow builder.… — @github-trending-js.bsky.social1 likes and repost
- Aug 20, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 simstudioai / sim ⭐ 7,807 (+334) 🗒 TypeScript Sim is an open-source AI agent workflow builder. Sim… — @github-trending.bsky.social1 likes and repost
- Aug 5, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 simstudioai / sim ⭐ 6,451 (+102) 🗒 TypeScript Sim is an open-source AI agent workflow builder. Sim… — @github-trending.bsky.social1 likes and repost
- Jul 20, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 simstudioai / sim ⭐ 5,114 (+177) 🗒 TypeScript Sim Studio is an open-source AI agent workflow builder.… — @github-trending.bsky.social1 likes and repost
- Jul 7, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 simstudioai / sim ⭐ 4,411 (+279) 🗒 TypeScript Sim Studio is an open-source AI agent workflow… — @github-trending-js.bsky.social1 likes and repost
- Dec 17, 2025💎 Hidden Gem! 💎 (1000+ new stars) 📦 simstudioai / sim ⭐ 23,354 (+1,357) 🗒 TypeScript Open-source platform to build and deploy AI agent… — @github-trending.bsky.social0 likes and reposts · 1 reply
On YouTube · 25
- Aug 29, 2025Sim AI: Easily Create AI Agents That Can Automate Anything! Opensource n8n Alternative! — WorldofAI43k views · 40 comments
- Aug 27, 2025Install Sim Locally with Ollama: AI Agent Workflow Builder — Fahd Mirza12k views · 21 comments
- Sep 8, 2025Build FREE AI Agent Using SIM AI (N8N Alternative & Open Source) — Codedigipt9.6k views · 9 comments
- May 19, 2025Sim Studio Product Hunt Demo — Sim AI6k views · 5 comments
- May 6, 2025The fastest way to build production AI agents — Sim AI1.9k views · 5 comments
20 more on YouTube
- May 4, 2025Use Clay in Sim Studio — Sim AI825 views
- Aug 20, 2025No-Code AI Agents with Sim | Drag & Drop AI Automation — Martin Khristi719 views
- Jul 11, 2025[Github] simstudioai/sim - an open-source AI agent workflow builder. — ExplorAI Podcast617 views · 2 comments
- May 12, 2025Use the Google Drive tool in Sim Studio — Sim AI594 views
- Sep 7, 2026Sim orchestrates AI agent workflows visually — safesynt572 views
- May 12, 2025Use the Goole Docs Write tool in Sim Studio — Sim AI541 views
- Jul 10, 2026Sim — Your AI Workspace — Sim AI450 views
- Apr 28, 2025GitHub - simstudioai/sim: Open-source AI Agent workflow builder. — GitHub Daily Trend AI Podcast370 views · 3 comments
- May 12, 2025Use the Google Docs Create tool in Sim Studio — Sim AI268 views
- May 12, 2025Use the Google Docs Read tool in Sim Studio — Sim AI218 views
- May 12, 2025Use the Google Sheets Append tool in Sim Studio — Sim AI216 views
- May 12, 2025Use the Google Sheets Update tool in Sim Studio — Sim AI182 views
- Nov 3, 202630K ⭐ Build AI Agents on One Canvas | Sim Open Source — Github God Eng91 views
- Nov 10, 2025Sim — Run Smart AI Agents Locally (No Cloud, No Tracking, Full Privacy) — ABV — AI · Books · Validation77 views
- Oct 22, 2026Sim: Collaborative AI Workspace | 100,000+ Builders 🚀 — RepoBytes | Find It. Understand It. Build With It.76 views
- Oct 6, 2026🏆 [GitHub Repo of the Day] sim: The Free Tool Taking Over GitHub! #shorts — githubrepo_cloud50 views
- Dec 23, 2025Build Workflows with Ease: Open‑Source AI Agent Platform Sim — ABV — AI · Books · Validation16 views
- Oct 29, 2026Describing your agent is easy. Building it? Sim drafts it — The AI Toolbox10 views
- Nov 15, 2026Sim: Open-Source Workspace to Build, Deploy and Monitor AI Agents | OpenViST Listing — OpenViST7 views
- Nov 17, 2026Why 30k developers starred Sim #Shorts — GIt Gems Daily0 views
On Hacker News · 3
- Dec 11, 2025Show HN: Sim – Apache-2.0 n8n alternative240 points · 61 comments
- Apr 28, 2025Show HN: Sim Studio – Open-Source Agent Workflow GUI196 points · 58 comments
- Apr 11, 2025SIM: Open-source AI Agent workflow builder1 point
On the web · 1
- Mar 27, 2025Sim AI Project Repository Download and Installation Guide — aibase.com
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 4,373 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository64 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/constitution.mdcCursor rule
- .cursor/rules/emcn-components.mdcCursor rule
- .cursor/rules/landing-seo-geo.mdcCursor rule
- .cursor/rules/sim-api-contracts.mdcCursor rule
- .cursor/rules/sim-architecture.mdcCursor rule
- .cursor/rules/sim-caching.mdcCursor rule
- .cursor/rules/sim-components.mdcCursor rule
- .cursor/rules/sim-content-delivery.mdcCursor rule
- .cursor/rules/sim-hooks.mdcCursor rule
- .cursor/rules/sim-imports.mdcCursor rule
- .cursor/rules/sim-integrations.mdcCursor rule
- .cursor/rules/sim-list-ordering.mdcCursor rule
- .cursor/rules/sim-queries.mdcCursor rule
- .cursor/rules/sim-react-performance.mdcCursor rule
- .cursor/rules/sim-sandbox.mdcCursor rule
- .cursor/rules/sim-settings-pages.mdcCursor rule
- .cursor/rules/sim-stores.mdcCursor rule
- .cursor/rules/sim-styling.mdcCursor rule
- .cursor/rules/sim-testing.mdcCursor rule
- .cursor/rules/sim-ui-copy.mdcCursor rule
- .cursor/rules/sim-url-state.mdcCursor rule
- add-block-previewSkill
- add-blockSkill
- add-column-typeSkill
- add-connectorSkill
- add-enrichmentSkill
- add-feature-flagSkill
- add-hosted-keySkill
- add-integrationSkill
- add-managed-cliSkill
- add-modelSkill
- add-permission-group-itemSkill
- add-selectorSkill
- add-settings-pageSkill
- add-toolsSkill
- add-triggerSkill
- babysitSkill
- cleanupSkill
- councilSkill
- db-migrateSkill
- design-taste-frontendSkill
- emcn-design-reviewSkill
- emil-design-engSkill
- make-interfaces-feel-betterSkill
- memory-load-checkSkill
- migrate-application-operationSkill
- react-query-best-practicesSkill
- shipSkill
- test-auditSkill
- tool-registry-boundarySkill
- v2-api-conventionsSkill
- validate-connectorSkill
- validate-integrationSkill
- validate-modelSkill
- validate-permission-group-itemSkill
- validate-selectorSkill
- validate-triggerSkill
- you-might-not-need-a-callbackSkill
- you-might-not-need-a-commentSkill
- The first 60 shown.
The file
We split this sim-workflow-code.mdc into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 67
Every engine meets at the canonical workflow model (CWM): id-free, keyed by normalized block name, with the executable view separated from …
- Very specific: line 122
Follow /add-column-type. The workspace codec reads the column registry (lib/workspace-source/application/kinds/table/codec.ts), but three …
- Very specific: line 152
If workflows name it by key: WORKFLOW_RESOURCE_KINDS, the live loader in lib/workspaces/resource-keys.ts, the manifest in …
- Very specific: line 172
Add it to the declaration type and to the kind's field table (DeclFields, declaration/field-table.ts: KNOWLEDGE_FIELDS, MCP_FIELDS, …
≈ “Common” is an estimate: at least 1 in 5 of the 7,324 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: "Workflows and workspaces as code (workflow source, workspace source, the workflow SDK, the Code tab)"
globs: ["packages/workflow-code/**","packages/workspace-code/**","packages/workflow-sdk/**","packages/table-cells/**","packages/workflow-persistence/src/save.ts","packages/sim-cli/src/commands/protocol/*source*","packages/sim-cli/src/commands/protocol/source-dir/**","packages/sim-cli/src/commands/protocol/workflow-dir.ts","packages/sim-cli/src/commands/protocol/stored-edges.ts","packages/sim-cli/src/commands/protocol/local-errors.ts","apps/sim/lib/workflows/code/**","apps/sim/lib/workflows/application/*source*","apps/sim/lib/workflows/application/source-pipeline/**","apps/sim/lib/workflows/api/source-*","apps/sim/lib/workspace-source/**","apps/sim/blocks/sdk-names/**","apps/sim/app/workspace/**/panel/components/code/**","apps/sim/app/api/workflows/*/source/**","apps/sim/app/api/v2/**/source/**","apps/sim/lib/api/contracts/workflow-source.ts","apps/sim/lib/api/contracts/v2/*source*","apps/sim/app/api/cron/cleanup-source-staging/**"]
---
<!-- Generated from .claude/rules/sim-workflow-code.md by `bun run skills:sync`. Edit the source, not this file. -->
# Workflows and Workspaces as Code
A workflow prints to TypeScript and compiles back; a workspace prints to a directory of
declarations and applies back. Read the design docs before changing an engine or a format:
`packages/workflow-code/DESIGN.md` (one workflow) and `packages/workspace-code/DESIGN.md` (the
workspace directory).
## Where things live
| Where | What |
|---|---|
| `packages/workflow-types` | Shared workflow, block and resource-kind types (`WORKFLOW_RESOURCE_KINDS`) |
| `packages/workflow-code` | Pure engines for one workflow: catalog types, canonicalize, print, compile, materialize, lock, diagnostics |
| `packages/workspace-code` | Pure workspace half: `KIND_DIRS`, `APPLY_ORDER`, one codec per kind (`src/kinds/`), `.sim/base.json`, `rf1:` fingerprints, limits |
| `packages/table-cells` | Pure table cell rules (coerce, validate, currency/date/ttl parsing) shared by the table codec's offline row check and the server's writes |
| `packages/workflow-sdk` | Authoring declarations (`src/core.d.ts`, `src/workspace/*.d.ts`), type codegen from the catalog (`src/codegen/`), the cookbook |
| `packages/sim-cli/src/commands/protocol/` | `workflow-source-*` and `workspace-source-*` commands, which never import each other's command modules; `source-dir/`, `workflow-dir.ts`, `source-check.ts`, `source-write.ts`, `source-tree.ts`, `source-ui.ts` and `workspace-source-dir.ts` (the workspace directory reader a workflow check also reads declarations through) are shared |
| `apps/sim/lib/workflows/code/` | Server glue: catalog projection from the registry (`catalog/`), source-apply gates (`apply/`), stored canonical form, the feature flag, the proof corpus (`corpus/`) |
| `apps/sim/lib/workflows/application/*source*` | Workflow source use cases: read, apply, create, catalog, resources; `source-pipeline/` holds the one plan → preview/commit flow an apply and a create share |
| `apps/sim/lib/workspace-source/` | Workspace source use cases (`application/`), one adapter per kind (`application/kinds/<kind>/`), route policies (`api/`) |
| `apps/sim/blocks/sdk-names/<type>.json` | Frozen SDK builder names, one file per block type |
| `apps/sim/app/workspace/**/panel/components/code/` | The read-only Code tab |
Public docs live in `apps/docs/content/docs/workflows/code/`. The exit-code, diagnostic-code, limit
and per-kind layout tables of `exit-codes.mdx`, `diagnostics.mdx`, `limits.mdx` and `directory.mdx` sit between
`workflow-code-docs` markers and come from their owners (`source-exit-codes.ts`, SYNTAX.md and `workspace-code`'s
`diagnostics/codes.ts` TSDoc, the `*_LIMITS` constants, `WORKSPACE_KIND_SPECS`): edit the owner, then run
`bun run generate:workflow-code-docs` (`check:workflow-code-docs` fails on drift, a diagnostic code a page names that
no engine emits, a limit or diagnostic code with no docs entry, and a `typescript@x.y.z` pin other than the CLI's).
A limit also needs a label in the generator's `WORKFLOW_LIMIT_LABELS` or `WORKSPACE_LIMIT_LABELS`.
A new exit code also needs a `[#exit-<code>]` section in `troubleshooting.mdx`, which the same check requires
for every non-zero code `sourceExitCodeRows` lists. Behaviour a user relies on (identity, stale, the three-way rule,
promotion) is explained once, in `how-it-works.mdx`; change it there when an engine changes it.
Dependencies point one way: `packages/workflow-types` → `packages/workflow-code` →
`packages/workspace-code` and `packages/workflow-sdk` → the CLI and `apps/sim`. `check:boundaries` keeps both engines and `packages/table-cells` pure (no
Node built-ins, `eval`, `globalThis`, dynamic import): they run in the browser, the CLI and the
server unchanged.
## Naming: "code" and "source"
Both words name the same feature, split by role; follow the split rather than rename:
- **code** names the feature and its engines: the packages (`workflow-code`, `workspace-code`), the
server glue folder `lib/workflows/code/`, the `workflow-code` flag, the Code tab.
- **source** names the artifact and the operations on it: the files themselves, the use cases
(`readWorkflowSource`, `applyWorkspaceSource`), the routes (`/source`), the CLI
(`sim workflows source get`), `lib/workspace-source/`.
A fingerprint of what the server stores now is a **stored fingerprint**: `storedFingerprint`
(`rf1:`, a resource) and `storedSourceFingerprint` (`sf1:`, a workflow); a plan records it as
`PlannedChange.storedFingerprint` and the apply re-reads it with `storedFingerprintNow`. The base
records the fingerprint the directory last read (`base.fingerprint`).
A new module goes where its neighbours are: an engine or engine glue under a `code` folder, a use
case or surface under a `source` name.
## The canonical model
Every engine meets at the canonical workflow model (CWM): id-free, keyed by normalized block name,
with the executable view separated from preserved state. Print and compile are inverses over it;
canonicalize and materialize convert between it and stored state, with identity carried by the
lock. The catalog (built from the block registry, `lib/workflows/code/catalog/`) is the only way an
engine learns about blocks; engines never import the registry. See DESIGN.md "The canonical model"
and "The catalog".
## Feature flag
One global flag, `workflow-code` (`lib/core/config/feature-flags.ts`, env fallback
`WORKFLOW_CODE`), gates workflow source, workspace source, the source catalog and resources, and
the Code tab. Every source operation (the workflow source ones in
`lib/workflows/application/operations.ts` and the workspace source ones in
`lib/workspace-source/application/operations.ts`) declares `feature: WORKFLOW_CODE_FEATURE`, which
the shared use-case wrapper checks after authorization (`FEATURE_NOT_ENABLED`); a new source
operation declares the same feature, never its own check. A surface outside an operation (the Code
tab, Copilot entitlements) calls `isWorkflowCodeEnabled()` (`lib/workflows/code/feature-flag.ts`);
the UI reads it from the workspace layout's flags.
## Adding things
### A block type
Normal integration work, then `bun run generate:sdk-names`, which adds
`apps/sim/blocks/sdk-names/<type>.json` and regenerates `sdk-names.generated.ts`. Nothing else: the
catalog projection, SDK codegen, the corpus and default parity derive from the registry.
`check:sdk-names` fails until the generator runs. Names are add-only (`check:sdk-names-frozen`):
never edit or delete an existing entry; a collision gets a hand-picked name for the new entry.
Goldens (`packages/workflow-code/src/print/__golden__`) print real blocks, so an edit to one of
those blocks can change a golden: refresh with
`bun run --cwd apps/sim test lib/workflows/code/goldens.test.ts -u`, never by hand.
A block whose `value()` or condition the probe cannot evaluate (`catalog/probe.ts`) degrades to an
opaque type: it works, with weaker SDK typing.
### A subBlock type
1. `SubBlockType` (`apps/sim/blocks/types.ts` and `@sim/workflow-types/blocks`).
2. `TYPE_RULES` in `lib/workflows/code/catalog/value-kind.ts` (a total `Record`, so type-checked).
3. `mapSubBlock` in `packages/workflow-sdk/src/codegen/map-subblock.ts` (a `never` arm).
4. `getSubBlockValueShape` in `apps/sim/tools/param-shape.ts`, which defaults to `string`.
5. `packages/workflow-code/src/compile/catalog.test-helpers.ts` restates the rule flags for package tests.
6. A **structured** value (`CatalogStructuredKind`): add an entry to `STRUCTURED_CODECS`
(`packages/workflow-code/src/structured/index.ts`); the record is total over the kinds, so tsc
fails until the kind has a codec, and `StructuredCodec` (`structured/codec.ts`) lists the hook
each stage calls. Add corpus coverage. Only a kind lifted out of the param value into its own
model shape (`tools`, `branches`, the `LIFTED_STRUCTURED_KINDS`) skips the record and has its
own stage modules.
7. A **selector to a workspace resource**: the resource kind (`WORKFLOW_RESOURCE_KINDS`), its live
loader in `lib/workspaces/resource-keys.ts`, the SDK `*Ref` type in `core.d.ts`, and the
manifest (`lib/workflows/application/read-source-resources.ts`,
`packages/workflow-sdk/src/codegen/workspace.ts`).
### A table column type
Follow `/add-column-type`. The workspace codec reads the column registry
(`lib/workspace-source/application/kinds/table/codec.ts`), but three places restate it:
- the `column.<type>()` helper in `packages/workflow-sdk/src/workspace/table.d.ts`
(`kinds/table/codec.test.ts` fails until it exists), then regenerate the embedded text
(`bun packages/workflow-sdk/scripts/generate-embedded-text.ts`);
- `valueType()` in `packages/workflow-sdk/src/codegen/workspace.ts`, the row type `table('k')`
gives, which defaults to `string`;
- a type that owns metadata: `TABLE_COLUMN_METADATA_KEYS` in
`packages/workspace-code/src/kinds/table.ts` plus the reader and printer there.
### A workspace resource kind
The kinds: secrets (`secrets.ts`), credentials (`credentials.ts`), custom tools, skills, MCP servers
(`mcp/<key>.ts`), tables (with opt-in rows in `tables/<key>.rows.jsonl`, see DESIGN.md "Table
rows"), knowledge bases, files, workflows and deployments
(`deployments/<workflow key>.ts`, applied after workflows; see DESIGN.md "The deployment kind").
Secrets and credentials are reference kinds declared whole in one root file (`FILE_KINDS`): see
DESIGN.md "Reference kinds" for holding back the workflows that use an entry the workspace cannot
satisfy.
1. `APPLY_ORDER` and `KIND_DIRS` (`packages/workspace-code/src/kind.ts`) and its
`WORKSPACE_KIND_SPECS` entry (`src/specs.ts`: `resourceKind` is the key-table kind a workflow
names it by and a write claims, `null` for a kind with no key row of its own: a secret, a file
keyed by path, a deployment keyed by its workflow's key); every `Record<WorkspaceKind, …>` then
fails to type-check until it has the kind.
2. A codec `packages/workspace-code/src/kinds/<kind>.ts` with tests; `KIND_LAYOUTS`, and
`BLOB_KIND_CODECS` if it holds blobs (`src/kinds/registry.ts`); its diagnostic codes.
3. An adapter `apps/sim/lib/workspace-source/application/kinds/<kind>/adapter.ts` calling the
kind's own use cases; `KIND_ADAPTERS` (`application/registry.ts`); an integration test.
4. If workflows name it by key: `WORKFLOW_RESOURCE_KINDS`, the live loader in
`lib/workspaces/resource-keys.ts`, the manifest in `read-source-resources.ts` and
`codegen/workspace.ts`, and `PENDABLE_REFERENCES` in
`lib/workflows/application/source-pipeline/evaluate/finalize.ts`.
5. SDK: `packages/workflow-sdk/src/workspace/<kind>.d.ts` plus `index.d.ts`, a cookbook example
under `cookbook/workspace/`, then regenerate the embedded text.
6. CLI (`workspace-source-dir.ts`): `workspaceTsconfig` includes, the `AGENTS_GUIDE` section and
`localDeclarations`.
7. Contracts: regenerate the OpenAPI specs and `packages/sim-cli/src/generated/v2-api.ts`.
Steps 4 to 6 have no compile-time guard: a miss ships a kind that the CLI never type-checks or
that a workflow cannot reference.
A kind whose resources workflows name a member of (an MCP server's
tools) carries the member on the workflow change's `refs` and checks it in its adapter's
`checkRefs`, which runs once every kind is planned. A secret-bearing field prints `stored()` or an
env reference, never a value, and a literal secret in source is refused (`E_MCP_LITERAL_SECRET`).
### A field on an existing kind
Add it to the declaration type and to the kind's field table (`DeclFields`,
`declaration/field-table.ts`: `KNOWLEDGE_FIELDS`, `MCP_FIELDS`, `SECRET_FIELDS`, …). The table is
typed over every field of the declaration, so tsc fails until the field has an entry, and that one
entry is how the kind reads, prints and fingerprints it. Then the server's stored → declaration
mapping and diff, and the SDK `.d.ts`. Custom tools (`TOOL_FIELDS`) and skills
(`FRONTMATTER_FIELDS`) use the same tables; only a tool's `code` and a skill's `content` are read,
printed and fingerprinted by hand. A field left out of the fingerprint
makes an edit fingerprint as unchanged and silently drops it; the kind's test fixture must set the
field so the "reads back every declaration it prints" test covers it. A default mirrored from
`apps/sim` (`DEFAULT_CHUNKING`) must match the server's, or every undeclared resource reads as
changed.
## Formats and versions
| Artifact | Marker | Rule |
|---|---|---|
| `.sim/lock.json` (workflow) | `version: 1` | Add optional fields without a bump; validators learn a field before writers emit it; unknown data goes under `x-` keys |
| `.sim/base.json` (workspace) | `version: 1` | Same policy |
| `workflow_source_meta` | `version: 1` | Same policy; a bump needs a data migration |
| Fingerprints | `sf1:` (workflow), `rf1:` (resource) | Any change to canonicalize or a kind's `canonical()` output changes every stored fingerprint and makes every checkout stale; treat it as a format change |
| SDK surface | `// @sim-sdk 1`, `SDK_MAJOR` | Compile refuses any major but the server's |
| `apps/sim/blocks/sdk-names/` | append-only | Never rename or remove a name |
Nothing upgrades an old version: a bump is a hard refusal until a migration exists. A lock or base
field also appears in the zod contracts (`workflowLockSchema`, `sourceBaseSchema` in
`lib/api/contracts/workflow-source.ts`), so keep both in step.
## Proof
Behaviour is proven by properties over the real registry, not restated unit tests:
- `bun run --cwd apps/sim test lib/workflows/code` runs the default corpus (sampled per block type,
under 60 s): round trip (`corpus/roundtrip.corpus.test.ts`, properties P0–P7 and O1–O3 in
DESIGN.md "Proof"), inactive params, stale outputs, secrets, default parity, goldens and SDK
examples.
- `ROUNDTRIP_CORPUS_FULL=1` runs every case; `ROUNDTRIP_CORPUS_EXTRA_DIR` adds redacted production
states; `ROUNDTRIP_CORPUS_REPORT_PATH` writes a report. `corpus/typecheck.corpus.test.ts` with
`ROUNDTRIP_CORPUS_FULL=1` type-checks every printed case against the generated SDK.
- Apply behaviour is proven against Postgres: `apps/sim/lib/workflows/application/*.integration.ts`
and `apps/sim/lib/workspace-source/application/*.integration.ts`.
- The Code tab and the CLI have HTTP e2e scripts (`apps/sim/scripts/test-workflow-code-ui-e2e.ts`,
`test-workflow-source-e2e.ts`, `test-workspace-source-e2e.ts`).
- Generated artifacts and their checks: `generate:sdk-names` (`check:sdk-names`,
`check:sdk-names-frozen`), `generate:workflow-sdk-embedded-text`
(`check:workflow-sdk-embedded-text`), `generate:sdk-fixture-catalog`
(`check:sdk-fixture-catalog`), goldens (`check:workflow-code-golden`).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

