Skip to content

Add mcode-repowiki plugin: a project Wiki that helps people read code and cuts MiniMax Code's tokens - #99

Open
Jialei-03 wants to merge 1 commit into
MiniMax-AI:mainfrom
Jialei-03:feat/mcode-repowiki
Open

Jialei-03 wants to merge 1 commit into
MiniMax-AI:mainfrom
Jialei-03:feat/mcode-repowiki

Conversation

@Jialei-03

@Jialei-03 Jialei-03 commented Dec 3, 2026 •

Copy link
Copy Markdown

What changes

Adds a new Plugin, mcode-repowiki, at plugins/Jialei-03/mcode-repowiki: MiniMax Code writes a local project Wiki (.repowiki/) for the current repository, people read it in a local web reader, and the agent looks code up in it before searching. Line numbers in the Wiki follow the code after every commit with no model calls, and chapters whose cited code changed are reported citation by citation, with a way to update them.

It ships one Skill (mcode-repowiki) and one local stdio MCP server with four tools:

Tool What it does
wiki_locate Looks up code by question, file or symbol: matching Wiki sections, live code with line ranges, a file's symbol outline, or one symbol's body plus every file that imports it (through package entries and re-exports), grouped by package
wiki_plan Repository blueprint and freshness report; per-module evidence (key files, symbols, dependants); sync fixes line numbers; mark_reviewed confirms a chapter is still correct
wiki_write_page Saves a chapter: checks every [file:Lx-Ly] citation against the code, records the symbol each one points at, returns writing checks for the agent to fix
wiki_serve Builds the offline reader, starts it on 127.0.0.1, installs the post-commit sync hook

README and DESIGN come in English and Chinese, with an architecture diagram, a chart of the measured results and screenshots of the reader. No files outside plugins/Jialei-03/mcode-repowiki/ are changed.

User value

Example prompts (Chinese and English work the same) and what the user gets:

用 mcode-repowiki 帮我分析当前项目,生成一份本地文档并打开阅读页面。
Analyze this repository with mcode-repowiki, generate a project Wiki, and open the local reading page.

→ Markdown chapters in .repowiki/ (overview with a "where to change what" table and glossary, architecture, core flows, one chapter per module, getting started, extension recipes), a local reader at http://127.0.0.1:4321 with search, a dependency graph and clickable citations that open the real file, and a clean git status.

帮我找一下这个项目里“会话存储”的代码在哪,改它之前有哪些其他文件会受影响?
Find where session storage is implemented in this repo, and which other files depend on it before I change it.

→ The agent calls wiki_locate and gets the matching chapter, exact file and line range, current code and importers in well under a second instead of searching the repository.

用 mcode-repowiki 更新过期的 Wiki 章节。
Update the out-of-date Wiki chapters with mcode-repowiki.

→ The agent re-syncs line numbers, checks each citation whose code changed, and rewrites only the paragraphs that are now wrong.

Measured on earendil-works/pi (810k lines, 137 packages) with local MiniMax Code (mcode exec, MiniMax-M3.1-Flash): 6 everyday tasks, 66 runs, identical prompts that never mention the plugin. Average change with the plugin installed:

Task Tokens Time
Locate code across packages −36% −29%
Trace a call path −35% −37%
Architecture overview −25% +4%
Impact of changing a type −14% 0%
Small edit −6% −14%
Rename a shared type (27 files) −7% −53%

Tokens went down on all 6 tasks (about −20% on average, time about −21%). The AI also stops wandering: on the locate task tool calls went from 22–72 per run to a steady 22–27. Answers were equally correct on both sides. Results vary somewhat from run to run (4–6 runs per group); the README has the full table with absolute numbers.

Plugin submission checklist

  • Plugin lives at plugins/<github-owner>/<plugin-name>.
  • plugin.json name matches the Plugin directory.
  • README.md includes a real example prompt and expected result.
  • LICENSE and plugin.json declare an open-source license (Apache-2.0).
  • Required executables, accounts, paid services, and supported platforms are disclosed (Node.js >= 22.5; git optional; no accounts or paid services; no npm dependencies).
  • Network destinations and data handled by the plugin are disclosed (no outbound network requests; the reader listens on 127.0.0.1 only; no telemetry).
  • No credentials, private endpoints, hidden telemetry, installers, symlinks, or native binaries are included.
  • Every scaffold TODO has been replaced.
  • npm run check passes for this Plugin (see Evidence for the unrelated local failures).

