From 136c88a2318659ecd02ffb302fdd71f292c787e7 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Tue, 9 Jun 2026 16:05:50 +0200 Subject: [PATCH] docs(skills): decouple safe local commands from destructive sync push (#9467) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs(skills): decouple safe local commands from destructive sync push The schedules, triggers, and resources skill templates lumped every CLI command under a blunt "do NOT run them yourself" directive. This conflated two very different risk profiles and forbade the agent from running even read-only/local commands, creating needless friction. Align these three with the nuanced policy flow-cli.md already uses: keep `wmill sync push` defensive (it deploys and can be destructive to remote state — only run when the user explicitly asks to deploy/publish/push), while letting read-only commands (`sync pull`, `schedule`, `resource list`) be run freely. Regenerated auto-generated skills + skills.gen.ts. Co-Authored-By: Claude Opus 4.8 (1M context) * feat(cli): warn that sync push is destructive in dry-run output Co-Authored-By: Claude Opus 4.8 (1M context) * docs(skills): clarify sync pull mutates local files, not read-only Co-Authored-By: Claude Opus 4.8 (1M context) --------- Co-authored-by: Claude Opus 4.8 (1M context) Co-authored-by: centdix --- cli/src/commands/sync/sync.ts | 12 ++++++++++++ cli/src/guidance/skills.gen.ts | 11 ++++++----- system_prompts/auto-generated/prompts.ts | 3 ++- .../auto-generated/skills/resources/SKILL.md | 3 ++- .../auto-generated/skills/schedules/SKILL.md | 4 ++-- .../auto-generated/skills/triggers/SKILL.md | 4 ++-- system_prompts/base/resources.md | 3 ++- system_prompts/base/schedules.md | 4 ++-- system_prompts/base/triggers.md | 4 ++-- 9 files changed, 32 insertions(+), 16 deletions(-) diff --git a/cli/src/commands/sync/sync.ts b/cli/src/commands/sync/sync.ts index 863ccb4142..10331ed668 100644 --- a/cli/src/commands/sync/sync.ts +++ b/cli/src/commands/sync/sync.ts @@ -3465,6 +3465,14 @@ function removeSuffix(str: string, suffix: string) { return str.slice(0, str.length - suffix.length); } +// Shown after a `wmill sync push --dry-run` preview that has changes. `sync push` +// deploys to the remote workspace and is destructive (it overwrites and prunes +// remote items that differ from or are absent locally), so the preview reminds +// the caller — especially an AI agent that ran the dry-run to inspect changes — +// to get explicit user confirmation before applying it for real. +const SYNC_PUSH_DESTRUCTIVE_WARNING = + "`wmill sync push` is destructive: applying it deploys these changes to the remote workspace and overwrites or deletes remote items that differ from or are absent locally — this is not automatically reversible. If you are an AI agent, do NOT run `wmill sync push` (without --dry-run) until the user has explicitly confirmed this deploy, unless your custom instructions explicitly allow bypassing that confirmation."; + export async function push( opts: GlobalOptions & SyncOptions & { repository?: string; branch?: string; acceptOverridingPermissionedAsWithSelf?: boolean }, ) { @@ -4001,6 +4009,9 @@ export async function push( : {}), })), total: changes.length, + ...(changes.length > 0 + ? { warning: SYNC_PUSH_DESTRUCTIVE_WARNING } + : {}), }; console.log(JSON.stringify(result, null, 2)); return; @@ -4044,6 +4055,7 @@ export async function push( if (opts.dryRun) { log.info(colors.gray(`Dry run complete.`)); + log.warn(colors.yellow(`\n⚠ ${SYNC_PUSH_DESTRUCTIVE_WARNING}`)); return; } diff --git a/cli/src/guidance/skills.gen.ts b/cli/src/guidance/skills.gen.ts index 61d92755fb..750b0df0ec 100644 --- a/cli/src/guidance/skills.gen.ts +++ b/cli/src/guidance/skills.gen.ts @@ -5266,10 +5266,10 @@ Text/HTML/inline parts are placed inline in \`body\` as strings. ## CLI Commands -After writing, tell the user they can run these commands (do NOT run them yourself): +\`wmill sync push\` deploys local changes to the workspace and can be destructive to remote state — only suggest/run it when the user explicitly asks to deploy/publish/push, not when they say "run", "try", or "test". \`sync pull\` is safe to run yourself — it never mutates remote state, though it does overwrite local files to match the remote (use \`sync pull --dry-run\` to only preview). \`\`\`bash -# Push trigger configuration +# Push trigger configuration — only when the user explicitly asks to deploy wmill sync push # Pull triggers from Windmill @@ -5317,10 +5317,10 @@ Windmill uses 6-field cron expressions (includes seconds): ## CLI Commands -After writing, tell the user they can run these commands (do NOT run them yourself): +\`wmill sync push\` deploys local changes to the workspace and can be destructive to remote state — only suggest/run it when the user explicitly asks to deploy/publish/push, not when they say "run", "try", or "test". The commands below never mutate remote state, so they're safe to run yourself — note that \`sync pull\` does overwrite local files to match the remote (use \`sync pull --dry-run\` to only preview), while \`schedule\` just lists. \`\`\`bash -# Push schedules to Windmill +# Push schedules to Windmill — only when the user explicitly asks to deploy wmill sync push # Pull schedules from Windmill @@ -5574,7 +5574,8 @@ wmill resource-type list --schema # Get specific resource type schema wmill resource-type get postgresql -# Push resources (tell the user to run this, do NOT run it yourself) +# Push resources to Windmill — deploys to the workspace and can be destructive to +# remote state, so only run it when the user explicitly asks to deploy/publish/push wmill sync push \`\`\` `, diff --git a/system_prompts/auto-generated/prompts.ts b/system_prompts/auto-generated/prompts.ts index 3d8819c4fe..4a068f2210 100644 --- a/system_prompts/auto-generated/prompts.ts +++ b/system_prompts/auto-generated/prompts.ts @@ -563,7 +563,8 @@ wmill resource-type list --schema # Get specific resource type schema wmill resource-type get postgresql -# Push resources (tell the user to run this, do NOT run it yourself) +# Push resources to Windmill — deploys to the workspace and can be destructive to +# remote state, so only run it when the user explicitly asks to deploy/publish/push wmill sync push \`\`\` `; diff --git a/system_prompts/auto-generated/skills/resources/SKILL.md b/system_prompts/auto-generated/skills/resources/SKILL.md index 3f78cc1b0b..113826ad63 100644 --- a/system_prompts/auto-generated/skills/resources/SKILL.md +++ b/system_prompts/auto-generated/skills/resources/SKILL.md @@ -242,6 +242,7 @@ wmill resource-type list --schema # Get specific resource type schema wmill resource-type get postgresql -# Push resources (tell the user to run this, do NOT run it yourself) +# Push resources to Windmill — deploys to the workspace and can be destructive to +# remote state, so only run it when the user explicitly asks to deploy/publish/push wmill sync push ``` diff --git a/system_prompts/auto-generated/skills/schedules/SKILL.md b/system_prompts/auto-generated/skills/schedules/SKILL.md index 24dab471e5..526740e04c 100644 --- a/system_prompts/auto-generated/skills/schedules/SKILL.md +++ b/system_prompts/auto-generated/skills/schedules/SKILL.md @@ -39,10 +39,10 @@ Windmill uses 6-field cron expressions (includes seconds): ## CLI Commands -After writing, tell the user they can run these commands (do NOT run them yourself): +`wmill sync push` deploys local changes to the workspace and can be destructive to remote state — only suggest/run it when the user explicitly asks to deploy/publish/push, not when they say "run", "try", or "test". The commands below never mutate remote state, so they're safe to run yourself — note that `sync pull` does overwrite local files to match the remote (use `sync pull --dry-run` to only preview), while `schedule` just lists. ```bash -# Push schedules to Windmill +# Push schedules to Windmill — only when the user explicitly asks to deploy wmill sync push # Pull schedules from Windmill diff --git a/system_prompts/auto-generated/skills/triggers/SKILL.md b/system_prompts/auto-generated/skills/triggers/SKILL.md index 81401f1fdf..494d5d9798 100644 --- a/system_prompts/auto-generated/skills/triggers/SKILL.md +++ b/system_prompts/auto-generated/skills/triggers/SKILL.md @@ -61,10 +61,10 @@ Text/HTML/inline parts are placed inline in `body` as strings. ## CLI Commands -After writing, tell the user they can run these commands (do NOT run them yourself): +`wmill sync push` deploys local changes to the workspace and can be destructive to remote state — only suggest/run it when the user explicitly asks to deploy/publish/push, not when they say "run", "try", or "test". `sync pull` is safe to run yourself — it never mutates remote state, though it does overwrite local files to match the remote (use `sync pull --dry-run` to only preview). ```bash -# Push trigger configuration +# Push trigger configuration — only when the user explicitly asks to deploy wmill sync push # Pull triggers from Windmill diff --git a/system_prompts/base/resources.md b/system_prompts/base/resources.md index 0f51f6d322..763c0741f8 100644 --- a/system_prompts/base/resources.md +++ b/system_prompts/base/resources.md @@ -237,6 +237,7 @@ wmill resource-type list --schema # Get specific resource type schema wmill resource-type get postgresql -# Push resources (tell the user to run this, do NOT run it yourself) +# Push resources to Windmill — deploys to the workspace and can be destructive to +# remote state, so only run it when the user explicitly asks to deploy/publish/push wmill sync push ``` diff --git a/system_prompts/base/schedules.md b/system_prompts/base/schedules.md index 8e50fb87a6..f3d9d9ee9a 100644 --- a/system_prompts/base/schedules.md +++ b/system_prompts/base/schedules.md @@ -34,10 +34,10 @@ Windmill uses 6-field cron expressions (includes seconds): ## CLI Commands -After writing, tell the user they can run these commands (do NOT run them yourself): +`wmill sync push` deploys local changes to the workspace and can be destructive to remote state — only suggest/run it when the user explicitly asks to deploy/publish/push, not when they say "run", "try", or "test". The commands below never mutate remote state, so they're safe to run yourself — note that `sync pull` does overwrite local files to match the remote (use `sync pull --dry-run` to only preview), while `schedule` just lists. ```bash -# Push schedules to Windmill +# Push schedules to Windmill — only when the user explicitly asks to deploy wmill sync push # Pull schedules from Windmill diff --git a/system_prompts/base/triggers.md b/system_prompts/base/triggers.md index d97688ca4d..37ce6fc0e6 100644 --- a/system_prompts/base/triggers.md +++ b/system_prompts/base/triggers.md @@ -56,10 +56,10 @@ Text/HTML/inline parts are placed inline in `body` as strings. ## CLI Commands -After writing, tell the user they can run these commands (do NOT run them yourself): +`wmill sync push` deploys local changes to the workspace and can be destructive to remote state — only suggest/run it when the user explicitly asks to deploy/publish/push, not when they say "run", "try", or "test". `sync pull` is safe to run yourself — it never mutates remote state, though it does overwrite local files to match the remote (use `sync pull --dry-run` to only preview). ```bash -# Push trigger configuration +# Push trigger configuration — only when the user explicitly asks to deploy wmill sync push # Pull triggers from Windmill