You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/skills/add-block/SKILL.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,10 @@ When the user asks you to create a block:
19
19
20
20
Blocks depend on tool outputs. If the underlying tool response schema is not documented or live-verified, you MUST tell the user instead of guessing block outputs.
21
21
22
+
When block work changes tool execution, same-process work must use a registered
23
+
`InternalToolConfig.operation`. Never add a Sim `/api/...` self-hop or the retired
24
+
`directExecution` property.
25
+
22
26
- Do NOT invent block outputs for undocumented tool responses
23
27
- Do NOT describe unknown JSON shapes as if they were confirmed
24
28
- Do NOT wire fields into the block just because they seem likely to exist
@@ -1052,6 +1056,10 @@ After creating the block, you MUST validate it against every tool it references:
1052
1056
4.**Verify conditions** — each subBlock should only show for the operations that actually use it
1053
1057
5.**Verify `{Service}BlockMeta` is exported** with at least 7 templates, each having `icon`, `title`, `prompt`, `modules`, `category`, and `tags`
1054
1058
6.**If any tool outputs are still unknown**, explicitly tell the user instead of guessing block outputs
1059
+
7.**Verify the tool execution boundary** — blocks never create or call API routes. Every referenced
1060
+
tool must already be either a registered `InternalToolConfig.operation` or an absolute external
1061
+
HTTP(S) `ToolConfig.request`. If transport needs to change, use the `add-tools` skill; do not add a
1062
+
same-origin `/api/...` hop from the block.
1055
1063
1056
1064
## Option Lists: `selectorKey` or `options`, never a per-block fetcher
Copy file name to clipboardExpand all lines: .agents/skills/add-feature-flag/SKILL.md
+16-15Lines changed: 16 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,16 @@
1
1
---
2
2
name: add-feature-flag
3
-
description: Add a runtime feature flag (AppConfig-backed on prod, secret fallback off-prod), global by default or optionally gated by org id, user id, or platform admin
3
+
description: Add a runtime feature flag (AppConfig-backed on prod, secret fallback off-prod), global by default or optionally gated by workspace id, org id, user id, or platform admin
4
4
argument-hint: <flag-name>
5
5
---
6
6
7
7
# Add Feature Flag Skill
8
8
9
-
You add a **runtime feature flag** to Sim that can change on prod with no redeploy (AWS AppConfig). Prefer a global on/off flag unless the rollout actually needs per-organization, per-user, or platform-admin targeting. When AppConfig isn't the source of truth, the flag falls back to a single **secret** (on/off only).
9
+
You add a **runtime feature flag** to Sim that can change on prod with no redeploy (AWS AppConfig). Prefer a global on/off flag unless the rollout actually needs per-workspace, per-organization, per-user, or platform-admin targeting. When AppConfig isn't the source of truth, the flag falls back to a single **secret** (on/off only).
10
10
11
11
## When to use this vs `env-flags.ts`
12
12
13
-
-**Feature flag** (`@/lib/core/config/feature-flags.ts`): runtime global on/off by default, optionally scoped by `userId`/`orgId`/admin. This skill.
13
+
-**Feature flag** (`@/lib/core/config/feature-flags.ts`): runtime global on/off by default, optionally scoped by `workspaceId`/`userId`/`orgId`/admin. This skill.
14
14
-**Env flag** (`@/lib/core/config/env-flags.ts`): deploy-time capability/environment detection (`isProd`, `isHosted`, `isBillingEnabled`). A module-load boolean. **Do not add gated flags here.**
15
15
16
16
If the user wants a fixed per-deployment toggle, send them to `env-flags.ts` instead.
@@ -21,10 +21,11 @@ A flag's **gating rule lives only in the hosted AppConfig document**. It is ON f
@@ -34,10 +35,10 @@ Critically, **none of this is expressible in code** — gating (especially `admi
34
35
35
36
1.**Confirm the granularity before editing code.** If the user has not already specified it, stop and ask:
36
37
37
-
> Should `<flag-name>` be a global on/off flag (recommended), or does it need rollout targeting by organization, user, and/or platform admin?
38
+
> Should `<flag-name>` be a global on/off flag (recommended), or does it need rollout targeting by workspace, organization, user, and/or platform admin?
38
39
39
-
- Recommend **global**. Do not infer scoped gating merely because the call site already has a user or organization id.
40
-
- If the user chooses scoped gating but does not name the dimensions, ask which of organization, user, and platform admin it needs. Wire only the selected dimensions.
40
+
- Recommend **global**. Do not infer scoped gating merely because the call site already has a workspace, user, or organization id.
41
+
- If the user chooses scoped gating but does not name the dimensions, ask which of workspace, organization, user, and platform admin it needs. Wire only the selected dimensions.
41
42
- If the user wants a fixed per-deployment toggle rather than a runtime AppConfig flag, use `env-flags.ts` instead.
42
43
43
44
2.**Define the flag.** Add one entry to the `FEATURE_FLAGS` registry in `apps/sim/lib/core/config/feature-flags.ts`. Each entry is the flag's whole definition — name (kebab-case key), `description`, and the `fallback` secret consulted when AppConfig isn't the source of truth (truthy ⇒ on globally):
@@ -51,7 +52,7 @@ Critically, **none of this is expressible in code** — gating (especially `admi
51
52
}
52
53
```
53
54
54
-
`fallback` is the env/secret key (typed as `keyof typeof env`), so add `<FLAG_SECRET>` to `apps/sim/lib/core/config/env.ts` first (and the deployment's secret store) — it won't typecheck otherwise. Do **not** add org/user/admin defaults here — that gating exists only in AppConfig. Adding the entry makes `<flag-name>` a valid `FeatureFlagName`.
55
+
`fallback` is the env/secret key (typed as `keyof typeof env`), so add `<FLAG_SECRET>` to `apps/sim/lib/core/config/env.ts` first (and the deployment's secret store) — it won't typecheck otherwise. Do **not** add workspace/org/user/admin defaults here — that gating exists only in AppConfig. Adding the entry makes `<flag-name>` a valid `FeatureFlagName`.
55
56
56
57
3.**Gate the call site at the chosen granularity.** For the recommended global mode, pass no context:
57
58
@@ -70,17 +71,17 @@ Critically, **none of this is expressible in code** — gating (especially `admi
if (awaitisFeatureEnabled('<flag-name>', { userId, orgId })) {
74
+
if (awaitisFeatureEnabled('<flag-name>', { workspaceId, userId, orgId })) {
74
75
// gated behavior
75
76
}
76
77
```
77
78
78
-
-Organization targeting uses `orgId`; user and platform-admin targeting require `userId`.
79
+
-Workspace targeting uses `workspaceId`; organization targeting uses `orgId`; user and platform-admin targeting require `userId`.
79
80
- Missing ids are fine — a clause with no matching id is skipped; with no `userId`, the admin clause resolves to `false` without a DB read.
80
81
- Admin routes that already know the caller is an admin may pass `{ userId, isAdmin: true }` to skip the role lookup.
81
82
-**Client/UI flags:** resolve server-side (in a server component, route, or loader) and pass the boolean down as a prop. There is no client AppConfig.
82
83
83
-
4.**(Prod) configure in AppConfig.** The infra `feature-flags` profile schema is permissive, so a new flag needs **no infra change**. Operators add the flag to the hosted `feature-flags` document using `enabled` for global rollout or only the selected `orgIds`/`userIds`/`adminEnabled` clauses for scoped rollout, then start a `sim-<env>-fast` deployment (see the AppConfig runbook in the infra README — same flow as `access-control`). The fallback secret only applies when AppConfig is disabled.
84
+
4.**(Prod) configure in AppConfig.** The infra `feature-flags` profile schema is permissive, so a new flag needs **no infra change**. Operators add the flag to the hosted `feature-flags` document using `enabled` for global rollout or only the selected `workspaceIds`/`orgIds`/`userIds`/`adminEnabled` clauses for scoped rollout, then start a `sim-<env>-fast` deployment (see the AppConfig runbook in the infra README — same flow as `access-control`). The fallback secret only applies when AppConfig is disabled.
84
85
85
86
5.**Test.** Add a case to `apps/sim/lib/core/config/feature-flags.test.ts` that matches the chosen granularity. For a global flag, exercise `isFeatureEnabled('<flag-name>')` with an AppConfig `enabled` rule and toggle the fallback secret for the off-AppConfig path. For scoped rollout, cover only the selected clauses and mock `isPlatformAdmin` when testing `adminEnabled`.
86
87
@@ -90,6 +91,6 @@ Critically, **none of this is expressible in code** — gating (especially `admi
90
91
91
92
- Flag keys are `kebab-case`.
92
93
- Never read flags via raw `fetch` or a new AppConfig client — always go through `isFeatureEnabled` / `getFeatureFlags`.
93
-
- Never bake gating into code. The fallback is a single boolean secret; org/user/admin scoping is AppConfig-only.
94
+
- Never bake gating into code. The fallback is a single boolean secret; workspace/org/user/admin scoping is AppConfig-only.
94
95
- Never add or propagate request context unless the user chose scoped rollout.
95
96
- The admin check reads the DB **replica** (`dbReplica`) and is resolved lazily, so an admin-gated flag adds at most one cheap replica read, and only when `adminEnabled` is the deciding clause.
0 commit comments