@huaqiu/dsh-tool-kicad-schematic-gen 0.7.5 → 0.7.7

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/lib/index.js CHANGED
@@ -7510,28 +7510,25 @@ const SCHEMATIC_GEN_TOKEN = "@schematic-gen";
7510
7510
  /**
7511
7511
  * The section text: what the `@schematic-gen` token MEANS.
7512
7512
  *
7513
- * Static on purpose (see the module header). Four jobs, each mapping to a
7514
- * failure mode observed with the earlier inline-payload chip:
7513
+ * Static on purpose (see the module header). This section carries only the
7514
+ * invariants that must hold in every session:
7515
7515
  * 1. define the token as an explicit user choice — a bare token alone is an
7516
7516
  * opaque string the model has no trained semantics for;
7517
7517
  * 2. pin the `kicad-schematic-design` skill — the retired online tools are
7518
7518
  * gone, so an unpinned agent may reach for a dead entry point;
7519
- * 3. forbid hand-written `.kicad_sch` files — asked for "an ESP32 mini", an
7520
- * LLM will otherwise author KiCad files itself, which KiCad cannot open;
7521
- * 4. defer requirements to the user's own words — a gesture is not a spec.
7519
+ * 3. require real user confirmation before design documents or scripts, and
7520
+ * forbid hand-written KiCad files.
7522
7521
  *
7523
- * It never claims the token carries content: it says what the token means,
7524
- * nothing about what the user asked for.
7522
+ * Detailed sequencing, plan read-back, layout repair and delivery rules live
7523
+ * in the skill body, which loads only when the task needs them. This section
7524
+ * never claims the token carries design content.
7525
7525
  */
7526
7526
  function schematicGenSectionText() {
7527
7527
  return [
7528
- `Schematic Gen: the ${SCHEMATIC_GEN_TOKEN} token in a user message is the Schematic Gen chip — the user explicitly chose it for that request. Produce the design with the \`kicad-schematic-design\` skill, which starts from the hardware design brief when none exists yet.`,
7529
- "For every new schematic project, first show the requirements summary, scope, key unknowns and recommended choices. Ask with ask_user_question and wait for an actual user reply BEFORE writing formal design documents or generation scripts. If the tool is unavailable, ask in chat and end the turn to wait. Silence, timeout, cancellation or a preselected option is not confirmation. Reuse an already confirmed requirements baseline for the same project; do not ask again unless core requirements change.",
7530
- "Before writing or running a schematic generation script, save the hardware design document and read it back with run-design.mjs --read-plan. Implement that document; pass its path and sha256 to generation. Never postpone the plan until after drawing. ",
7531
- "Never hand-write .kicad_sch files or KiCad project files yourself; go through the skill and its tools.",
7532
- "Use the user's own words as the design description — if they have not described the circuit yet, ask for the requirements instead of assuming them.",
7533
- "Follow-up messages in the same conversation continue that work without repeating the token.",
7534
- "For a simple schematic, plan layout before the first build, collect concrete readability defects and fix them together once, then verify and deliver. Stop layout edits when connections, grid, readability, page fit and project files meet the delivery criteria. Further iterations require an identified blocking defect; do not rebuild for cosmetic preferences or to drive conservative layout warnings to zero. Real errors must still be fixed, regardless of iteration count."
7528
+ `Schematic Gen: the ${SCHEMATIC_GEN_TOKEN} token in a user message is the Schematic Gen chip — the user explicitly chose it for that request. Load and follow the \`kicad-schematic-design\` skill, using the user’s own words as the design description.`,
7529
+ "For a new project, confirm requirements with the user (use ask_user_question when available) and wait for a real reply before writing formal design documents or generation scripts. Reuse an already confirmed baseline for the same project.",
7530
+ "Never hand-write .kicad_sch files or KiCad project files yourself; use the skill and its tools.",
7531
+ "Follow-up messages continue that work without repeating the token."
7535
7532
  ].join("\n");
7536
7533
  }
7537
7534
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@huaqiu/dsh-tool-kicad-schematic-gen",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "description": "KiCad 原理图设计:电路模块搜索、器件模型与手册、符号导入、编辑预览、脚本构建及设计技能",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -32,8 +32,8 @@
32
32
  "pdfjs-dist": "6.3.289",
33
33
  "sharp": "0.35.4",
34
34
  "undici": "^8.10.0",
35
- "@huaqiu/dsh-plugin-log": "0.7.5",
36
- "@huaqiu/dsh-sidebar-entry": "0.7.5"
35
+ "@huaqiu/dsh-plugin-log": "0.7.7",
36
+ "@huaqiu/dsh-sidebar-entry": "0.7.7"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@deepseek-ai/cordis": "^4.0.2",
@@ -25,7 +25,7 @@ description: Before a new schematic, ask the user to confirm requirements and wa
25
25
 
26
26
  ## 1. 明确需求与原理图形式
27
27
 
