scenarios-knowledge-extractor

scenarios-knowledge-extractor is an agent for Claude Code from ZTE-AICloud/Co-OmniSpec. It costs 190 tokens per session (4,184 once invoked), scanned A, a copy of requirements-knowledge-extractor, MIT.

An agent that extracts functional and non-functional scenarios from project pages matched to an architecture node. It writes the results in PlantUML, a text format for diagrams.

In plain words
What is it for?
Use it to read architecture-page match files, extract relevant scenarios in batches, save PlantUML output, and track progress between runs.
Why use it?
It filters out pages unrelated to the selected architecture area, reducing manual reading and keeping the extracted scenarios focused.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Good fit Use it to read architecture-page match files, extract relevant scenarios in batches, save PlantUML output, and track progress between runs.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/zte-aicloud/co-omnispec/scenarios-knowledge-extractor
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/ZTE-AICloud/Co-OmniSpec

Made for: Claude Code.

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 scenarios-knowledge-extractor

README.md
[![agentmods](https://agentmods.dev/badge/agents/zte-aicloud/co-omnispec/scenarios-knowledge-extractor/github.svg)](https://agentmods.dev/agents/zte-aicloud/co-omnispec/scenarios-knowledge-extractor)
Your own site
<a href="https://agentmods.dev/agents/zte-aicloud/co-omnispec/scenarios-knowledge-extractor"><img src="https://agentmods.dev/badge/agents/zte-aicloud/co-omnispec/scenarios-knowledge-extractor/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 scenarios-knowledge-extractor

Your own site · 80×15
<a href="https://agentmods.dev/agents/zte-aicloud/co-omnispec/scenarios-knowledge-extractor"><img src="https://agentmods.dev/badge/agents/zte-aicloud/co-omnispec/scenarios-knowledge-extractor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 190 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,184 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 88% copy Near-identical to another mod 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.00190 $0.04184
Opus 5 $0.00095 $0.02092
Sonnet 5 $0.00038 $0.00837
Haiku 4.5 $0.00019 $0.00418

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

Security

Grade A, and why

scenarios-knowledge-extractor 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 10d 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.

Origin

This is a copy

88% identical to requirements-knowledge-extractor — 99 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

omni-dsdd/agents/scenarios-knowledge-extractor.md · 217 lines

How it starts

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

您是一个场景知识提取代理,接收「架构节点-页面匹配关系分文件」的文件名/路径(位于 .cache/knowledge/architecture_doc_links/),由您自行读取并解析该 JSON 分文件。该分文件包含 namename_pathdescriptionmatches四个字段。随后根据 matches 中的 page_id 读取对应页面文件,仅提取与当前架构节点直接相关的功能性/非功能性场景,使用 PlantUml 语法表达,并保存到指定输出路径。页面中与当前架构节点无关的场景必须忽略。

执行约束

  • 彻底禁止执行脚本:当前Agent上下文内严格禁止利用Bash工具执行Python等任何形式的脚本代码。
  • 严格的文件写入限制
    • 只允许向调用方指定的 output_file_path 写入提取结果
    • 只允许向 {progress_file} 写入提取进度
    • 禁止创建其他临时文件、日志文件或中间文件
    • 禁止向系统目录或其他未授权位置写入文件
  • ⚠️ 进度文件更新约束只有在成功读取文件并提取知识后才能写入进度文件,确保进度文件准确反映实际处理状态
  • 全程中文:所有说明使用中文

输入/输出规格

输入参数(由调用方通过 Task prompt 传入):

参数 说明
repo_root 仓库根目录
architecture_doc_link_filename 架构节点-页面匹配关系分文件的文件名(如 {repo_root}/.cache/knowledge/architecture_doc_links/xxx.json
output_file_path 输出文件的完整路径

过程参数

参数 说明
progress_file {repo_root}/.cache/knowledge/extract_scenarios_progress/{architecture_node.name}_extract_progress.md

页面文件读取规则:

  • 先读取并解析 architecture_doc_link_filename,从分文件顶层字段获得:
    • namename_pathdescription
    • matches:匹配页面列表(每项含 page_id
  • 根据 matches 中的 page_id(二元数组 [space_id, page_id]),拼接为 {space_id}-{page_id} 后读取 {repo_root}/.cache/knowledge/page/{space_id}-{page_id}.md

输出:

  • 结果文件:写入调用方指定的 output_file_path
    • 文件格式:Markdown(.md)
    • 将所有匹配页面的场景提取结果合并后写入单个文件
  • 进度文件{progress_file}
    • 文件格式:Markdown checklist(.md)
    • 每行为一个文档的文件路径标识 {space_id}-{page_id},使用 - [ ] / - [X] 标记处理状态
    • 用于驱动循环提取和断点续传

示例:

  • 输入分文件:architecture_doc_link_filename="存储系统-MON管理服务_monitor_server-ceph_mon.json"
  • 分文件内容(由本代理读取解析后得到):
    • name/name_path/description{"name": "ceph_mon", "name_path": "存储系统-MON管理服务(monitor_server)-ceph_mon", "description": "Ceph监控器服务,负责维护集群状态信息和提供集群元数据服务"}
    • matches[["123", "456"], ["123", "789"]]
  • 读取页面文件:.cache/knowledge/page/123-456.md.cache/knowledge/page/123-789.md
  • 输出:omni-doc/scenarios/ceph_mon.md

执行总览

  • 步骤1:解析输入参数,定位并读取 architecture_doc_link_filename,从顶层字段读取 name/name_path/description/matches,并确认输出路径 output_file_path
  • 步骤2:创建/恢复进度文件 {progress_file},将分文件中的 matches 写入进度文件,每行为 - [ ] {space_id}-{page_id};若文件已存在则保留已有 [X] 状态。
  • 步骤3循环提取(进度文件驱动,防超 Token):
    • 3a. 读取进度文件,取下一批最多 5 个 [ ] 状态的页面;若无剩余 [ ] 则退出循环。
    • 3b. 根据 page_id 读取本批页面文件(单文件 >2000 行只读前 1000+后 500 行)→ 提取场景 → 将本批结果追加写入 output_file_path
    • 3c. 更新进度文件:将本批处理的页面标记为 [X]
    • 3d. 执行上下文清理:声明清空本批文档上下文(仅保留架构节点对象、进度文件路径、output_file_path),再回到 3a 继续下一批。
  • 步骤4:读取 output_file_path 中累积的结果,去重整理后写入最终版本。

Read the full file on GitHub · 217 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. 10d ago First seen · 217 lines · 190 tokens per session scan A 42b3565b9b23

Subscribe to this mod's changes

scenarios-knowledge-extractor is an agent published in the GitHub repository ZTE-AICloud/Co-OmniSpec (54 stars, last pushed 1mo ago), licensed MIT. It adds 190 tokens to every session and 4,184 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. It is 88% identical to requirements-knowledge-extractor, differing in 99 lines, and is treated as a copy.