@carllee1983/dbcli 1.31.0 → 1.37.0

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.
Files changed (36) hide show
  1. package/.agents/plugins/marketplace.json +21 -0
  2. package/.claude-plugin/plugin.json +9 -0
  3. package/.codex-plugin/plugin.json +41 -0
  4. package/.cursor/rules/dbcli.mdc +541 -0
  5. package/.cursor/skills/dbcli/SKILL.md +106 -0
  6. package/.cursor/skills/dbcli/reference.md +2232 -0
  7. package/.cursor-plugin/plugin.json +36 -0
  8. package/.github/skills/dbcli/SKILL.md +541 -0
  9. package/.github/skills/dbcli/reference.md +2232 -0
  10. package/CHANGELOG.md +81 -0
  11. package/README.md +38 -1
  12. package/README.zh-TW.md +37 -1
  13. package/assets/SKILL.md +86 -2
  14. package/assets/SKILL.zh-TW.md +71 -3
  15. package/assets/reference.md +286 -1
  16. package/assets/tasks/audit-permissions.md +35 -0
  17. package/assets/tasks/connection-health.md +37 -0
  18. package/assets/tasks/migration-review.md +41 -0
  19. package/assets/tasks/pr-database-review.md +38 -0
  20. package/assets/tasks/safe-backfill-verify.md +63 -0
  21. package/assets/tasks/safe-backfill.md +42 -0
  22. package/assets/tasks/schema-drift-review.md +37 -0
  23. package/assets/tasks/slow-endpoint-investigation.md +40 -0
  24. package/dist/cli.mjs +55833 -63508
  25. package/dist/core.mjs +1 -1
  26. package/gemini-extension.json +6 -0
  27. package/package.json +18 -5
  28. package/plugins/dbcli-agent/.codex-plugin/plugin.json +40 -0
  29. package/plugins/dbcli-agent/INSTALL.md +241 -0
  30. package/plugins/dbcli-agent/README.md +89 -0
  31. package/plugins/dbcli-agent/scripts/install-dbcli.sh +15 -0
  32. package/plugins/dbcli-agent/scripts/install-skills.sh +83 -0
  33. package/plugins/dbcli-agent/skills/dbcli/SKILL.md +541 -0
  34. package/plugins/dbcli-agent/skills/dbcli/reference.md +2232 -0
  35. package/skills/dbcli/SKILL.md +541 -0
  36. package/skills/dbcli/reference.md +2232 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,87 @@ 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.37.0] - 2026-06-22 - Rollback Scenario & Nested Shell Completions
