Repository navigation
feat!: replace @wiki chat participant with skills, agent plugin and richer MCP server - #124
Merged
Lili Xu (llxu1) merged 3 commits intoNov 11, 2026
Conversation
…icher MCP server VS Code deprecated chat participants and the Copilot harness does not run them, so @wiki no longer works for most users. Replace it with: - The MCP server as the chat surface: tool titles and annotations (read-only tools run without confirmation), server instructions that include the wiki's AGENTS.md, structured output, completions, an icon and real version, new wiki_fix and wiki_delete_page tools, and wiki discovery (wiki_open/wiki_init) for servers started without a root. - Skills (wiki-ask, wiki-research, wiki-ingest, wiki-save, wiki-fix), a Wiki Librarian custom agent and .wiki/** instructions, authored once in plugin/ and contributed by the extension through chatSkills, chatAgents and chatInstructions. - An Agent Plugins 1.0 plugin with a committed, self-contained MCP server bundle (CI checks it is current) and a marketplace index. - Fix Issues applies the deterministic fixes (new core fixWiki) and lists the rest in the Lint Findings view with a Fix with Copilot action; new Run Lint command. Also fixes relative sourcePath resolution in wiki_ingest_with_context, duplicate index entries from lint-fix and page re-creation, a gray-matter cache leak in readPage, source removal deleting pages that still have another source, and the extension's LLM ingest overwriting existing pages. Requires VS Code 1.109. BREAKING CHANGE: the @wiki chat participant is removed. See the migration table in the README. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace the old @wiki chat participant screenshot with one from VS Code 1.144. It shows the /wiki-ask skill answering through the LLM Wiki MCP tools in Copilot Chat, and the sidebar's new Lint Findings view. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Page deletion can traverse directory symlinks and remove raw sources, files outside the wiki, or protected files, creating a critical safety risk.
6 open issues
Resolve symlinked paths before validating and deleting pages · New Lint preview against the post-deletion state · New Repair or accept wikis with a missing index during initialization · New Protect index and log filenames case-insensitively · New Serialize shared-page merges across ingest writers · New Require approval before wiki_fix deletes pages · New
What changed in this PR
Replaces LLM Wiki’s @wiki chat participant with shared Copilot skills, a Wiki Librarian agent, and an expanded MCP server for VS Code and agent-plugin clients.
Changes:
- Packages shared skills, agent instructions, and a bundled MCP server as an agent plugin.
- Adds MCP discovery, maintenance tools, structured results, annotations, and completions.
- Centralizes wiki fixes, improves ingestion provenance handling, and expands tests and migration documentation.
| File | Description |
|---|---|
vitest.config.ts |
Updates coverage exclusions for participant removal and provider tests. |
tests/vscode/mcpProvider.test.ts |
Tests server definitions and explicit Node-mode environment. |
tests/vscode/integration/suite/index.ts |
Increases integration-test timeout. |
tests/vscode/integration/suite/extension.test.ts |
Tests activation, contributions, maintenance commands, and MCP startup. |
tests/vscode/integration/runTest.ts |
Creates a fixture workspace for real-editor tests. |
tests/vscode/integration/build.mjs |
Bundles the integration runner and suite as CommonJS. |
tests/vscode/commands.test.ts |
Covers maintenance commands and source removal. |
tests/vscode/chatHistory.test.ts |
Removes tests for deleted participant history handling. |
tests/shared/wiki.test.ts |
Adds frontmatter mutation-isolation regression coverage. |
tests/shared/wiki-create-pages.test.ts |
Tests derived-page merging and index-entry updates. |
tests/shared/mcp/server-metadata.test.ts |
Tests metadata, schemas, annotations, and server instructions. |
tests/shared/mcp/server-integration.test.ts |
Updates expected maintenance tools and bound-mode behavior. |
tests/shared/mcp/maintenance-tools.test.ts |
Tests fixes, deletion, provenance, and relative source paths. |
tests/shared/mcp/discovery.test.ts |
Covers discovery, workspace roots, opening, and initialization. |
tests/shared/mcp/completions.test.ts |
Tests resource and prompt argument completions. |
tests/shared/ingest-context.test.ts |
Updates expectations for previously ingested sources. |
tests/shared/fix.test.ts |
Covers cleanup, dry runs, provenance, and index regressions. |
tests/plugin/server-stdio.test.ts |
Exercises the committed plugin server over stdio. |
tests/plugin/plugin.test.ts |
Validates manifests, customizations, versions, and tool references. |
README.md |
Documents replacement workflows, plugin installation, and MCP capabilities. |
plugin/skills/wiki-save/SKILL.md |
Defines the conversation-to-wiki saving workflow. |
plugin/skills/wiki-research/SKILL.md |
Defines cross-page research and gap analysis. |
plugin/skills/wiki-ingest/SKILL.md |
Defines ingestion, provenance recording, and crosslinking. |
plugin/skills/wiki-fix/SKILL.md |
Defines preview, repair, and verification steps. |
plugin/skills/wiki-ask/SKILL.md |
Defines wiki-grounded answers with page citations. |
plugin/README.md |
Explains plugin contents, installation, and development. |
plugin/plugin.json |
Declares the agent-plugin manifest. |
plugin/mcp.json |
Configures the bundled MCP server launcher. |
plugin/com.github.copilot/rules/llmwiki.instructions.md |
Adds file-scoped wiki editing guidance. |
plugin/com.github.copilot/agents/wiki-librarian.agent.md |
Defines the Wiki Librarian agent. |
packages/vscode/src/mcpProvider.ts |
Explicitly starts the editor executable in Node mode. |
packages/vscode/src/llmIngest.ts |
Extends derived pages and preserves summaries edited during ingestion. |
packages/vscode/src/extension.ts |
Registers lint findings and removes participant wiring. |
packages/vscode/src/commands.ts |
Adds local maintenance commands and shared source cleanup. |
packages/vscode/src/chatParticipant.ts |
Removes the legacy @wiki participant implementation. |
packages/vscode/src/chatHistory.ts |
Removes participant-specific conversation conversion. |
packages/vscode/README.md |
Documents skills, maintenance commands, and migration. |
packages/vscode/package.json |
Replaces participant contributions and raises VS Code requirements. |
packages/vscode/esbuild.config.mjs |
Copies customizations and builds the plugin server bundle. |
packages/vscode/CHANGELOG.md |
Records breaking changes, new capabilities, and fixes. |
packages/core/src/wiki.ts |
Isolates frontmatter reads and adds derived-page upserts. |
packages/core/src/mcp/write-tools.ts |
Adds maintenance tools, provenance inputs, and annotations. |
packages/core/src/mcp/workspace-tools.ts |
Adds wiki opening and initialization tools. |
packages/core/src/mcp/wiki-root.ts |
Tracks configured, discovered, and explicitly selected wiki roots. |
packages/core/src/mcp/server.ts |
Integrates discovery, metadata, structured output, and completions. |
packages/core/src/mcp/schemas.ts |
Defines structured tool-result schemas. |
packages/core/src/mcp/resources.ts |
Resolves resource roots on demand. |
packages/core/src/mcp/read-tools.ts |
Adds read-only annotations, titles, and output schemas. |
packages/core/src/mcp/prompts.ts |
Corrects ingest parameter guidance and updates maintenance steps. |
packages/core/src/mcp/instructions.ts |
Builds server guidance with a bounded wiki-schema excerpt. |
packages/core/src/mcp/index.ts |
Exports new MCP capabilities and types. |
packages/core/src/mcp/completions.ts |
Supplies page, source, and topic suggestions. |
packages/core/src/mcp/bin.ts |
Supports environment configuration and discovery-mode startup. |
packages/core/src/lint.ts |
Adds dry-run support and prevents duplicate orphan indexing. |
packages/core/src/init.ts |
Updates generated provenance and maintenance guidance. |
packages/core/src/ingest.ts |
Returns the existing summary path for skipped ingestion. |
packages/core/src/ingest-context.ts |
Recommends extending previously ingested content. |
packages/core/src/index.ts |
Exports shared wiki-fix operations. |
packages/core/src/index-ops.ts |
Adds index upserts that preserve existing summaries. |
packages/core/src/fix.ts |
Centralizes provenance cleanup and deterministic wiki fixes. |
packages/core/src/constants.ts |
Adds the package version reported by MCP. |
packages/core/README.md |
Documents discovery and environment-based root selection. |
package.json |
Adds the real-editor integration-test command. |
package-lock.json |
Updates VS Code types and engine metadata. |
docs/workflows/smart-ingest.md |
References the ingestion skill and removes fixed tool counts. |
docs/mcp-tools.md |
Documents new tools, provenance, discovery, and structured results. |
.github/workflows/ci.yml |
Checks committed plugin-bundle freshness after building. |
.github/plugin/marketplace.json |
Adds the plugin marketplace entry. |
.gitattributes |
Marks the server bundle generated and preserves its bytes. |
Review effort: Max
Address the Copilot review of #124: - Add withWikiLock, a cross-process wiki write lock (wiki/.llmwiki.lock, re-entrant, broken when stale). Page and index read-modify-writes in core, the MCP write tools and the extension's ingest use it, so concurrent ingests no longer lose each other's content or sources. - deletePage resolves symlinked folders and checks that the real path stays inside the wiki; index.md and log.md are protected in any letter case. - The wiki_fix dry run lints the wiki as it would be after the planned deletions instead of filtering the findings afterwards. - MCP discovery accepts a wiki whose index.md is missing (the same test as wiki_init and the extension), so wiki_fix can rebuild the index. - The wiki-fix skill, the lint-and-fix prompt, the server instructions and the wiki_fix description require the user's approval before applying fixes that delete pages. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Songpei Du (songpeidu)
approved these changes
Nov 11, 2026
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.


