Skip to content

Commit 7ba22bb

Browse files
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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
Clause-②: no
6+
Metadata-protocol: none
7+
8+
`objectstack-query`'s description no longer claims a records query or aggregation sent over MCP, and its "Not for" names `objectstack-ask` for a business question answered from the app's records (a number, ranking or governed metric). Query trigger case 3 now asks for an aggregation written in server code; `objectstack-ask` gains a negative trigger case for a metadata change asked over MCP.

‎content/docs/ai/skills-reference.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Use when modelling records or editing `*.object.ts` / `src/data/*.ts`. Not for q
100100

101101
Write an ObjectQL query over ObjectStack records: filter, sort, paginate, aggregate by group, expand related records, full-text search.
102102

103-
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).
103+
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).
104104

105105
**Tags:** `query`, `filter`, `sort`, `paginate`, `aggregate`, `ObjectQL`, `full-text`
106106

‎content/docs/getting-started/build-with-claude-code.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ prompt you can give verbatim:
416416
| You want | Skill the agent loads | Say something like |
417417
|:---|:---|:---|
418418
| Data model — objects, fields, relationships, validations, seeds | `objectstack-data` | "Add an `account` object and link tickets to it with a required lookup. Seed three demo accounts." |
419-
| Queries & reports over records | `objectstack-query` | "Show me the count of open tickets per priority, using an aggregation." |
419+
| Queries in app code | `objectstack-query` | "In a hook, write the ObjectQL aggregation that counts open tickets per priority." |
420420
| Views, dashboards, apps, record pages | `objectstack-ui` | "Declare a `tickets` dataset over the ticket object, then add a dashboard with a metric for open tickets and a bar chart of tickets by priority." |
421421
| Business automation — flows, approvals, schedules | `objectstack-automation` | "Every day at 9:00, escalate tickets that have been open more than 48 hours." |
422422
| Permissions & row-level security | `objectstack-data` (security sections) | "Members should only see their own tickets; support managers see everything." |

‎skills/objectstack-ask/evals/triggers.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
{"id": 3, "prompt": "我通过 MCP 连着公司的 ObjectStack 环境:本月报销总额是多少?按部门排个名。", "should_trigger": true, "files": []},
77
{"id": 4, "prompt": "Using the ObjectStack MCP tools on our support app, list the ten customers with the most open tickets right now.", "should_trigger": true, "files": []},
88
{"id": 5, "prompt": "In an ObjectStack `beforeUpdate` hook on `deal`, write the ObjectQL aggregation that sums `amount` per `region` over closed-won deals.", "should_trigger": false, "files": []},
9-
{"id": 6, "prompt": "Write the ObjectQL filter for a scheduled job in our ObjectStack project: invoices more than 30 days overdue whose billing country is in the EU.", "should_trigger": false, "files": []}
9+
{"id": 6, "prompt": "Write the ObjectQL filter for a scheduled job in our ObjectStack project: invoices more than 30 days overdue whose billing country is in the EU.", "should_trigger": false, "files": []},
10+
{"id": 7, "prompt": "Over the ObjectStack MCP connection to our CRM, add a picklist field `region` (EMEA / APAC / Americas) to the `account` object.", "should_trigger": false, "files": []}
1011
]
1112
}

‎skills/objectstack-query/SKILL.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ name: objectstack-query
33
description: >
44
Write an ObjectQL query over ObjectStack records: filter, sort, paginate,
55
aggregate by group, expand related records, full-text search. Use when writing
6-
a query in app code or a hook, choosing a pagination strategy, or shaping a
7-
records query or aggregation sent over MCP. Not for adding objects or fields
8-
(objectstack-data), a list view's filter or a dashboard dataset
9-
(objectstack-ui), or designing an API endpoint (objectstack-api).
6+
a query in app code or a hook, or choosing a pagination strategy. Not for a
7+
business question answered from the app's records: a number, ranking or
8+
governed metric (objectstack-ask); adding objects or fields
9+
(objectstack-data); a list view's filter or a dashboard dataset
10+
(objectstack-ui); an API endpoint (objectstack-api).
1011
license: Apache-2.0
1112
compatibility: Requires @objectstack/spec 18.x (Zod v4 schemas)
1213
metadata:

‎skills/objectstack-query/evals/triggers.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
{
1717
"id": 3,
18-
"prompt": "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?",
18+
"prompt": "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.",
1919
"should_trigger": true,
2020
"files": []
2121
},

0 commit comments

Comments
 (0)