knowerage-analysis

A documented workflow for analysing legacy source code and recording which lines have been explained. Legacy code is older software that may be difficult to understand or change.

In plain words
What is it for?
Use it when analysing, documenting, or explaining Java, XML, or other source files, including creating analysis files and reconciling their coverage.
Why use it?
It keeps analysis documents and their coverage records consistent, so developers can see what code has been examined and avoid losing that record.

Cursor rule for Cursor

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 rules/mtimma/knowerage/knowerage-analysis
Clone the repo
git clone --depth 1 https://github.com/MTimma/knowerage

Made for: Cursor.

Per session 363 This file is loaded in full into every session.
When invoked 363 The same file — it is already loaded in full.
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.00363 $0.00363
Opus 5 $0.00181 $0.00181
Sonnet 5 $0.00073 $0.00073
Haiku 4.5 $0.00036 $0.00036

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

Security

Grade A, and why

knowerage-analysis 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 2d 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.

.cursor/rules/knowerage-analysis.mdc · 21 lines

What it actually says

Knowerage Analysis Workflow

If Knowerage MCP tools appear in your available tools, the user has opted in: use them for any task that analyzes, documents, or explains legacy/source files in this workspace. Do not bypass Knowerage by writing knowerage/analysis/**/*.md with generic file-edit tools only, and never hand-edit knowerage/registry.json.

When analyzing legacy code (Java, XML, or other source files):

  1. Create analysis — Use knowerage_create_or_update_doc to create an .md file with YAML frontmatter (source_file, covered_lines, analysis_date).
  2. Reconcile — Call knowerage_reconcile_record after creating or updating an analysis file (required every time).
  3. Record coverageknowerage_reconcile_record updates knowerage/registry.json (no manual append needed).

Registry inventory — To see every analysis↔source mapping, covered line ranges, and freshness in one response (same structure as registry.json), call knowerage_list_registry instead of reading the file manually.

"Analyze X" implies full workflow — create analysis, reconcile, and record coverage. No need for the user to say "record coverage" or "use the MCP" explicitly.

Repos without this rule — Users who only installed the MCP should add the same guidance to their client’s user-level agent rules (if supported) or add a project rules file using a path and format their MCP host documents (this repo uses .cursor/rules/ as an example).

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. 2d ago First seen · 21 lines · 363 tokens per session scan A 314d7142bdb4

Subscribe to this mod's changes

knowerage-analysis is a cursor rule published in the GitHub repository MTimma/knowerage (3 stars, last pushed 4mo ago), licensed MIT. It adds 363 tokens to every session, about $0.0018 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-31.