Repository navigation
Commit 7ba22bb
docs(skills): objectstack-query gives the business question over records to objectstack-ask (#35877)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D4n2wzAmmp4Z6W5jsqtM2qx)_
Fixes #35859
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:AI
助手通过连接向应用提业务问题(要一个数、一个排名、一个受管指标)时,「写查询」这份技能说明不再把这类问题揽到自己名下,而是写明交给「问数」技能;写在代码里的查询仍归「写查询」。
-
为什么做:属于「技能说明按任务开头」这条线的收尾。上一轮实测里两份技能同时安装时,「问数」十二次全中、「写查询」零次,可「写查询」的说明还在认领同一类问题,照它走会跳过受管指标的流程。
- 出错会怎样:最坏是助手在某类请求上少加载或多加载一份技能说明;只动说明文字和评测用例,不动任何运行代码,直接撤回本次合并即可复原。
- 要你做什么:本次改动落在对外发布的技能目录,需要你亲手合并。
## What changes
- **`skills/objectstack-query/SKILL.md`, frontmatter `description`
only.** The use-when drops "shaping a records query or aggregation sent
over MCP". "Not for" now opens with "a business question answered from
the app's records: a number, ranking or governed metric
(objectstack-ask)". The other three exclusions keep their owners; the
list is separated by semicolons because the first item carries commas,
and "designing an API endpoint" is shortened to "an API endpoint".
- **`skills/objectstack-query/evals/triggers.json`, case 3: reworded,
still `should_trigger: true`.**
- **`skills/objectstack-ask/evals/triggers.json`: case 7 added,
`should_trigger: false`**, a metadata change asked over MCP (N3 of
contract review 7040518746 on PR 35857). One case per line, as the file
already is.
- **`content/docs/ai/skills-reference.mdx`**: generator output of
`gen:skill-docs`, one line. `skills/README.md` is byte-identical,
because its table carries only the description's first sentence, which
did not move.
- **`.changeset/35859-query-sends-business-question-to-ask.md`**:
`'@objectstack/skills': patch`.
The boundary was written against what ask claims on `main`: its
description takes "EVERY question answered from the app's records ... a
number, a total ... a ranking, a breakdown, a trend or a list", its step
1 puts the governed metric first, and its "Do not use" sends "writing a
query in application code" to objectstack-query. Query's own
`rules/aggregation.md` already says the same ("Answering a user's
question over MCP (`aggregate_records`), not writing a query in code:
see **objectstack-ask**"). The query body teaches no MCP tool.
Description, before (435 characters):
> Write an ObjectQL query over ObjectStack records: filter, sort,
paginate, aggregate by group, expand related records, full-text search.
Use when writing a query in app code or a hook, choosing a pagination
strategy, or shaping a records query or aggregation sent over MCP. Not
for adding objects or fields (objectstack-data), a list view's filter or
a dashboard dataset (objectstack-ui), or designing an API endpoint
(objectstack-api).
After (477 characters):
> Write an ObjectQL query over ObjectStack records: filter, sort,
paginate, aggregate by group, expand related records, full-text search.
Use when writing a query in app code or a hook, or choosing a pagination
strategy. Not for a business question answered from the app's records: a
number, ranking or governed metric (objectstack-ask); adding objects or
fields (objectstack-data); a list view's filter or a dashboard dataset
(objectstack-ui); an API endpoint (objectstack-api).
Size readings (`skills/**` is a published catalog):
| | before | after |
|---|---|---|
| `skills/objectstack-query/SKILL.md` | 439 lines, 18404 bytes, 4596
tokens | 440 lines, 18448 bytes, 4607 tokens |
| all 14 `SKILL.md` | 4943 lines, 260339 bytes | 4944 lines, 260383
bytes |
Tokens are the ratchet's `ceil((bytes - 20) / 4)`. Whole PR: 18 added, 8
deleted, net 10 lines (budget 20).
Delta `d4661cccd3..abe3439` (L1 C1, 7045169982):
`content/docs/getting-started/build-with-claude-code.mdx`, one table
row. "Queries & reports over records" with "Show me the count of open
tickets per priority, using an aggregation." becomes "Queries in app
code" with "In a hook, write the ObjectQL aggregation that counts open
tickets per priority." The old prompt was a business question, which is
now ask's ground. The page has no objectstack-ask row, and none is added
here. The Verification section below ran at `d4661cccd3`. The delta's
own docs gates (doc-authoring, doc-anchors, route spelling, frontmatter)
exit 0 at `abe343969a`.
## Evals
Query case 3, before:
> I'm connected to an ObjectStack environment over MCP. In one call, how
many deals were won per sales region this quarter, and what is the
average amount per region?
After (still expects query to load):
> In our ObjectStack app's server code, write one ObjectQL aggregation
that returns, per sales region, the number of deals won this quarter and
their average amount.
Why reworded and not flipped to `should_trigger: false`:
- Case 3 was the bundle's only aggregation positive (1 is filter and
sort, 2 pagination, 4 search with an expanded relation, 5 filter and
paging in Chinese). Flipping it would leave "aggregate by group", which
the description still claims, with no trigger case. The reworded case
keeps the same data question and moves it to where the description
claims it: written in code.
- The MCP business question is already measured where it belongs. Ask
case 1 is that prompt verbatim, as an ask positive.
- As a query negative the old prompt would say little today: a trigger
turn installs one bundle, so it cannot show query yielding to ask. That
reading belongs to the two-bundle turn the runner does not have yet
(#35858).
New ask case 7 (expects ask to stay unloaded; the request is
objectstack-data's):
> Over the ObjectStack MCP connection to our CRM, add a picklist field
`region` (EMEA / APAC / Americas) to the `account` object.
It is the near miss that shares ask's MCP wording and falls under the
first clause of ask's "Do not use" ("building or changing metadata");
the two existing negatives both cover the second clause.
No eval round was run in this PR. The re-measure of the #34769 round
waits on #35858; this PR is meant to land before or with it.
## Verification
All on head `d4661cccd3`, exit codes captured before any pipe.
- First file to read: `skills/objectstack-query/SKILL.md` (the five
description lines are the whole risk). Then the two `triggers.json`
hunks.
- Two-minute check: `node scripts/check-skills-token-ratchet.mjs`;
expect the line below and exit 0.
<details><summary>Token ratchet (exit 0, no row raised, the script is
untouched)</summary>
```text
✓ check-skills-token-ratchet: skills/objectstack-query/SKILL.md is 4607 tokens (ceiling 5547; headroom 940). Its release-stamp line (`version: "18.6.0"`, 20 bytes) is written by the version script, not an author, and is not priced.
✓ check-skills-token-ratchet: 60 authored bundle file(s) within their ceilings; 11 generator-owned file(s) and 42 eval fixture(s) measured, not ratcheted.
```
</details>
<details><summary>Skill docs mirrors (gen then check, exit 0)</summary>
```text
pnpm --filter @objectstack/spec gen:skill-docs exit 0
pnpm --filter @objectstack/spec run check:skill-docs exit 0
✓ skills/README.md
✓ content/docs/ai/skills-reference.mdx
✅ Skill docs in sync
```
</details>
<details><summary>Trigger dry-runs (both exit 0; the files
parse)</summary>
```text
pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-query --triggers-only --dry-run
objectstack-query: 7 case(s)
7 trigger case(s) × the with-skill arm, × 1 = 7 turn(s), 2 at once
--triggers-only: 9 behaviour case(s) of these bundles left out
trigger cases: 5 should load the bundle, 2 should not
dry run: no login read, no model called, nothing written
pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-ask --triggers-only --dry-run
objectstack-ask: 7 case(s)
7 trigger case(s) × the with-skill arm, × 1 = 7 turn(s), 2 at once
--triggers-only: 19 behaviour case(s) of these bundles left out
trigger cases: 4 should load the bundle, 3 should not
dry run: no login read, no model called, nothing written
```
</details>
<details><summary>Derived gate list (`dispatch-gates.mjs --commands`, 73
families)</summary>
```text
✓ dispatch-gates --ran: 73 derived famil(ies) accounted for — 71 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3).
```
71 exited 0 in the sweep. The two exit 3 were PREREQUISITE NOT MET, not
findings: `check:skill-examples` (re-run after building the client
packages: exit 0, "346 prose examples type-check across 3 surface(s)")
and `check:dual-build-cjs-loads`, which needs every package built. That
one is NOT MEASURED locally and left to CI; the diff holds no package
source.
`node scripts/pm/overlap-check.mjs --branch=claude/area-a4A-35859`:
`VERDICT clean exit 0` against `origin/main` 9d07723 and PR 35129,
which shares query's `SKILL.md`.
</details>
No test suite ran: the diff changes no code a test pins, and the
runner's own tests use their own fixtures, not the catalog's trigger
files.
## Acceptance notes
- **The description is 477 characters, above the 432 to 450 band of its
six siblings.** Removing the MCP clause frees 53 characters and naming
ask with the order's wording costs about 100. Reaching 450 needs 27
more, and every candidate cut takes something no trigger round in this
PR would cover: "answered from the app's records" (the phrase that
matches ask's own claim), "or choosing a pagination strategy" (query
case 2), or the verbs and articles of the three older exclusions. No
gate enforces a description length; the token ratchet holds with 940 of
headroom. A 450-character variant is a one-line follow-up if the seat
prefers the band.
- **N2 of contract review 7040518746** (the "Cross-skill routing" bullet
in `skills/README.md` about wizards) reads as already settled on `main`:
line 125 now sends a stepped form over one object to ui. Not touched
here.
- `skills/README.md`'s hand-written routing section has no query and ask
line; none was added, the file is outside this card's surface.
- The reference page renders use-when and not-for as one paragraph, so
the new "Not for" shows there with its semicolons. Generator matter,
unchanged.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- signed: repo:objectstack#4 · os-elon-musk ·
session_016WV4d1ZJL93Kin2UHFXbFv -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 55cd85f commit 7ba22bb
6 files changed
Lines changed: 18 additions & 8 deletions
File tree
- .changeset
- content/docs
- ai
- getting-started
- skills
- objectstack-ask/evals
- objectstack-query
- evals
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
| 419 | + | |
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
0 commit comments