Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when answering MaxCompute data questions, writing SQL, inspecting schema for a query, using cold-start live metadata, reviewing SQL, cost-gating, executing SQL, or recording verified/failed query memory.
.claude/skills/aliyun-query/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-05 | ✗→✓ | ▲ Improved | -11% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 74% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 72% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 8% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 84% | 0% |
Never run mcs build or mcs package propose while answering a query. mcs build is maintenance / onboarding work and must be run only when the user explicitly asks to build, refresh, onboard, or maintain a profile.
All mcs commands auto-resolve the active profile via --profile → MCS_PROFILE → cwd-link → env-var fallback. Do not pass identity flags unless you need to override. Do not cd before running mcs; cwd-link binding is keyed on the starting directory.
Use mcs -f json ... whenever the next step depends on parsing output.
mcs sql execute and mcs sql submit are read-only by default. The same guard is enforced by the MaxCompute client APIs unless a managed write path sets allow_write=True. They refuse INSERT/UPDATE/DELETE/MERGE/CREATE/DROP/ ALTER/TRUNCATE/GRANT/REVOKE, session mutations such as SET, and any statement sqlglot can't classify as a known read shape before the cost gate, returning a WriteOpRejected envelope (exit code 2). Pass --allow-write only when the user explicitly asked for a write; it confirms write intent but does not skip the cost gate. For UDF lifecycle use mcs udf *; for profile rebuilds use mcs build.
bash mcs -f json show mcs -f json show --table T mcs -f json show --tables T1,T2,T3
bash mcs -f json meta list-tables mcs -f json meta search-tables KEYWORD mcs -f json meta search-columns KEYWORD mcs -f json meta describe-table TABLE See references/cold-start.md.
references/value-discovery.md.
references/rules.md, references/sql.md,references/projection.md, and references/from-table.md (FROM-table choice + join cardinality / COUNT(DISTINCT) discipline). Before deriving an aggregation from scratch, check for a named metric — the user may have vetted the math once already: bash mcs -f json metric list mcs -f json metric show <name> If one matches, copy its expression verbatim instead of reimplementing it (same name should mean the same number). Then run the SQL correctness checklist below before finalizing the SELECT.
bash mcs -f json sql review '<SQL>' Fix every error-severity issue. If the envelope has review_mode: syntax_only and semantic_checks_skipped: true, the profile has no package; fix syntax / dialect / tier issues, ignore missing semantic hints, and continue with cold-start metadata. Do not run mcs build to make review more complete.
bash mcs -f json sql cost '<SQL>' Read the JSON verdict; the command exits 0 even on blocked.
verdict=blocked: do not run; explain the cost and add a tighterpartition filter, predicate, or preview LIMIT.
verdict=confirm: ask the user. After confirmation, prefer asyncsubmit / wait / result and pass -y so the confirmed query does not stop at the non-TTY cost prompt.
verdict=ok (or cost skipped because the SQL is clearly tiny): usesynchronous execute only for probes and small-result queries: SELECT 1, schema/value probes, explicit small LIMIT previews, or tightly partition-filtered lookups/aggregations expected to finish in the current turn.
tables; SQL without a tight partition/filter/LIMIT; any query after a prior timeout; or any query the user says can run in the background. Synchronous path: bash mcs -f json sql execute '<SQL>' execute waits --timeout seconds (default 30). If it exceeds that wait it does not fail: the instance keeps running, so it returns data.sync_timed_out: true with data.instance_id (+ data.logview_url / data.next_step). Continue with the async path below using that instance_id — do not resubmit the SQL. Async path: bash mcs -f json sql submit -y '<SQL>' mcs -f json sql wait <instance_id> mcs -f json sql result <instance_id> If submit returns data.status == "Submitted" with data.status_probe_error, the SQL was submitted but the immediate status probe failed. Keep data.instance_id and use sql status / sql wait later. Read data.lifecycle_state, data.terminal, data.successful, and data.task_statuses[].status_name; do not decide from raw data.status == "Terminated" because MaxCompute's instance status can be terminated even when the task failed or was cancelled. Call result only after data.lifecycle_state == "success". execute and result cap returned rows at 10000 by default without rewriting SQL. If data.has_more is true, fetch the next page with --offset <data.next_offset>; use --max-rows N to change page size.
bash mcs memory verify --question Q --sql '<SQL>' --tables T1,T2
The highest-leverage rules from the references — they apply to almost every query, so they live in the workflow body, not behind --full. Load mcs skill get query --full only when you need the worked examples.
Projection — SELECT only what the question names.
id). "what is the highest / total / average X" → project the scalar aggregate of X, not the group it falls under.
signal, not output. Don't project intermediate values either.
ROUND / CAST / CONCAT unless the question askedfor that format — it breaks exact result-set comparison.
JOIN-ed SELECT, not two ;-separated queries.
FROM — the subject of the question decides the FROM table.
FROM x_table withCOUNT(x_table.pk); pull filter tables in via JOIN. Don't count from a fan-out child table (it inflates the denominator).
FROM to the filter's table.
Join cardinality — read the joins_to [..] markers in mcs show.
[1:n] JOIN where the partner is only in WHERE, useCOUNT(*). Reach for COUNT(DISTINCT pk) ONLY when the question says "distinct / unique / different X" or a partner column is in SELECT. Defensive DISTINCT on every 1:n JOIN changes the answer.
references/cold-start.mdreferences/projection.mdreferences/from-table.mdreferences/value-discovery.mdreferences/rules.mdreferences/sql.md| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 7,486 | 4,456 | -40% | 1 | 1 | 0% | 1,392 | 2,211 | +59% | 0 | 0 | — |
case-02 | fail→fail | 11,228 | 4,455 | -60% | 1 | 1 | 0% | 1,914 | 2,300 | +20% | 0 | 0 | — |
case-03 | fail→fail | 5,236 | 4,046 | -23% | 1 | 1 | 0% | 198 | 2,155 | +988% | 0 | 0 | — |
case-04 | fail→fail | 10,989 | 6,205 | -44% | 1 | 1 | 0% | 1,818 | 2,322 | +28% | 0 | 0 | — |
case-05 | fail→pass | 16,328 | 2,657 | -84% | 1 | 1 | 0% | 2,620 | 2,326 | -11% | 0 | 0 | — |
case-06 | fail→pass | 7,985 | 3,131 | -61% | 1 | 1 | 0% | 1,451 | 2,525 | +74% | 0 | 0 | — |
case-07 | fail→pass | 8,293 | 3,491 | -58% | 1 | 1 | 0% | 1,481 | 2,540 | +72% | 0 | 0 | — |
case-08 | fail→fail | 10,693 | 2,134 | -80% | 1 | 1 | 0% | 1,805 | 2,314 | +28% | 0 | 0 | — |
case-09 | fail→fail | 11,744 | 3,433 | -71% | 1 | 1 | 0% | 2,035 | 2,298 | +13% | 0 | 0 | — |
case-10 | fail→fail | 13,347 | 9,951 | -25% | 1 | 1 | 0% | 1,844 | 2,691 | +46% | 0 | 0 | — |
case-11 | fail→pass | 13,393 | 3,098 | -77% | 1 | 1 | 0% | 2,338 | 2,532 | +8% | 0 | 0 | — |
case-12 | fail→pass | 24,522 | 2,997 | -88% | 1 | 1 | 0% | 1,361 | 2,508 | +84% | 0 | 0 | — |
case-13 | pass→pass | 11,154 | 5,433 | -51% | 1 | 1 | 0% | 1,782 | 2,818 | +58% | 0 | 0 | — |
case-14 | pass→pass | 16,781 | 1,732 | -90% | 1 | 1 | 0% | 1,974 | 2,273 | +15% | 0 | 0 | — |
case-15 | pass→pass | 9,811 | 3,064 | -69% | 1 | 1 | 0% | 1,435 | 2,566 | +79% | 0 | 0 | — |
case-16 | fail→pass | 9,154 | 4,411 | -52% | 1 | 1 | 0% | 1,541 | 2,787 | +81% | 0 | 0 | — |
case-17 | pass→pass | 9,203 | 3,480 | -62% | 1 | 1 | 0% | 1,696 | 2,558 | +51% | 0 | 0 | — |
case-18 | fail→pass | 11,481 | 2,619 | -77% | 1 | 1 | 0% | 2,024 | 2,359 | +17% | 0 | 0 | — |
case-19 | pass→pass | 6,942 | 3,794 | -45% | 1 | 1 | 0% | 1,196 | 2,574 | +115% | 0 | 0 | — |
case-20 | fail→pass | 7,261 | 2,188 | -70% | 1 | 1 | 0% | 1,223 | 2,312 | +89% | 0 | 0 | — |
case-21 | pass→pass | 4,467 | 3,885 | -13% | 1 | 1 | 0% | 820 | 2,712 | +231% | 0 | 0 | — |
case-22 | fail→pass | 9,387 | 9,219 | -2% | 1 | 1 | 0% | 1,725 | 3,763 | +118% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 17 counted toward the lift figure. The other 5 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +41 percentage points is the difference between those two pass rates over the 17 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.