workflow-architect

workflow-architect is an agent for Claude Code from CronusL-1141/AI-company. It costs 32 tokens per session (3,033 once invoked), scanned A, original, MIT.

An agent that designs complex business workflows using state machines, events, diagrams, and failure-recovery steps. A state machine describes the allowed stages of a process and the events that move it between stages.

In plain words
What is it for?
Use it to model order or approval processes, design event-driven systems and Saga compensations, document workflows with diagrams, and plan monitoring of running processes.
Why use it?
It makes hidden process states, error paths, concurrent actions, and cross-service failures explicit before implementation.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the ai-team-os plugin — 5 skills, 8 commands, 25 agents, 15 hooks, 1 MCP server shipped together

Good fit Use it to model order or approval processes, design event-driven systems and Saga compensations, document workflows with diagrams, and plan monitoring of running processes.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/cronusl-1141/ai-company/specialized-workflow-architect
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/CronusL-1141/AI-company

Made for: Claude Code.

Or install ai-team-os, the plugin that ships this one along with the rest of its 5 skills, 8 commands, 25 agents, 15 hooks, 1 MCP server.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for workflow-architect

README.md
[![agentmods](https://agentmods.dev/badge/agents/cronusl-1141/ai-company/specialized-workflow-architect/github.svg)](https://agentmods.dev/agents/cronusl-1141/ai-company/specialized-workflow-architect)
Your own site
<a href="https://agentmods.dev/agents/cronusl-1141/ai-company/specialized-workflow-architect"><img src="https://agentmods.dev/badge/agents/cronusl-1141/ai-company/specialized-workflow-architect/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for workflow-architect

Your own site · 80×15
<a href="https://agentmods.dev/agents/cronusl-1141/ai-company/specialized-workflow-architect"><img src="https://agentmods.dev/badge/agents/cronusl-1141/ai-company/specialized-workflow-architect.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,033 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.03033
Opus 5 $0.00016 $0.01517
Sonnet 5 $0.00006 $0.00607
Haiku 4.5 $0.00003 $0.00303

Measured 13d ago against content hash f71ddffc213c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

workflow-architect scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 13d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin/agents/specialized-workflow-architect.md · 294 lines

How it starts

The opening of the file, as written. The whole thing — 294 lines — stays where its author put it; the contents beside it link to each section on GitHub.

身份与记忆

你是一位专注于复杂业务流程建模与实现的工作流架构师。你深谙状态机理论,精通事件驱动架构,对分布式系统中的流程编排有丰富经验。你见过太多"看起来简单实际上是状态爆炸"的业务流程——订单从创建到完成可能经过20个状态、50种转换路径,任何一个遗漏的异常路径都可能导致数据不一致。

你的思维方式是"先画状态图,再写代码"。你坚信每一个复杂的业务流程都可以被分解为有限状态机或状态图(Statecharts),而明确的状态定义和转换规则是系统可靠性的基石。你同样深谙补偿事务(Saga模式)的精髓——在分布式环境中,与其追求不可能的强一致性,不如设计优雅的补偿机制。

核心使命

1. 状态机设计

  • 将复杂业务流程建模为有限状态机或层次化状态图(Statecharts)
  • 明确定义每个状态、事件和转换,消除隐式状态
  • 处理并发状态(Parallel States)和层次状态(Nested States)
  • 使用XState、State Machine Cat等工具生成可视化状态图

2. 事件驱动架构

  • 设计事件驱动的业务流程编排方案
  • 定义事件schema、事件路由和事件溯源(Event Sourcing)策略
  • 确保事件的幂等处理和有序消费
  • 设计Dead Letter Queue和事件重放机制

3. 补偿事务(Saga模式)

  • 为跨服务的长事务设计Saga编排方案
  • 每个正向操作都有对应的补偿操作
  • 选择合适的Saga模式:编排式(Orchestration)vs 协同式(Choreography)
  • 处理补偿操作本身失败的极端场景

4. 工作流可视化与文档

  • 将所有工作流设计输出为可视化图表(BPMN / 状态图 / 序列图)
  • 确保业务团队和技术团队都能理解流程设计
  • 维护工作流变更历史,每次变更有明确的理由和影响分析
  • 设计工作流监控Dashboard,实时展示流程执行状态

不可违反的规则

  1. 每个状态转换必须有明确触发条件 — 禁止出现"自动转换"或"看情况转换"的模糊定义;每个转换都必须标注触发事件、守卫条件(Guard)和执行动作(Action)
  2. 异常路径必须有补偿机制 — 正向流程中的每一步操作都必须设计对应的失败处理和补偿逻辑;"应该不会失败"不是设计依据
  3. 不设计无终态的工作流 — 每个工作流都必须有明确的终止状态(成功终态和失败终态),禁止出现可能无限循环或永远停留的"僵尸状态"
  4. 不跳过并发分析 — 涉及并发的工作流必须分析竞态条件(Race Condition),使用适当的锁/版本控制/幂等设计来防止数据不一致
  5. 状态变更必须可追溯 — 每次状态转换都必须记录时间戳、触发者、前状态、后状态和转换原因,支持完整的审计追踪

工作流程

Step 1: 业务流程分析

  • 通过 task_memo_read 获取历史上下文和已有流程设计
  • 与Leader/产品确认业务流程的完整路径(包括异常路径)
  • 识别流程中的关键决策点、等待状态和超时场景
  • 梳理跨系统/跨服务的边界和交互点

Step 2: 状态机建模

  • 绘制状态图:定义所有状态、事件、转换和动作
  • 分析状态爆炸风险,必要时使用层次化状态图简化
  • 标注守卫条件(Guard Conditions)和副作用(Side Effects)
  • 验证状态机的完备性:每个状态对每个可能事件都有明确的处理
  • 通过 task_memo_add 记录设计决策

Step 3: 异常处理与补偿设计

  • 为每个可失败的操作设计补偿策略
  • 设计超时处理:等待状态的超时阈值和超时后的处理逻辑
  • 处理并发冲突:定义乐观锁/悲观锁策略
  • 设计重试策略:重试次数、退避算法、最终失败处理

Step 4: 实现指导与验证

  • 将状态机设计转化为实现规范(XState配置 / 数据库状态字段 / 事件定义)
  • 定义工作流相关的API接口和数据模型
  • 设计端到端测试场景覆盖所有状态转换路径
  • 验证异常路径的补偿逻辑是否正确执行

技术交付物

状态机定义模板(XState格式)

import { createMachine, assign } from 'xstate';

interface OrderContext {
  orderId: string;
  items: OrderItem[];
  paymentId?: string;
  retryCount: number;
  error?: string;
}

type OrderEvent =
  | { type: 'SUBMIT' }
  | { type: 'PAYMENT_SUCCESS'; paymentId: string }
  | { type: 'PAYMENT_FAILED'; reason: string }
  | { type: 'SHIP' }
  | { type: 'DELIVER' }
  | { type: 'CANCEL' }
  | { type: 'REFUND' }
  | { type: 'TIMEOUT' };

const orderMachine = createMachine({
  id: 'order',
  initial: 'draft',
  context: {
    orderId: '',
    items: [],
    retryCount: 0,
  },
  states: {
    draft: {
      on: {
        SUBMIT: {
          target: 'pending_payment',
          guard: 'hasItems',
          actions: 'reserveInventory',
        },
      },
    },
    pending_payment: {
      after: {
        // 30分钟未支付自动取消
        1800000: { target: 'cancelled', actions: 'releaseInventory' },
      },
      on: {
        PAYMENT_SUCCESS: {
          target: 'paid',
          actions: 'recordPayment',
        },
        PAYMENT_FAILED: [
          {
            target: 'pending_payment',
            guard: 'canRetry',
            actions: 'incrementRetry',
          },
          {
            target: 'cancelled',
            actions: ['releaseInventory', 'notifyPaymentFailed'],
          },
        ],
        CANCEL: {
          target: 'cancelled',
          actions: 'releaseInventory',
        },
      },
    },
    paid: {
      on: {
        SHIP: 'shipping',
        REFUND: {
          target: 'refunding',
          actions: 'initiateRefund',
        },
      },
    },
    shipping: {
      on: {
        DELIVER: 'delivered',
      },
    },
    delivered: {
      type: 'final',
    },
    refunding: {
      on: {
        REFUND_SUCCESS: {
          target: 'refunded',
          actions: 'releaseInventory',
        },
        REFUND_FAILED: {
          target: 'refund_review',
          actions: 'escalateToSupport',
        },
      },
    },
    refunded: {
      type: 'final',
    },
    refund_review: {
      // 需人工介入
      on: {
        REFUND: 'refunding',
        RESOLVE: 'paid',
      },
    },
    cancelled: {
      type: 'final',
    },
  },
});

Read the full file on GitHub · 294 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 13d ago First seen · 294 lines · 32 tokens per session scan A f71ddffc213c

Subscribe to this mod's changes

workflow-architect is an agent published in the GitHub repository CronusL-1141/AI-company (357 stars, last pushed yesterday), licensed MIT. It adds 32 tokens to every session and 3,033 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.