9
+
10
+ ### Added
11
+
12
+ - **`dbcli verify rollback` 情境執行器(第三個內建 verify 情境)。** 透過已穩定的 scenario registry 註冊,以 preflight / after-write 兩種模式驗證「還原變更後資料庫是否回到預期的先前狀態」,且**永遠不執行**還原寫入 / DDL——只分析 `--statement` 並執行回讀斷言。以必填的 `--kind <ddl|dml>` 選擇還原語句文法:`ddl` 複用 `migration` 的單語句 `ALTER TABLE` 契約,`dml` 複用 `safe-backfill` 的 `UPDATE` plan 契約。安全邏輯完全複用兩個 sibling 情境的 classifier,無重複實作。artifact 沿用既有 subject kind(`ddl→migration`、`dml→backfill`)並以 `subject.command = 'verify rollback'` 記錄出處,因此 artifact schema 與版本不變。
13
+ - **巢狀 bash / zsh / fish shell 補全。** 以遞迴 command-tree metadata model 從指令樹生成巢狀子指令與旗標補全,並由共用 registry 驅動 REPL 的補全與分派;補全會排除 denylisted 指令。
14
+
15
+ ### Changed
16
+
17
+ - **REPL 補全 / 分派改由共用 registry 驅動。** 補全與指令分派統一從同一份 command registry 取得,降低 CLI 與 REPL 之間補全行為漂移的風險;`buildProgram` 抽成可重用 factory 並消除補全啟動噪音。
18
+
19
+ ## [1.36.0] - 2026-06-22 - Verification Scenario Runner Suite
20
+
21
+ ### Added
22
+
23
+ - **`dbcli verify safe-backfill` 情境執行器。** 以 preflight / after-write 兩種模式驗證安全回填工作流,並**永遠不執行回填寫入**:preflight 依序跑黑名單、schema、目標表與唯讀 verify-query 防護後回傳 `ready` / `blocked` 並印出精確的 after-write 指令;after-write 重跑防護、執行回讀斷言,並寫入 v1 `VerificationArtifact`(狀態對應 `verified` / `not_verified` / `indeterminate`,防護失敗為 `blocked`)。
24
+ - **`dbcli verify migration` 情境執行器。** 對 schema migration 做 preflight / after-write 驗證,且**永遠不執行 DDL**:分析提案的 `ALTER TABLE`、跑唯讀防護、要求 DDL 目標與 `--table` 相符(schema-aware),after-write 後記錄 `migration` 主體的證據。MVP 僅接受單語句 `ALTER TABLE`,並阻擋 `CREATE TABLE` / `DROP TABLE` / `CREATE INDEX` 及多語句 DDL。
25
+ - **`ALTER TABLE` 目標識別字契約。** `verify migration` 的目標擷取改用 quote-aware tokenizer:支援 `table` / `schema.table` / `catalog.schema.table`,每區段可為未加引號名稱或雙引號 / 反引號 / 方括號識別字(含 `""`、`]]` 跳脫),因此 `"user accounts"`、`"tenant-1"."orders"` 等含空白或連字號的名稱皆可接受。無法完整解析的目標(未封閉引號、不支援的跳脫、超過三段)會 fail closed 並以「目標無法解析」為由阻擋,與 `must match --table` 的不符原因明確區分。
26
+ - **`verification summary --latest-only` 交接選項。** 於既有 summary 輸出之上額外回傳最新一筆有效 artifact,方便 agent 在交接時直接引用最新證據;無 artifact 時回傳 `latest: null` 並維持 exit 0,無效檔案不會被升入 `latest`。
27
+
28
+ ### Changed
29
+
30
+ - **抽取共用情境原語至 `src/core/verify/scenario.ts`。** 防護排序、all-guards-passed 判定、有界原因、狀態對應、shell-quote 與證據遮蔽等共用邏輯集中於此,`safe-backfill` 重構為消費這些原語且**對外行為零變更**,降低後續情境的重複實作風險。
31
+
32
+ ## [1.35.0] - 2026-06-19 - Verification Inspect & Prune Surface
33
+
34
+ ### Added
35
+
36
+ - **`dbcli assert --write-verification-artifact` 橋接(opt-in)。** `assert` 的判定結果(verdict)現在可選擇性地寫成一份結果型 `VerificationArtifact`:透過 subject 解析器將斷言主體對應到 artifact 的 `subject`、依 pass/fail 對應驗證狀態,並以既有的原子寫入器落地於 `.dbcli/verification/`。省略旗標時行為完全不變、不寫入任何檔案;`safe-backfill-verify` 仍維持 plan-only。artifact 路徑一律相對於 cwd,與 `--config` 無關。
37
+ - **唯讀 `verification` 指令介面(inspect + 生命週期)。** 新增核心 artifact 讀取器(含 schema 驗證、filter / summarize / find 輔助函式),並以此建構出 `verification list`(表格輸出,支援 subject-kind 篩選)、`verification show`、`verification summary` 等唯讀檢視指令,讓 agent 能直接讀取與彙整既有驗證證據,而非自行解析檔案。
38
+ - **`verification prune` 保留期清理。** 依保留期(duration 解析)與全域 `--keep-latest` 規則挑選清理候選,全域 keep-latest 優先於各項篩選;具刪除安全防護(缺少 mtime 的檔案排除在外、預設 dry-run 預覽、`--execute` 才實際刪除),並在 execute 模式輸出 deleted / skipped 明細表。
39
+ - **完整 v1 證據驗證。** 對 `subject` / `evidence` / 選用欄位進行完整驗證,並加入執行期 evidence-kind 防護,確保讀取與寫入兩端對 schema v1 的解讀一致。
40
+
41
+ ## [1.34.0] - 2026-06-18 - Verification Artifact Writer
42
+
43
+ ### Added
44
+
45
+ - **驗證證據建構器(`buildVerificationArtifact`)。** 純函式,產生 schema v1 的 `VerificationArtifact`:可注入 `now` / `idFactory` 以利測試確定性、證據文字欄位上限 2000 字元(超過截斷並標註)、證據筆數上限 20(超過保留前 19 筆並補一筆 `manual` 截斷標記);拒絕非法狀態、空白 summary、空證據。集中化證據裁切,讓後續寫入器與指令介面不必各自重複截斷決策。
46
+ - **`safe-backfill-verify` 計畫的「已規劃」驗證中繼資料。** `dbcli skill tasks plan safe-backfill-verify --format json` 現在輸出一個 `verification` 區塊(`status: "planned"`,取計畫中最後一個 `assert` 步驟作為證據)。此為**已規劃**證據,**不代表**驗證已執行或通過,與結果型 `VerificationArtifact` 明確區隔。其他 task pack 不受影響。
47
+ - **驗證證據寫入器(`writeVerificationArtifact`)。** 將建構出的 artifact 以原子方式寫入 `.dbcli/verification/verification-<YYYYMMDD-HHMMSS>-<short-id>.json`:檔名完全由 artifact 內部產生(UTC 時間戳 + `[a-z0-9]` 淨化短 id,杜絕路徑穿越)、缺少目錄時自動建立、以 `link()` 獨佔建立確保不會靜默覆寫既有檔案、回傳寫入路徑。
48
+ - **`recover --apply --write-verification-artifact`(opt-in)。** 僅在 verify 步驟實際執行時,將 recovery 驗證結果寫成一份 `recovery-verify` artifact(狀態取合約 `verificationStatus`,附 `recoveryRef`)。省略旗標時行為完全不變、不寫入任何檔案;寫入失敗只記到 stderr,不影響結束碼。保留既有 `verifyStatus`、不嵌入任何指令輸出或機密。
49
+
50
+ ## [1.33.0] - 2026-06-18 - Workflow Pack Expansion
51
+
52
+ ### Added
53
+
54
+ - **4 個新的 plan-only Agent Task Pack(皆唯讀)。** `pr-database-review`(PR 變更持久化路徑、查詢、migration 的資料庫風險審查)、`migration-review`(在套用 DDL 前擷取變更前 schema 證據並預覽 migration)、`safe-backfill-verify`(規劃安全 backfill 並產生 read-back `assert` 驗證指令)、`slow-endpoint-investigation`(串接 proxy / explain / missing-index 證據調查慢端點)。每個 pack 都以 `safety.mode: plan-only`、`risk: readonly` 步驟組成,只產生計畫、永不寫入;SQL 類 pack 先支援 `postgres` 與 `mysql`。
55
+ - **Skill 路由更新(en / zh-TW)。** 在 `SKILL.md` 與 `SKILL.zh-TW.md` 的 Agent Task Packs 段落各加入一段精簡導引,讓 agent 在自行組合手動的審查、migration、backfill、效能流程前,先選擇對應的 workflow pack;已重新同步所有 plugin / platform skill 副本。
56
+
57
+ ## [1.32.0] - 2026-06-18 - Agent Task Packs Expansion & Skill Parity Guards
58
+
59
+ ### Added
60
+
61
+ - **4 個新的內建 Agent Task Pack(皆 `plan-only` 唯讀)。** `audit-permissions`(權限等級與 blacklist 覆蓋稽核)、`safe-backfill`(在寫入前做 blacklist + schema + 風險檢查的回填計畫)、`schema-drift-review`(快取/committed schema 與線上 schema 的漂移比對)、`connection-health`(連線可達性 / 設定 / 容量分級三步診斷)。皆走確定存在的唯讀指令;用 `dbcli skill tasks list` 瀏覽完整清單。
62
+ - **平台清單 parity 檢查(`scripts/check-platform-parity.ts`,`bun run platform:check`)。** 以 `SUPPORTED_PLATFORMS` 為單一真實來源,驗證 README、SKILL.md、SKILL.zh-TW.md、reference.md 與 CLI `--install` 選項描述的平台列舉完全一致(缺項或多項皆報錯),並掛進 `release-check.sh`。
63
+ - **語意 parity 守門。** `scripts/check-skill-parity.ts` 在結構比對外,新增 14 個語言不變的安全/命令 token(`query`/`insert`/`update`/`delete`/`export`/`schema`、`blacklist`、`--dry-run`/`--no-limit`/`--recovery`、`LIMIT 1000`、三個權限等級)在 EN 與 zh-TW 皆須對稱出現的檢查。
64
+ - **安裝與 context CLI 測試覆蓋。** 新增 `skill --install` 對 7 個平台寫入 temp HOME/cwd 的 smoke 測試(含 cursor/windsurf 的 root-rule + reference 雙檔結構),以及 `skill context` 的 xml/json/markdown、預設格式、無效格式與 blacklist 不外洩的 CLI 入口測試。
65
+
66
+ ### Fixed
67
+
68
+ - **`codex` / `windsurf` 安裝目標文件漂移。** 兩者已存在於 `SUPPORTED_PLATFORMS`(`--install` 實際可用),卻在 `SKILL.md` / `SKILL.zh-TW.md` 缺漏、`windsurf` 在 README 缺漏。已補齊並重新同步所有 plugin/skill 副本;新的 `platform:check` 會防止再次漂移。
69
+
70
+ ## [1.31.0] - 2026-06-10 - Data Editing Surface & Agent Plugin Packaging
71
+
72
+ ### Added
73
+
74
+ - **`@carllee1983/dbcli/core` 公開匯出 `DataExecutor` 與資料執行型別。** 在 `./core` barrel 開出資料編輯介面(insert/update/delete 執行面),讓外部消費者(如 `dbcli-gui` sidecar)能重用與 CLI 同源的資料寫入能力,不必重寫 adapter 邏輯。CLI 行為不變。
75
+ - **Agent plugin 打包與 marketplace 安裝。** 將 dbcli 打包為 agent plugin(Ponytail 風格 marketplace install),新增 GitHub Copilot CLI plugin 支援與 Cursor plugin 安裝(add-plugin metadata、marketplace 提交路徑),並依各 agent 拆分安裝指令與文件。
76
+ - **開發者工作流 skill 指引(en/zh-TW)。** 在 dbcli skill 新增「Developer workflows」段落,把資料庫影響隱含於開發任務時的最小安全路徑(DB-backed 功能、資料錯誤排查、ORM/migration、PR 審查、慢查詢、回填、環境驗證)寫入 SKILL en/zh-TW 與各平台副本,並以可執行的指令錨點取代不可執行的 migrate 範例。
77
+
78
+ ## [1.30.0] - 2026-06-09 - Connection Writer API
79
+
80
+ ### Added
81
+
82
+ - **`@carllee1983/dbcli/core` 新增連線寫入 API。** 在 `./core` barrel 公開純函式 mutation:`upsertConnection`、`removeConnection`(含預設連線重指派與 last-connection 防護)、`setDefaultConnection`、`migrateV1ToV2`(保留 legacy `.env.local` 密碼)、`writeConnectionSecret` + `envVarNameFor`(per-connection env 命名空間)。讓外部消費者(如 `dbcli-gui` sidecar)能程式化管理 `.dbcli` v2 連線,與 CLI 同源。CLI 行為不變。
83
+
84
+ ### Fixed
85
+
86
+ - **`writeV2Config` 改為 atomic temp+rename 寫入**,避免寫入中斷時破壞設定庫。
87
+ - **`migrateV1ToV2` 對非 SQL 的 v1 連線 fail-loud 拒絕**,防止把不相容連線寫進 v2 設定庫。
88
+
8
89
  ## [1.29.0] - 2026-06-08 - Core Config-Read Entrypoint
