From 4b711e8c06e9b5b9fe7a5d36721cb37ed59e239c Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 06:06:16 +0000 Subject: [PATCH 1/3] docs(skills): the ask skill says what to do after the user answers an ask-back Step 2 of skills/objectstack-ask/SKILL.md gains the turn after an ask-back: an option is used only once the user picks it, computed by its exact name (step 3); a user who picks none gets step 4. Paid inside the file: three restatements cut, the measured token count stays at its ceiling. packages/mcp/src/ask-skill.generated.ts regenerated; one eval case for the second turn. Claude-Session: https://claude.ai/code/session_016WV4d1Dv2AVwokgRqfdKp2 Co-authored-by: Claude --- packages/mcp/src/ask-skill.generated.ts | 12 +++++++----- skills/objectstack-ask/SKILL.md | 12 +++++++----- .../evals/metric-selection-fallback.json | 10 ++++++++++ 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/packages/mcp/src/ask-skill.generated.ts b/packages/mcp/src/ask-skill.generated.ts index 8dddd48a2b0..bfc9efc24a4 100644 --- a/packages/mcp/src/ask-skill.generated.ts +++ b/packages/mcp/src/ask-skill.generated.ts @@ -18,8 +18,8 @@ export const ASK_SKILL_DATA_LOOP: string = [ '', '- Lift the question\'s business words: the thing measured ("win rate", "营收",', ' "商机数") and what it is grouped or filtered by ("by stage", "按行业").', - '- Call `list_datasets({ terms })` with those words, as the user wrote them and', - ' in the user\'s language. Do not translate or reword a term: a match on a word', + '- Call `list_datasets({ terms })` with those words, as the user wrote them.', + ' Do not translate or reword a term: a match on a word', ' you supplied is your reading, not the user\'s. A term is the noun phrase for', ' the thing, kept whole ("travel budget", not "travel" and "budget": a', ' fragment\'s matches are not the user\'s) and without the verbs, time words', @@ -43,13 +43,12 @@ export const ASK_SKILL_DATA_LOOP: string = [ '| One word matches several measures, in one dataset or in two | Ask the user which one they mean. List each candidate\'s label, its dataset\'s label and its description. Do not pick one. |', '| A word with a measure among its `candidates` | Ask the same way; with one candidate, ask whether it is the one meant. |', '| A word whose `candidates` are all dimensions | At most a possible grouping: never ask about it, and it never stops a matched measure. |', - '| Only a dimension matches | That is a grouping ("by stage"), not a number. You still need a measure match; without one, ask which number is meant. |', + '| Only a dimension matches | That is a grouping, not a number. Without a measure match, ask which number is meant. |', '| No match and no candidates for the word for a thing measured | Step 4. |', '| `membersWithheld: true` on a dataset | Say that it has members (measures or groupings) you may not read; the metric asked for may be among them. Do not say the metric does not exist. |', '', 'When the answer has `nextStep`, follow its `decision` and `note`. If `note`', - 'says to answer one measure and ask about a word, do both; use none of that', - 'word\'s candidates until the user answers.', + 'says to answer one measure and ask about a word, do both.', '', 'When you only ask, the reply is the question alone: no tool call until the user', 'answers. State no figure of your own in it (no count, total', @@ -59,6 +58,9 @@ export const ASK_SKILL_DATA_LOOP: string = [ 'instead of asking about some other word\'s matches. `partial: true` on the answer means the catalogue may', 'be incomplete; `warning` says why, and you repeat it when you fall back.', '', + 'Use an option only once the user picks it: compute it by its exact name', + '(step 3). If they pick none, go to step 4.', + '', '## 3. Compute a governed metric', '', '- `query_dataset({ datasetName, selection })`. `selection.measures` and', diff --git a/skills/objectstack-ask/SKILL.md b/skills/objectstack-ask/SKILL.md index 971c735348d..8fde5c118a1 100644 --- a/skills/objectstack-ask/SKILL.md +++ b/skills/objectstack-ask/SKILL.md @@ -33,8 +33,8 @@ wrote its business definition) outranks a number you work out yourself. - Lift the question's business words: the thing measured ("win rate", "营收", "商机数") and what it is grouped or filtered by ("by stage", "按行业"). -- Call `list_datasets({ terms })` with those words, as the user wrote them and - in the user's language. Do not translate or reword a term: a match on a word +- Call `list_datasets({ terms })` with those words, as the user wrote them. + Do not translate or reword a term: a match on a word you supplied is your reading, not the user's. A term is the noun phrase for the thing, kept whole ("travel budget", not "travel" and "budget": a fragment's matches are not the user's) and without the verbs, time words @@ -58,13 +58,12 @@ wrote its business definition) outranks a number you work out yourself. | One word matches several measures, in one dataset or in two | Ask the user which one they mean. List each candidate's label, its dataset's label and its description. Do not pick one. | | A word with a measure among its `candidates` | Ask the same way; with one candidate, ask whether it is the one meant. | | A word whose `candidates` are all dimensions | At most a possible grouping: never ask about it, and it never stops a matched measure. | -| Only a dimension matches | That is a grouping ("by stage"), not a number. You still need a measure match; without one, ask which number is meant. | +| Only a dimension matches | That is a grouping, not a number. Without a measure match, ask which number is meant. | | No match and no candidates for the word for a thing measured | Step 4. | | `membersWithheld: true` on a dataset | Say that it has members (measures or groupings) you may not read; the metric asked for may be among them. Do not say the metric does not exist. | When the answer has `nextStep`, follow its `decision` and `note`. If `note` -says to answer one measure and ask about a word, do both; use none of that -word's candidates until the user answers. +says to answer one measure and ask about a word, do both. When you only ask, the reply is the question alone: no tool call until the user answers. State no figure of your own in it (no count, total @@ -74,6 +73,9 @@ wrote; when their word matched nothing and has no candidates, go to step 4 instead of asking about some other word's matches. `partial: true` on the answer means the catalogue may be incomplete; `warning` says why, and you repeat it when you fall back. +Use an option only once the user picks it: compute it by its exact name +(step 3). If they pick none, go to step 4. + ## 3. Compute a governed metric - `query_dataset({ datasetName, selection })`. `selection.measures` and diff --git a/skills/objectstack-ask/evals/metric-selection-fallback.json b/skills/objectstack-ask/evals/metric-selection-fallback.json index d559b258690..3ff37202790 100644 --- a/skills/objectstack-ask/evals/metric-selection-fallback.json +++ b/skills/objectstack-ask/evals/metric-selection-fallback.json @@ -170,6 +170,16 @@ "must_contain": ["Sales Amount", "Sales Analysis", "?"], "must_not_contain": ["query_dataset", "aggregate_records", "sales_amount"] } + }, + { + "id": 18, + "prompt": "The user asked: \"What is our retention?\" `list_datasets({ terms: ['retention'] })` answered one dataset, `subscriptions` (label Subscriptions), with `matches: []`; its measures are `logo_retention`, labelled Logo Retention and described as \"Share of customers at the start of the period still subscribed at its end\", and `net_revenue_retention`, labelled Net Revenue Retention and described as \"Recurring revenue kept from existing customers, expansion included\". The answer also carried `candidates: [{ term: 'retention', dataset: 'subscriptions', member: 'measures.logo_retention' }, { term: 'retention', dataset: 'subscriptions', member: 'measures.net_revenue_retention' }]`. You asked which one they meant, listing both, and computed nothing. The user now replies: \"Net Revenue Retention.\" What do you do next, and how do you write the answer?", + "expected_output": "The user picked one of the two options by its label, so that measure is now used, by its exact name as `list_datasets` listed it: the next step is `query_dataset` with `datasetName: 'subscriptions'` and a `selection` whose `measures` is `['net_revenue_retention']`. Calling `list_datasets` again with the label as the term before that is also right: the label equals that one measure. It does not ask again, does not compute Logo Retention as well, and does not fall back to the object tools: the fallback is for a user who picks none of the options. Writes the answer in the user's language, cites the source from the tool's answer (its `sourceLine`, or built from `provenance`, as in \"Metric: Net Revenue Retention (dataset: Subscriptions)\") rather than from memory, uses the measure's `description` to say what the number includes.", + "files": [], + "assertions": { + "must_contain": ["query_dataset", "Net Revenue Retention", "Subscriptions"], + "must_not_contain": ["aggregate_records", "非指标口径", "do you mean", "Do you mean"] + } } ] } From c735af7640aec9023737d4f4b396e7ab8f26d2f4 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 06:06:36 +0000 Subject: [PATCH 2/3] chore(changeset): patch for the ask skill's after-answer sentence Claude-Session: https://claude.ai/code/session_016WV4d1Dv2AVwokgRqfdKp2 Co-authored-by: Claude --- .changeset/35004-ask-skill-after-answer.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .changeset/35004-ask-skill-after-answer.md diff --git a/.changeset/35004-ask-skill-after-answer.md b/.changeset/35004-ask-skill-after-answer.md new file mode 100644 index 00000000000..d2538f07339 --- /dev/null +++ b/.changeset/35004-ask-skill-after-answer.md @@ -0,0 +1,13 @@ +--- +'@objectstack/skills': patch +'@objectstack/mcp': patch +--- + +docs(skills): the `objectstack-ask` skill says what the client does after the user answers an ask-back + +Clause-②: no +Metadata-protocol: none + +Step 2 of the `objectstack-ask` skill, and the page at `GET /mcp/skill` that is generated from it, told a connected client to ask which reading the user meant and stopped there. It now carries the turn after the answer: an option is used only once the user picks it, and is then computed by its exact name as step 3 says (`query_dataset`, with the source cited from the tool's answer); a user who picks none of the options gets step 4, the object-query fallback with its label. This is ADR-0149 D3 rule 2 and rule 4 applied to the user's reply; no rule is added. + +Three restatements are cut from the same file, each keeping its other home, so the skill does not grow: "and in the user's language" in step 1 (beside "Do not translate or reword a term"), the "by stage" example and "You still need a measure match" in the grouping row of step 2, and "use none of that word's candidates until the user answers" under the step 2 table, which the new sentence now states for every option. `packages/mcp/src/ask-skill.generated.ts` is regenerated from the skill; no code path changes. From fe8707ed6ce7dc44070b831c4e0ae435c5143759 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 20 Nov 2026 07:22:31 +0000 Subject: [PATCH 3/3] docs(skills): a reply that names another word after an ask-back starts at step 1 Contract review of the previous head found "If they pick none, go to step 4" also covering a reply that brings a different metric word ("no, I mean ARR"), which ADR-0149 D3 rule 2 and the door's initialize rule send through a list_datasets lookup first. The sentence now reads "Another word starts at step 1; if they only pick none, go to step 4." Paid inside the file: "a fragment's matches are not the user's" is cut from step 1's term bullet, where "a match on a word you supplied is your reading, not the user's" keeps the reason. 7505 -> 7500 priced bytes; the ratchet row is not edited. packages/mcp/src/ask-skill.generated.ts regenerated; eval case 19 for the another-word reply; the changeset follows the text. Claude-Session: https://claude.ai/code/session_016WV4d1Dv2AVwokgRqfdKp2 Co-authored-by: Claude --- .changeset/35004-ask-skill-after-answer.md | 4 ++-- packages/mcp/src/ask-skill.generated.ts | 6 +++--- skills/objectstack-ask/SKILL.md | 6 +++--- .../evals/metric-selection-fallback.json | 10 ++++++++++ 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.changeset/35004-ask-skill-after-answer.md b/.changeset/35004-ask-skill-after-answer.md index d2538f07339..09b5a1b95b9 100644 --- a/.changeset/35004-ask-skill-after-answer.md +++ b/.changeset/35004-ask-skill-after-answer.md @@ -8,6 +8,6 @@ docs(skills): the `objectstack-ask` skill says what the client does after the us Clause-②: no Metadata-protocol: none -Step 2 of the `objectstack-ask` skill, and the page at `GET /mcp/skill` that is generated from it, told a connected client to ask which reading the user meant and stopped there. It now carries the turn after the answer: an option is used only once the user picks it, and is then computed by its exact name as step 3 says (`query_dataset`, with the source cited from the tool's answer); a user who picks none of the options gets step 4, the object-query fallback with its label. This is ADR-0149 D3 rule 2 and rule 4 applied to the user's reply; no rule is added. +Step 2 of the `objectstack-ask` skill, and the page at `GET /mcp/skill` that is generated from it, told a connected client to ask which reading the user meant and stopped there. It now carries the turn after the answer: an option is used only once the user picks it, and is then computed by its exact name as step 3 says (`query_dataset`, with the source cited from the tool's answer); a reply that names another word ("no, I mean ARR") starts at step 1, a new `list_datasets` lookup with that word, before anything else; a user who only picks none of the options gets step 4, the object-query fallback with its label. This is ADR-0149 D3 rule 1, rule 2 and rule 4 applied to the user's reply; no rule is added. The another-word case is also part of the ask-skill iteration loop (Part of #34996, item a of its third round). -Three restatements are cut from the same file, each keeping its other home, so the skill does not grow: "and in the user's language" in step 1 (beside "Do not translate or reword a term"), the "by stage" example and "You still need a measure match" in the grouping row of step 2, and "use none of that word's candidates until the user answers" under the step 2 table, which the new sentence now states for every option. `packages/mcp/src/ask-skill.generated.ts` is regenerated from the skill; no code path changes. +Four restatements are cut from the same file, each keeping its other home, so the skill does not grow: "and in the user's language" in step 1 (beside "Do not translate or reword a term"), "a fragment's matches are not the user's" in the same bullet (beside "a match on a word you supplied is your reading, not the user's"), the "by stage" example and "You still need a measure match" in the grouping row of step 2, and "use none of that word's candidates until the user answers" under the step 2 table, which the new sentence now states for every option. `packages/mcp/src/ask-skill.generated.ts` is regenerated from the skill; no code path changes. diff --git a/packages/mcp/src/ask-skill.generated.ts b/packages/mcp/src/ask-skill.generated.ts index bfc9efc24a4..47bf6a0b01c 100644 --- a/packages/mcp/src/ask-skill.generated.ts +++ b/packages/mcp/src/ask-skill.generated.ts @@ -21,8 +21,8 @@ export const ASK_SKILL_DATA_LOOP: string = [ '- Call `list_datasets({ terms })` with those words, as the user wrote them.', ' Do not translate or reword a term: a match on a word', ' you supplied is your reading, not the user\'s. A term is the noun phrase for', - ' the thing, kept whole ("travel budget", not "travel" and "budget": a', - ' fragment\'s matches are not the user\'s) and without the verbs, time words', + ' the thing, kept whole ("travel budget", not "travel" and "budget")', + ' and without the verbs, time words', ' and question words around it ("trip days", not "trip days requested";', ' "报销金额", not "报销金额合计是多少").', '- Each dataset in the answer carries `matches`: one entry per hit, with the', @@ -59,7 +59,7 @@ export const ASK_SKILL_DATA_LOOP: string = [ 'be incomplete; `warning` says why, and you repeat it when you fall back.', '', 'Use an option only once the user picks it: compute it by its exact name', - '(step 3). If they pick none, go to step 4.', + '(step 3). Another word starts at step 1; if they only pick none, go to step 4.', '', '## 3. Compute a governed metric', '', diff --git a/skills/objectstack-ask/SKILL.md b/skills/objectstack-ask/SKILL.md index 8fde5c118a1..38ffbd3633e 100644 --- a/skills/objectstack-ask/SKILL.md +++ b/skills/objectstack-ask/SKILL.md @@ -36,8 +36,8 @@ wrote its business definition) outranks a number you work out yourself. - Call `list_datasets({ terms })` with those words, as the user wrote them. Do not translate or reword a term: a match on a word you supplied is your reading, not the user's. A term is the noun phrase for - the thing, kept whole ("travel budget", not "travel" and "budget": a - fragment's matches are not the user's) and without the verbs, time words + the thing, kept whole ("travel budget", not "travel" and "budget") + and without the verbs, time words and question words around it ("trip days", not "trip days requested"; "报销金额", not "报销金额合计是多少"). - Each dataset in the answer carries `matches`: one entry per hit, with the @@ -74,7 +74,7 @@ instead of asking about some other word's matches. `partial: true` on the answer be incomplete; `warning` says why, and you repeat it when you fall back. Use an option only once the user picks it: compute it by its exact name -(step 3). If they pick none, go to step 4. +(step 3). Another word starts at step 1; if they only pick none, go to step 4. ## 3. Compute a governed metric diff --git a/skills/objectstack-ask/evals/metric-selection-fallback.json b/skills/objectstack-ask/evals/metric-selection-fallback.json index 3ff37202790..e913d61e4d0 100644 --- a/skills/objectstack-ask/evals/metric-selection-fallback.json +++ b/skills/objectstack-ask/evals/metric-selection-fallback.json @@ -180,6 +180,16 @@ "must_contain": ["query_dataset", "Net Revenue Retention", "Subscriptions"], "must_not_contain": ["aggregate_records", "非指标口径", "do you mean", "Do you mean"] } + }, + { + "id": 19, + "prompt": "The user asked: \"What is our retention?\" `list_datasets({ terms: ['retention'] })` answered one dataset, `subscriptions` (label Subscriptions), with `matches: []`; its only measures are `logo_retention`, labelled Logo Retention, and `net_revenue_retention`, labelled Net Revenue Retention. The answer also carried `candidates: [{ term: 'retention', dataset: 'subscriptions', member: 'measures.logo_retention' }, { term: 'retention', dataset: 'subscriptions', member: 'measures.net_revenue_retention' }]`. You asked which one they meant, listing both, and computed nothing. The user now replies: \"No, I mean ARR.\" What is your next tool call, and with what arguments?", + "expected_output": "The reply picks neither option and names another word, so neither option is used and the question starts again at step 1 with that word: the next tool call is `list_datasets` with `terms: ['ARR']`, the word as the user wrote it (not spelled out as annual recurring revenue, and not sent together with `retention`). It is a new lookup because the first answer was matched against `retention` only and lists no measure by that name. Nothing else is called before it: no object tool, and no `query_dataset` on either retention measure. Declining the options leads to the object-query fallback only when the reply brings no other word; here that fallback can follow only from this lookup, if `ARR` has no match and no candidates. It does not ask about retention again.", + "files": [], + "assertions": { + "must_contain": ["list_datasets", "ARR"], + "must_not_contain": ["describe_object(", "aggregate_records(", "非指标口径"] + } } ] }