flowcraft

作者 gorango已验证

A lightweight workflow engine

208
Stars
16
Forks
TypeScript
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/gorango/flowcraft

快速入门

使用 flowcraft 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

flowcraft

License: MIT NPM Version Codecov

Build complex, multi-step processes with a lightweight, composable, and type-safe approach. Model complex business processes, data pipelines, ETL workflows, or AI agents and scale from in-memory scripts to distributed systems without changing the core business logic.

Key Features

Installation

npm install flowcraft

Usage

There are three ways to compose workflows in Flowcraft:

Fluent API — Build workflows programmatically with the createFlow builder.
import { createFlow, FlowRuntime, type NodeContext } from 'flowcraft'

// 1. Define your functions for the nodes
async function startNode({ context }: NodeContext) {
	const output = await context.get('value')
	return { output }
}
async function doubleNode({ input, context }: NodeContext) {
	const output = input * 2
	context.set('double', output)
	return { output }
}

// 2. Define the workflow structure
const flow = createFlow('simple-workflow')
	.node('start', startNode)
	.node('double', doubleNode)
	.edge('start', 'double')

// 3. Initialize the runtime
const runtime = new FlowRuntime()

// 4. Execute the workflow
async function run() {
	const result = await flow.run(runtime, { value: 42 })
	console.log(result.context) // { start: 42, double: 84 }
	console.log(result.status) // 'completed'
}

run()

See the Fluent API Guide for more details.

Declarative — Separate workflow structure (JSON) from node implementations (registry).
import { FlowRuntime } from 'flowcraft'

// 1. Define reusable node functions in a registry
const nodeRegistry = {
	startNode: async ({ context }) => {
		const value = await context.get('value')
		return { output: value }
	},
	doubleNode: async ({ input }) => {
		return { output: input * 2 }
	},
}

// 2. Define the workflow structure as a JSON blueprint
const blueprint = {
	id: 'simple-workflow',
	nodes: [
		{ id: 'start', uses: 'startNode' },
		{ id: 'double', uses: 'doubleNode', inputs: 'start' },
	],
	edges: [{ source: 'start', target: 'double' }],
}

// 3. Run the blueprint with the registry
const runtime = new FlowRuntime({ registry: nodeRegistry })
const result = await runtime.run(blueprint, { value: 42 }, { functionRegistry: nodeRegistry })

See the Declarative Workflows Guide for more details.

Compiler — Use @flow / @step annotations to compile imperative code into a blueprint.
/** @step */
export async function startNode(params: { value: number }) {
	return { output: params.value }
}

/** @step */
export async function doubleNode(params: { value: number }) {
	return { output: params.value * 2 }
}

/** @flow */
export async function simpleWorkflow() {
	const start = await startNode({ value: 42 })
	const result = await doubleNode({ value: start.output })
	return result
}

The compiler generates the blueprint and registry at build time. See the Compiler API for more details.

Resiliency and Error Handling

Design robust workflows with built-in resiliency features.

  • Retries: Configure the maxRetries property on a node to automatically retry it on failure.
  • Fallbacks: Specify a fallback node ID in a node's configuration. If the node fails all its retry attempts, the fallback node will be executed instead, preventing the entire workflow from failing.

For more granular control, you can implement a node using the BaseNode class, which provides prep, exec, post, fallback, and recover lifecycle methods.

Tooling and Utilities

Flowcraft includes tools to help you validate, visualize, and integrate workflows with LLMs.

  • Linter (lintBlueprint): Statically analyze a blueprint to find common errors, such as orphan nodes, invalid edges, or nodes with missing implementations.
  • Analysis (analyzeBlueprint): Programmatically inspect a blueprint to detect cycles, find start/terminal nodes, and get other graph metrics.
  • Diagram Generation (generateMermaid): Automatically generate a Mermaid syntax string from a blueprint to easily visualize your workflow's structure.
  • Agent Tools: Use @flowcraft/tools to give LLMs Zod-based tools for composing, running, and monitoring workflows.

Extensibility and Customization

The FlowRuntime can be configured with pluggable components to tailor its behavior to your specific needs:

  • Logger: Provide a custom ILogger implementation (e.g., Pino, Winston) to integrate with your existing logging infrastructure.
  • Serializer: Replace the default JsonSerializer with a more robust one (e.g., superjson) to handle complex data types like Date, Map, and Set in the workflow context.
  • Evaluator: Swap the default PropertyEvaluator for a more powerful expression engine (like jsep or govaluate) to enable complex logic in edge conditions. For trusted environments, an UnsafeEvaluator is also available.
  • Middleware: Wrap node execution with custom logic for cross-cutting concerns like distributed tracing, performance monitoring, or advanced authorization.
  • Event Bus: An event emitter for monitoring workflow and node lifecycle events (workflow:start, node:finish, etc.).

Distributed Execution

Flowcraft's architecture is designed for progressive scalability. The BaseDistributedAdapter provides a foundation for running workflows across multiple machines. Flowcraft provides official adapters for BullMQ, AWS, GCP, Azure, RabbitMQ, Kafka, Vercel, and Cloudflare.

Documentation

For a complete overview of features, patterns, examples, and APIs, see the full documentation.

License

Flowcraft is licensed under the MIT License.

常见问题

What is flowcraft?

flowcraft is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by gorango. A lightweight workflow engine. It has 208 GitHub stars.

Is flowcraft safe to use?

Yes. flowcraft passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.

How do I install flowcraft?

Clone the repository with "git clone https://github.com/gorango/flowcraft" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is flowcraft written in?

flowcraft is primarily written in TypeScript. It is open-source under gorango on GitHub, so you can review or fork the full source.

Are there alternatives to flowcraft?

Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh flowcraft against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI 智能体
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情