9
90
 
10
91
  ### Added
package/README.md CHANGED
@@ -634,6 +634,8 @@ dbcli skill --install gemini # Install to Gemini CLI (being phased out)
634
634
  dbcli skill --install antigravity # Install to Antigravity CLI (Gemini CLI's successor)
635
635
  dbcli skill --install copilot # Install to GitHub Copilot
636
636
  dbcli skill --install cursor # Install to Cursor IDE
637
+ dbcli skill --install codex # Install to Codex skills
638
+ dbcli skill --install windsurf # Install to Windsurf (.windsurfrules)
637
639
  ```
638
640
 
639
641
  **Behavior:**
@@ -657,7 +659,8 @@ dbcli skill --install claude && \
657
659
  dbcli skill --install gemini && \
658
660
  dbcli skill --install antigravity && \
659
661
  dbcli skill --install copilot && \
660
- dbcli skill --install cursor
662
+ dbcli skill --install cursor && \
663
+ dbcli skill --install codex
661
664
  ```
662
665
 
663
666
  ---
@@ -887,6 +890,12 @@ dbcli completion --install zsh # Install for specific shell
887
890
 
888
891
  **Supported shells:** bash, zsh, fish
889
892
 
893
+ Installed completions cover **nested subcommands** — for example `dbcli queries list --<TAB>`, `dbcli migrate add-column --<TAB>`, and `dbcli verify safe-backfill --<TAB>`.
894
+
895
+ Inside `dbcli shell`, command completion follows the current command surface, so newly added commands (`q`, `queries`, `inspect`, `verify`, `proxy`, `snapshot`, …) complete and dispatch automatically.
896
+
897
+ `--install` is **marker-managed**: it writes a single block to your shell rc file and re-running it replaces that block rather than duplicating it.
898
+
890
899
  ---
891
900
 
892
901
  #### `dbcli upgrade`
@@ -1231,8 +1240,20 @@ dbcli skill --install gemini
1231
1240
  # GitHub Copilot CLI
1232
1241
  dbcli skill --install copilot
1233
1242
 
1243
+ # GitHub Copilot CLI plugin marketplace
1244
+ # copilot plugin marketplace add CarlLee1983/dbcli
1245
+ # copilot plugin install dbcli-agent@dbcli-agent
1246
+
1234
1247
  # Cursor IDE (AI-native editor)
1235
1248
  dbcli skill --install cursor
