-
Notifications
You must be signed in to change notification settings - Fork 3.7k
feat(skills): canonicalize skills to a single source with generated .claude/.cursor projections #5609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
feat(skills): canonicalize skills to a single source with generated .claude/.cursor projections #5609
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
f3d764d
improvement(cleanup-skill): parallelize analysis, apply fixes sequent…
TheodoreSpeaks 964f746
improvement(cleanup-skill): add comment-reduction pass; mirror 6 miss…
TheodoreSpeaks 8dc169a
fix(cleanup-skill): substitute parsed scope into analysis passes inst…
TheodoreSpeaks 390a902
fix(cleanup-skill): parse fix token anywhere; preserve pass labels th…
TheodoreSpeaks 85a26fe
fix(cleanup-skill): apply Step 1 proposals content-anchored, re-deriv…
TheodoreSpeaks b111671
fix(babysit-skill): correct garbled --reverse explanation across all …
TheodoreSpeaks d1b1040
fix(skills): propagate parallel cleanup to cursor/agents copies; disa…
TheodoreSpeaks 3a32a53
fix(skills): port url-state + comment passes to cursor/agents; clarif…
TheodoreSpeaks 722d287
feat(skills): canonicalize skills under .agents/skills with generated…
TheodoreSpeaks dfb6c34
fix(skills): strip leaked XML tags from skill tails; clarify lint:che…
TheodoreSpeaks 247f449
fix(add-block-skill): restore unknown-output stop in Final Validation
TheodoreSpeaks 183a605
Merge remote-tracking branch 'origin/staging' into feat/parallel-clea…
TheodoreSpeaks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| --- | ||
| name: add-block-preview | ||
| description: 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 | ||
| argument-hint: <block-type> | ||
| --- | ||
|
|
||
| # 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`): | ||
|
|
||
| 1. **`preview: true`** on the `BlockConfig` (static, in code) — the block is default-hidden EVERYWHERE (hosted, self-hosted, dev, SSR) until revealed. Fail-closed. | ||
| 2. **The hosted `block-visibility` AppConfig document** — per-block rule keyed by the existing block type: | ||
|
|
||
| ```jsonc | ||
| { | ||
| "<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') | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| 3. **`PREVIEW_BLOCKS` env** (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 | ||
|
|
||
| 1. **Author** the block normally (`/add-block` etc.) and set `preview: true` on its `BlockConfig`. **Ship no `BlockMeta` and no docs until GA** — `check-block-registry` deliberately skips preview blocks in meta coverage, and `generate-docs` skips them at every gate. | ||
| 2. **Local dev:** set `PREVIEW_BLOCKS=<block-type>` in your env to see it (with the suffix). | ||
| 3. **Merge/deploy.** The block's code is live everywhere but visible nowhere — no AppConfig rule exists and self-hosters have no env entry. | ||
| 4. **Hosted preview:** add a rule to the `block-visibility` AppConfig 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-deployment` with the `sim-<env>-fast` strategy (see the infra README). | ||
| 5. **GA cleanup:** delete `preview: true` from the block (now visible to self-hosters on their next upgrade), add its `BlockMeta` + regen docs, and drop the AppConfig entry. For a v2 upgrade, this is also when v1 gets `hideFromToolbar: 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 `isBlockTypeAccessControlExempt` resolve via pure `getBlock`. Do not add visibility checks to execution paths. | ||
| - **Clone-not-remove:** gated blocks stay in `getAllBlocks()` output as clones with `hideFromToolbar: 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) and `getExposedIntegrationTools` build 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.