Communitygithub.com

AgentFlow

通过看板(Asana、GitHub Projects、Linear)编排自主AI开发流水线。管理多Worker Claude Code调度、确定性质量门、对抗性审查、单任务成本追踪和防崩溃流水线执行。

AgentFlow 是什么?

AgentFlow 是一个强大的 AI 技能,旨在将现有的看板工具转化为完全自主的 AI 开发流水线。它适用于 Asana、GitHub Projects 和 Linear 等平台,通过将看板作为分布式状态机,使 AI 代理能够通过评论读取和写入状态,而人类则通过熟悉的 UI 进行干预。该技能的核心在于其无状态编排器,通过 crontab 驱动每 15 分钟执行一次扫描,因此即使崩溃也能从上一个状态恢复。AgentFlow 实现了确定性质量门(如 tsc、eslint 和测试)优先于 AI 审查,以及对抗性审查机制,可有效减少 AI 批准中的“橡皮图章”现象。它还提供任务优先级调度(根据下游阻塞情况)、单任务成本追踪和自动恢复功能(如自动回滚失败的集成)。用户只需编写 SPEC.md,通过 `/spec-to-board` 分解为任务,启动多个 Worker,并设置 crontab 即可开始使用。该技能非常适合需要自动化和监控多步骤开发流程的团队或个人项目。

兼容平台✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/SamuelChien/mega-skills-collection/tree/HEAD/agentflow

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

AgentFlow 是做什么的?

概述

AgentFlow 将你现有的看板转变为一个完全自主的 AI 开发流水线。无需构建自定义编排基础设施,它把你的项目管理工具(Asana、GitHub Projects、Linear)当作一个分布式状态机——任务在阶段间流转,AI 代理通过评论读写状态,人类通过他们已有的 UI 进行干预。

最终结果是:在手机上即可拥有完整的流水线可观测性、免费崩溃恢复(状态存在于你的 PM 工具中,而非内存中)、以及通过拖拽卡片随时进行人工干预的能力。

何时使用此技能

  • 当你需要编排多个 Claude Code Worker 完成完整的开发生命周期(构建、审查、测试、集成)时使用
  • 当你希望在 AI 审查 AI 生成代码之前,先通过确定性质量门(tsc/eslint/测试)过滤时使用
  • 当你希望从看板或手机上获得完整的流水线可见性时使用
  • 当你运行单人/团队项目,需要自主任务调度并跟踪成本时使用
  • 当你需要防崩溃编排,在会话重启后仍能存活时使用

核心概念

7 阶段看板流水线

任务依次流经:待办、研究、构建、审查、测试、集成、完成。每个阶段都有特定的关卡。看板本身就是编排层——无需单独的数据库、消息队列或自定义基础设施。

无状态编排器

一个由 crontab 驱动的一次性扫描每 15 分钟运行一次。无需守护进程,无需会话依赖。如果崩溃,下一次扫描会从上次中断的位置继续执行,因为所有状态都保存在你的 PM 工具中。

确定性先于概率性

硬性关卡(tsc + eslint + 测试)在任何 AI 审查之前运行,以接近零的成本捕获大约 60% 的问题。AI 审查作为第二层在其后进行。

对抗性审查

由不同的 AI 代理审查代码,并且必须列出 3 个问题才能决定通过。这可以防止橡皮图章式的批准。

传递性优先级调度

优先构建能够解除最多下游任务阻塞的任务,自动计算关键路径。

技能 / 命令

/spec-to-board

将 SPEC.md 分解为看板上的原子任务,并映射依赖关系。

/sdlc-orchestrate

基于传递性优先级和冲突检测将任务派发给 Worker。作为 crontab 扫描运行。

/sdlc-worker --slot <N>

在一个终端槽位中运行 Worker,该 Worker 拾取任务、构建代码并创建 PR。并行运行 3-4 个 Worker。

/sdlc-health

实时流水线状态仪表板,显示每个任务的当前阶段、分配代理、重试次数和累计成本。

/sdlc-stop

优雅关闭:活跃的 Worker 完成当前任务,未启动的任务返回到待办。

逐步指南

1. 编写你的 Spec

为你的项目创建一个 SPEC.md,描述你想要构建的内容。

2. 分解为任务

claude -p "/spec-to-board"

这会读取你的 SPEC.md,将其分解为原子任务,映射依赖关系,并在你的看板上创建它们。