28
- 新建原理图项目必须先执行 hardware-design-brief 的“方案前需求确认”:展示已知目标、交付范围、关键缺口和推荐选项,用 `ask_user_question` 提问并等待真实用户回复;即使能自行作假设也不能跳过。工具不可用时在对话中提问并结束本轮等待。未回复、取消、超时或默认选择不算确认,期间只可只读核实资料,不得写正式方案、生成脚本或电路副本。已确认的同一项目需求可沿用,不反复确认。需求回复应在现有 PRD/精简方案中记录实际来源;有文档和 hash 不等于需求已经确认。
28
+ 新建原理图项目必须先执行 hardware-design-brief 的“方案前需求确认”:展示已知目标、交付范围、关键缺口和推荐选项,用 `ask_user_question` 提问并等待真实用户回复;即使能自行作假设也不能跳过。工具不可用时在对话中提问并结束本轮等待。未回复、取消、超时或默认选择不算确认,期间只可只读核实资料,不得写正式方案、生成脚本或电路副本。已确认的同一项目需求可沿用,不反复确认。需求回复应在现有 PRD/精简方案中记录实际来源;有文档和 hash 不等于需求已经确认。设计描述使用用户自己的原话;用户尚未描述电路时先询问需求,不自行假设。
29
29
 
30
30
  方案阶段的器件、BOM 和电气网络问题优先用 `analyze_kicad_module`,已有结果直接复用。`edit_kicad_flat_schematic` 不作为方案检查的固定步骤:调用前应有一个现有分析无法回答的具体问题;只有缺少必要图纸备注等信息时,定向 `list` 并指定 types/references。不得用 connections 重复核对已有网表网络,也不为将来绘图提前收集全图坐标/UUID。纯方案任务不调用 create;几何查询及生成修改副本留到实际原理图适配阶段。网表提取不能替代数据手册与计算,缺少证据时记录未决条件,不反复调用几何工具补证。
31
31
 
package/src/prompt.ts CHANGED
@@ -54,35 +54,32 @@ export const SCHEMATIC_GEN_TOKEN = '@schematic-gen'
54
54
  /**
55
55
  * The section text: what the `@schematic-gen` token MEANS.
56
56
  *
57
- * Static on purpose (see the module header). Four jobs, each mapping to a
58
- * failure mode observed with the earlier inline-payload chip:
57
+ * Static on purpose (see the module header). This section carries only the
58
+ * invariants that must hold in every session:
59
59
  * 1. define the token as an explicit user choice — a bare token alone is an
60
60
  * opaque string the model has no trained semantics for;
61
61
  * 2. pin the `kicad-schematic-design` skill — the retired online tools are
62
62
  * gone, so an unpinned agent may reach for a dead entry point;
63
- * 3. forbid hand-written `.kicad_sch` files — asked for "an ESP32 mini", an
64
- * LLM will otherwise author KiCad files itself, which KiCad cannot open;
65
- * 4. defer requirements to the user's own words — a gesture is not a spec.
63
+ * 3. require real user confirmation before design documents or scripts, and
64
+ * forbid hand-written KiCad files.
66
65
  *
67
- * It never claims the token carries content: it says what the token means,
68
- * nothing about what the user asked for.
66
+ * Detailed sequencing, plan read-back, layout repair and delivery rules live
67
+ * in the skill body, which loads only when the task needs them. This section
68
+ * never claims the token carries design content.
69
69
  */
70
70
  export function schematicGenSectionText(): string {
71
71
  return [
72
72
  `Schematic Gen: the ${SCHEMATIC_GEN_TOKEN} token in a user message is the ` +
73
73
  'Schematic Gen chip — the user explicitly chose it for that request. ' +
74
- 'Produce the design with the `kicad-schematic-design` skill, which ' +
75
- 'starts from the hardware design brief when none exists yet.',
76
- 'For every new schematic project, first show the requirements summary, scope, key unknowns and recommended choices. Ask with ask_user_question and wait for an actual user reply BEFORE writing formal design documents or generation scripts. If the tool is unavailable, ask in chat and end the turn to wait. Silence, timeout, cancellation or a preselected option is not confirmation. Reuse an already confirmed requirements baseline for the same project; do not ask again unless core requirements change.',
77
- 'Before writing or running a schematic generation script, save the hardware design document and read it back with run-design.mjs --read-plan. Implement that document; pass its path and sha256 to generation. Never postpone the plan until after drawing. ',
78
- 'Never hand-write .kicad_sch files or KiCad project files yourself; go ' +
79
- 'through the skill and its tools.',
80
- "Use the user's own words as the design description — if they have not " +
81
- 'described the circuit yet, ask for the requirements instead of ' +
82
- 'assuming them.',
83
- 'Follow-up messages in the same conversation continue that work without ' +
84
- 'repeating the token.',
85
- 'For a simple schematic, plan layout before the first build, collect concrete readability defects and fix them together once, then verify and deliver. Stop layout edits when connections, grid, readability, page fit and project files meet the delivery criteria. Further iterations require an identified blocking defect; do not rebuild for cosmetic preferences or to drive conservative layout warnings to zero. Real errors must still be fixed, regardless of iteration count.',
74
+ 'Load and follow the `kicad-schematic-design` skill, using the user’s ' +
75
+ 'own words as the design description.',
76
+ 'For a new project, confirm requirements with the user (use ask_user_question ' +
77
+ 'when available) and wait for a real reply before writing formal design ' +
78
+ 'documents or generation scripts. Reuse an already confirmed baseline for ' +
79
+ 'the same project.',
80
+ 'Never hand-write .kicad_sch files or KiCad project files yourself; use ' +
81
+ 'the skill and its tools.',
82
+ 'Follow-up messages continue that work without repeating the token.',
86
83
  ].join('\n')
87
84
  }
88
85