浏览器与自动化
1.
2.
3.
4.
5.
6.
add-workflow-node
Add a new workflow node type to the plugin. Use when implementing a new node type for the workflow engine (e.g., new command, integration, or control flow node).
takeshy · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add takeshy/obsidian-llm-hub --skill add-workflow-node技能说明
name: add-workflow-node description: Add a new workflow node type to the plugin. Use when implementing a new node type for the workflow engine (e.g., new command, integration, or control flow node). argument-hint: "[node-type-name]" disable-model-invocation: true allowed-tools: Read, Edit, Write, Grep, Glob, Bash
Add New Workflow Node Type
Add a new workflow node type called $ARGUMENTS to the plugin.
Required File Changes (ALL must be updated)
Update the following files in order. Missing any file will cause bugs:
1. src/workflow/types.ts
- Add to
WorkflowNodeTypeunion type - Add to
WORKFLOW_NODE_TYPESSet (single source of truth forisWorkflowNodeType()) - If forgotten: nodes are skipped during parsing and disappear from visual workflow
2. src/workflow/workflowSpec.ts
- Add documentation entry for AI workflow generation
3. src/workflow/nodeHandlers.ts
- Add
handle*Node()function with the node's execution logic - Export the handler
4. src/workflow/executor.ts
- Add
casein the switch statement to call the handler and log execution - If forgotten: node execution fails silently
5. src/ui/components/workflow/WorkflowPanel.tsx
- Add to
NODE_TYPE_LABELSobject (display name) - Add to
ADDABLE_NODE_TYPESarray - Add to
getDefaultProperties()switch (default property values) - Add to
getNodeSummary()switch (summary text for node list)
6. src/ui/components/workflow/NodeEditorModal.ts
- Add to
NODE_TYPE_LABELSobject - Add
caseinrenderPropertyFields()switch for editor UI fields
Verification
After implementing all changes:
- Run
npm run lintto check for errors - Run
npm run buildto verify compilation - Review each file to ensure the new node type is consistently named