mscodebase-intelligence AGENTS.md

A set of instructions for an IDE codebase-intelligence system that combines code analysis, language-server information, predictions, diagnostics, and development tools.

In plain words
What is it for?
Navigating and analyzing codebases, checking project history and runtime status, predicting changes, and following the system's required MCP tool workflow.
Why use it?
It tells the agent which project records to inspect and which code-intelligence tools to use before making changes.

Instructions file for CodexOpenCode

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 instructions/mansio/mscodebase-intelligence/agents-md
Clone the repo
git clone --depth 1 https://github.com/ManSio/mscodebase-intelligence

Made for: Codex, OpenCode.

Per session 7,439 This file is loaded in full into every session.
When invoked 7,439 The same file — it is already loaded in full.
Security scan D 3 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.07439 $0.07439
Opus 5 $0.03719 $0.03719
Sonnet 5 $0.01488 $0.01488
Haiku 4.5 $0.00744 $0.00744

Measured yesterday against content hash ac6982fdf1fb, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade D, and why

mscodebase-intelligence AGENTS.md scanned grade D with 3 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 yesterday.

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.

Hidden instructionshighPrompt injection

Directives inside HTML comments, invisible characters or bidirectional overrides are read by the model and not by the person reviewing the file.

<!-- stale-ignore -->

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

r = httpx.post('http://127.0.0.1:8080/v1/embeddings',

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- **NEVER** use `subprocess.run(capture_output=True)` in daemon threads — pipe buffer deadlock on Windows.
AGENTS.md · 471 lines

How it starts

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

Project Agent Rules — MSCodeBase Hybrid Architecture (64 Registered Tools)

Global system prompt / context injection for the AI Agent in Zed IDE. Applied across all projects. Optimized for the hybrid model: 16 Intel Layer + 31 Core MCP (включая codebase hub + 6 LSP + predict_change) + 13 Inline/Diagnostic + 4 Dev Tools = 64 registered (+1 execute_script при MSCODEBASE_EXECUTE_SCRIPT_ENABLED=true → 65)

* execute_script отключён по умолчанию. Включить: MSCODEBASE_EXECUTE_SCRIPT_ENABLED=true в .env.

0. FIRST STEP IN ANY SESSION

  1. Check File-Contract: Артефакты MCP живут ВНЕ проекта (Задача 4/5). progress.json — в системной папке: <MSCODEBASE_DATA_DIR | %LOCALAPPDATA%/mscodebase | ~/.cache/mscodebase>/projects/<hash8>/progress.json, где <hash8> = md5(normalized project path)[:8] (lower, \\/). Быстрый способ узнать путь — intel_get_runtime_status (поле progress_file) или python -c "from src.core.artifact_paths import get_progress_file; print(get_progress_file(Path('.').resolve()))". Легаси-путь .mscodebase/progress.json в проекте — больше не пишется.

  2. Read the Diary + Wisdom: Review the first 5 entries in AGENT_DIARY.md and read WISDOM.md целиком (если существуют) — WISDOM.md загружается всегда, это дистиллят фактов, а не архив.

  3. Determine MCP Context:

    • If intel_* tools or search_code are available → MCP-FIRST MODE (§0.2). IDE grep/read — только fallback.
    • If absent → MCP server offline. Work exclusively with grep, read_file, terminal.
  4. Runtime Check (MCP pipe): Call debug_runtime_passport() — единственная команда проверки «жив ли MCP-процесс».

    • Ответ с RUN_ID / BUILD_ID / PID → MCP подключён, продолжаем.
    • Transport error / «Not connected» → MCP offline, fallback на grep.
    • НЕ использовать intel_get_runtime_status для проверки связи — он проверяет embedder/индекс, а не pipe.
  5. Load Project Memory: Call intel_get_project_memory() to learn ADRs, known issues, tech debt.

  6. ⚠️ MULTI-WINDOW CHECK: intel_get_runtime_status().project_path — ЭТОТ проект видит MCP. Если пользователь говорит о ДРУГОМ проекте (лежит рядом, открыт в другом окне) — НЕ ДОВЕРЯЙ данным get_index_status() для этого проекта. Вместо этого:

    • Проверь, открыт ли проект: ls <путь>
    • Предупреди пользователя: «Сейчас MCP показывает проект X. Хотите, переключусь на Y?»
    • Используй intel_explain_project_state для проверки другого проекта

Read the full file on GitHub · 471 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. yesterday First seen · 471 lines · 7,439 tokens per session scan D ac6982fdf1fb

Subscribe to this mod's changes

mscodebase-intelligence AGENTS.md is an instructions file published in the GitHub repository ManSio/mscodebase-intelligence (2 stars, last pushed 3d ago), licensed MIT. It adds 7,439 tokens to every session, about $0.0372 per session on Opus 5. A static security scan graded it D with 3 findings (hidden instructions, sends data to an external url, runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.