Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

node-generator

БесплатноБез исполняемых скриптовНе проверен

Generate new workflow nodes with implementation, tests, and registry registration

dafthunk-comот dafthunk-com★ 151 звезда на GitHub15 установок в других каталогах

Об этом скилле

Node Generator Skill

Generate workflow nodes for Dafthunk: research requirements, create implementation and tests, register in the node registry.

Step 1: Research and Define Requirements

When a user requests a new node, research first, then present a complete specification for confirmation.

Research the functionality:

  • If based on a library/API: Use WebSearch or WebFetch to find official documentation
  • Look for function signatures, parameters, return types, and examples
  • Check if the package exists in apps/api/package.json or search npm for the latest version

Check existing patterns:

  • Search packages/runtime/src/nodes/<category>/ for similar nodes
  • Examine 2-3 similar implementations to understand input/output patterns and validation approaches

Draft complete requirements:

  • Node purpose, category, name, and kebab-case ID
  • Inputs: names, types, descriptions, required/optional, defaults, repeated (from function signature/docs)
  • Outputs: primary outputs and metadata outputs (hidden: true for counts, flags, etc.)
  • Icon: appropriate lucide icon name
  • Tags: category + relevant keywords
  • Dependencies: package name and version if needed

Present for confirmation:

Based on [library/API/functionality], here's the proposed node:

**Name**: [Node Name]
**ID**: `node-id`
**Category**: category
**Icon**: icon-name

**Inputs**:
- `inputName` (type, required/optional): Description

**Outputs**:
- `outputName` (type): Description
- `metadata` (type, hidden): Description

**Dependencies**:
- package-name@^version

**Tags**: Category, Tag1, Tag2

Does this match your requirements?

Only ask for information you cannot reasonably infer or research. The goal is to present a complete, research-backed specification that the user only needs to approve or tweak.

Step 2: Create Node Implementation

File: packages/runtime/src/nodes/<category>/<node-id>.ts

import { NodeExecution, NodeType } from "@dafthunk/types";
import { ExecutableNode, NodeContext } from "../../runtime/node-types";

export class [NodeClassName]Node extends ExecutableNode {
  public static readonly nodeType: NodeType = {
    id: "[node-id]",
    name: "[Node Display Name]",
    type: "[node-id]",
    description: "[One-line description]",
    tags: ["Category", "Tag1", "Tag2"],
    icon: "[icon-name]",
    documentation: "[Detailed documentation]",
    inlinable: false,
    asTool: false,
    inputs: [
      {
        name: "[inputName]",
        type: "[type]",
        description: "[Description]",
        required: true,
        repeated: false,
      },
    ],
    outputs: [
      {
        name: "[outputName]",
        type: "[type]",
        description: "[Description]",
      },
    ],
  };

  public async execute(context: NodeContext): Promise<NodeExecution> {
    try {
      const { input1, optionalInput = "default" } = context.inputs;

      // Validate required inputs
      if (input1 === null || input1 === undefined) {
        return this.createErrorResult("Missing required input: input1");
      }

      if (typeof input1 !== "expectedType") {
        return this.createErrorResult(
          `Invalid input type for input1: expected expectedType, got ${typeof input1}`
        );
      }

      // Handle repeated inputs (arrays)
      if (Array.isArray(input1)) {
        for (let i = 0; i < input1.length; i++) {
          if (typeof input1[i] !== "string") {
            return this.createErrorResult(
              `Invalid input at position ${i}: expected string, got ${typeof input1[i]}`
            );
          }
        }
      }

      // Main logic
      const result = processInput(input1);

      return this.createSuccessResult({ output1: result });
    } catch (err) {
      const error = err as Error;
      return this.createErrorResult(`Error in [NodeName]: ${error.message}`);
    }
  }
}

Defensive programming checklist:

  • Validate null/undefined, then types, then ranges/constraints
  • Handle single values and arrays for repeated inputs
  • Use descriptive error messages with input names and types
  • Use nested try-catch for risky operations (parsing, external APIs)
  • Handle edge cases: empty arrays/strings, zero/negative numbers
  • Never let execute throw — every failure path returns createErrorResult. A thrown error still gets caught by the runtime, but the message loses the node's context, so the user sees a bare "fetch failed" with no clue which step broke.

Conventions enforced across all nodes:

Rule Why
id === type, kebab-case, matching the filename minus -node type is the discriminator persisted in stored workflow graphs; renaming it breaks saved workflows
Descriptions (node, inputs, outputs) carry no trailing period when they are a single sentence The UI renders them inline; multi-sentence text keeps its punctuation
documentation only when it says something the description does not Otherwise it is
Полный SKILL.md на GitHub

Установить node-generator в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл node-generator?

Generate new workflow nodes with implementation, tests, and registry registration

Как установить скилл node-generator?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл node-generator запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить node-generator с