1249
+
1250
+ # Cursor plugin marketplace
1251
+ # /add-plugin dbcli-agent
1252
+
1253
+ # Codex plugin marketplace
1254
+ # codex plugin marketplace add CarlLee1983/dbcli
1255
+ # Then open /plugins and install dbcli-agent.
1256
+ # Full install guide: plugins/dbcli-agent/INSTALL.md
1236
1257
  ```
1237
1258
 
1238
1259
  After installation, the AI agent will have access to dbcli commands and can use them to query, insert, update, or export data based on your permission level.
@@ -1285,6 +1306,22 @@ After installation, the AI agent will have access to dbcli commands and can use
1285
1306
 
1286
1307
  **Skill location:** `.cursor/rules/dbcli.mdc` (summary + workflows) and `.cursor/skills/dbcli/reference.md` (full command flags and examples) under the **current working directory** when you run `dbcli skill --install cursor`.
1287
1308
 
1309
+ **Cursor plugin install:** in Cursor Agent chat, run `/add-plugin dbcli-agent`, or see `plugins/dbcli-agent/INSTALL.md#cursor` for marketplace and fallback options.
1310
+
1311
+ ---
1312
+
1313
+ #### Codex
1314
+
1315
+ 1. Add the marketplace: `codex plugin marketplace add CarlLee1983/dbcli`.
1316
+ 2. Open `/plugins`, select the dbcli Agent marketplace, and install `dbcli-agent`.
1317
+ 3. For a persistent CLI, install dbcli globally: `bun install -g @carllee1983/dbcli` or `npm install -g @carllee1983/dbcli`.
1318
+ 4. Without a global install, the plugin skill uses `bunx @carllee1983/dbcli <command>` as its fallback.
1319
+ 5. Initialize: `dbcli init` or `bunx @carllee1983/dbcli init`.
1320
+
1321
+ **Plugin skill location:** `skills/dbcli/` (SKILL.md + reference.md).
1322
+
1323
+ **Install guide:** `plugins/dbcli-agent/INSTALL.md`.
1324
+
1288
1325
  ---
1289
1326
 
1290
1327
  ### Example: AI Agent Workflow
package/README.zh-TW.md CHANGED
@@ -532,6 +532,7 @@ dbcli skill --install gemini # 安裝至 Gemini CLI(即將淘汰)
532
532
  dbcli skill --install antigravity # 安裝至 Antigravity CLI(Gemini CLI 後繼者)
533
533
  dbcli skill --install copilot # 安裝至 GitHub Copilot
534
534
  dbcli skill --install cursor # 安裝至 Cursor IDE
535
+ dbcli skill --install codex # 安裝至 Codex skills
535
536
  ```
536
537
 
537
538
  **行為:**
@@ -555,7 +556,8 @@ dbcli skill --install claude && \
555
556
  dbcli skill --install gemini && \
556
557
  dbcli skill --install antigravity && \
557
558
  dbcli skill --install copilot && \
558
- dbcli skill --install cursor
559
+ dbcli skill --install cursor && \
560
+ dbcli skill --install codex
559
561
  ```
560
562
 
561
563
  ---
@@ -786,6 +788,12 @@ dbcli completion --install zsh # 指定 shell 安裝
786
788
 
787
789
  **支援 shell:** bash、zsh、fish
788
790
 
791
+ 已安裝的補全支援**巢狀子指令**,例如 `dbcli queries list --<TAB>`、`dbcli migrate add-column --<TAB>` 與 `dbcli verify safe-backfill --<TAB>`。
792
+
793
+ 在 `dbcli shell` 中,指令補全會依照目前的指令範圍運作,因此新增的指令(`q`、`queries`、`inspect`、`verify`、`proxy`、`snapshot` 等)會自動補全並可被執行。
794
+
795
+ `--install` 採用**標記區塊管理**:它只會在 shell 設定檔寫入單一管理區塊,重新執行時會「取代」該區塊,而不會重複新增。
796
+
789
797
  ---
790
798
 
791
799
  #### `dbcli upgrade`
@@ -1127,8 +1135,20 @@ dbcli skill --install gemini
1127
1135
  # GitHub Copilot CLI
1128
1136
  dbcli skill --install copilot
1129
1137
 
1138
+ # GitHub Copilot CLI plugin marketplace
1139
+ # copilot plugin marketplace add CarlLee1983/dbcli
1140
+ # copilot plugin install dbcli-agent@dbcli-agent
1141
+
1130
1142
  # Cursor IDE
1131
1143
  dbcli skill --install cursor
1144
+
1145
+ # Cursor plugin marketplace
1146
+ # /add-plugin dbcli-agent
1147
+
1148
+ # Codex plugin marketplace
1149
+ # codex plugin marketplace add CarlLee1983/dbcli
1150
+ # 接著開啟 /plugins 並安裝 dbcli-agent。
1151
+ # 完整安裝說明:plugins/dbcli-agent/INSTALL.md
1132
1152
  ```
1133
1153
 
1134
1154
  安裝後,AI 可依你的權限等級使用 dbcli 查詢、插入、更新或匯出資料。
@@ -1181,6 +1201,22 @@ dbcli skill --install cursor
1181
1201
 
1182
1202
  **Skill 路徑:** 在**目前工作目錄**執行 `dbcli skill --install cursor` 時,寫入 **`.cursor/rules/dbcli.mdc`**(摘要與工作流程)及 **`.cursor/skills/dbcli/reference.md`**(完整旗標與範例)。
1183
1203
 
1204
+ **Cursor plugin 安裝:** 在 Cursor Agent chat 執行 `/add-plugin dbcli-agent`,或參考 `plugins/dbcli-agent/INSTALL.md#cursor` 的 marketplace 與 fallback 說明。
1205
+
1206
+ ---
1207
+
1208
+ #### Codex
1209
+
1210
+ 1. 加入 marketplace:`codex plugin marketplace add CarlLee1983/dbcli`。
1211
+ 2. 開啟 `/plugins`,選擇 dbcli Agent marketplace,並安裝 `dbcli-agent`。
1212
+ 3. 若要常駐 CLI,請全域安裝 dbcli:`bun install -g @carllee1983/dbcli` 或 `npm install -g @carllee1983/dbcli`。
1213
+ 4. 若未全域安裝,plugin 內的 skill 會以 `bunx @carllee1983/dbcli <command>` 作為 fallback。
1214
+ 5. 初始化:`dbcli init` 或 `bunx @carllee1983/dbcli init`。
1215
+
1216
+ **Plugin skill 路徑:** `skills/dbcli/`(`SKILL.md` + `reference.md`)。
1217
+
1218
+ **安裝說明:** `plugins/dbcli-agent/INSTALL.md`。
1219
+
1184
1220
  ---
1185
1221
 
1186
1222
  ### 範例:AI 代理工作流程
package/assets/SKILL.md CHANGED
@@ -7,6 +7,11 @@ description: Database CLI for AI agents with permission-based access control. Us
7
7
 
8
8
  Database CLI for AI agents with permission-based access control.
9
9
 
10
+ If the `dbcli` executable is not available in `PATH`, use
11
+ `bunx @carllee1983/dbcli <command>` as the command prefix. This is the expected
12
+ fallback for Codex plugin installs where the skill is installed by the plugin but
13
+ the CLI package has not been installed globally.
14
+
10
15
  ## AI agent workflow (follow in order)
