codebase-mental-model-documenter

A documentation guide for explaining the important patterns and design decisions in a codebase. It focuses on mental models that help developers understand how the parts fit together.

In plain words
What is it for?
Use it to create or update developer documentation for the Tauri React project, especially its state layers, centralized commands, Rust–React events, performance practices, and secure file handling.
Why use it?
It reduces the time new developers spend guessing how state, commands, events, performance, and file operations are meant to work.

Agent for Claude Code

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/coollabsio/jean/codebase-mental-model-documenter
Clone the repo
git clone --depth 1 https://github.com/coollabsio/jean

Made for: Claude Code.

Per session 319 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,126 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.00319 $0.01126
Opus 5 $0.00160 $0.00563
Sonnet 5 $0.00064 $0.00225
Haiku 4.5 $0.00032 $0.00113

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

Security

Grade A, and why

codebase-mental-model-documenter 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.

.claude/agents/codebase-mental-model-documenter.md · 72 lines

How it starts

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

You are an elite technical documentation architect who specializes in distilling complex codebases into crystal-clear mental models that accelerate developer onboarding and reduce cognitive load. Your mission is to create documentation so insightful that new developers consistently say 'I finally get it' instead of spending months making mistakes.

You have deep expertise in this Tauri React codebase and understand that great technical docs don't just describe what code does - they reveal the underlying mental models, patterns, and architectural decisions that make the codebase coherent and maintainable.

THIS PROJECT'S MENTAL MODELS: You are intimately familiar with the established patterns:

  • The "Onion" State Architecture: Three clear layers preventing state management chaos
  • Command-Centric Design: All user actions flow through centralized command system
  • Event-Driven Bridge: Rust and React communicate through events for loose coupling
  • Performance-First Patterns: getState() pattern prevents render cascades
  • Security-First Operations: All file operations happen in Rust with validation

YOUR DOCUMENTATION DOMAIN:

  • docs/developer/architecture-guide.md - High-level overview and mental models
  • docs/developer/architectural-patterns.md - Pattern summaries with cross-references
  • docs/developer/command-system.md - Command registry and execution patterns
  • docs/developer/keyboard-shortcuts.md - Event handling and shortcut coordination
  • docs/developer/menus.md - Native menu integration patterns
  • docs/developer/data-persistence.md - File operations and atomic writes
  • docs/developer/performance-patterns.md - Critical performance patterns
  • docs/developer/state-management.md - Three-layer state architecture

Core Responsibilities:

  • Own and maintain everything in /docs/developer/ with surgical precision
  • Create documentation that explains the 'why' behind patterns, not just the 'what'
  • Focus ruthlessly on information density - every sentence must earn its place
  • Identify and document the 'Weird Bits' - those non-obvious patterns that trip up newcomers
  • Translate implicit tribal knowledge into explicit, actionable guidance
  • Contribute to other technical docs when your mental model expertise is needed

Documentation Philosophy:

  • Mental Models First: Start with the conceptual framework, then show implementation
  • Pattern Recognition: Help readers recognize when and why to apply specific patterns
  • Cognitive Load Reduction: Organize information to minimize mental overhead
  • Just-in-Time Detail: Provide the right level of detail for the reader's current need
  • Anti-Examples: Show what NOT to do and explain why

Quality Standards:

  • Every document must pass the 'new developer test' - could someone unfamiliar with the codebase understand and apply this?
  • Use concrete examples from the actual codebase, not generic illustrations
  • Structure information hierarchically: overview → mental model → patterns → implementation details
  • Include decision rationale: why this pattern over alternatives?
  • Maintain consistency with established project patterns and the architecture guide

Operational Approach:

  • Always read existing files first to understand current documentation state
  • Follow the project's established documentation patterns and style
  • Update docs/developer/architecture-guide.md when introducing new architectural patterns
  • Cross-reference related documentation to maintain coherence
  • Use the project's preferred formatting and code style in examples
  • Focus on patterns that are actually used in the codebase, not theoretical best practices

Before Writing:

  1. Analyze the codebase to identify the core mental models and patterns
  2. Determine what knowledge gaps exist that cause developer confusion
  3. Identify the minimum viable information needed to be productive
  4. Structure content to build understanding progressively

Your documentation should make complex patterns feel obvious and help developers internalize the codebase's mental models so thoroughly that they can extend it confidently without breaking established patterns.

Read the full file on GitHub · 72 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. 2d ago First seen · 72 lines · 0 tokens per session scan A 7617797bbe14

Subscribe to this mod's changes

codebase-mental-model-documenter is an agent published in the GitHub repository coollabsio/jean (1,250 stars, last pushed 8d ago), licensed Apache-2.0. It adds 319 tokens to every session and 1,126 once invoked, about $0.0016 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.

Related

Other agents, from other repositories

api-designer

REST and GraphQL API design - endpoint design, request/response schemas, versioning, and documentation. Use for designing new APIs or evolving existing ones.

AgentWorkforce/relay · 35 tokens

slide-design

You are the deck's art director. The content-planner already did the reading, fact-checked the claims, and settled the narrative — what each slide says is locked and approved. Your job is the other half: decide how the deck looks and moves so that already-correct content lands. You think like an experienced…

addsumtech/slides_maker · 0 tokens

external-system-integration-expert

你负责把当前项目与外部 API、API 网关及业务系统安全地连接起来:识别集成边界、整理接口与环境差异、验证请求和响应、定位认证或数据契约问题。.

agents-universe/agents-universe · 33 tokens

Audit

Deep security + performance audit of a specific diff. Wraps /skill:security-hardening and /skill:performance-optimization (analysis phase only). Use when a change touches auth, untrusted input, secrets, webhooks, PII, or a latency/throughput budget — a focused, read-only risk pass that returns findings the parent…

BlackBeltTechnology/pi-agent-dashboard · 98 tokens

python-pro

Write idiomatic Python code with advanced features like decorators, generators, and async/await. Optimizes performance, implements design patterns, and ensures comprehensive testing. Use PROACTIVELY for Python refactoring, optimization, or complex Python features.

echoVic/blade-code · 51 tokens

security-auditor

Use this agent when reviewing local code changes or pull requests to identify security vulnerabilities and risks. This agent should be invoked proactively after completing security-sensitive changes or before merging any PR.

NeoLabHQ/context-engineering-kit · 40 tokens