Skip to content

Commit 4b711e8

Browse files
committed
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 <noreply@anthropic.com>
1 parent cceb5c6 commit 4b711e8

3 files changed

Lines changed: 24 additions & 10 deletions

File tree

‎packages/mcp/src/ask-skill.generated.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export const ASK_SKILL_DATA_LOOP: string = [
1818
'',
1919
'- Lift the question\'s business words: the thing measured ("win rate", "营收",',
2020
' "商机数") and what it is grouped or filtered by ("by stage", "按行业").',
21-
'- Call `list_datasets({ terms })` with those words, as the user wrote them and',
22-
' in the user\'s language. Do not translate or reword a term: a match on a word',
21+
'- Call `list_datasets({ terms })` with those words, as the user wrote them.',
22+
' Do not translate or reword a term: a match on a word',
2323
' you supplied is your reading, not the user\'s. A term is the noun phrase for',
2424
' the thing, kept whole ("travel budget", not "travel" and "budget": a',
2525
' 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 = [
4343
'| 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. |',
4444
'| A word with a measure among its `candidates` | Ask the same way; with one candidate, ask whether it is the one meant. |',
4545
'| A word whose `candidates` are all dimensions | At most a possible grouping: never ask about it, and it never stops a matched measure. |',
46-
'| 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. |',
46+
'| Only a dimension matches | That is a grouping, not a number. Without a measure match, ask which number is meant. |',
4747
'| No match and no candidates for the word for a thing measured | Step 4. |',
4848
'| `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. |',
4949
'',
5050
'When the answer has `nextStep`, follow its `decision` and `note`. If `note`',
51-
'says to answer one measure and ask about a word, do both; use none of that',
52-
'word\'s candidates until the user answers.',
51+
'says to answer one measure and ask about a word, do both.',
5352
'',
5453
'When you only ask, the reply is the question alone: no tool call until the user',
5554
'answers. State no figure of your own in it (no count, total',
@@ -59,6 +58,9 @@ export const ASK_SKILL_DATA_LOOP: string = [
5958
'instead of asking about some other word\'s matches. `partial: true` on the answer means the catalogue may',
6059
'be incomplete; `warning` says why, and you repeat it when you fall back.',
6160
'',
61+
'Use an option only once the user picks it: compute it by its exact name',
62+
'(step 3). If they pick none, go to step 4.',
63+
'',
6264
'## 3. Compute a governed metric',
6365
'',
6466
'- `query_dataset({ datasetName, selection })`. `selection.measures` and',

‎skills/objectstack-ask/SKILL.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ wrote its business definition) outranks a number you work out yourself.
3333

3434
- Lift the question's business words: the thing measured ("win rate", "营收",
3535
"商机数") and what it is grouped or filtered by ("by stage", "按行业").
36-
- Call `list_datasets({ terms })` with those words, as the user wrote them and
37-
in the user's language. Do not translate or reword a term: a match on a word
36+
- Call `list_datasets({ terms })` with those words, as the user wrote them.
37+
Do not translate or reword a term: a match on a word
3838
you supplied is your reading, not the user's. A term is the noun phrase for
3939
the thing, kept whole ("travel budget", not "travel" and "budget": a
4040
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.
5858
| 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. |
5959
| A word with a measure among its `candidates` | Ask the same way; with one candidate, ask whether it is the one meant. |
6060
| A word whose `candidates` are all dimensions | At most a possible grouping: never ask about it, and it never stops a matched measure. |
61-
| 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. |
61+
| Only a dimension matches | That is a grouping, not a number. Without a measure match, ask which number is meant. |
6262
| No match and no candidates for the word for a thing measured | Step 4. |
6363
| `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. |
6464

6565
When the answer has `nextStep`, follow its `decision` and `note`. If `note`
66-
says to answer one measure and ask about a word, do both; use none of that
67-
word's candidates until the user answers.
66+
says to answer one measure and ask about a word, do both.
6867

6968
When you only ask, the reply is the question alone: no tool call until the user
7069
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
7473
instead of asking about some other word's matches. `partial: true` on the answer means the catalogue may
7574
be incomplete; `warning` says why, and you repeat it when you fall back.
7675

76+
Use an option only once the user picks it: compute it by its exact name
77+
(step 3). If they pick none, go to step 4.
78+
7779
## 3. Compute a governed metric
7880

7981
- `query_dataset({ datasetName, selection })`. `selection.measures` and

‎skills/objectstack-ask/evals/metric-selection-fallback.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,16 @@
170170
"must_contain": ["Sales Amount", "Sales Analysis", "?"],
171171
"must_not_contain": ["query_dataset", "aggregate_records", "sales_amount"]
172172
}
173+
},
174+
{
175+
"id": 18,
176+
"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?",
177+
"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.",
178+
"files": [],
179+
"assertions": {
180+
"must_contain": ["query_dataset", "Net Revenue Retention", "Subscriptions"],
181+
"must_not_contain": ["aggregate_records", "非指标口径", "do you mean", "Do you mean"]
182+
}
173183
}
174184
]
175185
}

0 commit comments

Comments
 (0)