Agent Skillskqcoxn/MaaPipelineEditor › react-flow-node-ts

react-flow-node-ts

GitHub

提供React Flow自定义节点的开发指南,包含TypeScript类型定义、Zustand状态管理集成及UI组件模板。用于构建可视化工作流编辑器中的节点组件。

.agents/skills/react-flow-node-ts/SKILL.md kqcoxn/MaaPipelineEditor

Trigger Scenarios

创建React Flow自定义节点 实现可视化流程图编辑器 配置节点TypeScript类型与Handle

Install

npx skills add kqcoxn/MaaPipelineEditor --skill react-flow-node-ts -g -y
More Options

Non-standard path

npx skills add https://github.com/kqcoxn/MaaPipelineEditor/tree/main/.agents/skills/react-flow-node-ts -g -y

Use without installing

npx skills use kqcoxn/MaaPipelineEditor@react-flow-node-ts

指定 Agent (Claude Code)

npx skills add kqcoxn/MaaPipelineEditor --skill react-flow-node-ts -a claude-code -g -y

安装 repo 全部 skill

npx skills add kqcoxn/MaaPipelineEditor --all -g -y

预览 repo 内 skill

npx skills add kqcoxn/MaaPipelineEditor --list

SKILL.md

Frontmatter
{
    "name": "react-flow-node-ts",
    "license": "MIT",
    "metadata": {
        "author": "Microsoft",
        "version": "1.0.0"
    },
    "description": "Create React Flow node components with TypeScript types, handles, and Zustand integration. Use when building custom nodes for React Flow canvas, creating visual workflow editors, or implementing node-based UI components."
}

React Flow Node

Create React Flow node components following established patterns with proper TypeScript types and store integration.

Website: https://reactflow.dev/

References

This skill includes a local mirror of the React Flow official documentation under references/. Use it when you need detailed API signatures, guides, or UI component references without relying on network access:

Prefer the local references over the website when exact API behavior or TypeScript types matter, because the mirrored docs are pinned to the same version this skill targets.

Quick Start

Copy templates from assets/ and replace placeholders:

  • {{NodeName}} → PascalCase component name (e.g., VideoNode)
  • {{nodeType}} → kebab-case type identifier (e.g., video-node)
  • {{NodeData}} → Data interface name (e.g., VideoNodeData)

Templates

Node Component Pattern

export const MyNode = memo(function MyNode({
  id,
  data,
  selected,
  width,
  height,
}: MyNodeProps) {
  const updateNode = useAppStore((state) => state.updateNode);
  const canvasMode = useAppStore((state) => state.canvasMode);

  return (
    <>
      <NodeResizer isVisible={selected && canvasMode === "editing"} />
      <div className="node-container">
        <Handle type="target" position={Position.Top} />
        {/* Node content */}
        <Handle type="source" position={Position.Bottom} />
      </div>
    </>
  );
});

Type Definition Pattern

export interface MyNodeData extends Record<string, unknown> {
  title: string;
  description?: string;
}

export type MyNode = Node<MyNodeData, "my-node">;

Integration Steps

  1. Add type to src/frontend/src/types/index.ts
  2. Create component in src/frontend/src/components/nodes/
  3. Export from src/frontend/src/components/nodes/index.ts
  4. Add defaults in src/frontend/src/store/app-store.ts
  5. Register in canvas nodeTypes
  6. Add to AddBlockMenu and ConnectMenu

Version History

  • 9875bea Current 2026-07-24 22:31

Same Skill Collection

.agents/skills/ant-design-x/skills/use-x-chat/SKILL.md
.agents/skills/ant-design-x/skills/x-card/SKILL.md
.agents/skills/ant-design-x/skills/x-chat-provider/SKILL.md
.agents/skills/ant-design-x/skills/x-components/SKILL.md
.agents/skills/ant-design-x/skills/x-markdown/SKILL.md
.agents/skills/ant-design/SKILL.md
.agents/skills/maafw/SKILL.md
.agents/skills/sync-reference-projects/SKILL.md
.agents/skills/tauri-v2/SKILL.md
.agents/skills/zustand-store-ts/SKILL.md
.agents/skills/ant-design-x/skills/x-request/SKILL.md

Metadata

Files
0
Version
c28002d
Hash
1b807748
Indexed
2026-07-24 22:31

trang chủ - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-09-02 23:55
浙ICP备14020137号-1 $bản đồ khách truy cập$