kcode-pi 0.1.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.
- package/README.md +358 -0
- package/dist/cli/kcode.d.ts +15 -0
- package/dist/cli/kcode.js +153 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +7 -0
- package/docs/KCODE_DISTRIBUTION.md +91 -0
- package/extensions/kingdee-harness.ts +180 -0
- package/extensions/kingdee-header.ts +122 -0
- package/extensions/kingdee-tools.ts +379 -0
- package/knowledge/.backup/v1.0.0/version.json +10 -0
- package/knowledge/cangqiong/product-notes.md +15 -0
- package/knowledge/common/business-flows.md +115 -0
- package/knowledge/common/config-guides.md +110 -0
- package/knowledge/common/error-patterns.md +170 -0
- package/knowledge/common/implementation.md +144 -0
- package/knowledge/cosmic/hard-constraints.md +38 -0
- package/knowledge/cosmic/ksql-datafix.md +34 -0
- package/knowledge/cosmic/platform-baseline.md +32 -0
- package/knowledge/cosmic/plugin-decision-matrix.md +40 -0
- package/knowledge/cosmic/review-checklist.md +40 -0
- package/knowledge/cosmic/unittest.md +35 -0
- package/knowledge/enterprise/api-reference.md +186 -0
- package/knowledge/enterprise/code-patterns.md +217 -0
- package/knowledge/enterprise/plugin-lifecycle.md +188 -0
- package/knowledge/enterprise/tables.json +159 -0
- package/knowledge/flagship/api-reference.md +237 -0
- package/knowledge/flagship/code-patterns.md +246 -0
- package/knowledge/flagship/cosmic-platform-note.md +15 -0
- package/knowledge/flagship/plugin-lifecycle.md +248 -0
- package/knowledge/flagship/tables.json +159 -0
- package/knowledge/version.json +10 -0
- package/knowledge/xinghan/product-notes.md +15 -0
- package/package.json +71 -0
- package/prompts/kd-discuss.md +11 -0
- package/prompts/kd-execute.md +12 -0
- package/prompts/kd-plan.md +12 -0
- package/prompts/kd-ship.md +12 -0
- package/prompts/kd-spec.md +12 -0
- package/prompts/kd-verify.md +12 -0
- package/skills/kd-check/SKILL.md +26 -0
- package/skills/kd-cosmic-dev/SKILL.md +82 -0
- package/skills/kd-cosmic-review/SKILL.md +90 -0
- package/skills/kd-cosmic-unittest/SKILL.md +92 -0
- package/skills/kd-debug/SKILL.md +30 -0
- package/skills/kd-discuss/SKILL.md +24 -0
- package/skills/kd-execute/SKILL.md +22 -0
- package/skills/kd-gen/SKILL.md +34 -0
- package/skills/kd-ksql/SKILL.md +86 -0
- package/skills/kd-plan/SKILL.md +24 -0
- package/skills/kd-ship/SKILL.md +22 -0
- package/skills/kd-spec/SKILL.md +24 -0
- package/skills/kd-verify/SKILL.md +22 -0
- package/themes/kcode-dark.json +81 -0
- package/vendor/kingdee-skills/cosmic-unittest/SKILL.md +788 -0
- package/vendor/kingdee-skills/cosmic-unittest/author-cache.json +5 -0
- package/vendor/kingdee-skills/cosmic-unittest/cosmic-unittest-skill-overview.html +746 -0
- package/vendor/kingdee-skills/cosmic-unittest/examples/business-test.md +205 -0
- package/vendor/kingdee-skills/cosmic-unittest/examples/common-test.md +257 -0
- package/vendor/kingdee-skills/cosmic-unittest/examples/formplugin-test.md +560 -0
- package/vendor/kingdee-skills/cosmic-unittest/examples/op-plugin-test.md +231 -0
- package/vendor/kingdee-skills/cosmic-unittest/examples/validator-test.md +232 -0
- package/vendor/kingdee-skills/cosmic-unittest/patterns/business-helper.md +184 -0
- package/vendor/kingdee-skills/cosmic-unittest/patterns/common-module.md +355 -0
- package/vendor/kingdee-skills/cosmic-unittest/patterns/convert-plugin.md +130 -0
- package/vendor/kingdee-skills/cosmic-unittest/patterns/formplugin.md +235 -0
- package/vendor/kingdee-skills/cosmic-unittest/patterns/op-plugin.md +226 -0
- package/vendor/kingdee-skills/cosmic-unittest/patterns/validator.md +206 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/SKILL.md +674 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/advanced-scenario-checklist.md +307 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/algox-performance-checklist.md +129 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/coding-standard-checklist.md +491 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/cosmic-api-checklist.md +285 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/data-access-checklist.md +261 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/data-transaction-checklist.md +390 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/domain-logic-checklist.md +295 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/form-plugin-checklist.md +508 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/infra-checklist.md +254 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/ksql-checklist.md +305 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/lifecycle-checklist.md +298 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/operation-plugin-checklist.md +442 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/test-mock-checklist.md +120 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/references/ui-performance-checklist.md +320 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/scripts/pattern-matcher.py +336 -0
- package/vendor/kingdee-skills/kingdee-cosmic-reviewer/scripts/review-score-calculator.py +121 -0
- package/vendor/kingdee-skills/ok-cosmic/CHANGELOG.md +295 -0
- package/vendor/kingdee-skills/ok-cosmic/README.md +460 -0
- package/vendor/kingdee-skills/ok-cosmic/SKILL.md +287 -0
- package/vendor/kingdee-skills/ok-cosmic/agents/openai.yaml +17 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/BatchImportPluginTemplate.java +93 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/BillPlugInTemplate.java +156 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/ConvertPlugInTemplate.java +255 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/FormPluginTemplate.java +597 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/IWorkflowPluginTemplate.java +91 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/ListPluginTemplate.java +194 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/OpPluginTemplate.java +201 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/OpenApiControllerTemplate.java +103 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/PrintPluginTemplate.java +95 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/ReportFormPluginTemplate.java +257 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/ReportListDataPluginTemplate.java +70 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/StandardTreeListPluginTemplate.java +130 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/TaskTemplate.java +80 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/TreeListPluginTemplate.java +152 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/WriteBackPlugInTemplate.java +286 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/attachment/AttachmentUploadBindSample.java +93 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/botp/BotpTracePushSample.java +168 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/botp/SampleConvertPlugin.java +223 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/cache/SampleCacheUsage.java +218 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/concurrent/SampleThreadPoolBatch.java +156 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/data/DynamicObjectCrudSample.java +205 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/data/DynamicObjectOpsSample.java +100 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/BeforeOperationConfirmSample.java +217 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/ConfirmDialogSample.java +131 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/EntryRowCalculateSample.java +116 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/F7FilterSample.java +134 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/GetAndSetValueSample.java +176 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/HyperlinkJumpSample.java +124 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/OpenBillModalSample.java +253 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/ReturnParentDataSample.java +295 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/TreeControlSample.java +140 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/form/ViewControlOpsSample.java +132 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/list/ListPluginBasicSample.java +170 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/list/ListPreOpenFilterSample.java +68 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/message/MessageNotifySample.java +95 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/mq/SampleMQConsumer.java +198 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/mq/sample_mq.xml +15 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/operation/OpAddValidatorsSample.java +137 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/operation/OperationOptionBridgeSample.java +228 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/package-info.java +19 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/query/BaseDataQuerySample.java +194 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/query/BatchQuerySample.java +368 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/query/DataSetQueryStatSample.java +131 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/report/SampleReportFormPlugin.java +179 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/report/SampleReportListDataPlugin.java +616 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/snippets-guide.md +64 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/task/ScheduleTaskSample.java +160 -0
- package/vendor/kingdee-skills/ok-cosmic/assets/snippets/workflow/SampleWorkflowPlugin.java +302 -0
- package/vendor/kingdee-skills/ok-cosmic/manifest.json +78 -0
- package/vendor/kingdee-skills/ok-cosmic/ok-cosmic-intro.html +903 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/attachment-api.md +114 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/botp-convert.md +98 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/dynamic-object.md +113 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/entity-metadata.md +123 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/event-lifecycle.md +184 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/flex-prop.md +114 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/form-utils.md +133 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/operate-chain.md +159 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/plugin-base.md +218 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/query-dataset.md +149 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/request-context.md +88 -0
- package/vendor/kingdee-skills/ok-cosmic/references/adv/view-handler.md +157 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-bill.md +76 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-botp.md +70 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-form.md +165 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-import.md +69 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-list.md +227 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-openapi.md +112 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-operation.md +135 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-print.md +65 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-report-data.md +64 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-report-form.md +90 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-task.md +62 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-tree-list.md +71 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-workflow.md +82 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/plugin/plugin-writeback.md +71 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-algo.md +67 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-cache.md +63 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-dynamic-model-svc.md +82 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-dynamic-object.md +70 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-entity-model.md +61 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-exception.md +64 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-file.md +63 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-id.md +47 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-lock.md +61 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-log.md +63 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-network-control.md +70 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-orm-access.md +78 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-request-context.md +62 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-threadpool.md +63 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-tx.md +64 -0
- package/vendor/kingdee-skills/ok-cosmic/references/base/sdk/sdk-utils.md +67 -0
- package/vendor/kingdee-skills/ok-cosmic/requirements.txt +2 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/a-layer-rules.json +24 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/anti-patterns.md +48 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/cheat-sheet.md +256 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/coding-preferences.md +140 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/constraints.md +61 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/decision-matrix.md +222 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/intent-routing.md +94 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/platform-baseline.md +69 -0
- package/vendor/kingdee-skills/ok-cosmic/rules/post-check.md +109 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/config_loader.py +204 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-api-knowledge.py +910 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-basedata-query.py +359 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-config-check.py +181 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-extpoints-query.py +389 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-form-metadata.py +856 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-post-check.py +262 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/cosmic-post-lint.py +293 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/lint/__init__.py +2 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/lint/base.py +393 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/lint/resource_check.py +176 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/lint/scene_check.py +375 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/lint/style_check.py +434 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/lint/verify_check.py +36 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/route_client.py +186 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/script_utils.py +40 -0
- package/vendor/kingdee-skills/ok-cosmic/scripts/sqlite_cache.py +142 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/cuslib/kd-cd-cosmic-commons.jar +0 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/cuslib/kd-cd-cosmic-features.jar +0 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/ok-cosmic-docs.db +0 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/ok-cosmic.json +13 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/setup-mac.sh +18 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/setup-windows.bat +53 -0
- package/vendor/kingdee-skills/ok-cosmic/setup/setup.jar +0 -0
- package/vendor/kingdee-skills/ok-ksql/SKILL.md +81 -0
- package/vendor/kingdee-skills/ok-ksql/agents/openai.yaml +7 -0
- package/vendor/kingdee-skills/ok-ksql/manifest.json +14 -0
- package/vendor/kingdee-skills/ok-ksql/references/ksql-datafix.md +452 -0
- package/vendor/kingdee-skills/ok-ksql/scripts/ksql_lint.py +363 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-cosmic-dev
|
|
3
|
+
description: 金蝶 Cosmic 体系 Java 插件开发技能,适用于苍穹、星瀚、星空旗舰版和共享 Cosmic 平台。处理表单、单据、列表、操作、转换、任务、工作流、OpenAPI、元数据、DynamicObject、附件、基础资料、SDK 方法签名等 Cosmic 体系开发时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 金蝶 Cosmic 开发
|
|
7
|
+
|
|
8
|
+
当需要为 Cosmic 体系产品实现或修改 Java 代码时使用本技能:
|
|
9
|
+
|
|
10
|
+
- `cosmic`
|
|
11
|
+
- `cangqiong`
|
|
12
|
+
- `xinghan`
|
|
13
|
+
- `flagship`
|
|
14
|
+
|
|
15
|
+
不要把本技能用于金蝶 Enterprise C# 项目。
|
|
16
|
+
|
|
17
|
+
## Harness 前置条件
|
|
18
|
+
|
|
19
|
+
生成或修改代码前:
|
|
20
|
+
|
|
21
|
+
- 先用 `kd_plan_status` 查看当前运行状态。
|
|
22
|
+
- 确认产品画像属于 Cosmic 体系。
|
|
23
|
+
- 执行阶段必须已有 `PLAN.md`。
|
|
24
|
+
- Cosmic 代码生成前必须运行 `kd_cosmic_config`。如果配置检查失败,停止编码并说明缺失配置。
|
|
25
|
+
|
|
26
|
+
在当前运行产物中记录决策和证据:
|
|
27
|
+
|
|
28
|
+
- `.pi/kd/runs/<run-id>/PLAN.md`
|
|
29
|
+
- `.pi/kd/runs/<run-id>/EXECUTION.md`
|
|
30
|
+
- `.pi/kd/runs/<run-id>/evidence/cosmic-config.txt`
|
|
31
|
+
- `.pi/kd/runs/<run-id>/evidence/cosmic-metadata.json`
|
|
32
|
+
- `.pi/kd/runs/<run-id>/evidence/cosmic-api.txt`
|
|
33
|
+
|
|
34
|
+
官方工具会在存在 active run 时自动写入证据;如果没有自动写入,需要把命令、结果摘要和采用原因写进 `EXECUTION.md`。
|
|
35
|
+
|
|
36
|
+
## 开发流程
|
|
37
|
+
|
|
38
|
+
1. 先把需求拆成“时机 + 载体 + 能力”。
|
|
39
|
+
- 时机:生命周期事件、操作阶段、转换阶段、定时任务、API 请求、UI 事件。
|
|
40
|
+
- 载体:表单插件、单据插件、列表插件、操作插件、校验器、转换插件、反写插件、任务、工作流、报表、控制器。
|
|
41
|
+
- 能力:元数据、字段访问、查询保存、基础资料、DynamicObject、附件、权限上下文、消息、集成。
|
|
42
|
+
|
|
43
|
+
2. 依赖平台行为前,先搜索内置知识。
|
|
44
|
+
- 用 `kd_search` 查询生命周期、插件类型、决策矩阵、平台约束、API 模式和审查清单。
|
|
45
|
+
- `kd_table` 只用于已覆盖的内置表结构。Cosmic 数据库字段优先使用官方元数据证据。
|
|
46
|
+
|
|
47
|
+
3. 通过官方适配器验证产品事实。
|
|
48
|
+
- 代码引用字段、表单 ID、单据名称、枚举/下拉值、实体 ID、操作编码、SQL 字段时,使用 `kd_cosmic_metadata`。
|
|
49
|
+
- 类名、方法名、方法签名、继承关系、Override 签名未被内置知识验证时,使用 `kd_cosmic_api`。
|
|
50
|
+
- 多个表单或字段尽量合并到一次元数据查询。
|
|
51
|
+
- 元数据查询和 API 签名查询互不依赖时并行执行。
|
|
52
|
+
|
|
53
|
+
4. 只有插件类型、生命周期方法、字段元数据和 API 签名都明确后,才生成或修改代码。
|
|
54
|
+
- 遵循项目已有包名、基类、常量、日志风格和 helper 封装。
|
|
55
|
+
- 优先使用项目本地封装和已批准的 Cosmic helper,再考虑底层 BOS API。
|
|
56
|
+
- 事件处理器只做当前事件阶段该做的事。
|
|
57
|
+
|
|
58
|
+
5. 验证结果。
|
|
59
|
+
- 对修改的 Java 代码运行 `kd_check`。
|
|
60
|
+
- 条件允许时运行 `kd_build` 或计划中的 Gradle/Maven 命令。
|
|
61
|
+
- 把验证证据写进 `EXECUTION.md`,最终验收交给 `kd-verify`。
|
|
62
|
+
|
|
63
|
+
## 硬性规则
|
|
64
|
+
|
|
65
|
+
- 不臆造字段 key、表单 ID、操作名、枚举值、表名或 SDK 方法。
|
|
66
|
+
- 不把 Enterprise C# 命名空间或生命周期假设用于 Cosmic Java。
|
|
67
|
+
- 不在数据绑定前的初始化阶段操作 UI 控件。
|
|
68
|
+
- 不在平台期望修改入参数据实体的事务钩子里另起保存。
|
|
69
|
+
- 不在循环中查询或保存,除非计划中明确说明无法批量处理并接受风险。
|
|
70
|
+
- 使用参数化查询或平台查询过滤,不拼接用户输入 SQL。
|
|
71
|
+
- 按 SDK 要求关闭 `DataSet` 和其他平台资源。
|
|
72
|
+
- 避免插件类中的不安全静态可变状态。
|
|
73
|
+
|
|
74
|
+
## 输出要求
|
|
75
|
+
|
|
76
|
+
完成执行工作时说明:
|
|
77
|
+
|
|
78
|
+
- 修改了哪些文件。
|
|
79
|
+
- 使用了哪些官方检查:配置、元数据、API。
|
|
80
|
+
- 哪些事实仍无法验证。
|
|
81
|
+
- 验证命令和结果。
|
|
82
|
+
- `EXECUTION.md` 中记录相对 `PLAN.md` 的偏差。
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-cosmic-review
|
|
3
|
+
description: 金蝶 Cosmic 体系 Java 插件和 KSQL 代码审查技能,按官方审查优先级检查代码质量、生命周期、事务、性能、安全、DataSet 泄漏、校验器/操作/表单/列表/转换插件和 KSQL 风险。适用于 Cosmic、苍穹、星瀚、星空旗舰版项目。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 金蝶 Cosmic 审查
|
|
7
|
+
|
|
8
|
+
本技能用于审查 Cosmic 体系 Java 或 KSQL 变更。除非用户明确要求修复,否则只做审查,不直接改代码。
|
|
9
|
+
|
|
10
|
+
不要把本技能用于 Enterprise C# 代码;Enterprise 使用通用金蝶检查流程。
|
|
11
|
+
|
|
12
|
+
## 审查输入
|
|
13
|
+
|
|
14
|
+
优先审查用户明确指定的文件。若用户要求整体审查,在可用时检查 active run 和变更的 Java/SQL 文件。
|
|
15
|
+
|
|
16
|
+
审查前:
|
|
17
|
+
|
|
18
|
+
- 存在 harness run 时,先用 `kd_plan_status` 查看产品画像。
|
|
19
|
+
- 用 `kd_search` 查询 Cosmic 审查清单、生命周期、平台约束、KSQL 和单测指导。
|
|
20
|
+
- SDK 签名或生命周期方法不确定时,用 `kd_cosmic_api` 验证。
|
|
21
|
+
- 变更中用到字段、操作、枚举值、表名、数据库列时,用 `kd_cosmic_metadata` 验证。
|
|
22
|
+
- 先运行 `kd_check` 做基础静态检查,再按下方清单深入审查。
|
|
23
|
+
- 对新增或修改的 SQL/KSQL 文件运行 `kd_ksql_lint`。
|
|
24
|
+
|
|
25
|
+
## 严重级别
|
|
26
|
+
|
|
27
|
+
- P0:阻断问题,可能导致崩溃、数据损坏、事务失效、安全暴露、严重资源泄漏或核心功能不可用。
|
|
28
|
+
- P1:高风险问题,可能影响生产性能、稳定性、扩展性或可维护性。
|
|
29
|
+
- P2:规范和可维护性问题,建议在合适时机修复。
|
|
30
|
+
|
|
31
|
+
## P0 重点
|
|
32
|
+
|
|
33
|
+
重点检查:
|
|
34
|
+
|
|
35
|
+
- 监听注册或 UI 操作放在错误生命周期阶段。
|
|
36
|
+
- 在事务钩子中独立 `save` 或 `update`,而不是修改平台传入的数据实体。
|
|
37
|
+
- `DataSet` 未使用 try-with-resources 或等价方式关闭。
|
|
38
|
+
- 校验器或操作插件使用字段但未声明预加载属性。
|
|
39
|
+
- 循环内数据库调用、服务保存或远程调用。
|
|
40
|
+
- 硬编码组织、用户、部门、账套、URL、密钥、账号密码等环境相关值。
|
|
41
|
+
- SQL 拼接、原生 `Statement`、用户输入未参数化、XML 外部实体风险。
|
|
42
|
+
- 在事件参数类型不支持的阶段调用不存在的 API。
|
|
43
|
+
- 嵌套 `DynamicObject` 访问缺少必要空值保护。
|
|
44
|
+
|
|
45
|
+
## P1 重点
|
|
46
|
+
|
|
47
|
+
重点检查:
|
|
48
|
+
|
|
49
|
+
- 循环内 `updateView`、`getFieldIndex`、元数据查询或高成本序列化。
|
|
50
|
+
- 查询缺少过滤条件、大结果集、字段路径过深。
|
|
51
|
+
- 大分录更新使用低效 UI model API,而不是批量或属性级 API。
|
|
52
|
+
- 无界集合、缓存 key 缺少账套隔离、绕过平台的原生线程。
|
|
53
|
+
- HTTP 或第三方调用缺少超时。
|
|
54
|
+
- 可批量处理的 SDK 调用被重复逐条调用。
|
|
55
|
+
|
|
56
|
+
## P2 重点
|
|
57
|
+
|
|
58
|
+
重点检查:
|
|
59
|
+
|
|
60
|
+
- 应抽常量的魔法值。
|
|
61
|
+
- 面向用户的中文提示未按项目规范走资源管理。
|
|
62
|
+
- 空 catch、丢失异常 cause、`printStackTrace`、日志缺少堆栈。
|
|
63
|
+
- 类名或方法名与插件类型不一致。
|
|
64
|
+
- 项目规范要求的 public 方法注释缺失。
|
|
65
|
+
|
|
66
|
+
## 误报规避
|
|
67
|
+
|
|
68
|
+
- 固定业务元数据 ID,如 formId、appId、billTypeId、枚举编码,不按环境硬编码处理。
|
|
69
|
+
- 中文注释和内部日志不按国际化问题处理。
|
|
70
|
+
- 不机械判定 `DynamicObject.getString`、`getLong`、`getBigDecimal` 的 null 检查,要结合字段可空性和平台行为。
|
|
71
|
+
- 注释中的代码不作为活动代码审查。
|
|
72
|
+
- 单元测试里的测试数据常量不按生产硬编码处理。
|
|
73
|
+
|
|
74
|
+
## 输出格式
|
|
75
|
+
|
|
76
|
+
先输出发现项,按严重级别排序。每个发现项包含:
|
|
77
|
+
|
|
78
|
+
- 级别:P0、P1 或 P2。
|
|
79
|
+
- 文件和行号。
|
|
80
|
+
- 具体问题。
|
|
81
|
+
- 为什么在 Cosmic 中有风险。
|
|
82
|
+
- 修复建议。
|
|
83
|
+
|
|
84
|
+
随后说明:
|
|
85
|
+
|
|
86
|
+
- 已运行和未运行的检查。
|
|
87
|
+
- 已验证的产品、元数据和 API 事实。
|
|
88
|
+
- 剩余风险或缺失上下文。
|
|
89
|
+
|
|
90
|
+
如果没有发现问题,明确说明未发现问题,并列出剩余测试或证据缺口。
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-cosmic-unittest
|
|
3
|
+
description: 金蝶 Cosmic 体系 Java 单元测试生成和审查技能,适用于 common、business、opplugin、formplugin 四工程结构。用户要求编写、补充、修复或审查苍穹、星瀚、星空旗舰版、共享 Cosmic Java 单测时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 金蝶 Cosmic 单元测试
|
|
7
|
+
|
|
8
|
+
本技能用于 Cosmic 体系 Java 模块的单元测试工作。
|
|
9
|
+
|
|
10
|
+
常见模块结构:
|
|
11
|
+
|
|
12
|
+
- `<module>-common`
|
|
13
|
+
- `<module>-business`
|
|
14
|
+
- `<module>-opplugin`
|
|
15
|
+
- `<module>-formplugin`
|
|
16
|
+
|
|
17
|
+
不要把本技能用于 Enterprise C# 测试。
|
|
18
|
+
|
|
19
|
+
## 前置条件
|
|
20
|
+
|
|
21
|
+
编写测试前:
|
|
22
|
+
|
|
23
|
+
- 确认产品属于 Cosmic 体系。
|
|
24
|
+
- 从文件路径和包名识别目标工程类型。
|
|
25
|
+
- 阅读被测类和最近的测试基类。
|
|
26
|
+
- 新增测试风格前,先搜索同模块同包下已有测试。
|
|
27
|
+
- 用 `kd_search` 查询 Cosmic 单测指导和模块测试模式。
|
|
28
|
+
- 仅在测试或被测代码使用的 SDK 方法签名不确定时,使用 `kd_cosmic_api`。
|
|
29
|
+
|
|
30
|
+
## 测试模式选择
|
|
31
|
+
|
|
32
|
+
选择一种模式:
|
|
33
|
+
|
|
34
|
+
- common POJO/DTO:直接实例化,测试 getter、setter、构造方法和简单转换。
|
|
35
|
+
- common 枚举:测试查找方法、匹配逻辑、未知值和空值处理。
|
|
36
|
+
- common 工具类:测试静态方法,隔离平台依赖。
|
|
37
|
+
- business helper:mock 静态服务 helper,验证返回值或副作用。
|
|
38
|
+
- Validator:准备必需属性,执行校验,断言收集到的校验消息。
|
|
39
|
+
- 操作插件:验证属性准备、事务阶段行为和操作结果处理。
|
|
40
|
+
- 转换插件:验证源单到目标单映射、空值和默认值。
|
|
41
|
+
- 表单/列表/单据插件:使用模块 `BasePluginTest` 或既有 formplugin 测试模式,验证 model/view 交互。
|
|
42
|
+
|
|
43
|
+
## 编码前分析
|
|
44
|
+
|
|
45
|
+
非平凡类在改代码前先摘要:
|
|
46
|
+
|
|
47
|
+
- 被测类和模块类型。
|
|
48
|
+
- 被测 public/protected 方法。
|
|
49
|
+
- 分支、switch case 和边界值。
|
|
50
|
+
- 需要 mock 的静态 helper 和平台服务。
|
|
51
|
+
- 需要构造的 `DynamicObject` 字段和集合结构。
|
|
52
|
+
- 被测代码中应由测试暴露而不是绕过的 bug。
|
|
53
|
+
|
|
54
|
+
POJO 或简单枚举场景可以简要说明后直接实现。
|
|
55
|
+
|
|
56
|
+
## 测试质量规则
|
|
57
|
+
|
|
58
|
+
- 使用项目已有 JUnit 和 Mockito 版本。
|
|
59
|
+
- import 保持显式;项目风格允许时也不要使用宽泛静态通配导入。
|
|
60
|
+
- 每个测试方法必须有真实断言或交互验证。
|
|
61
|
+
- 避免 `assertTrue(true)`、`assertEquals(x, x)` 或只执行不验证的测试。
|
|
62
|
+
- 每个 `switch` case 默认拆成独立测试方法,除非本地惯例明显不同。
|
|
63
|
+
- 覆盖有意义的 `if/else` 组合和比较运算边界值。
|
|
64
|
+
- 缺失常量或枚举时,不用猜测字面值替代。先搜索来源;找不到就让用户补充。
|
|
65
|
+
- 关闭所有 `MockedStatic` 和构造函数 mock。
|
|
66
|
+
- 不重复声明测试基类已经管理的静态 mock。
|
|
67
|
+
|
|
68
|
+
## Cosmic Mock 注意点
|
|
69
|
+
|
|
70
|
+
- 优先使用项目已有 `DynamicObjectMocker`、`CommonMockObject`、`BaseTest`、`BasePluginTest`。
|
|
71
|
+
- `DataSet` 和查询行只 mock 实际 select 并读取的字段。
|
|
72
|
+
- 查询别名里包含点号时,如果平台 mocker 无法安全表示,使用 mock 的 `DynamicObject`。
|
|
73
|
+
- 对 `kd.bos.db.DB`,遵循项目已有 Class defrost 后再静态 mock 的模式。
|
|
74
|
+
- 对带分布式缓存行为的 helper,先搜索已有测试中的专用 mock helper,不直接 `mockStatic`。
|
|
75
|
+
|
|
76
|
+
## 验证
|
|
77
|
+
|
|
78
|
+
写完测试后:
|
|
79
|
+
|
|
80
|
+
- 使用 `kd_build` 或计划中的命令运行最窄可行 Gradle test 任务。
|
|
81
|
+
- 如果本机缺少业务 jar 或本地配置导致 Gradle 不能运行,明确说明原因,并给出用户应在 IDE 中运行的准确任务。
|
|
82
|
+
- 存在 harness run 时,把测试文件和验证结果写入 `.pi/kd/runs/<run-id>/EXECUTION.md`。
|
|
83
|
+
|
|
84
|
+
## 输出要求
|
|
85
|
+
|
|
86
|
+
说明:
|
|
87
|
+
|
|
88
|
+
- 创建或修改的测试文件。
|
|
89
|
+
- 覆盖的场景。
|
|
90
|
+
- 引入的 mock。
|
|
91
|
+
- 发现的被测代码 bug。
|
|
92
|
+
- 验证命令和结果。
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-debug
|
|
3
|
+
description: Debug Kingdee plugin issues using logs, stack traces, metadata assumptions, SDK lifecycle knowledge, and verification feedback.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kingdee Debug
|
|
7
|
+
|
|
8
|
+
Use this skill when analyzing Kingdee runtime, build, or plugin behavior failures.
|
|
9
|
+
|
|
10
|
+
Analysis approach:
|
|
11
|
+
|
|
12
|
+
- Identify whether the issue is business exception, SDK lifecycle misuse, metadata/configuration, permission, database, integration, or environment.
|
|
13
|
+
- Trace stack frames to the first project-owned plugin or service class.
|
|
14
|
+
- Check common Kingdee causes:
|
|
15
|
+
- missing or incorrect field mapping in metadata
|
|
16
|
+
- wrong operation type or lifecycle hook
|
|
17
|
+
- bill/entity/form mismatch
|
|
18
|
+
- database timeout or connection issue
|
|
19
|
+
- permission or authorization failure
|
|
20
|
+
- null dynamic object or missing entry rows
|
|
21
|
+
- repeated DB calls in loops causing slow saves/submits
|
|
22
|
+
- Use `kd_search` for uncertain SDK behavior and `kd_table` for table assumptions.
|
|
23
|
+
|
|
24
|
+
Output expectations:
|
|
25
|
+
|
|
26
|
+
- State the likely root cause and confidence level.
|
|
27
|
+
- Provide the next concrete inspection step.
|
|
28
|
+
- Suggest a minimal fix, then verification evidence needed to prove it.
|
|
29
|
+
- If evidence is insufficient, say exactly what log, stack trace, metadata, or code file is missing.
|
|
30
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-discuss
|
|
3
|
+
description: Kingdee Harness Engineering discussion phase for capturing business intent, boundaries, product profile, plugin type, and open questions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kingdee Discuss Phase
|
|
7
|
+
|
|
8
|
+
Use this skill when starting or refining a Kingdee development task.
|
|
9
|
+
|
|
10
|
+
Goal:
|
|
11
|
+
|
|
12
|
+
- Capture the business goal.
|
|
13
|
+
- Identify Kingdee product, version, and tech stack: Cosmic-family Java for Cangqiong/Xinghan/Xingkong Flagship, or enterprise C#.
|
|
14
|
+
- Identify plugin type, lifecycle event, bill/entity/form, and data fields when known.
|
|
15
|
+
- Record out-of-scope items and unresolved questions.
|
|
16
|
+
- Write or update `.pi/kd/runs/<run-id>/CONTEXT.md`.
|
|
17
|
+
|
|
18
|
+
Rules:
|
|
19
|
+
|
|
20
|
+
- Do not propose implementation before the context is clear.
|
|
21
|
+
- Do not invent SDK APIs, table names, or lifecycle methods.
|
|
22
|
+
- If the product/version, tech stack, or target object is unknown, mark it as an open question.
|
|
23
|
+
- Never apply enterprise C# rules to Java products, or Java/Cosmic plugin rules to enterprise C#.
|
|
24
|
+
- Keep context concise; detailed design belongs in `SPEC.md`.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-execute
|
|
3
|
+
description: Kingdee Harness Engineering execution phase for making planned code changes under gates and recording deviations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kingdee Execute Phase
|
|
7
|
+
|
|
8
|
+
Use this skill only after `PLAN.md` exists.
|
|
9
|
+
|
|
10
|
+
Goal:
|
|
11
|
+
|
|
12
|
+
- Implement only the approved plan.
|
|
13
|
+
- Use `kd_search` and `kd_table` before relying on Kingdee APIs or table schemas.
|
|
14
|
+
- Update `.pi/kd/runs/<run-id>/EXECUTION.md` with completed steps, changed files, and deviations.
|
|
15
|
+
|
|
16
|
+
Rules:
|
|
17
|
+
|
|
18
|
+
- Do not broaden scope silently.
|
|
19
|
+
- Do not rewrite unrelated modules.
|
|
20
|
+
- Do not mark work complete until verification runs.
|
|
21
|
+
- If implementation needs a plan change, update `PLAN.md` first.
|
|
22
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-gen
|
|
3
|
+
description: Generate Kingdee product-specific Java/C# plugin code using verified SDK patterns and the active harness plan.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kingdee Code Generation
|
|
7
|
+
|
|
8
|
+
Use this skill when generating Kingdee product-specific plugin code.
|
|
9
|
+
|
|
10
|
+
Inputs to establish before coding:
|
|
11
|
+
|
|
12
|
+
- Kingdee product, version, and tech stack.
|
|
13
|
+
- Plugin type and correct base class.
|
|
14
|
+
- Target bill/entity/form and lifecycle event.
|
|
15
|
+
- Business rule and acceptance criteria.
|
|
16
|
+
- Relevant SDK/table facts from `kd_search` or `kd_table`.
|
|
17
|
+
|
|
18
|
+
Rules:
|
|
19
|
+
|
|
20
|
+
- Generate code only after the active run has a `PLAN.md`.
|
|
21
|
+
- Use the correct base class only when verified for the target product family.
|
|
22
|
+
- Use `kd.bos.*` style packages for Cosmic-family Java code and `Kingdee.BOS.*` style namespaces for enterprise C# code.
|
|
23
|
+
- Do not reuse Cosmic/Xinghan/Cangqiong APIs for enterprise C#.
|
|
24
|
+
- Do not reuse enterprise C# namespaces or lifecycle assumptions for Java products.
|
|
25
|
+
- Add Chinese comments only for business logic or non-obvious Kingdee lifecycle behavior.
|
|
26
|
+
- Handle exceptions with logging or business exceptions; do not leave empty catch blocks.
|
|
27
|
+
- Avoid magic values; promote status values, field keys, operation codes, and table names to constants.
|
|
28
|
+
- Avoid database calls inside loops.
|
|
29
|
+
|
|
30
|
+
Output expectations:
|
|
31
|
+
|
|
32
|
+
- Keep code changes scoped to the plan.
|
|
33
|
+
- Update `.pi/kd/runs/<run-id>/EXECUTION.md` with changed files and any deviations.
|
|
34
|
+
- Do not claim completion until `kd-verify` has collected evidence.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-ksql
|
|
3
|
+
description: 金蝶 Cosmic 体系 KSQL/SQL 数据修复脚本生成、审查和验证技能。适用于数据修复、批量更新、字段回填、影响范围查询、备份、回滚、元数据确认表字段映射、SQL lint 证据等苍穹、星瀚、星空旗舰版场景。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 金蝶 KSQL 数据修复
|
|
7
|
+
|
|
8
|
+
本技能用于 Cosmic 体系 SQL/KSQL 数据修复工作。它产出数据库脚本,不生成 Java 插件代码。
|
|
9
|
+
|
|
10
|
+
不要把本技能用于 Enterprise C# 技术栈假设或非 Cosmic 表结构映射。
|
|
11
|
+
|
|
12
|
+
## 前置条件
|
|
13
|
+
|
|
14
|
+
生成最终 SQL 前:
|
|
15
|
+
|
|
16
|
+
- 确认产品属于 Cosmic 体系。
|
|
17
|
+
- 运行 `kd_cosmic_config`,或使用已有成功配置证据。
|
|
18
|
+
- 使用带 SQL 信息的 `kd_cosmic_metadata` 验证表单 ID、单据名称、表名、字段数据库名、字段类型、枚举/下拉值、基础资料落库字段、`dbKey` 和 `dbName`。
|
|
19
|
+
- 表、字段、枚举或数据库路由事实未验证时,停止并列出待确认项。
|
|
20
|
+
- 多张表的 `dbName` 不一致时,不生成普通跨库更新 SQL;先让用户确认跨库处理策略。
|
|
21
|
+
|
|
22
|
+
## 确认卡片
|
|
23
|
+
|
|
24
|
+
最终 SQL 前提供确认卡片:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
意图:<业务目标>
|
|
28
|
+
产品:<Cosmic 体系产品>
|
|
29
|
+
对象:<表单/单据/基础资料>
|
|
30
|
+
元数据:已确认 / 待确认
|
|
31
|
+
表:已确认 / 待确认
|
|
32
|
+
字段:已确认 / 待确认
|
|
33
|
+
数据库路由:单库 / 跨库 / 待确认
|
|
34
|
+
影响范围查询:已确认 / 待确认
|
|
35
|
+
备份:已确认 / 待确认
|
|
36
|
+
更新:已确认 / 待确认
|
|
37
|
+
验证:已确认 / 待确认
|
|
38
|
+
回滚:已确认 / 待确认
|
|
39
|
+
Lint:已通过 / 待执行
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
只有所有必需项都已确认,才生成最终 SQL。
|
|
43
|
+
|
|
44
|
+
## 脚本结构
|
|
45
|
+
|
|
46
|
+
最终 SQL 应包含:
|
|
47
|
+
|
|
48
|
+
1. 文件头:目的、产品、元数据来源、时间戳和执行提醒。
|
|
49
|
+
2. 影响范围查询。
|
|
50
|
+
3. 整表备份:`SELECT * INTO bak_<table>_<yyyyMMddHHmm>`。
|
|
51
|
+
4. 与更新范围一致的更新前确认查询。
|
|
52
|
+
5. 正式更新语句。
|
|
53
|
+
6. 更新后验证查询。
|
|
54
|
+
7. 回滚语句。
|
|
55
|
+
8. 来自元数据证据的字段映射摘要。
|
|
56
|
+
|
|
57
|
+
默认使用 PostgreSQL 语法,除非用户明确指定其他数据库方言。
|
|
58
|
+
|
|
59
|
+
## 安全规则
|
|
60
|
+
|
|
61
|
+
- 不生成无 `WHERE` 的 `UPDATE` 或 `DELETE`。
|
|
62
|
+
- 除整表备份外,不使用 `SELECT *`。
|
|
63
|
+
- 影响范围、更新前检查、更新、验证和回滚的范围保持一致。
|
|
64
|
+
- 语义等价时优先使用可读的 `IN` 成员条件。
|
|
65
|
+
- 空值判断使用 `IS NULL` 和 `IS NOT NULL`。
|
|
66
|
+
- 避免 drop、rename 等破坏性结构变更;除非用户明确要求并记录风险。
|
|
67
|
+
- 数据更新前先做整表备份。
|
|
68
|
+
- 备份表名和输出文件名使用同一个时间戳。
|
|
69
|
+
|
|
70
|
+
## Lint 和证据
|
|
71
|
+
|
|
72
|
+
创建 SQL 文件后:
|
|
73
|
+
|
|
74
|
+
- 对文件运行 `kd_ksql_lint`。
|
|
75
|
+
- 交付前必须修复 lint `ERROR`。
|
|
76
|
+
- 对剩余 `WARN` 说明保留原因。
|
|
77
|
+
- lint 结果写入 `.pi/kd/runs/<run-id>/evidence/ksql-lint.txt`;没有自动 evidence 时写进 `EXECUTION.md`。
|
|
78
|
+
|
|
79
|
+
## 输出要求
|
|
80
|
+
|
|
81
|
+
交付时说明:
|
|
82
|
+
|
|
83
|
+
- SQL 文件路径。
|
|
84
|
+
- 使用的元数据来源。
|
|
85
|
+
- lint 状态。
|
|
86
|
+
- 执行前还需要人工确认的事项。
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-plan
|
|
3
|
+
description: Kingdee Harness Engineering planning phase for file inspection, implementation steps, SDK lookup, validation commands, and rollback notes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kingdee Plan Phase
|
|
7
|
+
|
|
8
|
+
Use this skill after `SPEC.md` exists.
|
|
9
|
+
|
|
10
|
+
Goal:
|
|
11
|
+
|
|
12
|
+
- Produce or update `.pi/kd/runs/<run-id>/PLAN.md`.
|
|
13
|
+
- List files to inspect before editing.
|
|
14
|
+
- List expected files to modify.
|
|
15
|
+
- List required `kd_search` and `kd_table` lookups.
|
|
16
|
+
- Define validation commands and expected evidence.
|
|
17
|
+
- Add rollback or containment notes for medium/high risk work.
|
|
18
|
+
|
|
19
|
+
Gate:
|
|
20
|
+
|
|
21
|
+
- Execution must not start without `PLAN.md`.
|
|
22
|
+
- A plan without validation commands is incomplete.
|
|
23
|
+
- A plan that relies on unverified Kingdee API names is incomplete.
|
|
24
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-ship
|
|
3
|
+
description: Kingdee Harness Engineering ship phase for summarizing changes, evidence, risks, and handoff notes.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kingdee Ship Phase
|
|
7
|
+
|
|
8
|
+
Use this skill only after `VERIFY.md` exists.
|
|
9
|
+
|
|
10
|
+
Goal:
|
|
11
|
+
|
|
12
|
+
- Produce `.pi/kd/runs/<run-id>/SHIP.md`.
|
|
13
|
+
- Summarize changed files and behavior.
|
|
14
|
+
- Link verification evidence.
|
|
15
|
+
- List known risks and follow-up tasks.
|
|
16
|
+
|
|
17
|
+
Rules:
|
|
18
|
+
|
|
19
|
+
- Do not claim completion without verification evidence.
|
|
20
|
+
- Keep the handoff concise and decision-oriented.
|
|
21
|
+
- If verification is partial, say so clearly.
|
|
22
|
+
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-spec
|
|
3
|
+
description: Kingdee Harness Engineering specification phase for acceptance criteria, lifecycle hooks, data objects, constraints, and risks.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kingdee Spec Phase
|
|
7
|
+
|
|
8
|
+
Use this skill after `CONTEXT.md` exists.
|
|
9
|
+
|
|
10
|
+
Goal:
|
|
11
|
+
|
|
12
|
+
- Produce or update `.pi/kd/runs/<run-id>/SPEC.md`.
|
|
13
|
+
- Define acceptance criteria.
|
|
14
|
+
- Define target lifecycle event or extension point.
|
|
15
|
+
- List data objects, fields, table assumptions, and SDK assumptions.
|
|
16
|
+
- Capture exception behavior, performance constraints, and risk level.
|
|
17
|
+
|
|
18
|
+
Rules:
|
|
19
|
+
|
|
20
|
+
- Separate confirmed facts from assumptions.
|
|
21
|
+
- Mark every API/table assumption as requiring lookup with `kd_search` or `kd_table`.
|
|
22
|
+
- Do not edit product code in this phase.
|
|
23
|
+
- If acceptance criteria are vague, ask targeted questions or state explicit assumptions.
|
|
24
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: kd-verify
|
|
3
|
+
description: Kingdee Harness Engineering verification phase for build, tests, checks, UAT evidence, and residual risk.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Kingdee Verify Phase
|
|
7
|
+
|
|
8
|
+
Use this skill after implementation.
|
|
9
|
+
|
|
10
|
+
Goal:
|
|
11
|
+
|
|
12
|
+
- Run planned validation commands.
|
|
13
|
+
- Run `kd_check` when code is available.
|
|
14
|
+
- Collect evidence into `.pi/kd/runs/<run-id>/VERIFY.md`.
|
|
15
|
+
- Record failures, fixes, skipped checks, and residual risk.
|
|
16
|
+
|
|
17
|
+
Rules:
|
|
18
|
+
|
|
19
|
+
- Passing unit tests is not enough if acceptance criteria require workflow behavior.
|
|
20
|
+
- If validation cannot run, state the exact blocker.
|
|
21
|
+
- Do not ship while verification evidence is missing.
|
|
22
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/earendil-works/pi/main/packages/coding-agent/src/modes/interactive/theme/theme-schema.json",
|
|
3
|
+
"name": "kcode-dark",
|
|
4
|
+
"vars": {
|
|
5
|
+
"text": "#d7dde3",
|
|
6
|
+
"cyan": "#23b8c7",
|
|
7
|
+
"blue": "#4f7fcf",
|
|
8
|
+
"green": "#6dbb76",
|
|
9
|
+
"red": "#d66a6a",
|
|
10
|
+
"yellow": "#d6b45f",
|
|
11
|
+
"gray": "#8b949e",
|
|
12
|
+
"dimGray": "#5f6872",
|
|
13
|
+
"darkGray": "#39414a",
|
|
14
|
+
"accent": "#2fb7a2",
|
|
15
|
+
"selectedBg": "#23343a",
|
|
16
|
+
"userMsgBg": "#1f2a30",
|
|
17
|
+
"toolPendingBg": "#202833",
|
|
18
|
+
"toolSuccessBg": "#1f3026",
|
|
19
|
+
"toolErrorBg": "#332326",
|
|
20
|
+
"customMsgBg": "#242d38"
|
|
21
|
+
},
|
|
22
|
+
"colors": {
|
|
23
|
+
"accent": "accent",
|
|
24
|
+
"border": "blue",
|
|
25
|
+
"borderAccent": "accent",
|
|
26
|
+
"borderMuted": "darkGray",
|
|
27
|
+
"success": "green",
|
|
28
|
+
"error": "red",
|
|
29
|
+
"warning": "yellow",
|
|
30
|
+
"muted": "gray",
|
|
31
|
+
"dim": "dimGray",
|
|
32
|
+
"text": "text",
|
|
33
|
+
"thinkingText": "gray",
|
|
34
|
+
"selectedBg": "selectedBg",
|
|
35
|
+
"userMessageBg": "userMsgBg",
|
|
36
|
+
"userMessageText": "text",
|
|
37
|
+
"customMessageBg": "customMsgBg",
|
|
38
|
+
"customMessageText": "text",
|
|
39
|
+
"customMessageLabel": "accent",
|
|
40
|
+
"toolPendingBg": "toolPendingBg",
|
|
41
|
+
"toolSuccessBg": "toolSuccessBg",
|
|
42
|
+
"toolErrorBg": "toolErrorBg",
|
|
43
|
+
"toolTitle": "text",
|
|
44
|
+
"toolOutput": "gray",
|
|
45
|
+
"mdHeading": "accent",
|
|
46
|
+
"mdLink": "blue",
|
|
47
|
+
"mdLinkUrl": "dimGray",
|
|
48
|
+
"mdCode": "cyan",
|
|
49
|
+
"mdCodeBlock": "green",
|
|
50
|
+
"mdCodeBlockBorder": "darkGray",
|
|
51
|
+
"mdQuote": "gray",
|
|
52
|
+
"mdQuoteBorder": "darkGray",
|
|
53
|
+
"mdHr": "darkGray",
|
|
54
|
+
"mdListBullet": "accent",
|
|
55
|
+
"toolDiffAdded": "green",
|
|
56
|
+
"toolDiffRemoved": "red",
|
|
57
|
+
"toolDiffContext": "gray",
|
|
58
|
+
"syntaxComment": "#6A9955",
|
|
59
|
+
"syntaxKeyword": "#569CD6",
|
|
60
|
+
"syntaxFunction": "#DCDCAA",
|
|
61
|
+
"syntaxVariable": "#9CDCFE",
|
|
62
|
+
"syntaxString": "#CE9178",
|
|
63
|
+
"syntaxNumber": "#B5CEA8",
|
|
64
|
+
"syntaxType": "#4EC9B0",
|
|
65
|
+
"syntaxOperator": "#D4D4D4",
|
|
66
|
+
"syntaxPunctuation": "#D4D4D4",
|
|
67
|
+
"thinkingOff": "darkGray",
|
|
68
|
+
"thinkingMinimal": "dimGray",
|
|
69
|
+
"thinkingLow": "blue",
|
|
70
|
+
"thinkingMedium": "cyan",
|
|
71
|
+
"thinkingHigh": "accent",
|
|
72
|
+
"thinkingXhigh": "#d183e8",
|
|
73
|
+
"bashMode": "green"
|
|
74
|
+
},
|
|
75
|
+
"export": {
|
|
76
|
+
"pageBg": "#14191f",
|
|
77
|
+
"cardBg": "#1b222a",
|
|
78
|
+
"infoBg": "#272f35"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|