From 72acc4be9f42b4ed26eeda002faf20c98348e32f Mon Sep 17 00:00:00 2001 From: Marcus Chandra Date: Mon, 7 Sep 2026 18:42:31 -0700 Subject: [PATCH] all skills: parse CLI output defensively Claude-Session: https://claude.ai/code/session_01MYsyypbYR5eT4rxM2vaeEF --- skills/build-workflow/SKILL.md | 14 ++++++++++++++ skills/deploy-workflow/SKILL.md | 14 ++++++++++++++ skills/knowledge-base/SKILL.md | 10 ++++++++++ skills/run-tool/SKILL.md | 10 ++++++++++ skills/run-workflow/SKILL.md | 14 ++++++++++++++ skills/table/SKILL.md | 10 ++++++++++ 6 files changed, 72 insertions(+) diff --git a/skills/build-workflow/SKILL.md b/skills/build-workflow/SKILL.md index 1e6fe6d..edfd5e0 100644 --- a/skills/build-workflow/SKILL.md +++ b/skills/build-workflow/SKILL.md @@ -22,6 +22,20 @@ more than one call, branching, or a schedule. Preserve blocks, edges, variables, and deployment state outside the requested change. - If the workflow is locked or read-only, stop instead of attempting an alternate mutation path. +## Parse CLI output defensively + +- `--output json` can print human notice lines to stdout above the JSON body (truncation notices, + for example). Strip everything before the first `[` or `{` before parsing. +- `sim files read` visibly truncates content in its default rendering. Use `--output json` whenever + the full content matters. +- `workflows state get` returns the bare `{blocks, edges, loops, parallels, variables}` object; + `workflows export` wraps the same state in a portable envelope. A jq filter written for one shape + and run against the other yields an empty document with no error - the most dangerous kind of + wrong. Match the filter to the command. +- Select a profile with `SIM_PROFILE=` or an explicit `-P ` argument. Interpolating a + shell variable that holds `-P ` passes the name with a leading space and fails with an + unknown-profile error. + ## Design before encoding - Translate the request into an entry point, required transformations or decisions, external diff --git a/skills/deploy-workflow/SKILL.md b/skills/deploy-workflow/SKILL.md index d499b1b..7c96429 100644 --- a/skills/deploy-workflow/SKILL.md +++ b/skills/deploy-workflow/SKILL.md @@ -51,3 +51,17 @@ ahead of the deployed version, say so. Undeploy only on an explicit request. Use `workflows undeploy`, `workflows chat unpublish`, or `workflow-mcp-servers tools delete` for the matching surface, supplying confirmation where the CLI requires it. Then read the matching deployment status or MCP tool list again to verify it is offline. + +## Parse CLI output defensively + +- `--output json` can print human notice lines to stdout above the JSON body (truncation notices, + for example). Strip everything before the first `[` or `{` before parsing. +- `sim files read` visibly truncates content in its default rendering. Use `--output json` whenever + the full content matters. +- `workflows state get` returns the bare `{blocks, edges, loops, parallels, variables}` object; + `workflows export` wraps the same state in a portable envelope. A jq filter written for one shape + and run against the other yields an empty document with no error - the most dangerous kind of + wrong. Match the filter to the command. +- Select a profile with `SIM_PROFILE=` or an explicit `-P ` argument. Interpolating a + shell variable that holds `-P ` passes the name with a leading space and fails with an + unknown-profile error. diff --git a/skills/knowledge-base/SKILL.md b/skills/knowledge-base/SKILL.md index 3a34920..75c72c1 100644 --- a/skills/knowledge-base/SKILL.md +++ b/skills/knowledge-base/SKILL.md @@ -17,6 +17,16 @@ query whose expected answer is present in the source material. - Keep ids returned by create, upload, and connector calls. Do not rediscover resources by display name when an exact id is available. +## Parse CLI output defensively + +- `--output json` can print human notice lines to stdout above the JSON body (truncation notices, + for example). Strip everything before the first `[` or `{` before parsing. +- `sim files read` visibly truncates content in its default rendering. Use `--output json` whenever + the full content matters. +- Select a profile with `SIM_PROFILE=` or an explicit `-P ` argument. Interpolating a + shell variable that holds `-P ` passes the name with a leading space and fails with an + unknown-profile error. + ## Create with intentional chunking For ordinary documents, begin with the server defaults unless the user has a retrieval reason to diff --git a/skills/run-tool/SKILL.md b/skills/run-tool/SKILL.md index 1687b49..a9f4154 100644 --- a/skills/run-tool/SKILL.md +++ b/skills/run-tool/SKILL.md @@ -16,6 +16,16 @@ Never put a live credential in the command. - An unversioned name resolves to the newest version visible in the workspace, and the response echoes the id that answered. Use that id in the call. +## Parse CLI output defensively + +- `--output json` can print human notice lines to stdout above the JSON body (truncation notices, + for example). Strip everything before the first `[` or `{` before parsing. +- `sim files read` visibly truncates content in its default rendering. Use `--output json` whenever + the full content matters. +- Select a profile with `SIM_PROFILE=` or an explicit `-P ` argument. Interpolating a + shell variable that holds `-P ` passes the name with a leading space and fails with an + unknown-profile error. + ## Bind auth from the declaration, not from habit `tools get` labels every parameter with a `visibility`, and the label says where its value comes diff --git a/skills/run-workflow/SKILL.md b/skills/run-workflow/SKILL.md index c741c86..e562246 100644 --- a/skills/run-workflow/SKILL.md +++ b/skills/run-workflow/SKILL.md @@ -52,6 +52,20 @@ workflow and contains the state the selected block needs. - Use `--async` only for deployed runs that should return immediately. Then wait with `workflows runs wait` or inspect with `workflows runs get`; do not poll without a stopping bound. +## Parse CLI output defensively + +- `--output json` can print human notice lines to stdout above the JSON body (truncation notices, + for example). Strip everything before the first `[` or `{` before parsing. +- `sim files read` visibly truncates content in its default rendering. Use `--output json` whenever + the full content matters. +- `workflows state get` returns the bare `{blocks, edges, loops, parallels, variables}` object; + `workflows export` wraps the same state in a portable envelope. A jq filter written for one shape + and run against the other yields an empty document with no error - the most dangerous kind of + wrong. Match the filter to the command. +- Select a profile with `SIM_PROFILE=` or an explicit `-P ` argument. Interpolating a + shell variable that holds `-P ` passes the name with a leading space and fails with an + unknown-profile error. + ## Diagnose failures 1. Read the returned run id, status, error, and selected outputs. diff --git a/skills/table/SKILL.md b/skills/table/SKILL.md index e754724..98c7af2 100644 --- a/skills/table/SKILL.md +++ b/skills/table/SKILL.md @@ -16,6 +16,16 @@ smallest requested mutation, and verify stored rows or run state afterward. `sim --output json tables get ` before changing its schema or data. - Keep the returned table id. Do not rediscover a table by name after creating it. +## Parse CLI output defensively + +- `--output json` can print human notice lines to stdout above the JSON body (truncation notices, + for example). Strip everything before the first `[` or `{` before parsing. +- `sim files read` visibly truncates content in its default rendering. Use `--output json` whenever + the full content matters. +- Select a profile with `SIM_PROFILE=` or an explicit `-P ` argument. Interpolating a + shell variable that holds `-P ` passes the name with a leading space and fails with an + unknown-profile error. + ## Design the schema first Create a table with at least one explicit column: