@carllee1983/dbcli 1.51.0 → 1.51.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor/rules/dbcli.mdc +35 -1
- package/.cursor/skills/dbcli/reference.md +8 -0
- package/.cursor-plugin/plugin.json +1 -1
- package/.github/skills/dbcli/SKILL.md +35 -1
- package/.github/skills/dbcli/reference.md +8 -0
- package/CHANGELOG.md +16 -0
- package/assets/SKILL.md +35 -1
- package/assets/SKILL.zh-TW.md +26 -1
- package/assets/reference.md +8 -0
- package/dist/cli.mjs +1 -1
- package/gemini-extension.json +1 -1
- package/package.json +1 -1
- package/plugins/dbcli-agent/.codex-plugin/plugin.json +1 -1
- package/plugins/dbcli-agent/skills/dbcli/SKILL.md +35 -1
- package/plugins/dbcli-agent/skills/dbcli/reference.md +8 -0
- package/skills/dbcli/SKILL.md +35 -1
- package/skills/dbcli/reference.md +8 -0
package/.cursor/rules/dbcli.mdc
CHANGED
|
@@ -82,6 +82,40 @@ warnings) go to stderr so stdout stays parseable — when piping JSON into a par
|
|
|
82
82
|
use `2>/dev/null` or leave stderr alone. **Never `2>&1`**: it merges those lines back
|
|
83
83
|
into stdout and the parse fails.
|
|
84
84
|
|
|
85
|
+
**Intent confirmation:** Treat `auto`, `confirm`, and `guided` as conversational
|
|
86
|
+
preferences for the current request, not as dbcli flags or persistent configuration.
|
|
87
|
+
Do not ask the user a meta-question about whether they want questions.
|
|
88
|
+
|
|
89
|
+
- `auto` (default): autonomously use governed semantic context and schema discovery.
|
|
90
|
+
If unresolved ambiguity would materially change the result, ask one compact batch of
|
|
91
|
+
questions before querying; otherwise state the assumptions and proceed.
|
|
92
|
+
- `confirm`: first state the proposed interpretation and wait for the user's approval
|
|
93
|
+
before issuing the task's data query.
|
|
94
|
+
- `guided`: resolve the request through short, focused questions, carrying confirmed
|
|
95
|
+
answers forward rather than asking again.
|
|
96
|
+
|
|
97
|
+
For business requests, material ambiguity includes the requested result shape or grain,
|
|
98
|
+
metric definition, time boundary and timezone, inclusion/exclusion rules (such as order
|
|
99
|
+
status or refunds), grouping, or selected connection. Example: for “yesterday's sales,”
|
|
100
|
+
do not guess whether the user needs a total or detail, which timezone defines yesterday,
|
|
101
|
+
or whether cancelled and refunded orders count. Summarize the candidate interpretation
|
|
102
|
+
and ask only the unresolved, result-changing questions.
|
|
103
|
+
|
|
104
|
+
When the user explicitly says to decide without further questions, proceed in `auto`
|
|
105
|
+
mode and disclose the material assumptions. This never bypasses blacklist, schema,
|
|
106
|
+
permission, dry-run, production-selection, or write-confirmation gates; an agent must
|
|
107
|
+
still stop where those gates require human confirmation.
|
|
108
|
+
|
|
109
|
+
**Business-language discovery:** When a user uses a business alias, metric, recurring
|
|
110
|
+
term, or relationship/join intent instead of a physical table or field name, first run
|
|
111
|
+
`dbcli skill context --format json`. If it includes `semantic`, treat that reviewed
|
|
112
|
+
section as the governed vocabulary; use `dbcli semantic search <terms> --format json`
|
|
113
|
+
to look up a specific term. If no semantic section exists or search returns no result,
|
|
114
|
+
fall back to `blacklist` → `schema` mapping and tell the user that optional
|
|
115
|
+
`dbcli.semantic.json` can make future requests consistent. Never create, update, or
|
|
116
|
+
migrate that file without an explicit human request; semantic vocabulary never replaces
|
|
117
|
+
schema confirmation or the normal query/write safety gates.
|
|
118
|
+
|
|
85
119
|
## Agent Task Packs
|
|
86
120
|
|
|
87
121
|
When the user asks for a database workflow ("diagnose this slow query", "audit
|
|
@@ -552,7 +586,7 @@ schema. Raw `query` / `export` invocations render a sortable table only.
|
|
|
552
586
|
- **Health / growth:** `check --all` (huge tables skipped unless `--include-large`); consult schema `sizeCategory` before ad-hoc queries.
|
|
553
587
|
- **Codegen from live DB:** `schema --format json` to drive an ORM; cross-check once with `dbcli query`.
|
|
554
588
|
- **Integration truth:** `query` before → run app → `query` after. Unit-test mocks are not a substitute.
|
|
555
|
-
- **Natural language requests** (e.g. "update order to shipped"): pick `query` vs DML, map terms → columns via `schema` (and enum values in data), respect blacklist and `sizeCategory`, **always `--dry-run` writes first**.
|
|
589
|
+
- **Natural language requests** (e.g. "update order to shipped"): follow **Business-language discovery** first when the request uses business terminology; then pick `query` vs DML, map terms → columns via `schema` (and enum values in data), respect blacklist and `sizeCategory`, **always `--dry-run` writes first**.
|
|
556
590
|
|
|
557
591
|
## Notes
|
|
558
592
|
|
|
@@ -2197,6 +2197,14 @@ project root. It supplies business names and descriptions to an agent, but is
|
|
|
2197
2197
|
not a query language: these commands are offline, read-only, and never execute
|
|
2198
2198
|
SQL or contact an LLM.
|
|
2199
2199
|
|
|
2200
|
+
When an agent receives a business term, metric, alias, or relationship/join intent,
|
|
2201
|
+
it should first inspect `dbcli skill context --format json`. If that output includes
|
|
2202
|
+
`semantic`, use the reviewed vocabulary and use `semantic search <terms>` for a
|
|
2203
|
+
specific lookup. When the section is absent or search has no result, fall back to the
|
|
2204
|
+
blacklist-filtered schema and tell the user that `dbcli.semantic.json` is an optional
|
|
2205
|
+
way to make future terminology consistent. Do not create, update, or migrate the file
|
|
2206
|
+
without an explicit human request.
|
|
2207
|
+
|
|
2200
2208
|
```bash
|
|
2201
2209
|
dbcli semantic validate
|
|
2202
2210
|
dbcli semantic validate --format json
|
|
@@ -82,6 +82,40 @@ warnings) go to stderr so stdout stays parseable — when piping JSON into a par
|
|
|
82
82
|
use `2>/dev/null` or leave stderr alone. **Never `2>&1`**: it merges those lines back
|
|
83
83
|
into stdout and the parse fails.
|
|
84
84
|
|
|
85
|
+
**Intent confirmation:** Treat `auto`, `confirm`, and `guided` as conversational
|
|
86
|
+
preferences for the current request, not as dbcli flags or persistent configuration.
|
|
87
|
+
Do not ask the user a meta-question about whether they want questions.
|
|
88
|
+
|
|
89
|
+
- `auto` (default): autonomously use governed semantic context and schema discovery.
|
|
90
|
+
If unresolved ambiguity would materially change the result, ask one compact batch of
|
|
91
|
+
questions before querying; otherwise state the assumptions and proceed.
|
|
92
|
+
- `confirm`: first state the proposed interpretation and wait for the user's approval
|
|
93
|
+
before issuing the task's data query.
|
|
94
|
+
- `guided`: resolve the request through short, focused questions, carrying confirmed
|
|
95
|
+
answers forward rather than asking again.
|
|
96
|
+
|
|
97
|
+
For business requests, material ambiguity includes the requested result shape or grain,
|
|
98
|
+
metric definition, time boundary and timezone, inclusion/exclusion rules (such as order
|
|
99
|
+
status or refunds), grouping, or selected connection. Example: for “yesterday's sales,”
|
|
100
|
+
do not guess whether the user needs a total or detail, which timezone defines yesterday,
|
|
101
|
+
or whether cancelled and refunded orders count. Summarize the candidate interpretation
|
|
102
|
+
and ask only the unresolved, result-changing questions.
|
|
103
|
+
|
|
104
|
+
When the user explicitly says to decide without further questions, proceed in `auto`
|
|
105
|
+
mode and disclose the material assumptions. This never bypasses blacklist, schema,
|
|
106
|
+
permission, dry-run, production-selection, or write-confirmation gates; an agent must
|
|
107
|
+
still stop where those gates require human confirmation.
|
|
108
|
+
|
|
109
|
+
**Business-language discovery:** When a user uses a business alias, metric, recurring
|
|
110
|
+
term, or relationship/join intent instead of a physical table or field name, first run
|
|
111
|
+
`dbcli skill context --format json`. If it includes `semantic`, treat that reviewed
|
|
112
|
+
section as the governed vocabulary; use `dbcli semantic search <terms> --format json`
|
|
113
|
+
to look up a specific term. If no semantic section exists or search returns no result,
|
|
114
|
+
fall back to `blacklist` → `schema` mapping and tell the user that optional
|
|
115
|
+
`dbcli.semantic.json` can make future requests consistent. Never create, update, or
|
|
116
|
+
migrate that file without an explicit human request; semantic vocabulary never replaces
|
|
117
|
+
schema confirmation or the normal query/write safety gates.
|
|
118
|
+
|
|
85
119
|
## Agent Task Packs
|
|
86
120
|
|
|
87
121
|
When the user asks for a database workflow ("diagnose this slow query", "audit
|
|
@@ -552,7 +586,7 @@ schema. Raw `query` / `export` invocations render a sortable table only.
|
|
|
552
586
|
- **Health / growth:** `check --all` (huge tables skipped unless `--include-large`); consult schema `sizeCategory` before ad-hoc queries.
|
|
553
587
|
- **Codegen from live DB:** `schema --format json` to drive an ORM; cross-check once with `dbcli query`.
|
|
554
588
|
- **Integration truth:** `query` before → run app → `query` after. Unit-test mocks are not a substitute.
|
|
555
|
-
- **Natural language requests** (e.g. "update order to shipped"): pick `query` vs DML, map terms → columns via `schema` (and enum values in data), respect blacklist and `sizeCategory`, **always `--dry-run` writes first**.
|
|
589
|
+
- **Natural language requests** (e.g. "update order to shipped"): follow **Business-language discovery** first when the request uses business terminology; then pick `query` vs DML, map terms → columns via `schema` (and enum values in data), respect blacklist and `sizeCategory`, **always `--dry-run` writes first**.
|
|
556
590
|
|
|
557
591
|
## Notes
|
|
558
592
|
|
|
@@ -2197,6 +2197,14 @@ project root. It supplies business names and descriptions to an agent, but is
|
|
|
2197
2197
|
not a query language: these commands are offline, read-only, and never execute
|
|
2198
2198
|
SQL or contact an LLM.
|
|
2199
2199
|
|
|
2200
|
+
When an agent receives a business term, metric, alias, or relationship/join intent,
|
|
2201
|
+
it should first inspect `dbcli skill context --format json`. If that output includes
|
|
2202
|
+
`semantic`, use the reviewed vocabulary and use `semantic search <terms>` for a
|
|
2203
|
+
specific lookup. When the section is absent or search has no result, fall back to the
|
|
2204
|
+
blacklist-filtered schema and tell the user that `dbcli.semantic.json` is an optional
|
|
2205
|
+
way to make future terminology consistent. Do not create, update, or migrate the file
|
|
2206
|
+
without an explicit human request.
|
|
2207
|
+
|
|
2200
2208
|
```bash
|
|
2201
2209
|
dbcli semantic validate
|
|
2202
2210
|
dbcli semantic validate --format json
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ All notable changes to dbcli are documented here.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.51.2] - 2026-08-07 - Intent confirmation for business requests
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Per-request agent intent confirmation.** Installed dbcli skills now support `auto` (default), `confirm`, and `guided` conversational preferences for business-language database requests. Agents ask only result-changing questions, carry confirmed answers forward, and disclose material assumptions when explicitly asked to decide without further questions. These preferences are not persistent CLI configuration and never bypass schema, blacklist, permission, dry-run, production-selection, or write-confirmation gates.
|
|
13
|
+
|
|
14
|
+
## [1.51.1] - 2026-08-07 - Proactive semantic context discovery
|
|
15
|
+
|
|
16
|
+
### Changed
|
|
17
|
+
|
|
18
|
+
- **Agent skills now surface semantic context before users have to discover it.** When a request uses business aliases, metrics, recurring terminology, or relationship/join intent, installed dbcli skills first check `skill context`; they use validated semantic vocabulary when available, otherwise fall back to the blacklist-filtered schema and explain that `dbcli.semantic.json` is an optional way to keep future requests consistent. Skills never create, update, or migrate the file without explicit human instruction.
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- **Release formatting gate.** Remove an extra closing brace from the static guides stylesheet so Prettier can parse the repository and the release gate can run.
|
|
23
|
+
|
|
8
24
|
## [1.51.0] - 2026-08-07 - Local semantic context and offline query-draft validation
|
|
9
25
|
|
|
10
26
|
### Added
|
package/assets/SKILL.md
CHANGED
|
@@ -82,6 +82,40 @@ warnings) go to stderr so stdout stays parseable — when piping JSON into a par
|
|
|
82
82
|
use `2>/dev/null` or leave stderr alone. **Never `2>&1`**: it merges those lines back
|
|
83
83
|
into stdout and the parse fails.
|
|
84
84
|
|
|
85
|
+
**Intent confirmation:** Treat `auto`, `confirm`, and `guided` as conversational
|
|
86
|
+
preferences for the current request, not as dbcli flags or persistent configuration.
|
|
87
|
+
Do not ask the user a meta-question about whether they want questions.
|
|
88
|
+
|
|
89
|
+
- `auto` (default): autonomously use governed semantic context and schema discovery.
|
|
90
|
+
If unresolved ambiguity would materially change the result, ask one compact batch of
|
|
91
|
+
questions before querying; otherwise state the assumptions and proceed.
|
|
92
|
+
- `confirm`: first state the proposed interpretation and wait for the user's approval
|
|
93
|
+
before issuing the task's data query.
|
|
94
|
+
- `guided`: resolve the request through short, focused questions, carrying confirmed
|
|
95
|
+
answers forward rather than asking again.
|
|
96
|
+
|
|
97
|
+
For business requests, material ambiguity includes the requested result shape or grain,
|
|
98
|
+
metric definition, time boundary and timezone, inclusion/exclusion rules (such as order
|
|
99
|
+
status or refunds), grouping, or selected connection. Example: for “yesterday's sales,”
|
|
100
|
+
do not guess whether the user needs a total or detail, which timezone defines yesterday,
|
|
101
|
+
or whether cancelled and refunded orders count. Summarize the candidate interpretation
|
|
102
|
+
and ask only the unresolved, result-changing questions.
|
|
103
|
+
|
|
104
|
+
When the user explicitly says to decide without further questions, proceed in `auto`
|
|
105
|
+
mode and disclose the material assumptions. This never bypasses blacklist, schema,
|
|
106
|
+
permission, dry-run, production-selection, or write-confirmation gates; an agent must
|
|
107
|
+
still stop where those gates require human confirmation.
|
|
108
|
+
|
|
109
|
+
**Business-language discovery:** When a user uses a business alias, metric, recurring
|
|
110
|
+
term, or relationship/join intent instead of a physical table or field name, first run
|
|
111
|
+
`dbcli skill context --format json`. If it includes `semantic`, treat that reviewed
|
|
112
|
+
section as the governed vocabulary; use `dbcli semantic search <terms> --format json`
|
|
113
|
+
to look up a specific term. If no semantic section exists or search returns no result,
|
|
114
|
+
fall back to `blacklist` → `schema` mapping and tell the user that optional
|
|
115
|
+
`dbcli.semantic.json` can make future requests consistent. Never create, update, or
|
|
116
|
+
migrate that file without an explicit human request; semantic vocabulary never replaces
|
|
117
|
+
schema confirmation or the normal query/write safety gates.
|
|
118
|
+
|
|
85
119
|
## Agent Task Packs
|
|
86
120
|
|
|
87
121
|
When the user asks for a database workflow ("diagnose this slow query", "audit
|
|
@@ -552,7 +586,7 @@ schema. Raw `query` / `export` invocations render a sortable table only.
|
|
|
552
586
|
- **Health / growth:** `check --all` (huge tables skipped unless `--include-large`); consult schema `sizeCategory` before ad-hoc queries.
|
|
553
587
|
- **Codegen from live DB:** `schema --format json` to drive an ORM; cross-check once with `dbcli query`.
|
|
554
588
|
- **Integration truth:** `query` before → run app → `query` after. Unit-test mocks are not a substitute.
|
|
555
|
-
- **Natural language requests** (e.g. "update order to shipped"): pick `query` vs DML, map terms → columns via `schema` (and enum values in data), respect blacklist and `sizeCategory`, **always `--dry-run` writes first**.
|
|
589
|
+
- **Natural language requests** (e.g. "update order to shipped"): follow **Business-language discovery** first when the request uses business terminology; then pick `query` vs DML, map terms → columns via `schema` (and enum values in data), respect blacklist and `sizeCategory`, **always `--dry-run` writes first**.
|
|
556
590
|
|
|
557
591
|
## Notes
|
|
558
592
|
|
package/assets/SKILL.zh-TW.md
CHANGED
|
@@ -64,6 +64,31 @@ legacy 單檔 `.dbcli`。若要防護同一 OS 使用者的惡意 process,host
|
|
|
64
64
|
stdout 保持可解析——把 JSON 導進 parser 時請用 `2>/dev/null` 或不要動 stderr。
|
|
65
65
|
**絕對不要用 `2>&1`**:那會把那些訊息併回 stdout,解析必定失敗。
|
|
66
66
|
|
|
67
|
+
**意圖確認:**將 `auto`、`confirm` 與 `guided` 視為**當次請求**的對話偏好,而不是 dbcli
|
|
68
|
+
旗標或持久化設定。不要先用後設問題詢問使用者「要不要讓我提問」。
|
|
69
|
+
|
|
70
|
+
- `auto`(預設):自主使用受治理的 semantic context 與 schema 探索。若尚未解決的歧義會
|
|
71
|
+
實質改變結果,先用一小批精簡問題確認;否則說明假設後繼續。
|
|
72
|
+
- `confirm`:先說明預計採用的解讀,等待使用者核准後,才發出該任務的資料查詢。
|
|
73
|
+
- `guided`:以短而聚焦的問題逐步釐清請求;已確認的答案必須延續使用,不可重複詢問。
|
|
74
|
+
|
|
75
|
+
對業務請求而言,會實質改變結果的歧義包括所需結果的形狀或粒度、指標定義、時間邊界與
|
|
76
|
+
時區、納入/排除規則(例如訂單狀態或退款)、分組方式與選用連線。例如「昨天的銷售資料」
|
|
77
|
+
不能猜測使用者要總額或明細、哪個時區定義昨天,或取消與退款訂單是否計入。先摘要候選解讀,
|
|
78
|
+
只詢問尚未解決且會改變結果的問題。
|
|
79
|
+
|
|
80
|
+
當使用者明確要求自行判斷、不要再問時,以 `auto` 模式繼續並說明重要假設。這絕不繞過
|
|
81
|
+
blacklist、schema、permission、dry-run、production 選取或寫入確認閘門;只要閘門要求人類
|
|
82
|
+
確認,agent 仍必須停止。
|
|
83
|
+
|
|
84
|
+
**業務語言探索:** 當使用者以業務別名、metric、反覆出現的術語或 relationship/join 意圖,
|
|
85
|
+
而非實體 table 或 field 名稱提出需求時,先執行 `dbcli skill context --format json`。若輸出含有
|
|
86
|
+
`semantic`,將該已檢閱的區塊視為受治理詞彙;需查找特定術語時,用
|
|
87
|
+
`dbcli semantic search <terms> --format json`。若沒有 semantic 區塊,或搜尋沒有結果,就退回
|
|
88
|
+
`blacklist` → `schema` 對照,並告知使用者可選用的 `dbcli.semantic.json` 能讓後續需求保持一致。
|
|
89
|
+
除非人類明確要求,絕不可建立、更新或 migrate 此檔案;語意詞彙不能取代 schema 確認或正常的
|
|
90
|
+
query/write 安全閘門。
|
|
91
|
+
|
|
67
92
|
## Agent Task Packs
|
|
68
93
|
|
|
69
94
|
當使用者要求一個資料庫工作流(例如「診斷這個慢查詢」、「審計權限」、「審視長時間執行的操作」),**優先選用已發布的任務模板,而非憑記憶自行組合步驟。**
|
|
@@ -421,7 +446,7 @@ dbcli export "SELECT * FROM orders" --format html --output orders.html
|
|
|
421
446
|
- **健康 / 成長:** `check --all`(除非加 `--include-large`,否則略過巨大表);做 ad-hoc query 前先看 schema 的 `sizeCategory`。
|
|
422
447
|
- **從活線 DB 產生程式:** `schema --format json` 餵給 ORM;再用 `dbcli query` 交叉驗證一次。
|
|
423
448
|
- **整合事實:** 前 `query` → 跑應用 → 後 `query`。單元測試 mock 不能替代。
|
|
424
|
-
- **自然語言請求**(如「把訂單更新為 shipped
|
|
449
|
+
- **自然語言請求**(如「把訂單更新為 shipped」):若需求使用業務術語,先遵循**業務語言探索**;接著決定要 `query` 還是 DML,透過 `schema` 把詞彙映到欄位(值用 enum 資料),尊重 blacklist 與 `sizeCategory`,**寫入永遠先 `--dry-run`**。
|
|
425
450
|
|
|
426
451
|
## 備註
|
|
427
452
|
|
package/assets/reference.md
CHANGED
|
@@ -2197,6 +2197,14 @@ project root. It supplies business names and descriptions to an agent, but is
|
|
|
2197
2197
|
not a query language: these commands are offline, read-only, and never execute
|
|
2198
2198
|
SQL or contact an LLM.
|
|
2199
2199
|
|
|
2200
|
+
When an agent receives a business term, metric, alias, or relationship/join intent,
|
|
2201
|
+
it should first inspect `dbcli skill context --format json`. If that output includes
|
|
2202
|
+
`semantic`, use the reviewed vocabulary and use `semantic search <terms>` for a
|
|
2203
|
+
specific lookup. When the section is absent or search has no result, fall back to the
|
|
2204
|
+
blacklist-filtered schema and tell the user that `dbcli.semantic.json` is an optional
|
|
2205
|
+
way to make future terminology consistent. Do not create, update, or migrate the file
|
|
2206
|
+
without an explicit human request.
|
|
2207
|
+
|
|
2200
2208
|
```bash
|
|
2201
2209
|
dbcli semantic validate
|
|
2202
2210
|
dbcli semantic validate --format json
|
package/dist/cli.mjs
CHANGED
package/gemini-extension.json
CHANGED
package/package.json
CHANGED
|
@@ -82,6 +82,40 @@ warnings) go to stderr so stdout stays parseable — when piping JSON into a par
|
|
|
82
82
|
use `2>/dev/null` or leave stderr alone. **Never `2>&1`**: it merges those lines back
|
|
83
83
|
into stdout and the parse fails.
|
|
84
84
|
|
|
85
|
+
**Intent confirmation:** Treat `auto`, `confirm`, and `guided` as conversational
|
|
86
|
+
preferences for the current request, not as dbcli flags or persistent configuration.
|
|
87
|
+
Do not ask the user a meta-question about whether they want questions.
|
|
88
|
+
|
|
89
|
+
- `auto` (default): autonomously use governed semantic context and schema discovery.
|
|
90
|
+
If unresolved ambiguity would materially change the result, ask one compact batch of
|
|
91
|
+
questions before querying; otherwise state the assumptions and proceed.
|
|
92
|
+
- `confirm`: first state the proposed interpretation and wait for the user's approval
|
|
93
|
+
before issuing the task's data query.
|
|
94
|
+
- `guided`: resolve the request through short, focused questions, carrying confirmed
|
|
95
|
+
answers forward rather than asking again.
|
|
96
|
+
|
|
97
|
+
For business requests, material ambiguity includes the requested result shape or grain,
|
|
98
|
+
metric definition, time boundary and timezone, inclusion/exclusion rules (such as order
|
|
99
|
+
status or refunds), grouping, or selected connection. Example: for “yesterday's sales,”
|
|
100
|
+
do not guess whether the user needs a total or detail, which timezone defines yesterday,
|
|
101
|
+
or whether cancelled and refunded orders count. Summarize the candidate interpretation
|
|
102
|
+
and ask only the unresolved, result-changing questions.
|
|
103
|
+
|
|
104
|
+
When the user explicitly says to decide without further questions, proceed in `auto`
|
|
105
|
+
mode and disclose the material assumptions. This never bypasses blacklist, schema,
|
|
106
|
+
permission, dry-run, production-selection, or write-confirmation gates; an agent must
|
|
107
|
+
still stop where those gates require human confirmation.
|
|
108
|
+
|
|
109
|
+
**Business-language discovery:** When a user uses a business alias, metric, recurring
|
|
110
|
+
term, or relationship/join intent instead of a physical table or field name, first run
|
|
111
|
+
`dbcli skill context --format json`. If it includes `semantic`, treat that reviewed
|
|
112
|
+
section as the governed vocabulary; use `dbcli semantic search <terms> --format json`
|
|
113
|
+
to look up a specific term. If no semantic section exists or search returns no result,
|
|
114
|
+
fall back to `blacklist` → `schema` mapping and tell the user that optional
|
|
115
|
+
`dbcli.semantic.json` can make future requests consistent. Never create, update, or
|
|
116
|
+
migrate that file without an explicit human request; semantic vocabulary never replaces
|
|
117
|
+
schema confirmation or the normal query/write safety gates.
|
|
118
|
+
|
|
85
119
|
## Agent Task Packs
|
|
86
120
|
|
|
87
121
|
When the user asks for a database workflow ("diagnose this slow query", "audit
|
|
@@ -552,7 +586,7 @@ schema. Raw `query` / `export` invocations render a sortable table only.
|
|
|
552
586
|
- **Health / growth:** `check --all` (huge tables skipped unless `--include-large`); consult schema `sizeCategory` before ad-hoc queries.
|
|
553
587
|
- **Codegen from live DB:** `schema --format json` to drive an ORM; cross-check once with `dbcli query`.
|
|
554
588
|
- **Integration truth:** `query` before → run app → `query` after. Unit-test mocks are not a substitute.
|
|
555
|
-
- **Natural language requests** (e.g. "update order to shipped"): pick `query` vs DML, map terms → columns via `schema` (and enum values in data), respect blacklist and `sizeCategory`, **always `--dry-run` writes first**.
|
|
589
|
+
- **Natural language requests** (e.g. "update order to shipped"): follow **Business-language discovery** first when the request uses business terminology; then pick `query` vs DML, map terms → columns via `schema` (and enum values in data), respect blacklist and `sizeCategory`, **always `--dry-run` writes first**.
|
|
556
590
|
|
|
557
591
|
## Notes
|
|
558
592
|
|
|
@@ -2197,6 +2197,14 @@ project root. It supplies business names and descriptions to an agent, but is
|
|
|
2197
2197
|
not a query language: these commands are offline, read-only, and never execute
|
|
2198
2198
|
SQL or contact an LLM.
|
|
2199
2199
|
|
|
2200
|
+
When an agent receives a business term, metric, alias, or relationship/join intent,
|
|
2201
|
+
it should first inspect `dbcli skill context --format json`. If that output includes
|
|
2202
|
+
`semantic`, use the reviewed vocabulary and use `semantic search <terms>` for a
|
|
2203
|
+
specific lookup. When the section is absent or search has no result, fall back to the
|
|
2204
|
+
blacklist-filtered schema and tell the user that `dbcli.semantic.json` is an optional
|
|
2205
|
+
way to make future terminology consistent. Do not create, update, or migrate the file
|
|
2206
|
+
without an explicit human request.
|
|
2207
|
+
|
|
2200
2208
|
```bash
|
|
2201
2209
|
dbcli semantic validate
|
|
2202
2210
|
dbcli semantic validate --format json
|
package/skills/dbcli/SKILL.md
CHANGED
|
@@ -82,6 +82,40 @@ warnings) go to stderr so stdout stays parseable — when piping JSON into a par
|
|
|
82
82
|
use `2>/dev/null` or leave stderr alone. **Never `2>&1`**: it merges those lines back
|
|
83
83
|
into stdout and the parse fails.
|
|
84
84
|
|
|
85
|
+
**Intent confirmation:** Treat `auto`, `confirm`, and `guided` as conversational
|
|
86
|
+
preferences for the current request, not as dbcli flags or persistent configuration.
|
|
87
|
+
Do not ask the user a meta-question about whether they want questions.
|
|
88
|
+
|
|
89
|
+
- `auto` (default): autonomously use governed semantic context and schema discovery.
|
|
90
|
+
If unresolved ambiguity would materially change the result, ask one compact batch of
|
|
91
|
+
questions before querying; otherwise state the assumptions and proceed.
|
|
92
|
+
- `confirm`: first state the proposed interpretation and wait for the user's approval
|
|
93
|
+
before issuing the task's data query.
|
|
94
|
+
- `guided`: resolve the request through short, focused questions, carrying confirmed
|
|
95
|
+
answers forward rather than asking again.
|
|
96
|
+
|
|
97
|
+
For business requests, material ambiguity includes the requested result shape or grain,
|
|
98
|
+
metric definition, time boundary and timezone, inclusion/exclusion rules (such as order
|
|
99
|
+
status or refunds), grouping, or selected connection. Example: for “yesterday's sales,”
|
|
100
|
+
do not guess whether the user needs a total or detail, which timezone defines yesterday,
|
|
101
|
+
or whether cancelled and refunded orders count. Summarize the candidate interpretation
|
|
102
|
+
and ask only the unresolved, result-changing questions.
|
|
103
|
+
|
|
104
|
+
When the user explicitly says to decide without further questions, proceed in `auto`
|
|
105
|
+
mode and disclose the material assumptions. This never bypasses blacklist, schema,
|
|
106
|
+
permission, dry-run, production-selection, or write-confirmation gates; an agent must
|
|
107
|
+
still stop where those gates require human confirmation.
|
|
108
|
+
|
|
109
|
+
**Business-language discovery:** When a user uses a business alias, metric, recurring
|
|
110
|
+
term, or relationship/join intent instead of a physical table or field name, first run
|
|
111
|
+
`dbcli skill context --format json`. If it includes `semantic`, treat that reviewed
|
|
112
|
+
section as the governed vocabulary; use `dbcli semantic search <terms> --format json`
|
|
113
|
+
to look up a specific term. If no semantic section exists or search returns no result,
|
|
114
|
+
fall back to `blacklist` → `schema` mapping and tell the user that optional
|
|
115
|
+
`dbcli.semantic.json` can make future requests consistent. Never create, update, or
|
|
116
|
+
migrate that file without an explicit human request; semantic vocabulary never replaces
|
|
117
|
+
schema confirmation or the normal query/write safety gates.
|
|
118
|
+
|
|
85
119
|
## Agent Task Packs
|
|
86
120
|
|
|
87
121
|
When the user asks for a database workflow ("diagnose this slow query", "audit
|
|
@@ -552,7 +586,7 @@ schema. Raw `query` / `export` invocations render a sortable table only.
|
|
|
552
586
|
- **Health / growth:** `check --all` (huge tables skipped unless `--include-large`); consult schema `sizeCategory` before ad-hoc queries.
|
|
553
587
|
- **Codegen from live DB:** `schema --format json` to drive an ORM; cross-check once with `dbcli query`.
|
|
554
588
|
- **Integration truth:** `query` before → run app → `query` after. Unit-test mocks are not a substitute.
|
|
555
|
-
- **Natural language requests** (e.g. "update order to shipped"): pick `query` vs DML, map terms → columns via `schema` (and enum values in data), respect blacklist and `sizeCategory`, **always `--dry-run` writes first**.
|
|
589
|
+
- **Natural language requests** (e.g. "update order to shipped"): follow **Business-language discovery** first when the request uses business terminology; then pick `query` vs DML, map terms → columns via `schema` (and enum values in data), respect blacklist and `sizeCategory`, **always `--dry-run` writes first**.
|
|
556
590
|
|
|
557
591
|
## Notes
|
|
558
592
|
|
|
@@ -2197,6 +2197,14 @@ project root. It supplies business names and descriptions to an agent, but is
|
|
|
2197
2197
|
not a query language: these commands are offline, read-only, and never execute
|
|
2198
2198
|
SQL or contact an LLM.
|
|
2199
2199
|
|
|
2200
|
+
When an agent receives a business term, metric, alias, or relationship/join intent,
|
|
2201
|
+
it should first inspect `dbcli skill context --format json`. If that output includes
|
|
2202
|
+
`semantic`, use the reviewed vocabulary and use `semantic search <terms>` for a
|
|
2203
|
+
specific lookup. When the section is absent or search has no result, fall back to the
|
|
2204
|
+
blacklist-filtered schema and tell the user that `dbcli.semantic.json` is an optional
|
|
2205
|
+
way to make future terminology consistent. Do not create, update, or migrate the file
|
|
2206
|
+
without an explicit human request.
|
|
2207
|
+
|
|
2200
2208
|
```bash
|
|
2201
2209
|
dbcli semantic validate
|
|
2202
2210
|
dbcli semantic validate --format json
|