11
16
 
12
17
  0. `dbcli skill context --format xml` — LLM prompt context payload: serializes connection metadata, schema caches, and saved queries into a compressed XML/JSON structure for prompt injection.
@@ -26,6 +31,13 @@ Database CLI for AI agents with permission-based access control.
26
31
  - `failed` — verifier exited non-zero or timed out.
27
32
  - `indeterminate` — verifier exited 0 but the heuristic could not confirm the fix (JSON parse failure, missing field, gate skip).
28
33
  Verify is **only run when** `finalStatus === 'ok'`. Pass `--no-verify` to skip it. Heuristic is intentionally cheap; agents should still re-run their own check against the original failing operation when correctness matters.
34
+
35
+ Verification outcome vocabulary: use `verified` only when required evidence matched;
36
+ use `not_verified` when the check ran and contradicted the expected state; use
37
+ `indeterminate` when the check ran but evidence was ambiguous; use `blocked` when
38
+ verification could not run because of config, permission, schema, placeholder, or
39
+ safety gates.
40
+
29
41
  - **v1.17.0 P2 Multi-turn `--next`.** When `--apply` is too coarse — interactive blocks it, the plan needs per-step inspection, or the agent wants to drive recovery with its own tools — execute steps one at a time and ask dbcli for the next:
30
42
 
31
43
  ```bash
@@ -74,11 +86,82 @@ Builtin packs: `diagnose-slow-query` and **(v1.23)** `analyze-table-perf` — a
74
86
  read-only `plan-only` pack taking a required `table` parameter that walks
75
87
  `blacklist list` → `schema <table> --format json` → `guide index-usage`. `dbcli
