用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ForceInjection/domain-driven-design-skills --skill node-generator命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | node-generator |
| description | Generate new workflow nodes with implementation, tests, and registry registration |
Generate workflow nodes for Dafthunk: research requirements, create implementation and tests, register in the node registry.
When a user requests a new node, research first, then present a complete specification for confirmation.
Research the functionality:
apps/api/package.json or search npm for the latest versionCheck existing patterns:
apps/api/src/nodes/<category>/ for similar nodesDraft complete requirements:
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.
File: apps/api/src/nodes/<category>/<node-id>.ts
import { NodeExecution, NodeType } from "@dafthunk/types";
import { ExecutableNode, NodeContext } from "../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,
},
],
: [
{
: ,
: ,
: ,
},
],
};
(: ): <> {
{
{ input1, optionalInput = } = context.;
(input1 === || input1 === ) {
.();
}
( input1 !== ) {
.(
);
}
(.(input1)) {
( i = ; i < input1.; i++) {
( input1[i] !== ) {
.(
);
}
}
}
result = (input1);
.({ : result });
} (err) {
error = err ;
.();
}
}
}
Defensive programming checklist:
File: apps/api/src/nodes/<category>/<node-id>.test.ts
import { Node } from "@dafthunk/types";
import { describe, expect, it } from "vitest";
import { NodeContext } from "../types";
import { [NodeClassName]Node } from "./<node-id>";
describe("[NodeClassName]Node", () => {
const createContext = (inputs: Record<string, unknown>): NodeContext => ({
nodeId: "[node-id]",
inputs,
getIntegration: async () => { throw new Error("No integrations in test"); },
env: {},
} as unknown as NodeContext);
it("should [perform expected operation]", async () => {
const node = new [NodeClassName]Node({ nodeId: "[node-id]" } as unknown as Node);
result = node.(({ : }));
(result.).();
(result.?.).();
});
(, () => {
node = []({ : } );
result = node.(({ : }));
(result.).();
});
(, () => {
node = []({ : } );
result = node.(({}));
(result.).();
(result.).();
});
(, () => {
node = []({ : } );
result = node.(({ : }));
(result.).();
(result.).();
});
(, () => {
node = []({ : } );
result = node.(({ : [, ] }));
(result.).();
});
(, () => {
node = []({ : } );
result = node.(({ : [, ] }));
(result.).();
(result.).();
});
});
Test coverage: Happy path, edge cases (empty/boundary values), error cases (missing/wrong types), array handling, type coercion (if applicable), domain-specific cases.
File: apps/api/src/nodes/cloudflare-node-registry.ts
Add import (alphabetically within category):
import { [NodeClassName]Node } from "./<category>/<node-id>";
Register in constructor (alphabetically within category):
this.registerImplementation([NodeClassName]Node);
pnpm typecheck
pnpm --filter '@dafthunk/api' test <node-id>
List files created, confirm registry registration, show test command, note any dependencies to install.
Repeated inputs (single value or array):
if (typeof values === "string") { /* handle single */ }
if (Array.isArray(values)) { /* validate each element */ }
Number coercion:
const num = Number(input);
if (isNaN(num)) { return this.createErrorResult("Invalid number"); }
Optional inputs:
const { required, optional = "default" } = context.inputs;
External libraries:
try {
const result = library.function(input);
} catch (err) {
return this.createErrorResult(`Operation failed: ${(err as Error).message}`);
}
Conduct deep academic research for philosophy, neuroscience, cognitive science, and theoretical computer science (computability, complexity, AI theory, logic). Use when user asks to: research academic topics, find scholarly papers, conduct literature reviews, analyze citations, synthesize research findings, explore philosophical arguments, investigate consciousness/cognition, study computability/decidability/Turing machines, or analyze academic debates. Triggers on: 'research papers', 'literature review', 'academic sources', 'scholarly articles', 'philosophy of mind', 'computability theory', 'neuroscience studies', 'find papers on', 'what does the research say'.
Create clear action plans with steps, success criteria, and risk awareness. Use before implementing features, making changes, starting projects, or anytime you need a roadmap to success. Triggers on "plan this", "how should we approach", "what's the strategy", "steps to complete", or when facing complex multi-step work.
Add keyboard navigation to a feature using CommandRegistryService. Use when implementing keyboard shortcuts, vim-style navigation, or hotkeys for a page or component.
基于 SOC 职业分类