add-block-preview
Skill1 starsChanged 2 months agoApache-2.0View on GitHub
Gate a block's visibility — ship an unreleased block as a preview (hidden until revealed via AppConfig/env), reveal it to admins/orgs, GA it, or kill-switch a shipped block
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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
- Very specific: line 38
Hosted preview: add a rule to the block-visibility AppConfig document and start a deployment (no code deploy):
- Very specific: line 44
GA cleanup: delete preview: true from the block (now visible to self-hosters on their next upgrade), add its BlockMeta + regen docs, and …
- Very specific: line 54
Keys are registry block types: Never custom_block_* (parse drops them — custom blocks have their own enabled/disabled lifecycle).
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill 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
Add Block Preview Skill
You manage block visibility gating in Sim — hiding blocks from every discovery surface (toolbar, cmd+K search, copilot @-mentions, agent tool picker, mothership VFS/metadata/tools, Access Control list, public docs/catalog) while never gating execution of already-placed instances.
The model
Three levers, evaluated in apps/sim/lib/core/config/block-visibility.ts and folded into the registry accessors (apps/sim/blocks/registry.ts):
preview: trueon theBlockConfig(static, in code) — the block is default-hidden EVERYWHERE (hosted, self-hosted, dev, SSR) until revealed. Fail-closed.The hosted
block-visibilityAppConfig document — per-block rule keyed by the existing block type:{ "<block-type>": { "enabled": false, // required. true = GA (visible to everyone) "orgIds": ["org_..."], // optional allowlist clauses (any match reveals) "userIds": ["user_..."], "adminEnabled": true // platform admins (user.role === 'admin') } }PREVIEW_BLOCKSenv (comma-separated block types) — the off-AppConfig reveal path for self-hosters and local dev.
A revealed block that is not globally GA (enabled !== true, or env-revealed) renders with a " (Preview)" name suffix on discovery surfaces. getBlock() stays pure, so placed instances keep their canonical name and always execute.
Lifecycle of a preview block
- Author the block normally (
/add-blocketc.) and setpreview: trueon itsBlockConfig. Ship noBlockMetaand no docs until GA —check-block-registrydeliberately skips preview blocks in meta coverage, andgenerate-docsskips them at every gate. - Local dev: set
PREVIEW_BLOCKS=<block-type>in your env to see it (with the suffix). - Merge/deploy. The block's code is live everywhere but visible nowhere — no AppConfig rule exists and self-hosters have no env entry.
Hosted preview: add a rule to the
block-visibilityAppConfig document and start a deployment (no code deploy):- Admins only:
{ "enabled": false, "adminEnabled": true } - Design-partner org:
{ "enabled": false, "orgIds": ["org_123"] } - GA via config (code cleanup pending):
{ "enabled": true }— suffix disappears everywhere within ~30s (AppConfig TTL) + client refetch.
Same runbook as
feature-flags: edit the hosted document,aws appconfig start-deploymentwith thesim-<env>-faststrategy (see the infra README).- Admins only:
- GA cleanup: delete
preview: truefrom the block (now visible to self-hosters on their next upgrade), add itsBlockMeta+ regen docs, and drop the AppConfig entry. For a v2 upgrade, this is also when v1 getshideFromToolbar: true(the superseded-version paradigm).
Kill switch (shipped blocks)
To pull an already-GA block from discovery surfaces on hosted (incident, deprecation): add { "<block-type>": { "enabled": false } } to the document. Allowlist clauses can carve out exceptions. Execution is NOT stopped — workflows already using the block keep running; the kill switch only prevents new placement/discovery.
Invariants (do not violate)
- Execution is never gated. The executor, serializer, drop-naming, and
isBlockTypeAccessControlExemptresolve via puregetBlock. Do not add visibility checks to execution paths. - Clone-not-remove: gated blocks stay in
getAllBlocks()output as clones withhideFromToolbar: true—.find-by-type consumers rely on this. Never filter them out. - Keys are registry block types. Never
custom_block_*(parse drops them — custom blocks have their own enabled/disabled lifecycle). - The shared hidden-predicate is
isHiddenUnder(apps/sim/blocks/visibility/context.ts). Never restate the preview/disabled rule inline at a new consumer. - Process-global caches stay ungated.
getStaticComponentFiles(VFS) andgetExposedIntegrationToolsbuild the ungated universe; per-viewer filtering happens at stamp/consumer time. Never move gating into a shared builder. - Gating is surface hiding, not secrecy — the full config ships in the client JS bundle. Anything truly secret cannot be a registered block.
Tests
Evaluation semantics: apps/sim/lib/core/config/block-visibility.test.ts. Registry projection: apps/sim/blocks/visibility/visibility.test.ts. When gating behavior changes, extend those — mock isPlatformAdmin for the admin clause; use the local withAppConfig harness.
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- simstudioai/sim★ 30k86% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/constitution.mdcCursor rule
- .cursor/rules/emcn-components.mdcCursor rule
- .cursor/rules/global.mdcCursor rule
- .cursor/rules/landing-seo-geo.mdcCursor rule
- .cursor/rules/sim-architecture.mdcCursor rule
- .cursor/rules/sim-components.mdcCursor rule
- .cursor/rules/sim-hooks.mdcCursor rule
- .cursor/rules/sim-imports.mdcCursor rule
- .cursor/rules/sim-integrations.mdcCursor rule
- .cursor/rules/sim-queries.mdcCursor rule
- .cursor/rules/sim-sandbox.mdcCursor rule
- .cursor/rules/sim-stores.mdcCursor rule
- .cursor/rules/sim-styling.mdcCursor rule
- .cursor/rules/sim-testing.mdcCursor rule
- .cursor/rules/sim-typescript.mdcCursor rule
- .cursor/rules/sim-ui-copy.mdcCursor rule
- add-blockSkill
- add-column-typeSkill
- add-connectorSkill
- add-enrichmentSkill
- add-feature-flagSkill
- add-hosted-keySkill
- add-integrationSkill
- add-managed-cliSkill
- add-modelSkill
- 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
- tool-registry-boundarySkill
- v2-api-conventionsSkill
- validate-connectorSkill
- validate-integrationSkill
- validate-modelSkill
- validate-triggerSkill
- you-might-not-need-a-callbackSkill
- you-might-not-need-a-commentSkill
- you-might-not-need-a-memoSkill
- you-might-not-need-an-effectSkill
- you-might-not-need-stateSkill
- you-might-not-need-url-stateSkill
- add-settings-pageSkill
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.