76
88
  inspect` suggests `analyze-table-perf` automatically for the hottest table in
77
- recent audit activity.
89
+ recent audit activity. Additional read-only packs: `audit-permissions`,
90
+ `safe-backfill`, `schema-drift-review`, `connection-health` — run
91
+ `dbcli skill tasks list` for the full set.
92
+
93
+ Review & verification packs: `pr-database-review` (assess a PR's changed queries,
94
+ migrations and blacklist risk), `migration-review` (capture pre-change schema and
95
+ preview DDL), `safe-backfill-verify` (backfill planning with a read-back `assert`),
96
+ and `slow-endpoint-investigation` (chain `proxy analyze` → `explain` →
97
+ `guide missing-index-for`). All are read-only `plan-only` — pick the pack matching the
98
+ user's situation before improvising, and run any index/DDL proposal through
99
+ `migration-review` before writing.
78
100
 
79
101
  Tasks live under `assets/tasks/` (builtin), `.dbcli-shared/tasks/` (shared), and
80
102
  `.dbcli/tasks/` (local override).
81
103
 
104
+ ## Developer workflows
105
+
106
+ Use these workflows when database impact is implicit in a development task. Keep
107
+ the normal dbcli safety rules: prefer `--format json`, run `blacklist list`
108
+ before touching sensitive data, confirm names with `schema`, dry-run writes, and
109
+ use `--recovery` / `recover` after failures.
110
+
111
+ | Situation | Use dbcli for | Minimum safe path |
112
+ | --- | --- | --- |
113
+ | DB-backed feature | Map product/code terms to real objects before editing code. | `inspect --for-agent` -> `blacklist list` -> `schema <object>` -> `queries suggest <intent>` |
114
+ | Application data bug | Separate stored facts from application-code inference. | `inspect --for-agent` -> `audit tail --for-agent --n 10` -> `blacklist list` -> `schema <object>` -> narrow query/snippet |
115
+ | ORM or migration work | Ground model and migration edits in live schema evidence. | `schema --format json` -> `diff --snapshot <name>` -> generate DDL via `migrate add-index`/`add-column` (preview SQL) -> `diff --against <snapshot>` |
116
+ | PR database review | Check query, write, migration, export, fixture, and blacklist risk. | Review changed persistence paths, then propose concrete `schema`, `plan`, `dry-run`, `report`, or `guide` commands for each material claim. |
117
+ | Slow endpoint or query | Prefer read-only diagnostics before index proposals. | `report --section perf` -> task pack `analyze-table-perf` -> `guide missing-index-for "<query>"`; use `proxy analyze` when logs exist. |
118
+ | Safe data backfill | Scope affected rows and preview mutations before execution. | `blacklist list` -> `schema <object>` -> count/scope query -> `update ... --dry-run` -> read-back or snippet `--verify`. |
119
+ | Environment validation | Check config shape and connectivity without leaking secrets. | `status --format json` -> `doctor --format json` -> `inspect --for-agent --no-connect --format json`. |
120
+
121
+ Copy-paste command anchors:
122
+
123
+ ```bash
124
+ dbcli inspect --for-agent --format json
125
+ dbcli blacklist list --format json
126
+ dbcli schema <object> --format json
127
+ dbcli queries suggest <intent> --format json
128
+ dbcli audit tail --for-agent --n 10
129
+ dbcli schema --format json
130
+ dbcli diff --snapshot <name>
131
+ dbcli migrate add-index <table>
132
+ dbcli diff --against <snapshot>
133
+ dbcli report --section perf --format json
134
+ dbcli skill tasks plan analyze-table-perf --param table=<table> --format json
135
+ dbcli guide missing-index-for "<query>" --format json
136
+ dbcli proxy analyze --format json
137
+ dbcli query "<count/scope query>" --format json
138
+ dbcli update <object> --where "<bounded predicate>" --set '<json>' --dry-run --format json
139
+ dbcli status --format json
140
+ dbcli doctor --format json
141
+ dbcli inspect --for-agent --no-connect --format json
142
+ ```
143
+
144
+ Developer workflow guardrails:
145
+
146
+ - Never invent table, collection, key, index, or field names. Confirm them with
147
+ `schema` before writing code that depends on them.
148
+ - Separate database facts from application-code inference. Report which dbcli
149
+ output shaped the code or review conclusion.
150
+ - For writes and backfills, include scope count, dry-run preview, execution
151
+ command, and read-back or snippet verification.
152
+ - Do not create indexes directly from a performance suggestion; turn them into reviewed migrations.
153
+ - Do not print credentials, copied connection strings, or blacklisted values.
154
+ - To persist result evidence for a read-back assertion, run `assert ... --write-verification-artifact --verification-subject <kind:name>` (kinds: `recovery`, `task-pack`, `assertion`, `migration`, `backfill`, `manual`).
155
+ - Inspect result evidence (read-only): `dbcli verification summary --format json`
156
+ (also `verification list` / `verification show <id>`). Reclaim old artifacts with
157
+ `dbcli verification prune --older-than 30d` (dry-run; add `--execute --force` to delete).
158
+ - `tasks plan safe-backfill-verify` — when the user needs a plan only.
159
+ - `verify safe-backfill` — before a real safe backfill (preflight) and after it
160
+ (`--after-write`) when durable evidence is required. Never executes the write.
161
+ - `tasks plan migration-review` — when the user needs a migration plan only (plan output, no DDL executed).
162
+ - `verify migration` — preflight a schema migration (analyze DDL, run guards) and after the migration is applied externally (`--after-write`) to record evidence. Never executes DDL.
163
+ - `verification show <id>` — cite the final artifact.
164
+
82
165
  Full flags, per-command copy-paste blocks, `migrate` DDL, interactive `shell`, and MongoDB/Redis/ES walkthroughs are in [reference.md](reference.md) (installed next to this file).
83
166
 
84
167
  ## Audit Log usage
@@ -252,6 +335,7 @@ Full flags and edge cases: see [reference.md](reference.md) `init` section.
252
335
  | `diff` | query-only+ | SQL only. Save/compare schema snapshots. |
253
336
  | `snapshot` | query-only+ | **(v1.25)** SQL only. Capture a result fingerprint (`rowCount` + per-column null/distinct/min/max/sum + order-independent checksum). `--out` (default `.dbcli/snapshots/snap-<ts>.json`), `--rows`, `--stdout`, `--format`, `--no-limit`. Baseline for `assert --against`. |
254
337
  | `assert` | query-only+ | **(v1.25)** SQL only. Verify an invariant; exit 1 on failure unless `--no-fail`. `--expect "rows>0\|value==X\|col:c not null\|unique\|between a and b\|>= n"`, `--vs <query> --compare rows\|value` (reconcile), `--against <snapshot> --tolerance <pct>`. |
338
+ | `verification` | n/a | Inspect and manage local verification artifacts. `list` / `show <id-or-path>` / `summary` are read-only; `prune` is dry-run by default and deletes only with `--execute --force`. Reads `<cwd>/.dbcli/verification/`; no DB connection, no audit writes. |
255
339
  | `proxy` | n/a | **(v1.26)** MySQL/MariaDB/PostgreSQL only. Local-dev observability proxy — relays app traffic to the real DB and appends query/latency/byte/error events to `.dbcli/proxy/events.jsonl`. Subcommands: `mysql` \| `mariadb` \| `postgresql`. `--listen`, `--target`, `--events` (default `.dbcli/proxy/events.jsonl`), `--slow-ms` (default `1000`), `--redact none\|literals` (default `none`). Observe-only. **(v1.27)** `proxy analyze` aggregates the event log offline into a JSON/text report (summary, byFingerprint with suggestedCommands, slowest, errors, hotTables, N+1) — `--format`, `--top`, `--slow-ms`, `--n-plus-one`. |
256
340
  | `status` | query-only+ | Safe JSON/text summary (no credentials). |
257
341
  | `inspect` | query-only+ | Read-only context snapshot (connection, permission, blacklist, objects, snippets, context-aware `suggestedCommands`, and **(v1.23)** human-readable `hints`). `--for-agent` / `--brief` / `--no-connect` / `--require-schema-cache`. Supports `--recovery`. |
@@ -263,7 +347,7 @@ Full flags and edge cases: see [reference.md](reference.md) `init` section.
263
347
  | `completion` | n/a | bash / zsh / fish scripts. |
264
348
  | `upgrade` | n/a | Self-update from npm; 24h-cached version hints on every command. |
265
349
  | `shell` | (same as query+) | Interactive REPL. SQL engines, MongoDB, and Redis (single-line; `.no-limit on/off`). **(v1.22)** Elasticsearch opens a Kibana Dev Tools-style REPL (`<METHOD> /<path>` + optional JSON body, blank line submits). |
266
- | `skill` | n/a | Generate / install AI skill docs (`--install <claude\|gemini\|antigravity\|copilot\|cursor>`); `skill tasks list/show/plan` for Agent Task Packs; `skill context` for LLM prompt context payload. |
350
+ | `skill` | n/a | Generate / install AI skill docs (`--install <claude\|gemini\|antigravity\|copilot\|cursor\|codex\|windsurf>`); `skill tasks list/show/plan` for Agent Task Packs; `skill context` for LLM prompt context payload. |
267
351
  | `migrate` | admin | SQL only. **DDL; dry-run by default** — needs `--execute`. |
268
352
 
269
353
  `--use <name>` on any subcommand targets a v2 connection without changing the default.
@@ -28,6 +28,11 @@ description: 為 AI 代理設計、具權限控管的資料庫 CLI。可用於
28
28
  - `failed` — 驗證器以非零退出或逾時。
29
29
  - `indeterminate` — 驗證器以 0 退出,但啟發式判斷無法確認修復(JSON 解析失敗、欄位缺失、門控略過)。
30
30
  Verify **僅在** `finalStatus === 'ok'` 時執行。傳 `--no-verify` 可略過。啟發式刻意輕量;正確性重要時,代理仍應自行對原始失敗操作再驗證一次。
31
+
32
+ 驗證結果詞彙:只有在必要證據符合預期時才使用 `verified`;檢查已執行但結果違反預期時使用
33
+ `not_verified`;檢查已執行但證據不足或模糊時使用 `indeterminate`;因 config、權限、schema、
34
+ placeholder 或安全閘門導致驗證無法執行時使用 `blocked`。
35
+
31
36
  - **v1.17.0 P2 Multi-turn `--next`(多輪逐步執行)。** 當 `--apply` 顆粒度過粗(interactive 卡住、計畫需要逐步檢視,或代理希望用自有工具驅動復原)時,可逐步執行步驟並向 dbcli 詢問下一步:
32
37
 
33
38
  ```bash
@@ -68,8 +73,71 @@ dbcli skill tasks plan <task> --param key=value --format json # 產生計畫
68
73
 
69
74
  計畫輸出是一組附帶說明與風險標籤的 dbcli 指令序列。請逐一執行 — 任務計畫**不會**繞過 blacklist、schema、dry-run 或確認等要求。