3. 启动 Worker

打开 3-4 个终端窗口,每个作为一个 Worker 槽位:

# 终端 2 — 构建者
claude -p "/sdlc-worker --slot T2"

# 终端 3 — 构建者
claude -p "/sdlc-worker --slot T3"

# 终端 4 — 审查者
claude -p "/sdlc-worker --slot T4"

# 终端 5 — 测试者
claude -p "/sdlc-worker --slot T5"

4. 启动编排器

# 添加到 crontab(每 15 分钟运行一次)
crontab -e
# 添加一行:*/15 * * * * ~/.claude/sdlc/agentflow-cron.sh >> /tmp/agentflow-orchestrate.log 2>&1

5. 监控和干预

在手机上打开你的看板。观察任务在流水线中流转。将任意卡片拖拽到“需要人工处理”一栏进行干预。运行 /sdlc-health 获取终端仪表板。

6. 停止流水线

claude -p "/sdlc-stop"

质量门

每个阶段在晋级之前都会执行特定的关卡:

  • 构建到审查:tsc + eslint + npm test 必须全部通过(确定性)
  • 审查到测试:对抗性审查者必须列出 3 个问题才能通过
  • 测试到集成:新文件覆盖率达到 80% 阈值
  • 集成到完成:合并后在主分支上运行完整测试套件;失败则自动回滚

成本追踪

单任务成本追踪,带有阶段上限(Sonnet 默认值):

  • 研究:约 $0.10
  • 构建:约 $0.40
  • 审查:约 $0.10
  • 测试:约 $0.05
  • 集成:约 $0.03

自动防护栏:在 $3/$8 时发出警告,在 $10/$20(Sonnet/Opus)时硬性停止,并升级到人工处理。

安全与恢复

  • 自动回滚:集成失败触发 git revert(新建提交,绝不强制推送)
  • 阻塞任务:经过 2 次尝试失败后,任务升级到人工审查
  • 死代理检测:每 5 分钟心跳检测,10 分钟超时后重新分配
  • 优雅关闭:/sdlc-stop 排空 Worker,将未启动任务返回到待办
  • 范围蔓延检测:将 PR 差异文件与预测文件列表进行比较
  • 规约漂移检测:通过 SHA-256 哈希比较,在中途发现需求变化

安装

# 克隆仓库
git clone https://github.com/UrRhb/agentflow.git

