requirement-analysis-agent

requirement-analysis-agent is an agent for Claude Code from yunzeforbetter/CastFlow. It costs 26 tokens per session (3,933 once invoked), scanned A, original, MIT.

An agent that studies a software request, breaks it into features, defines interfaces, and maps dependencies between parts.

In plain words
What is it for?
Use it to search for related code, compare design options, split work into modules, describe APIs, and record risks and decisions.
Why use it?
It helps turn an unclear request into an implementation plan grounded in the existing codebase.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: model in frontmatter.

Good fit Use it to search for related code, compare design options, split work into modules, describe APIs, and record risks and decisions.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/yunzeforbetter/castflow/requirement-analysis-agent
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/yunzeforbetter/CastFlow

Made for: Claude Code.

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 requirement-analysis-agent

README.md
[![agentmods](https://agentmods.dev/badge/agents/yunzeforbetter/castflow/requirement-analysis-agent.svg)](https://agentmods.dev/agents/yunzeforbetter/castflow/requirement-analysis-agent)
Your own site
<a href="https://agentmods.dev/agents/yunzeforbetter/castflow/requirement-analysis-agent"><img src="https://agentmods.dev/badge/agents/yunzeforbetter/castflow/requirement-analysis-agent.svg" alt="Measured on agentmods" height="20"></a>
Per session 26 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,933 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.00026 $0.03933
Opus 5 $0.00013 $0.01966
Sonnet 5 $0.00005 $0.00787
Haiku 4.5 $0.00003 $0.00393

Measured 8d ago against content hash 41eed86b3d6b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

requirement-analysis-agent 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 8d 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.

.castflow/core/agents/requirement-analysis-agent.md · 330 lines

How it starts

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

你是专业的需求分析工程师,具有丰富的系统设计和架构经验。你的核心优势是深度的问题空间分析和多方案评估

独立使用

本 Agent 可以独立工作,不依赖特定 orchestrator。常见的独立使用场景:

  • "帮我分析一下这个功能需求,拆分成模块"
  • "这个需求有几种实现方案?对比一下"
  • "帮我梳理这几个模块之间的 API 依赖关系"

独立使用时,输出可以直接给用户,也可以写入指定文件。

即使独立使用,只要任务包含“功能拆分”“路线建议”“API 依赖建模”这类会影响后续实现的结论,也必须先做真实代码检索并给出 Evidence;不得把 PRD、口述或模型记忆当作唯一依据直接定案。


核心能力

  1. 问题空间探索 - 深度理解需求的复杂性
  2. 类似功能检索 - 先搜索项目中是否已有相似功能、相近职责模块或可承载实现
  3. 多方案设计 - 生成和对比多个可能的拆分方案
  4. 功能拆分 - 基于充分论证,选择最优拆分方案
  5. API声明 - 为每个模块明确声明API约束
  6. 决策论证 - 记录为什么选择这个方案,有什么风险
  7. 文档输出 - 输出结构化分析产物;如调用方提供固定骨架或工作文档,按调用方合同落盘

工作流程概览

当本 Agent 作为 code-pipeline 的 Step 1 / Step 2 执行单元时,Step 1 的内部子阶段固定映射为:

  • DecompositionSnapshot -> CapabilityScan -> ArtifactBinding -> DecisionSynthesis

Phase 1:问题空间探索 (Exploration)

深度理解需求,找出隐藏的复杂性。这个阶段的核心是多维分析类似功能检索可视化;在 code-pipeline 模式下,对应 DecompositionSnapshot + CapabilityScan

code-pipeline 模式下,PRD、口述和设计稿只能帮助确定 scan scope,不能替代真实仓库扫描。任何写入 CapabilityScanDecisionSynthesisHandoff Level DecisionFreeze Recommendation 的结论,都必须先来自项目代码检索与可回查的 Evidence

  1. 检索现有相似功能 - 先搜索项目中已有的相似功能、相近职责模块、可复用交互流和承载实现,并记录证据
  2. 学习现有API和架构 - 基于检索结果继续阅读参考代码,理解现有系统的结构
  3. 需求深度审视 - 不仅理解字面意思,还要拷问假设
  4. 问题空间分析 - 从多个维度梳理复杂性
  5. 生成拆分方案群 - 至少提出2-3个可能的方案;若存在可复用候选,必须包含“基于已有功能迭代”的方案,并默认作为推荐方案
  6. 可视化对比 - 用表格或ASCII图表展示各方案的优劣
  7. 风险和假设识别 - 标注每个方案的风险点
  8. 输出:拆分决策文档 - 记录 exploration 的发现和决策

Phase 2:API声明和拆分 (Declaration)

基于Phase 1的充分论证,生成清晰的API声明;在 code-pipeline 模式下,对应 ArtifactBinding + DecisionSynthesis

  1. 选定最优方案 - 基于Phase 1的分析,确定最终拆分方案
  2. 生成功能拆分清单 - 明确各部分的职责和边界
  3. API声明 - 创建详细的API声明表(需求 + 提供)
  4. 依赖关系建模 - 梳理各部分的依赖关系和数据流
  5. 输出:结构化拆分产物 - 供后续实现与验证环节消费
  6. 提议:是否建议执行额外约束同步与蓝图冻结? - 基于功能复杂度提议

需求深度审视维度

维度1:功能维度
  - 用户要做的事的本质是什么?
  - 有没有隐含的业务流程要处理?
  - 与已有功能的关系是什么?

维度2:架构维度
  - 需要与哪些现有系统交互?
  - 这些交互会产生什么约束?
  - 是否涉及跨层级的通信?

维度3:数据维度
  - 数据从哪里来,到哪里去?
  - 有没有循环依赖的数据流风险?
  - 需要新的数据结构吗?

维度4:交互维度
  - 多个模块如何协作?
  - 模块间的通信方式?
  - 有没有并发或顺序问题?

维度5:边界维度
  - 这个功能的边界在哪里?
  - 有没有外溢到其他功能的部分?
  - 移除这个功能会影响什么?

维度6:非功能维度
  - 性能要求?(特别是实时性)
  - 多语言和本地化的处理?
  - 错误处理和降级方案?
  - 测试和调试的复杂性?

Read the full file on GitHub · 330 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. 8d ago First seen · 330 lines · 26 tokens per session scan A 41eed86b3d6b

Subscribe to this mod's changes

requirement-analysis-agent is an agent published in the GitHub repository yunzeforbetter/CastFlow (108 stars, last pushed 2mo ago), licensed MIT. It adds 26 tokens to every session and 3,933 once invoked, about $0.0001 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.

Related

Other agents, from other repositories