🦄 This PR was prepared by an AI agent on behalf of Lili Xu (@llxu1).
Why
VS Code deprecated chat participants (docs updated with VS Code 1.143, Oct 2026). The Copilot harness, which VS Code 1.142 began rolling out as the default for new chat sessions, doesn't run participants. So
@wikino longer works for most users, and neither does the sidebar Fix Issues button, which only opened@wiki /fix. The recommended replacement is skills plus an MCP server, with an optional custom agent, shipped as an agent plugin. LLM Wiki already had the MCP server.This PR implements phases 0–2 of the plan: remove
@wiki, make the MCP server the chat surface, and ship skills, an agent and a plugin.What changed
Phase 0: remove
@wikichatParticipant.ts,chatHistory.tsand their test, and removedcontributes.chatParticipants.fixWiki()), shows what still needs judgment in the Lint Findings view, and offers Fix with Copilot, which opens chat with/wiki-fix. That view was implemented and tested but never registered. Fix Issues no longer lets a model delete pages without confirmation, which/fixused to do.fixWiki()instead of a duplicated loop.^1.109.0(extension-contributed skills);@types/vscodeis pinned to~1.109.0.Phase 1: the MCP server becomes the chat surface
readOnlyHint, so VS Code no longer prompts for every lookup. Tools that overwrite or delete setdestructiveHint, based on actual behavior; for example, the create tools overwrite a page with the same slug.AGENTS.md, capped at 12k characters.wiki_fix(withdryRun) andwiki_delete_page(refusesindex.md,log.md, non-.mdfiles and traversal; reports pages that still link to it).outputSchema+structuredContent) for status, query, lint and fix. Completions for resource templates and prompt arguments. A server icon, title and real version.LLMWIKI_ROOT, then MCP roots (VS Code sends them), then<cwd>/.wiki, and addswiki_open/wiki_init. The extension still binds the server to its wiki, so those two tools don't appear there.wiki_create_entity/wiki_create_conceptacceptsources, andwiki_update_pageacceptsaddSources. Pages created or extended by agents are cleaned up only when all of their sources are removed, matching what the extension's own ingest does. Source paths must be existing pages, and pages without sources are never cleaned up automatically.ELECTRON_RUN_AS_NODE=1explicitly. It runs the VS Code binary as Node and previously relied on inheriting that variable.Phase 2: skills, the Wiki Librarian agent, and the agent plugin
plugin/(Agent Plugins 1.0) is the single source for the skills (wiki-ask,wiki-research,wiki-ingest, plus on-demandwiki-saveandwiki-fix), the Wiki Librarian agent, and a.wiki/**instructions rule.chatSkills/chatAgents/chatInstructions(gated onllmwiki.isWikiWorkspace);esbuild.config.mjscopies them intoout/chat/.plugin/server/llmwiki-mcp.cjs). It is minified, deterministic and markedlinguist-generated, and CI fails if it's stale. Install withcopilot plugin install microsoft/llmwiki:plugin, or through.github/plugin/marketplace.json(llmwiki@llmwiki).Existing bugs found and fixed
wiki_ingest_with_contextresolved relativesourcePathagainst the server's cwd, soraw/x.mdnever worked; the docs and prompts used it anyway. It now resolves against the wiki root.lintFix({ fixOrphans: true })indexed an unindexed orphan page twice, duplicating its index entry. Confirmed againstmainwith a regression test.readPage. Cacheddataobjects are shared, so afterlintFixaddedcreatedto a page, a later read of identical content returned the mutated frontmatter. The live CLI run exposed this: the agent rewrote a page, andwiki_lintreported zero findings when there was one. Fixed and covered by unit and MCP regression tests, both confirmed to fail without the fix.ingest-and-integrateprompt named the parametersource_pathinstead ofsourcePath. TheAGENTS.mdtemplate referenced@wiki /lintand a command that doesn't exist.Fixes from code review
An independent review of this diff, plus a follow-up pass, found more issues. All are fixed here:
raw/deletion watcher deleted any page that listed the removed source, even if it also drew on another source. Both now use the new coreremoveSourcePages(), which keeps pages that still have an existing source. Agents record extra sources withaddSources.sourcesentries. Onlysources/<name>.mdsummary paths take part in provenance, and onlyENOENTcounts as missing. Previously a hand-written page listingraw/paper.pdfor a URL as a source would be deleted by Refresh or Fix Issues; that is a pre-existing bug thatwiki_fixwould have widened. The MCP tools accept only existing summary pages.sources. That was a pre-existing data-loss bug when two sources mention the same entity, and it also raced with/wiki-ingest. The new coreupsertDerivedPage()extends existing pages (content, tags, sources). The ingest keeps a summary edited while the model runs, and repeated creates no longer duplicate index entries. A skipped ingest now returnssummary_page, and its message no longer pushes agents to force a re-ingest.<cwd>/.wikiat startup first, then client roots.Fixes from the Copilot review
sources. Losing a source could later let cleanup delete a page that still had one. The new corewithWikiLockis awiki/.llmwiki.lockfile shared by the extension and every MCP server process. It is re-entrant within one call chain, and a stale lock is broken after 10 seconds. Every page and index read-modify-write runs under it: ingest,upsertDerivedPage, crosslinks, the MCP write tools, index updates, fixes and source cleanup. Cleanup checks a page's sources and deletes it under the same lock.deletePagenow resolves symlinked folders and requires the real path to stay inside the wiki, sowiki/linked -> ../rawcan't delete a raw source. It also refusesindex.mdandlog.mdin any letter case, at both the given and the resolved location.wiki_delete_pagechecks case-insensitively too.wiki_fixpreview. The dry run used to lint the current wiki and filter out findings about pages it would delete. Now it lints the wiki as it would be after the deletions, so links to those pages show up as broken, and the preview matches what applying reports.index.md. MCP discovery now uses the same test aswiki_initand the extension (.wiki/wiki/exists). A wiki whose index went missing therefore opens, andwiki_fixrebuilds the index. Before,wiki_opensent agents towiki_init, which then failed.wiki_fixdeletes. The/wiki-fixskill, thelint-and-fixprompt, the server instructions and thewiki_fixdescription now say to apply only after the user approves theremoved_pagesfrom the preview. If the user declines, the agent must not apply the fixes.Breaking changes / migration
@wiki <question>/wiki-ask@wiki /statuswiki_status@wiki /lintwiki_lint@wiki /fix/wiki-fix/ Fix with Copilot@wiki /save/wiki-save [title](previously only printed a suggested path)llmwiki-mcpwithout a path now starts in discovery mode instead of exiting when./.wikiis missing.Testing
Unit + integration (vitest): 619 tests in 35 files pass. Coverage rose to 86.7% statements, 77.4% branches and 89.7% functions, from 82.1%, 72.5% and 83.2%. New coverage includes:
fixWiki, thelintFixdry run,removeSourcePages,normalizeSourceRef,upsertDerivedPage;upsertDerivedPagecalls, andwiki_update_pagecalls overlapping with an ingest, on one page; all of these lose sources without the lock;index.md/log.md(all 8 cases fail on the previousdeletePage), and awiki_fixpreview that matches what applying reports;wiki_open/wiki_init, a wiki with noindex.md, bound mode), the maintenance tools, provenance (sources/addSources);Cross-process lock check: the committed plugin server ran as a child process and handled
wiki_update_pagecalls. Meanwhile this process extended the same page withupsertDerivedPage, the way the extension does: 12 concurrent writers, 3 rounds. No sources or content were lost, and no lock file was left behind.MCP stdio e2e: spawns the committed
plugin/server/llmwiki-mcp.cjswithnodefrom the plugin folder, the way plugin clients do. Covers discovery, open, ingest with a relative path, structured status and dry-run fix, plus bound mode andLLMWIKI_ROOT.VS Code e2e (
npm run test:integration, newly runnable, VS Code 1.145.3): 7 tests pass in a real VS Code on a fixture wiki with known problems:ELECTRON_RUN_AS_NODE.No contribution-point warnings appear in the logs.
Live Copilot CLI 1.0.105 e2e (
--plugin-dir plugin, onlyllmwikitools allowed, on a seeded sample wiki):/llmwiki:wiki-ask→wiki_open→wiki_query→ 3×wiki_read_page; answered only from the wiki, with.wiki/wiki/...citations./llmwiki:wiki-save→queries/computability-basics.mdwith valid relative links and an index entry./llmwiki:wiki-fix→ dry run, apply, the remaining broken link rewritten, lint clean, nothing deleted,raw/untouched./llmwiki:wiki-ingest raw/grace-hopper.md→ summary, 6 entities and 2 concepts, all tagged withsources, 9 crosslinks. A dry-runwiki_fixafter removing the source would delete exactly those 8 pages.--agent llmwiki:wiki-librarian→ auto-loaded a skill, answered with a citation./llmwiki:wiki-ingestof a second source that overlaps existing pages extendedcobol.mdandgrace-hopper.mdwithaddSourcesinstead of overwriting them. Simulating removal of the first source then deletes only its summary and keeps both shared pages. Lint is clean.Packaging:
npm run package→ the VSIX (18 files) containsout/chat/**andout/mcp-server.cjs, and no participant or test files.A clean
npm ciwith the updated lockfile, then build, lint, the bundle freshness check, and coverage, all pass.Manual check in VS Code 1.144, signed in to Copilot (Copilot harness, extension VSIX installed): asked
/wiki-ask Is JWST a replacement for Hubble?against a sample wiki.wiki-askskill andllmwiki.instructions.md.wiki_queryonce andwiki_read_pagethree times. None of them asked for confirmation, since they're annotated read-only.Not covered:
Notes for reviewers
[Unreleased].package-lock.json: this machine resolves npm through an internal mirror. I rewrote the new@types/vscode@1.109.0entry toregistry.npmjs.orgwith asha512that I computed from the tarball and confirmed against a public lockfile.docs/images/interface.pngwas retaken in VS Code 1.144. The old one showed@wikiand listed JWST twice under Entities. The new one shows/wiki-ask, the MCP tool calls and the Lint Findings view.@llmwiki/coredoesn't appear to be published on npm. The README'snpxsnippets now also show the bundled-server alternative.