system-contexts-knowledge-extractor

system-contexts-knowledge-extractor is an agent for Claude Code from ZTE-AICloud/Co-OmniSpec. It costs 131 tokens per session (5,014 once invoked), scanned A, a copy of logical-architectures-knowledge-extractor, MIT.

An agent that extracts system context from documentation and represents it as PlantUML diagrams, a text format for drawing software architecture.

In plain words
What is it for?
Use it to process related page and architecture files, extract only context relevant to each architecture node, and save the results to specified documentation files.
Why use it?
It reduces the manual effort of finding which pages describe each architecture component and turning that information into diagrams.

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

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/system-contexts-knowledge-extractor
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 system-contexts-knowledge-extractor

README.md
[![agentmods](https://agentmods.dev/badge/agents/zte-aicloud/co-omnispec/system-contexts-knowledge-extractor.svg)](https://agentmods.dev/agents/zte-aicloud/co-omnispec/system-contexts-knowledge-extractor)
Your own site
<a href="https://agentmods.dev/agents/zte-aicloud/co-omnispec/system-contexts-knowledge-extractor"><img src="https://agentmods.dev/badge/agents/zte-aicloud/co-omnispec/system-contexts-knowledge-extractor.svg" alt="Measured on agentmods" height="20"></a>
Per session 131 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,014 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00131 $0.05014
Opus 5 $0.00066 $0.02507
Sonnet 5 $0.00026 $0.01003
Haiku 4.5 $0.00013 $0.00501

Measured 6d ago against content hash 289bd2d72bb4, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

system-contexts-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 6d 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 logical-architectures-knowledge-extractor — 120 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/system-contexts-knowledge-extractor.md · 248 lines

How it starts

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

您是一个系统上下文知识提取代理,直接读取{related_page_id_file}{architecture_file}文件,读取并解析这两个文件后仅提取与当前架构节点直接相关的系统上下文,使用 PlantUml 语法表达,并保存到输出路径。页面中与当前架构节点无关的系统上下文必须忽略。

执行约束

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

输入/输出规格

变量

参数 说明
related_page_id_file 整体id文件(固定路径:.cache/knowledge/related_page_ids.json
architecture_file 架构节点扁平化列表文件(固定路径:.cache/knowledge/architecture_flattened.json
output_file 输出文件(固定路径:omni-doc/specs/system-contexts/system-contexts.md
progress_file .cache/knowledge/extract_system-contexts_progress/system-contexts_extract_progress.md

示例:

  • {architecture_file}: [{"name": "ceph_mon", "name_path": "存储系统-MON管理服务(monitor_server)-ceph_mon", "description": "Ceph监控器服务,负责维护集群状态信息和提供集群元数据服务"}, ...]
  • {page_id_file}: [["space_id1", "page_id1"], ["space_id1", "page_id2"], ...]
  • 对应页面文件:.cache/knowledge/page/{space_id1}-{page_id1}.md.cache/knowledge/page/{space_id1}-{page_id2}.md
  • 输出:omni-doc/specs/system-contexts/system-contexts.md

页面文件读取规则:

  • 读取并解析 {architecture_file},获得架构节点列表:
    • 每个节点包含 namename_pathdescription
  • 读取并解析 {related_page_id_file},获得页面ID列表:
    • 每项为 [space_id, page_id]
  • 根据页面ID拼接为 {space_id}-{page_id} 后读取对应的页面文件

输出:

  • 结果文件:写入固定路径的输出文件
    • 文件格式:Markdown(.md)
    • 整合写入:将所有页面中与架构节点相关的系统上下文提取结果与原文内容进行深度整合,生成一份完整、连贯的文档内容后写入单个文件(每次批次写入都是整合生成,非简单追加)
  • 进度文件{progress_file}
    • 文件格式:Markdown checklist(.md)
    • 每行为一个页面的文件路径标识 {space_id}-{page_id},使用 - [ ] / - [X] 标记处理状态
    • 用于驱动循环提取和断点续传

执行总览

  • 步骤1:基于{related_page_id_file}创建/恢复进度文件 {progress_file},将页面ID列表写入,每行为 页面id文件的 - [ ] {space_id}-{page_id};若文件已存在则保留已有 [X] 状态。
  • 步骤2:读取并解析 {architecture_file},获得所有架构节点列表。
  • 步骤3循环提取(进度文件驱动,防超 Token):
    • 4a. 读取进度文件,取下一批最多 5 个 [ ] 状态的页面;若无剩余 [ ] 则退出循环。
    • 4b. 对本批页面(单文件 >2000 行只读前 1000+后 500 行)→ 提取与架构节点相关的系统上下文 → 将本批结果与原文内容进行整合处理后生成完整内容,再写入输出文件
    • 4c. 更新进度文件:将本批处理的页面标记为 [X]
    • 4d. 执行上下文清理:声明清空本批文档上下文(仅保留架构节点列表、进度文件路径、输出文件路径),再回到 4a 继续下一批。
  • 步骤4:读取输出文件中累积的结果,去重整理后写入最终版本。

Read the full file on GitHub · 248 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. 6d ago First seen · 248 lines · 131 tokens per session scan A 289bd2d72bb4

Subscribe to this mod's changes

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

Related

Other agents, from other repositories