Data and files the plugin writes

  • Inside the repository: everything goes to .repowiki/ (Markdown chapters, manifest.json with citation anchors and hashes, descriptions.json, impact.json, delta-index.json, index.html). It is hidden through the local .git/info/exclude; the tracked .gitignore is never modified.
  • Git hook: wiki_serve (and the repowiki serve/init/hook install commands) adds a clearly marked block to .git/hooks/post-commit that runs the plugin's 0-token line sync after each commit. It keeps any existing hook content, falls back to node on PATH if the original Node path disappears, skips silently if the plugin is removed, and never fails a commit. repowiki hook remove <repo> removes the block.
  • Outside the repository: ~/.repowiki/registry.json maps repositories to their Wiki directory; the parse cache (SQLite via node:sqlite when available) lives in $PLUGIN_DATA, or mcode-repomap-cache/ in the system temp folder.
  • Source code is only read locally. The model that writes chapters is the one the user already runs in MiniMax Code.

Evidence

Automated:

$ node --test plugins/Jialei-03/mcode-repowiki/test/*.test.mjs
ℹ tests 20
ℹ pass 20
ℹ fail 0

$ node plugins/Jialei-03/mcode-repowiki/scripts/validate-plugin.mjs
PASS Official MiniMax-Code-Plugins validation: {"name":"mcode-repowiki","version":"0.6.0","mcpServers":["mcode-repowiki"],"skill":"mcode-repowiki"}

$ npm run check
ℹ tests 1171
ℹ pass 1167
ℹ fail 3

The 3 local failures are in other Plugins and depend on tools not installed on this machine: antianqi/mcode-island (PowerShell) and two weekbin/octopus-meme-maker tests (Pillow, which CI installs). They fail the same way without this change.

Tests cover the MCP pipeline end to end (plan → evidence → write with citation checks → build → sync), the live reader's SSE updates, parser edge cases across languages, long-run line drift, importers resolved through package entries and re-exports, citation anchors (moved / changed / deleted code, mark as reviewed), writing checks, the post-commit hook surviving a missing Node path, the MCP server starting from a path with spaces, and anchors following chapters edited without wiki_write_page.

Manual, with local MiniMax Code 0.7.7 on a copy of earendil-works/pi:

  • Generated the full Wiki (17 chapters, 314 verified citations, 108 file descriptions) in about 9.5 minutes; source tree untouched.
  • 66 benchmark runs with and without the plugin (summary above, full table in the README).
  • Three commits to test freshness: inserting 14 lines moved 7 citations in 2 chapters with nothing flagged; changing two cited symbols and renaming a file flagged exactly those two citations and followed the rename; deleting a cited file flagged the 3 chapters citing it. Pasting the plugin's update prompt into MiniMax Code updated 4 chapters (about 10.6 minutes) and returned the Wiki to 17/17 current.
  • Rewrote two chapters under the writing checks: the agent fixed the two reported problems on its second save; citations over 200 lines went from 2 to 0 and uncited walkthrough steps from 3/8 to 0/8.

Manual, on Windows 11 (MiniMax Code 0.7.7 from npm, Node 24, Git for Windows with core.autocrlf=true), same pi commit:

  • Plugin tests 20/20. npm run check: 1169 tests, 4 failures, all in other Plugins (weekbin/mcode-trajectory-studio needs bash, weekbin/octopus-meme-maker needs Pillow).
  • Installed from source as the README says; MiniMax Code generated the Wiki (16 chapters, 424 citations, about 9 minutes), git status clean, hook installed and run by Git for Windows.
  • Commits that moved cited code were re-anchored with nothing reported; a changed SessionHeader was reported as exactly one citation; the update prompt brought the Wiki back to 17/17 current.
  • The reader's source endpoint refused ..\, ../, drive-letter, .git and UNC paths.
  • This testing found and fixed a bug that kept the MCP server from starting on Windows (and from any path with spaces), Windows gaps in scripts/install-local.mjs, and stale anchors on chapters written without wiki_write_page; regression tests were added for the first and last.

Tested by hand on macOS (Apple Silicon) and Windows 11. Linux is covered by the automated tests only.

…Code

MiniMax Code reads the repository once and writes a local Wiki to
.repowiki/: an overview, the architecture, one chapter per module and a
dependency graph, with every code citation opening the real source.

- wiki_locate: look up code by question, file or symbol; returns live
  code with line ranges and every file that imports a symbol, resolved
  through package entries and re-exports.
- wiki_plan / wiki_write_page: blueprint, per-module evidence, citation
  checks and writing checks when chapters are saved.
- wiki_serve: local reader on 127.0.0.1 with search and graph, plus a
  post-commit hook that keeps line numbers in step at no token cost.
- Freshness per citation: chapters whose cited code changed are flagged
  with an update prompt; moved code is re-anchored silently.
- Works on macOS, Linux and Windows; Node.js >= 22.5, no npm deps.
@Jialei-03
Jialei-03 force-pushed the feat/mcode-repowiki branch from 349ec7b to 9769919 Compare December 3, 2026 16:09
@Jialei-03 Jialei-03 changed the title Add Jialei-03/mcode-repowiki plugin: a local project Wiki that people read and MiniMax Code looks code up in Add mcode-repowiki plugin: a project Wiki that helps people read code and cuts MiniMax Code's tokens Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant