@huaqiu/dsh-kicad 0.6.22 → 0.6.24
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
CHANGED
|
@@ -54,6 +54,15 @@ retry), `UNAVAILABLE` (KiCad unreachable — retry once after checking the envir
|
|
|
54
54
|
|
|
55
55
|
### Skills
|
|
56
56
|
|
|
57
|
+
**`skills/pcb-copper-pour/`** — create or refill copper zones using the existing
|
|
58
|
+
KiCad IPC tools. It distinguishes existing-zone refills from new pours, checks
|
|
59
|
+
explicit nets, enabled layers and actual board boundaries, and handles duplicate
|
|
60
|
+
requests and partial outcomes. It does not invent settings the tools cannot
|
|
61
|
+
express, guess double-sided GND, or substitute a bounding rectangle for an
|
|
62
|
+
irregular board. Load `references/common-cases.md` for the relevant cases.
|
|
63
|
+
For routing followed by pouring, wait for routing and safe cleanup before any
|
|
64
|
+
further board mutation. No automatic save.
|
|
65
|
+
|
|
57
66
|
Every directory under `skills/` is registered as a DSH skill, so one installation
|
|
58
67
|
delivers the operating guidance along with the tools. Each is progressive-disclosure:
|
|
59
68
|
the agent reads `SKILL.md` first and opens `references/` only when the task needs it.
|
package/lib/index.mjs
CHANGED
|
@@ -132,6 +132,11 @@ const KICAD_SKILLS = {
|
|
|
132
132
|
summary: "Turn a market need into verifiable hardware requirements: clarify them through staged questioning and write the market MRD, the hardware PRD and the schematic/PCB design inputs. Use when defining requirements for a new board project.",
|
|
133
133
|
ownsScripts: false
|
|
134
134
|
},
|
|
135
|
+
"pcb-copper-pour": {
|
|
136
|
+
id: "pcb-copper-pour",
|
|
137
|
+
summary: "Create or refill PCB copper zones through KiCad IPC with explicit nets, layers and scope.",
|
|
138
|
+
ownsScripts: false
|
|
139
|
+
},
|
|
135
140
|
"pcb-initial-placement": {
|
|
136
141
|
id: "pcb-initial-placement",
|
|
137
142
|
summary: "Produce a Phase-1 initial placement for a KiCad PCB that has a netlist but no layout yet: functional clustering, anchor placement, zone partitioning, overlap-free packing and a handover report; prefer applying the result to the open board through the KiCad IPC API, falling back to an offline board file only when IPC is unavailable. Suited to 20–200 components on a single, mostly single-sided board.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@huaqiu/dsh-kicad",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.24",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/index.mjs",
|
|
6
6
|
"types": "./lib/index.d.mts",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@deepseek-ai/dsh-tools": "^0.2.1-rc.2"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@huaqiu/dsh-plugin-log": "0.6.
|
|
25
|
+
"@huaqiu/dsh-plugin-log": "0.6.24"
|
|
26
26
|
},
|
|
27
27
|
"files": [
|
|
28
28
|
"lib",
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: pcb-copper-pour
|
|
3
|
+
description: "在 KiCad 当前 PCB 中创建或填充铜区;适用于铺地铜、指定网络和铜层铺铜、重新填充,以及自动布线后的铺铜。检查已有铜区与实际板框,复用 KiCad IPC 工具,不猜测网络、铜层或异形边界。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# PCB 铺铜
|
|
7
|
+
|
|
8
|
+
目标是在当前板子上完成用户要求的铜区创建或填充,并报告已确认的结果。使用 `dsh-kicad` 的 KiCad IPC 能力;不把 FreeRouting 的走线完成当作铺铜完成。
|
|
9
|
+
|
|
10
|
+
## 工具与边界
|
|
11
|
+
|
|
12
|
+
- 先加载 `kicad-ipc` 技能,遵循其连接、读取、事务与验证方法;先通过 `kicad_ipc_diagnose` 确认当前 PCB。诊断本身不提供完整板框和铜区清单;需要时按该技能的公开 `kipy` 接口在会话工作区编写只读检查脚本,不修改随包模板。
|
|
13
|
+
- `kicad_pcb_create_copper_zone` 接收已存在的 `net`、启用的 `layer` 和按顺序排列的毫米坐标 `points`,只创建未填充多边形。它不提供板框自动内缩、孔洞、圆弧、热焊盘、优先级或间距参数;不能虚构参数,也不能声称这些设置已生效。
|
|
14
|
+
- `kicad_pcb_refill_zones` 填充当前板上的已有区域,不是仅填充本次新建的区域。工具完成通知不是完整连通性或设计规则检查结论。
|
|
15
|
+
- 写入串行执行;与布线互斥。用户同时要求布线和铺铜时,等待布线及其收尾实际结束,再重新读取板子。未知写板结果或未释放占用时,不继续写入。
|
|
16
|
+
- 所有工具使用 `save:false`,除非用户明确要求保存。填充失败保留原有走线和已确认创建的铜区;不要为了重试重新创建或清空板子。
|
|
17
|
+
|
|
18
|
+
## 选择操作
|
|
19
|
+
|
|
20
|
+
1. 读取当前板名、启用铜层、精确网络名、已有铜区的 UUID/网络/层/边界,以及实际板框和内部挖空。不能用磁盘中的旧 PCB 代替编辑器内的未保存状态。
|
|
21
|
+
2. 用户只要求重新填充且板上已有铜区时,直接填充;无铜区则说明缺少铜区,转到创建需求。已有匹配铜区时优先复用,不因重复请求叠加相同铜区。
|
|
22
|
+
3. 创建前确定网络、铜层和范围。沿用本轮已明确的设计要求;“铺铜”“布线并铺铜”不自动代表双面 GND、整板或内缩 0.5 mm。对影响结果的缺失项一次简短询问;网名不存在时报告候选,不新建网络或把 AGND/DGND/PGND 自动合并。
|
|
23
|
+
4. 多层板仅操作用户指定且启用的铜层。已有不同网络、重叠区域、锁定区域或分割电源时,保留原设置;需要改变优先级、间距或已有区域时,先核对所需公开 API 和精确作用范围。常见分支见 [references/common-cases.md](references/common-cases.md)。
|
|
24
|
+
5. 用户指定多边形可直接核对后创建。整板范围必须基于有效、闭合的实际板框;不要用包围矩形替代异形板、缺口或孔洞。仅当已有公开原生能力能保留边界和挖空时生成几何。边界不明、板框不闭合或当前工具不能表达需要的形状时停止创建,说明需要明确多边形或补充原生能力;不现场编造通用几何算法。
|
|
25
|
+
6. 记录操作前目标与已有铜区 UUID,调用创建工具,保存返回 UUID,并重新读取核对网络、层和边界。多层创建由多个独立事务完成,不承诺“一次撤销所有铺铜”。部分成功时报告已创建和未创建的层;结果未知时先重读,不盲目重试或删除。
|
|
26
|
+
7. 创建核验后再填充,重新读取目标铜区状态。不能确认填充、出现超时或编辑器断开时,明确报告未知或失败,保留诊断;不把“发出请求”当成“填充完成”。
|
|
27
|
+
|
|
28
|
+
## 回复用户
|
|
29
|
+
|
|
30
|
+
使用已确认事实说明:本次新建或复用了哪些网络/层的铜区,填充是否完成,哪些操作未完成,以及是否保存。没有执行 DRC 或连通性检查时不承诺规则通过、无孤岛或全部接通。
|
|
31
|
+
|
|
32
|
+
布线与铺铜一起请求时分别报告两个结果;布线任务卡成功只代表布线任务。若铺铜需要澄清,先说明布线的实际结果,再询问缺失信息,让用户知道剩余工作尚未执行。
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# 常见情况
|
|
2
|
+
|
|
3
|
+
| 情况 | 处理 |
|
|
4
|
+
| --- | --- |
|
|
5
|
+
| 无铜区,只说“重新填充” | 说明没有可填充对象;不要自行新建双面 GND。 |
|
|
6
|
+
| 已有同网络同层铜区 | 读取边界确认是否满足范围,优先复用;部分覆盖不能声称整板已铺。 |
|
|
7
|
+
| 不同网络或相互重叠铜区 | 保留已有优先级和连接设置;无法读取关键设置时停止修改,不自动覆盖。 |
|
|
8
|
+
| AGND、DGND、PGND 等多个地网 | 使用用户指定的精确网名,不自动合并、桥接或跨区域铺铜。 |
|
|
9
|
+
| 双层或多层板 | 先确认目标层,不因为层存在就全部铺;未启用层不能作为目标。 |
|
|
10
|
+
| 矩形闭合板框 | 使用实际边界和已确认范围;工具默认值不等于已实现设计规则或边缘内缩。 |
|
|
11
|
+
| 凹形、圆弧、内部挖空、多个独立外框 | 不使用包围盒猜边界;现有 points 工具不能直接表达孔洞和圆弧,须有已验证原生能力或用户明确的可表达范围。 |
|
|
12
|
+
| 高频、天线、隔离槽、爬电间距 | 保留禁布与特殊设计要求;不能从几何空白推断允许铺铜。缺失设计意图时询问。 |
|
|
13
|
+
| 重复执行或某层已创建后失败 | 按本次返回 UUID 重新读取,确认已有对象后继续;不重复新建,不删除用户原铜。 |
|
|
14
|
+
| 全板填充影响已有其他区域 | 明确 refill 工具作用于全板已有区域;只授权局部填充而接口不支持时说明限制。 |
|
|
15
|
+
| 填充成功但仍有未连接或孤岛 | 只报告实际检查结果;填充完成不证明电气设计合格,不能凭视觉作结论。 |
|
|
16
|
+
| 超时、取消或编辑器关闭 | 先确认写入结果,报告已知与未知;不盲目重试写入,不自动保存。 |
|
|
17
|
+
|
|
18
|
+
工具不能设置热焊盘、连接方式、间距、优先级或孔洞时,不能在回复中承诺这些参数已采用。确有此要求时,应复用已验证的公开 KiCad IPC 能力,或明确报告能力缺口;不修改 PCB 文件文本补救。
|
package/src/skills.ts
CHANGED
|
@@ -76,6 +76,11 @@ export const KICAD_SKILLS: Readonly<Record<string, KicadBundledSkill>> = {
|
|
|
76
76
|
'a new board project.',
|
|
77
77
|
ownsScripts: false,
|
|
78
78
|
},
|
|
79
|
+
'pcb-copper-pour': {
|
|
80
|
+
id: 'pcb-copper-pour',
|
|
81
|
+
summary: 'Create or refill PCB copper zones through KiCad IPC with explicit nets, layers and scope.',
|
|
82
|
+
ownsScripts: false,
|
|
83
|
+
},
|
|
79
84
|
'pcb-initial-placement': {
|
|
80
85
|
id: 'pcb-initial-placement',
|
|
81
86
|
summary:
|