70
75
 
76
+ 內建套件:`diagnose-slow-query` 與 **(v1.23)** `analyze-table-perf` — 後者是 read-only 的 `plan-only` 套件,需帶入必填的 `table` 參數,依序執行 `blacklist list` → `schema <table> --format json` → `guide index-usage`。`dbcli inspect` 會針對近期 audit 活動中最熱門的資料表自動建議 `analyze-table-perf`。其他唯讀套件:`audit-permissions`、`safe-backfill`、`schema-drift-review`、`connection-health` — 用 `dbcli skill tasks list` 瀏覽完整清單。
77
+
78
+ 審查與驗證套件:`pr-database-review`(評估 PR 變更的查詢、遷移與 blacklist 風險)、
79
+ `migration-review`(擷取變更前 schema 並預覽 DDL)、`safe-backfill-verify`(backfill 規劃
80
+ 搭配 read-back `assert`),以及 `slow-endpoint-investigation`(串接 `proxy analyze` →
81
+ `explain` → `guide missing-index-for`)。全部為唯讀 `plan-only` — 先選擇符合使用者情境的
82
+ 套件再行動,任何索引/DDL 提案都應先經 `migration-review` 再寫入。
83
+
71
84
  任務檔放在 `assets/tasks/`(內建)、`.dbcli-shared/tasks/`(共享)與 `.dbcli/tasks/`(本地覆寫)。
72
85
 
86
+ ## 開發者工作流
87
+
88
+ 當資料庫影響隱含在開發任務中時使用這些流程。保留一般 dbcli 安全規則:優先使用 `--format json`,碰觸敏感資料前先跑 `blacklist list`,用 `schema` 確認名稱,寫入先 dry-run,失敗後使用 `--recovery` / `recover`。
89
+
90
+ | 情境 | 使用 dbcli 的目的 | 最小安全路徑 |
91
+ | --- | --- | --- |
92
+ | DB-backed 功能 | 編輯程式碼前先把產品/程式語彙對應到真實資料物件。 | `inspect --for-agent` -> `blacklist list` -> `schema <object>` -> `queries suggest <intent>` |
93
+ | 應用程式資料錯誤 | 分離資料庫事實與應用程式推論。 | `inspect --for-agent` -> `audit tail --for-agent --n 10` -> `blacklist list` -> `schema <object>` -> 最小查詢/snippet |
94
+ | ORM 或 migration | 用 live schema 證據支撐 model 與 migration 修改。 | `schema --format json` -> `diff --snapshot <name>` -> 用 `migrate add-index`/`add-column` 產生 DDL(預覽 SQL)-> `diff --against <snapshot>` |
95
+ | PR 資料庫風險審查 | 檢查 query、write、migration、export、fixture 與 blacklist 風險。 | 審查變更的 persistence path,並針對每個重要主張提出具體 `schema`、`plan`、`dry-run`、`report` 或 `guide` 指令。 |
96
+ | 慢 endpoint 或查詢 | 在提出 index 前優先使用 read-only diagnostics。 | `report --section perf` -> task pack `analyze-table-perf` -> `guide missing-index-for "<query>"`;有 proxy log 時使用 `proxy analyze`。 |
97
+ | 安全資料回填 | 先界定受影響資料範圍並預覽 mutation。 | `blacklist list` -> `schema <object>` -> count/scope query -> `update ... --dry-run` -> read-back 或 snippet `--verify`。 |
98
+ | 環境設定驗證 | 不洩漏 secrets 地檢查 config shape 與 connectivity。 | `status --format json` -> `doctor --format json` -> `inspect --for-agent --no-connect --format json`。 |
99
+
100
+ 可直接複製的指令錨點:
101
+
102
+ ```bash
103
+ dbcli inspect --for-agent --format json
104
+ dbcli blacklist list --format json
105
+ dbcli schema <object> --format json
106
+ dbcli queries suggest <intent> --format json
107
+ dbcli audit tail --for-agent --n 10
108
+ dbcli schema --format json
109
+ dbcli diff --snapshot <name>
110
+ dbcli migrate add-index <table>
111
+ dbcli diff --against <snapshot>
112
+ dbcli report --section perf --format json
113
+ dbcli skill tasks plan analyze-table-perf --param table=<table> --format json
114
+ dbcli guide missing-index-for "<query>" --format json
115
+ dbcli proxy analyze --format json
116
+ dbcli query "<count/scope query>" --format json
117
+ dbcli update <object> --where "<bounded predicate>" --set '<json>' --dry-run --format json
118
+ dbcli status --format json
119
+ dbcli doctor --format json
120
+ dbcli inspect --for-agent --no-connect --format json
121
+ ```
122
+
123
+ 開發者工作流守門規則:
124
+
125
+ - 不要猜測 table、collection、key、index 或 field 名稱。先用 `schema` 確認,再編寫依賴這些名稱的程式碼。
126
+ - 分離資料庫事實與應用程式推論。回報是哪個 dbcli 輸出影響了程式修改或 review 結論。
127
+ - 寫入與 backfill 必須包含 scope count、dry-run preview、execution command,以及 read-back 或 snippet verification。
128
+ - 不要直接從 performance suggestion 建 index;應轉成經過 review 的 migration。
129
+ - 不要列印 credentials、複製的連線字串或 blacklisted 值。
130
+ - 若需持久化 read-back 斷言的結果佐證,執行 `assert ... --write-verification-artifact --verification-subject <kind:name>`(允許的 kind:`recovery`、`task-pack`、`assertion`、`migration`、`backfill`、`manual`)。
131
+ - 檢視驗證佐證(唯讀):`dbcli verification summary --format json`
132
+ (亦可用 `verification list` / `verification show <id>`)。以 `dbcli verification prune --older-than 30d` 回收舊文物(dry-run;加上 `--execute --force` 才刪除)。
133
+ - `tasks plan safe-backfill-verify` — 當使用者只需要計畫時使用。
134
+ - `verify safe-backfill` — 在真實 backfill 前(preflight)及執行後(`--after-write`)使用,需要持久佐證時必用。永不執行寫入。
135
+ - `tasks plan migration-review` — 當使用者只需要 migration 計畫時使用(僅輸出計畫,不執行 DDL)。
136
+ - `verify migration` — 預檢 schema migration(分析 DDL、執行防護),並在外部套用 migration 後(`--after-write`)記錄佐證。永不執行 DDL。
137
+ - `verification show <id>` — 引用最終文物。
138
+
139
+ 完整旗標、每個指令的可貼上範例、`migrate` DDL、互動式 `shell` 與 MongoDB / Redis / ES 教學在 [reference.md](reference.md)(安裝時與本檔放在一起)。
140
+
73
141
  ## Audit Log 使用
