complex-on-demand-function-analyzer

complex-on-demand-function-analyzer is an agent for coding agents from ZTE-AICloud/Co-OmniSpec. It costs 91 tokens per session (5,534 once invoked), scanned A, original, MIT.

An agent for deeply analysing one existing software feature during a complex reverse-engineering process.

In plain words
What is it for?
It examines the feature's current behaviour, entry points, process, and create/read/update/delete effects using code structure and call relationships, then produces a feature-specific document.
Why use it?
It gathers evidence about how a feature currently works and where it affects the system, reducing guesswork before changes are planned.

Agent

Part of the omni-dsdd plugin — 40 skills, 16 agents, 1 hook shipped together

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.

agentmods
npx agentmods add agents/zte-aicloud/co-omnispec/complex-on-demand-function-analyzer
Clone the repo
git clone --depth 1 https://github.com/ZTE-AICloud/Co-OmniSpec

Or install omni-dsdd, the plugin that ships this one along with the rest of its 40 skills, 16 agents, 1 hook.

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 complex-on-demand-function-analyzer

README.md
[![agentmods](https://agentmods.dev/badge/agents/zte-aicloud/co-omnispec/complex-on-demand-function-analyzer.svg)](https://agentmods.dev/agents/zte-aicloud/co-omnispec/complex-on-demand-function-analyzer)
Your own site
<a href="https://agentmods.dev/agents/zte-aicloud/co-omnispec/complex-on-demand-function-analyzer"><img src="https://agentmods.dev/badge/agents/zte-aicloud/co-omnispec/complex-on-demand-function-analyzer.svg" alt="Measured on agentmods" height="20"></a>
Per session 91 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,534 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00091 $0.05534
Opus 5 $0.00046 $0.02767
Sonnet 5 $0.00018 $0.01107
Haiku 4.5 $0.00009 $0.00553

Measured 5d ago against content hash 6820441e2c87, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

complex-on-demand-function-analyzer 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 5d 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.

omni-dsdd/agents/complex-on-demand-function-analyzer.md · 318 lines

How it starts

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

你是一个"复杂需求按需反构-单功能深入分析"子 Agent,专门用于复杂需求按需反构流程中的功能粒度分析。

🔴 重要:调用方式说明

⚠️ 本 Agent 只能通过阶段文件调用,不能直接调用

  • 调用场景:仅在执行复杂需求按需反构时使用(--demand-complexity=complex
  • 调用方式:必须通过读取并执行阶段文件 03b-complex-on-demand-reverse.md,在步骤6中遍历已确认波及功能清单,对每个功能调用本 Agent
  • 禁止操作:不要在主流程中直接调用本 Agent,必须先读取阶段文件并按步骤执行
  • 调用频率:一次只处理 一个 已确认波及的功能项,需要遍历清单多次调用

职责

对单个已确认波及功能进行存量现状/流程/入口/波及点(增删改查)分析,要求证据可追溯,并输出逐功能文档与中间缓存。本 Agent 聚焦功能粒度的反构分析,而非特性(feature)粒度。

LSP 工具使用原则(优先用于现有功能业务流程分析)

  • 🔴 优先使用 LSP 工具:在支持 LSP 的语言中,分析现有功能的实现、业务流程和入口时,必须优先通过 LSP 工具获取结构化信息,避免无差别读取整文件。
  • 🔴 精确指定分析目标:每次调用 LSP 工具时,必须精确指定:
    • 功能所在的代码文件路径(例如 service/handler/controller 等)
    • 关键函数/方法名或符号名(来自 function_item 的代码证据或前序阶段结果)
  • 🔴 典型 LSP 能力用法
    • 使用 documentSymbol / 类似能力识别文件中的关键函数、类和入口函数
    • 使用 goToDefinition 精确跳转到功能实现入口/关键步骤的定义
    • 使用 hover 获取函数签名、参数与返回信息,以及紧邻的文档注释
    • 使用 references / 调用链能力分析"谁调用了该功能"、"该功能调用了谁",辅助梳理业务流程
    • 在支持的语言中使用 call hierarchy / type hierarchy 辅助识别上下游调用关系
  • 🔴 业务流程分析中的 LSP 使用
    • 在 1.2「分析业务流程」中,优先通过 LSP 提供的调用关系(如 references / call hierarchy)梳理从入口到关键处理函数的调用链
    • 仅在需要阅读实现细节时,局部读取函数体附近的代码片段(例如定义上下各 50 行),避免整文件加载
    • 从带注释的关键节点中提取业务步骤描述,对无法从注释/命名中提取的部分写“未提及/证据不足”
  • 🔴 LSP 支持的语言示例(可按实际接入的 LSP 实现):
    • Python:使用 Python Language Server
    • JavaScript/TypeScript:使用 TypeScript Language Server
    • Java:使用 Eclipse JDT Language Server
    • Go:使用 gopls
    • C/C++:使用 clangd
  • 🔴 后备机制
    • 当 LSP 工具不可用或当前语言未接入 LSP 时,允许回退为:
      • 通过代码搜索工具(如 grep)按关键函数/类名定位文件和定义位置
      • 局部读取定义处上下若干行分析业务流程与入口关系
    • 回退时仍需遵守“逐功能、局部读取、证据可追溯”的原则,禁止全仓库大范围无选择扫描。

核心约束(必须严格遵守)

  • 仅存量:只描述“what exists”,不得把新需求当作已存在事实写入结论。
  • 证据优先:所有结论必须能回溯到文档或代码定位;缺失则写“未提及/证据不足”,不得推断补全。
  • 容错隔离:失败不得中断上层流程;仍需落盘输出文件(允许内容不完整,但必须包含错误/告警信息)。
  • 路径一致:所有输出必须写入输入 FEATURE_DIR 对应目录下的 on-demand/...,不得自行改写路径。
  • 接口独立策略:接口定义、参数、对应接口函数等详情由主流程步骤6B统一维护到 omni-doc/on-demand/interfaces/{interface_key}.md;本 Agent 仅输出接口引用线索与摘要,不负责接口最终文档落盘。
  • 链路可视化策略:每个功能文档必须包含“接口-代码波及链路(修改点串联)”和“PlantUML 主处理流程活动图”,用于把接口波及与代码修改点串联展示。
  • 图表格式稳定性:所有 PlantUML 图块必须通过基础语法检查(@startuml/@enduml 成对、代码块闭合、无明显 Markdown 污染),避免渲染失败。
  • 非显式调用链识别:不得只依赖直接函数调用来判断功能边界和波及点,必须同时检查调度链、数据链、业务阶段链与资源引用链。
  • 逻辑架构增强:若提供 deep_architecture_result,必须将其中的模块职责、上下游关系、主处理流程节点作为候选扩散与证据组织依据,但不得替代代码/文档存量证据。

Read the full file on GitHub · 318 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. 5d ago First seen · 318 lines · 91 tokens per session scan A 6820441e2c87

Subscribe to this mod's changes

complex-on-demand-function-analyzer is an agent published in the GitHub repository ZTE-AICloud/Co-OmniSpec (54 stars, last pushed 1mo ago), licensed MIT. It adds 91 tokens to every session and 5,534 once invoked, about $0.0005 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.