# 将技能和提示词复制到你的 Claude Code 配置中
cp -r agentflow/skills/* ~/.claude/skills/
cp -r agentflow/prompts/* ~/.claude/sdlc/prompts/
cp agentflow/conventions.md ~/.claude/sdlc/conventions.md

或者作为 Claude Code 插件安装:

/plugin marketplace add UrRhb/agentflow
/plugin install agentflow

最佳实践

  • 做:在运行 /spec-to-board 之前编写清晰的 SPEC.md
  • 做:对于典型项目,从 3-4 个 Worker 开始
  • 做:从看板监控,并在需要时将卡片拖拽到“需要人工处理”
  • 做:定期查阅 LEARNINGS.md——它记录了常见的失败模式
  • 不要:跳过确定性质量门——它们能以低成本捕获大多数问题
  • 不要:强制推送到主分支——AgentFlow 使用 git revert 确保安全
  • 不要:运行超过项目并行度支持的 Worker 数量

故障排除

问题:Worker 似乎卡住或已死亡

症状:任务卡片超过 15 分钟没有移动,没有新评论 解决方案:编排器通过心跳检测到死代理,并在 10 分钟后重新分配。如果问题持续,运行 /sdlc-health 检查状态,并手动将卡片拖回待办。

问题:成本防护栏被触发

症状:任务被移动到“需要人工处理”,并带有 COST:CRITICAL 标签 解决方案:查看任务的评论线程以获取累积上下文。决定是增加预算、简化任务还是将其拆分为更小的部分。

问题:合并后的集成测试失败

症状:任务自动从主分支回滚 解决方案:自动回滚维护了主分支稳定性。在评论中检查任务的重试上下文,其中包含已尝试和失败的内容。下一个分配的 Worker 将使用此上下文。

相关技能

  • @brainstorming — 在 AgentFlow 之前使用,设计你的 SPEC.md
  • @writing-plans — 补充任务分解的规约编写
  • @test-driven-development — 与 AgentFlow 的质量门配合良好
  • @subagent-driven-development — 多代理协调的替代方法

其他资源

限制

  • 仅当任务明确符合上述范围时使用此技能。
  • 请勿将输出视为环境特定验证、测试或专家审查的替代品。
  • 如果缺少必需的输入、权限、安全边界或成功标准,请停止并请求澄清。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

SamuelChien/mega-skills-collection

Security audit, hardening, threat modeling (STRIDE/PASTA), Red/Blue Team, OWASP checks, code review, incident response, and infrastructure security for any project.

SamuelChien/mega-skills-collection

Arquitecto de Soluciones Principal y Consultor Tecnológico de Andru.ia. Diagnostica y traza la hoja de ruta óptima para proyectos de IA en español.

SamuelChien/mega-skills-collection

Ingeniero de Sistemas de Andru.ia. Diseña, redacta y despliega nuevas habilidades (skills) dentro del repositorio siguiendo el Estándar de Diamante.

SamuelChien/mega-skills-collection

Estratega de Inteligencia de Dominio de Andru.ia. Analiza el nicho específico de un proyecto para inyectar conocimientos, regulaciones y estándares únicos del sector. Actívalo tras definir el nicho.

SamuelChien/mega-skills-collection

2D game development principles. Sprites, tilemaps, physics, camera.

SamuelChien/mega-skills-collection

3D game development principles. Rendering, shaders, physics, cameras.

SamuelChien/mega-skills-collection

Expert in building 3D experiences for the web - Three.js, React Three Fiber, Spline, WebGL, and interactive 3D scenes. Covers product configurators, 3D portfolios, immersive websites, and bringing depth to web experiences.

SamuelChien/mega-skills-collection

Accessibility audit skill for scanning, fixing, and verifying WCAG 2.2 Level A and AA compliance across React, Next.js, Vue, Angular, Svelte, and plain HTML codebases. Use when auditing accessibility, fixing a11y violations, checking color contrast, generating compliance reports, or integrating accessibility checks into CI/CD pipelines.

SamuelChien/mega-skills-collection

Ab Test Analyzer - Auto-activating skill for Data Analytics. Triggers on: ab test analyzer, ab test analyzer Part of the Data Analytics skill category.

SamuelChien/mega-skills-collection

A B Test Config Creator - Auto-activating skill for ML Deployment. Triggers on: a b test config creator, a b test config creator Part of the ML Deployment skill category.

SamuelChien/mega-skills-collection

When the user wants to plan, design, or implement an A/B test or experiment. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "conversion experiment," "statistical significance," or "test this." For tracking implementation, see analytics-tracking.

SamuelChien/mega-skills-collection

Acceptance Criteria Creator - Auto-activating skill for Enterprise Workflows. Triggers on: acceptance criteria creator, acceptance criteria creator Part of the Enterprise Workflows skill category.

SamuelChien/mega-skills-collection

Use when a coding task should be driven end-to-end from issue intake through implementation, review, deployment, and acceptance verification with minimal human re-intervention.

SamuelChien/mega-skills-collection

Accessibility Audit Runner - Auto-activating skill for Frontend Development. Triggers on: accessibility audit runner, accessibility audit runner Part of the Frontend Development skill category.

SamuelChien/mega-skills-collection

You are an accessibility expert specializing in WCAG compliance, inclusive design, and assistive technology compatibility. Conduct audits, identify barriers, and provide remediation guidance.

SamuelChien/mega-skills-collection

Web accessibility patterns for WCAG 2.2 compliance including ARIA, keyboard navigation, screen readers, and testing

SamuelChien/mega-skills-collection

Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed, or change policy for the Discord channel.

SamuelChien/mega-skills-collection

Create unified specification packages across Business, Development, and Design teams. Staged elaboration (L0 Vision → L1 Requirements → L2 Team Detail → L3 Acceptance Criteria) to build shared understanding. Does not write code.

SamuelChien/mega-skills-collection

Research a company or person and get actionable sales intel. Works standalone with web search, supercharged when you connect enrichment tools or your CRM. Trigger with "research [company]", "look up [person]", "intel on [prospect]", "who is [name] at [company]", or "tell me about [company]".

SamuelChien/mega-skills-collection

Validate messaging consistency across website, GitHub repos, and local documentation generating read-only discrepancy reports. Use when checking content alignment or finding mixed messaging. Trigger with phrases like "check consistency", "validate documentation", or "audit messaging".

相关技能