74
142
 
75
143
  當需要跨 session 或事後 forensics 重建工具歷史時,請優先使用 audit log,而非從零開始查詢 DB 狀態。
@@ -97,8 +165,6 @@ dbcli audit show --recovery-ref <envelope-id> # 反向找出觸發 envelope 的
97
165
 
98
166
  詳細指令參考:[`reference.md`](./reference.md) §audit(英文)。完整 agent 復原 walkthrough(各錯誤碼 end-to-end 情境、`--next` 多輪逐步、envelope ⇄ audit pivot、risk gate cheat sheet)見 [`reference.md`](./reference.md) §Recovery Cookbook(英文)。
99
167
 
100
- 完整旗標、每個指令的可貼上範例、`migrate` DDL、互動式 `shell` 與 MongoDB / Redis / ES 教學在 [reference.md](reference.md)(安裝時與本檔放在一起)。
101
-
102
168
  ## 快速開始
103
169
 
104
170
  ```bash
@@ -200,6 +266,7 @@ dbcli init --use-env-refs \
200
266
  | `list` | query-only+ | 資料表(SQL)、collections(MongoDB)、keys(Redis)或 indices(Elasticsearch)。 |
201
267
  | `schema` | query-only+ | SQL:單表或全掃描存入 `.dbcli/schemas/`。MongoDB:sampled。ES:flattened mapping。Redis:僅單一 key(type / TTL / size)。支援 `--recovery`。 |
202
268
  | `query` | query-only+ | SQL、Mongo JSON(`--collection`)、Redis 指令、ES DSL / Lucene(`--collection`)。`--format table\|json\|csv\|html`、`--ui` 開啟瀏覽器互動式 dashboard。支援 `--recovery`。 |
269
+ | `explain` | query-only+ | **(v1.23)** 唯讀查詢計畫並附註解。僅 SQL。單一查詢、`@saved-query`、`@file.sql` 或 `--bulk @glob/*`。`--analyze`(EXPLAIN ANALYZE / MariaDB ANALYZE SELECT)、`--format markdown\|json\|table`。 |
203
270
  | `plan` | n/a | 靜態 SQL 風險分析器(`--format text\|json`);不連線即可分類語句。 |
204
271
  | `q` | query-only+ | 以 `@name` 執行已儲存 snippet,搭配 `--param k=v`。支援 `--verify` 以執行斷言。 |
205
272
  | `queries` | n/a | 管理已儲存 snippet:`list` / `show` / `search` / `suggest` / `new` / `edit` / `check` / `delete` / `rename` / `copy` / `import` / `export`。 |
@@ -211,6 +278,7 @@ dbcli init --use-env-refs \
211
278
  | `diff` | query-only+ | 僅 SQL。儲存 / 比較 schema snapshot。 |
212
279
  | `snapshot` | query-only+ | **(v1.25)** 僅 SQL。擷取結果指紋(`rowCount` + 每欄 null/distinct/min/max/sum + 順序無關 checksum)。`--out`(預設 `.dbcli/snapshots/snap-<ts>.json`)、`--rows`、`--stdout`、`--format`、`--no-limit`。作為 `assert --against` 的基準。 |
213
280
  | `assert` | query-only+ | **(v1.25)** 僅 SQL。驗證不變量;失敗時 exit 1,除非 `--no-fail`。`--expect "rows>0\|value==X\|col:c not null\|unique\|between a and b\|>= n"`、`--vs <query> --compare rows\|value`(對帳)、`--against <snapshot> --tolerance <pct>`。 |
281
+ | `verification` | n/a | 檢視與管理本機驗證 artifact。`list`/`show`/`summary` 為唯讀檢視;`prune` 預設 dry-run,僅在 `--execute --force` 時刪除。讀取 `<cwd>/.dbcli/verification/`;不需 DB 連線,不寫入 audit log。 |
214
282
  | `proxy` | n/a | **(v1.26)** 僅 MySQL/MariaDB/PostgreSQL。本地端開發觀測代理 — 中繼應用程式流量至真實資料庫,並將查詢 / 延遲 / 位元組 / 錯誤事件附加到 `.dbcli/proxy/events.jsonl`。子指令:`mysql` \| `mariadb` \| `postgresql`。`--listen`、`--target`、`--events`(預設 `.dbcli/proxy/events.jsonl`)、`--slow-ms`(預設 `1000`)、`--redact none\|literals`(預設 `none`)。僅作觀測,不改寫或封鎖。 |
215
283
  | `status` | query-only+ | 安全 JSON / 文字摘要(不含憑證)。 |
216
284
  | `inspect` | query-only+ | 唯讀脈絡快照(連線、權限、blacklist、物件、snippets、建議指令)。`--for-agent` / `--no-connect` / `--require-schema-cache`。支援 `--recovery`。 |
@@ -222,7 +290,7 @@ dbcli init --use-env-refs \
222
290
  | `completion` | n/a | bash / zsh / fish 腳本。 |
223
291
  | `upgrade` | n/a | 從 npm 自我更新;每個指令都帶 24h 快取的版本提示。 |
224
292
  | `shell` | (與 query 同) | 互動式 REPL。支援 SQL 引擎、MongoDB 與 Redis(單行;`.no-limit on/off`)。 |
225
- | `skill` | n/a | 產出 / 安裝 AI skill 文件(`--install <claude\|gemini\|antigravity\|copilot\|cursor>`);`skill tasks list/show/plan` 提供 Agent Task Packs;`skill context` 提供 LLM 提示詞脈絡載荷。 |
293
+ | `skill` | n/a | 產出 / 安裝 AI skill 文件(`--install <claude\|gemini\|antigravity\|copilot\|cursor\|codex\|windsurf>`);`skill tasks list/show/plan` 提供 Agent Task Packs;`skill context` 提供 LLM 提示詞脈絡載荷。 |
226
294
  | `migrate` | admin | 僅 SQL。**DDL;預設 dry-run** — 需 `--execute` 才會真的執行。 |
227
295
 
228
296
  任何子指令上的 `--use <name>` 都會把目標切到對應的 v2 連線,但不改變預設值。