Repository navigation
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
Open
Add mcode-repowiki plugin: a project Wiki that helps people read code and cuts MiniMax Code's tokens#99Jialei-03 wants to merge 1 commit into
Jialei-03 wants to merge 1 commit into
Conversation
…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
force-pushed
the
feat/mcode-repowiki
branch
from
December 3, 2026 16:09
349ec7b to
9769919
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Adds a new Plugin,
mcode-repowiki, atplugins/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:wiki_locatewiki_plansyncfixes line numbers;mark_reviewedconfirms a chapter is still correctwiki_write_page[file:Lx-Ly]citation against the code, records the symbol each one points at, returns writing checks for the agent to fixwiki_serve127.0.0.1, installs the post-commit sync hookREADME 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:
→ 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 athttp://127.0.0.1:4321with search, a dependency graph and clickable citations that open the real file, and a cleangit status.→ The agent calls
wiki_locateand gets the matching chapter, exact file and line range, current code and importers in well under a second instead of searching the repository.→ 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: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
plugins/<github-owner>/<plugin-name>.plugin.jsonname matches the Plugin directory.README.mdincludes a real example prompt and expected result.LICENSEandplugin.jsondeclare an open-source license (Apache-2.0).127.0.0.1only; no telemetry).TODOhas been replaced.npm run checkpasses for this Plugin (see Evidence for the unrelated local failures).Data and files the plugin writes
.repowiki/(Markdown chapters,manifest.jsonwith citation anchors and hashes,descriptions.json,impact.json,delta-index.json,index.html). It is hidden through the local.git/info/exclude; the tracked.gitignoreis never modified.wiki_serve(and therepowiki serve/init/hook installcommands) adds a clearly marked block to.git/hooks/post-committhat runs the plugin's 0-token line sync after each commit. It keeps any existing hook content, falls back tonodeonPATHif the original Node path disappears, skips silently if the plugin is removed, and never fails a commit.repowiki hook remove <repo>removes the block.~/.repowiki/registry.jsonmaps repositories to their Wiki directory; the parse cache (SQLite vianode:sqlitewhen available) lives in$PLUGIN_DATA, ormcode-repomap-cache/in the system temp folder.Evidence
Automated:
The 3 local failures are in other Plugins and depend on tools not installed on this machine:
antianqi/mcode-island(PowerShell) and twoweekbin/octopus-meme-makertests (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:
Manual, on Windows 11 (MiniMax Code 0.7.7 from npm, Node 24, Git for Windows with
core.autocrlf=true), same pi commit:npm run check: 1169 tests, 4 failures, all in other Plugins (weekbin/mcode-trajectory-studioneedsbash,weekbin/octopus-meme-makerneeds Pillow).git statusclean, hook installed and run by Git for Windows.SessionHeaderwas reported as exactly one citation; the update prompt brought the Wiki back to 17/17 current...\,../, drive-letter,.gitand UNC paths.scripts/install-local.mjs, and stale anchors on chapters written withoutwiki_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.