بنقرة واحدة
sync-from-wiki
// Use when checking whether the Star Citizen Wiki has changes the local repo doesn't have yet. Triggered by requests like "sync from wiki", "check wiki for changes", "pull recent edits", or "see what's changed upstream".
// Use when checking whether the Star Citizen Wiki has changes the local repo doesn't have yet. Triggered by requests like "sync from wiki", "check wiki for changes", "pull recent edits", or "see what's changed upstream".
Use when deploying a module or template from the local pages/ directory to the Star Citizen Wiki. Triggered by requests like "deploy Details", "push module to wiki", "sync InfoboxLua to wiki", or "deploy Template:Entity/Description".
Use when reconciling the Star Citizen Wiki's `Category:Codex icons` against the upstream `wikimedia/design-codex` repo. Triggered by requests like "sync Codex icons", "upload new Codex icons", "check for Codex icon updates", or "update CdxIcon files".
Use when migrating all article pages in a Category:<Type> from the legacy {{Item}} template to {{Entity}}, normalizing page structure, updating the type's index article, and cleaning up legacy size-based subcategories. Triggered by requests like "migrate Weapon mounts to Entity", "do a Coolers sweep", "convert Quantum drives pages to the Entity template".
Use when an existing wiki page (typically a stub or thin article) needs to be expanded with content sourced from one or more URLs, with proper citations. Covers the RSI page-fetch fallback ladder (curl → playwright-cli → Wayback) and the Development-section / Cite-template / named-ref conventions. Triggered by requests like "expand the X page with this URL", "add a Development section sourced from the patch notes", "fill out this stub from these sources".
Convert a local README.md (for a wiki module or template) into ready-to-push wikitext for the corresponding `<Namespace>:<Name>/doc` page. Use when deploying a doc page (called by deploy-to-wiki), or when the user asks to "preview the doc page" or "render the README as wikitext".
Convert a Markdown Parameters table in a wiki template README to a `<templatedata>` JSON block ready for embedding on a Template namespace doc page. Use when deploying a Template:* page's README to its /doc subpage (called by deploy-to-wiki), or when the user asks to "generate templatedata" / "preview templatedata" for a README.
| name | sync-from-wiki |
| description | Use when checking whether the Star Citizen Wiki has changes the local repo doesn't have yet. Triggered by requests like "sync from wiki", "check wiki for changes", "pull recent edits", or "see what's changed upstream". |
Pull recent changes from the Star Citizen Wiki and reconcile them against the local pages/ mirror. The inverse of deploy-to-wiki — the wiki is the source of truth for this direction.
Pass wiki: "starcitizen.tools" explicitly on every MCP call in this workflow. The server is stateless — there is no persistent "current wiki", and omitting wiki falls back to the configured default (not necessarily Star Citizen Wiki).
Use the latest commit that touched pages/:
git log -1 --format=%aI -- pages/
If the working tree has uncommitted edits to pages/, fall back to a wider window (e.g., the prior commit) and warn the user — uncommitted local work has no timestamp anchor.
Call get-recent-changes with:
since — the ISO timestamp from step 2.namespace — [828, 10] (Module, Template — the namespaces this repo mirrors).hideBots — true.If the result is paginated (continuation token), keep fetching until exhausted.
For each row, classify into one of four buckets:
| Bucket | Detection | Action |
|---|---|---|
| Own deploy | comment matches ^Sync from Git ... and user is the project deployer (e.g. Alistair3149) | Ignore — these are our own pushes. |
| Drift | title maps to a file we already have locally, but editor is someone else | Investigate (step 5a). |
| Pull candidate | title is new (Is new: true) and would map under a directory we own (e.g., a new sibling renderer under Module:Entity/..., or a new TemplateStyles file for an existing module) | Pull (step 5b). |
| Informational | title is on/under a namespace tree we don't mirror (e.g., random Template:* we never deployed) | Report only. |
"Directory we own" check: take the page title's first path segment after the namespace (e.g., Module:Entity/Ports → Entity). If pages/<namespace>/<segment>/ exists locally, treat as in-scope.
get-page to fetch the wiki source.get-page to fetch the wiki source.
Compute the local path using the inverse of deploy-to-wiki's mapping:
Module namespace:
Module:<Name> → pages/module/<Name>/<Name>.luaModule:<Name>/<Sub...> (Scribunto) → pages/module/<Name>/<Sub...>.luaModule:<Name>/<Sub...>.css (sanitized-css) → pages/module/<Name>/<Sub...>.cssModule:<Name>/<Sub...>.json (json) → pages/module/<Name>/<Sub...>.jsonModule:<Name>/doc → flag, don't pull (requires wikitext → markdown reverse conversion; tell the user to handle manually)Template namespace:
Template:<Name> → pages/template/<Name>/<Name>.wikitextTemplate:<Name>/<Sub...> (wikitext) → pages/template/<Name>/<Sub...>.wikitextTemplate:<Name>/<Sub...>.css → pages/template/<Name>/<Sub...>.cssTemplate:<Name>/doc → flag, don't pull (same reason)mkdir -p any new directory, then Write the file.
Run mise run fix then mise run lint. The fixer typically converts spaces → tabs and normalizes quotes, so the freshly-pulled local copy will diverge from the wiki copy on whitespace. That's expected.
After step 6, the wiki and local copies of pulled pages now differ on formatting only. Mention this in the summary so the user can decide whether to redeploy to normalize the wiki copy. Don't auto-deploy — pulling and pushing in the same flow is too easy to get wrong.
Show a categorized summary:
Pulled:
- Module:Entity/Ports → pages/module/Entity/Ports/Ports.lua
- Module:Entity/Ports/styles.css → pages/module/Entity/Ports/styles.css
Drift (needs decision):
- Module:Foo — edited by SomeUser at 2026-04-22
Flagged for manual:
- Module:Bar/doc — wikitext→markdown reverse conversion needed
Informational (off-mirror):
- Template:Main page/settings — Weehamster
module.json is local-only — module metadata never appears on the wiki, so don't expect to find it there or reverse-create it./doc pages are one-way — deploy-to-wiki converts README.md → wikitext via doc-page-from-readme. There's no reverse conversion; pulling a /doc edit means hand-editing the README.mise run fix even if the wiki author used spaces. This is fine; just don't claim "perfect parity" with the wiki after linting.hideBots: true skips MaintenanceBot and friends. If you need to see bot activity, drop the flag.get-recent-changes doesn't surface patrol status by default. If the user wants to know whether an edit is reviewed, pass showPatrolStatus: true (requires patrol rights on the wiki account).