Done:
- npm package (ESM, Node >= 20), TypeScript strict (
noUncheckedIndexedAccess), build withtsc. - ESLint 9 (flat config,
typescript-eslintstrict) + Prettier, Vitest. - GitHub Actions CI: lint, format check, typecheck, build, tests on Node 20 and 22.
- README, LICENSE (MIT), minimal CLI skeleton (
modshift --version). - Test setup that stubs the global
fetchso that any accidental real network call fails.
Decisions:
- Runtime dependencies kept minimal:
commander(CLI),fflate(zip read/write, pure JS),smol-toml(TOML parsing formods.toml). HTTP uses Node's nativefetch. - Vitest pinned to 4.1.x (not 5.x) because Vitest 5 requires Node >= 22 and we support
Node 20. TypeScript pinned to 5.9 (the 7.x native compiler is not yet supported by
typescript-eslint). - npm 10 crashes (
Cannot read properties of null (reading 'edgesOut')) when resolving the Vitest 4.1.12 peer set from scratch; the lockfile was generated with npm 11.npm cion npm 10 works fine with that lockfile. - Modrinth's docs site is not reachable from the dev environment; the API was checked against the
official OpenAPI spec (
modrinth/coderepository,apps/docs/public/openapi.yaml, v2.7.0).
Done (src/input/):
.mrpack:modrinth.index.json(name, version, Minecraft version, loader fromdependencies), mod files with their SHA-1/SHA-512,env, downloads;.jarfiles found inoverrides/,client-overrides/,server-overrides/are read and hashed locally.- CurseForge zip:
manifest.json(Minecraft version, primary loader such asforge-47.2.0,files[]project/file IDs, custom overrides folder) + override jars. - Folder of
.jar: uses themods/subfolder if present (instance folder), otherwise the folder itself; non-recursive. - Jar metadata:
fabric.mod.json,quilt.mod.json,META-INF/mods.toml,META-INF/neoforge.mods.toml(mod id, name, version, dependencies),${file.jarVersion}resolved fromMETA-INF/MANIFEST.MF. Multi-loader jars report every loader. loadPack(path)auto-detects the format (archive content, not file extension).- Fixtures are plain, readable files in
test/fixtures/; a helper zips them at test time (folders named*.jarbecome nested jars). Fixture hashes and IDs are fake.
Decisions:
- Only
mods/*.jarentries are treated as mods. Other files (resource packs, shaders, configs) are kept inotherFilesand not analysed for now. - Paths that escape the instance folder (
.., absolute) are ignored with a warning, as the.mrpackformat requires. - Platform dependencies (
minecraft,java,fabricloader,forge,neoforge…) are dropped from jar dependency lists; Forge/NeoForgeincompatible/discouragedentries too. - Early NeoForge mods (1.20.x) using
mods.tomlare recognised by theirneoforgedependency. fabric.mod.jsonis parsed leniently (raw control characters are tolerated) because Fabric's own parser accepts them.- CurseForge
files[]references are kept but cannot be identified (no CurseForge API): they will be reported as "not found" with an explicit reason. - For folders, the source loader is inferred only when a strict majority of jars agree; the source Minecraft version is unknown (it is not needed for the analysis).
Done (src/modrinth/):
ModrinthClientfor the endpoints ModShift needs:POST /version_files(hash lookup, SHA-1 or SHA-512),GET /project/{id},GET /projects,GET /project/{id}/version(filtered byloaders/game_versions,include_changelog=false),GET /versions,GET /search(facets).- Explicit User-Agent:
NeyorDEV/ModShift/<version> (https://github.com/NeyorDEV/ModShift), as Modrinth requires. - Rate limiting: local sliding window (300 requests / 60 s, Modrinth's documented limit) plus the
X-Ratelimit-Remaining/X-Ratelimit-Resetresponse headers. On429the client waits for the announced reset and retries. - Retries with exponential backoff (1 s, 2 s, 4 s; 3 retries) on network errors, timeouts
(30 s) and 5xx. Other 4xx errors fail immediately (
ModrinthApiError);404on project lookups returnsnull/[]. - Cache:
ResponseCacheinterface withFileCache(one JSON file per request, SHA-256 of the key, atomic writes, corrupted files ignored) andMemoryCache. Default directory:$MODSHIFT_CACHE_DIR, else$XDG_CACHE_HOME/modshift, else~/.cache/modshift. Default TTL 24 h.404results are cached too. - Offline mode: the cache is used whatever the entry age; a cache miss raises
OfflineCacheMissErrorand no request is sent. - Tests use an injected mock
fetch(test/helpers/mockFetch.ts) and a fake clock, so retries and rate-limit waits run instantly.
Decisions:
fetchand time (now,sleep) are injected instead of using an HTTP mocking library: no extra dependency and fully deterministic tests.- Bulk requests (hashes, ids) are split into batches of 100 to keep URLs and bodies small.
- Requests are sent one at a time (the limiter serialises them). Simple and well within the rate limit; parallelism can be added later if analysis feels slow.
Done (src/core/):
analyzePack(pack, target, api)runs these steps:- identify files by hash (
POST /version_files, SHA-1, or SHA-512 when only that is known); - fallback for local jars unknown to Modrinth: look up a project whose slug equals the jar's
mod id (also trying
_→-). Markedidentification: "mod-id"and "unverified"; - fetch target versions per project (
loaders+game_versionsfilters); - status per mod: compatible (the current file already supports the target), update-found, alternative-suggested, or not-found, each with a reason;
- resolve dependencies on the final list (compatible + updated mods).
- identify files by hash (
- Best version choice: native loader first (Quilt before Fabric on a Quilt target), then release > beta > alpha, then most recent; draft/unlisted versions are skipped.
- Alternatives (max 3 by default,
maxAlternatives: 0disables them). First a name search (catches ports and forks), keeping only hits that share a significant word with the original title. Then a search in the same Modrinth categories, sorted by downloads. Both are filtered on the target loader, Minecraft version andproject_type:mod. Projects already in the pack are excluded. Every alternative carriesnote: "suggestion, to verify". - Dependencies: required dependencies (by
project_id, orversion_idresolved throughGET /versions) are added recursively in a target-compatible version (dependencies.added, withrequiredBy). Those without such a version are listed independencies.missing.incompatibledeclarations between two projects of the final list are reported inconflicts.optionalandembeddeddependencies are ignored. - Tests run the real
ModrinthClientagainst an in-memory fake Modrinth (test/helpers/fakeModrinth.ts) driven bytest/fixtures/modrinth/catalog.json(fake data).
Decisions:
- Quilt targets accept Fabric versions. Forge and NeoForge are kept strictly separate, even though NeoForge 1.20.1 could load some Forge mods; that case is rare and error-prone.
- A mod whose current file already supports the target stays compatible even if a newer version exists (minimal change); upgrading everything can be a later option.
- Alternatives are not used for dependency resolution: the user must pick them first.
- Dependencies declared only in jar metadata (unidentified jars) are not resolved; Modrinth dependency data is the source of truth.
Done:
modshift analyze <pack> --mc <version> --loader <loader>with--format table|json|markdown(mdalias),--output,--offline,--no-cache,--cache-dir,--max-alternatives,--quiet,--no-color.- Reports (
src/report/):- table: aligned columns, optional ANSI colors (TTY only, honours
NO_COLOR), long notes truncated; - JSON: the full
AnalysisResultplusschemaVersion(1) andgenerator; - Markdown: summary, mods table with Modrinth links, alternatives section, dependencies, conflicts, warnings; pipes are escaped.
- table: aligned columns, optional ANSI colors (TTY only, honours
- Errors are printed without a stack trace and exit with code 1: invalid options, unreadable pack, network failure after retries, offline cache miss.
- Progress messages go to stderr, so stdout stays clean for
--format json. - CLI tests run the full program (parsing → analysis → report) against the fake Modrinth, with a real on-disk cache in a temp folder (the offline test reuses it).
- Smoke test of the built binary: in this sandbox,
api.modrinth.comis blocked by the network policy. The CLI retries 3 times (1 s, 2 s, 4 s) and exits witherror: Network error while calling …, as intended. No analysis against the real Modrinth API could be run from this environment.
Decisions:
- The exit code does not depend on statuses (a pack with "not found" mods still exits 0); a
--fail-onoption can be added later for CI use. - The "to verify" warning is placed at the start of the alternatives note, so table truncation never hides it.
- Colors use raw ANSI codes (no
chalk/picocolorsdependency).
Done:
modshift migrate <pack> --mc <v> --loader <l> --out <file.mrpack>with--loader-version,--include-alternatives,--dry-run,--forceand the shared options (--offline,--no-cache,--cache-dir,--max-alternatives,--quiet).src/migrate/:mrpackSpec.ts: format rules and validators (validateMrpackIndex,validateMrpackArchive);plan.ts:buildMigrationPlan(pure) turns anAnalysisResultinto the new index plus included and excluded mods;resolveLoaderVersion;writer.ts:collectOverrides(copiesoverrides/,client-overrides/andserver-overrides/; CurseForge overrides becomeoverrides/; mod jars are never copied) andbuildMrpackArchive, which re-validates the archive and throwsInvalidMrpackError;report.ts:MIGRATION_REPORT.mdand the console plan.
- The pack contains:
- compatible mods (same file) and updated mods, with their Modrinth file;
- added dependencies;
- adopted alternatives (only with
--include-alternatives, flagged "suggestion, to verify"); - non-mod index files from the source
.mrpack(resource packs…), kept unchanged when they still satisfy the format; - overrides.
- Excluded mods (no compatible version) are listed in
MIGRATION_REPORT.mdwith their reason and alternatives. The report is written next to--out. - Engine: new
adoptAlternativesoption. It takes the first alternative (in relevance order) that has a target version, adds it to dependency resolution, and records it inModAnalysis.adoptedAlternative. The mod's status staysalternative-suggested. - Input:
ModPack.indexFiles(raw non-mod index entries) andModPack.overridesDir(CurseForge).
Format rules (see docs/mrpack-format.md, with sources):
- The public docs (
support.modrinth.com,docs.modrinth.com) are blocked here, so the rules were read from Modrinth's own source code on raw.githubusercontent.com: the labrinth validator,PackFormat,SafeRelativeUtf8UnixPathBufandWHITELISTED_MODPACK_DOMAINS. sha1andsha512are mandatory for every file. Allowed download domains:cdn.modrinth.com,github.com,raw.githubusercontent.com.fileSizeis a u32. Paths are strict (no.., backslash, drive prefix or Windows device names). The installer requiresdependencies.minecraft.
Decisions:
- Loader version: the official loader metadata services (meta.fabricmc.net, meta.quiltmc.org,
maven.neoforged.net, files.minecraftforge.net) are blocked here, so their formats cannot be
verified.
migratetherefore needs--loader-version, except when the source pack already uses the same loader and Minecraft version (its version is reused). The check runs before any API request, and the error message points to the loader's website.--dry-runonly warns. - Mods that are not identified or have no compatible version are never copied, even when they
were local jars in
overrides/mods/: an old jar would probably crash the game. - A Modrinth file whose URL is not on an allowed domain (theoretical) is excluded with a warning, never written.
- The pack is always built and validated, even in
--dry-run, so format problems show up early. --outmust end with.mrpack, must differ from the input, and is never overwritten without--force.- Generated metadata:
name=<source name> (<mc> <loader>);versionId=<source version>+<loader>-<mc>;summarymentions ModShift and the source/target. MIGRATION_REPORT.mdhas a fixed name (as requested): two migrations into the same folder overwrite each other's report.
Done:
test/e2e/scenarios.test.tsruns the full CLI (read → analyse → plan →.mrpack→ report) against the fake Modrinth, with real files in a temp folder:- 1.20.1 Forge → 1.21.1 NeoForge (
test/fixtures/packs/mrpack-forge): JEI and Create updated, Flywheel added as Create's dependency, Rubidium excluded with Sodium/Embeddium as alternatives,envand overrides kept; also with--include-alternatives; - Fabric → Quilt: Quilt-native versions first, Fabric otherwise,
quilt-loaderdependency; - unidentifiable mods (folder of jars): unknown jars excluded with reasons, a mod-id match included but flagged "identified by mod id only, unverified";
- missing dependency: the mod is kept and the dependency is reported;
analyze --format jsonon the Forge pack.
- 1.20.1 Forge → 1.21.1 NeoForge (
- Automatic validation of every generated pack (
test/helpers/mrpackAssertions.ts):- format rules (
validateMrpackArchive); - JSON Schema
schemas/modrinth.index.schema.jsonchecked withajv(dev dependency only); - hash coherence: each
mods/entry matches the Modrinth file (sha1, sha512, size, URL).
- format rules (
test/migrate/schema.test.tschecks that the schema itself rejects invalid indexes.- Coverage:
npm run test:coverage(@vitest/coverage-v8, also run in CI) with thresholds of 80 % (statements, branches, functions, lines) onsrc/core/**andsrc/input/**.- Current: core 93 % statements / 80.3 % branches; input 95 % / 84 %; overall 92.9 % / 83 %.
- Reports are written to
coverage/(git-ignored).
- Catalog fixture extended with Forge/NeoForge projects (Create, Flywheel, Rubidium, Embeddium) and a Forge JEI version.
Decisions:
ajvis a dev dependency used only by tests. The runtime keeps its own validator (mrpackSpec.ts) because it also checks rules a schema cannot express (canonical URLs, Windows device names, duplicate paths).- Mods identified only by their mod id are included when a target version exists, but the
report marks them as unverified (
PlannedMod.unverified).
Done:
- Actionable errors (
src/errorMessages.ts):describeError()turns each known error intoerror: <message>plushint: <what to do>. Unknown errors still crash with a stack trace (they are bugs).- network: check the connection/proxy, or use
--offline; - invalid pack: the formats ModShift accepts;
- rate limit (new
RateLimitError, thrown when429persists after retries): wait N s, cached responses are reused; - offline cache miss: run once online;
- Modrinth 5xx: retry later (status page);
- other 4xx and
InvalidMrpackError: open an issue.
- network: check the connection/proxy, or use
- Unidentifiable mods: the reason now says the file may come from another site or have been modified.
- Logs (
src/commands/logger.ts): three levels (--quiet, normal,-v/--verbose), always on stderr.- The progress bar (per-project version lookup,
onProgressTickin the engine) is drawn only when stderr is a TTY and is cleared before any other line. --verboselogs every request (method, path, status, duration), cache hits and retries, through the newModrinthClientOptions.onEvent.- Rate-limit pauses of 2 s or more are always announced (
RateLimiteronWait).
- The progress bar (per-project version lookup,
createSession()(src/commands/analyze.ts) is shared byanalyzeandmigrate: logger, client (cache, offline, events) and the option checks (--quiet+--verbose,--offline+--no-cache).- Conflicts now have a
kindand anexplanation(with the recommended action), shown in every report and inMIGRATION_REPORT.md:incompatible: A declares B incompatible and both are in the final list;pinned-version: A requires a specificversion_idof B, but another B version was selected for the target;duplicate: the same project appears in several files of the source pack.
Decisions:
- Conflicts are reported, never resolved automatically: picking which mod to drop needs the user's judgement (the interactive mode, phase 14, can ask).
CliIogainedstderrIsTTYandcolumns; test IOs set them explicitly.
Done:
FileCache.stats(ttlMs?)/FileCache.clear({ olderThanMs? })(src/modrinth/cache.ts). They only touch files named like entries (<sha256>.json), so foreign files in the directory are never deleted. Unreadable entries are counted, and removed byclear --expired.modshift cache stats [--cache-dir] [--cache-ttl] [--json]andmodshift cache clear [--cache-dir] [--expired [--cache-ttl]](src/commands/cache.ts).- Configurable lifetime:
--cache-ttl <duration>onanalyze/migrate, orMODSHIFT_CACHE_TTL. Accepted values:90s,30m,12h,7d,0= always refresh; default24h.- Parsing:
src/duration.ts; resolution:resolveCacheTtl()insrc/commands/analyze.ts. - Invalid values are rejected before any request, and the error names their source (option or env var).
- Parsing:
- Offline:
OfflineCacheMissErrornow names the missing request, throughdescribeRequest()insrc/modrinth/errors.ts(e.g. "the hash lookup of 6 file(s)", "versions of project X"). An uncached alternatives search no longer aborts the analysis: it becomes a warning, and the mod is reported without alternatives. Required lookups (hashes, versions, dependencies) still stop with the hint "run once without --offline".
Decisions:
- Offline mode never reads expired entries any differently: any cached entry is used, whatever its age (unchanged since Phase 3).
- Durations without a unit are rejected (except
0) to avoid ambiguity (seconds vs. hours).
Done:
src/curseforge/client.ts:CurseForgeClientwithPOST /v1/mods/filesandPOST /v1/mods(batched ids), thex-api-keyheader, retries on 429/5xx (Retry-After), the shared response cache (TTL,--offline) and errors with hints (CurseForgeApiError401/403 → "check the key",CurseForgeNetworkError).- The key comes only from
CURSEFORGE_API_KEY(curseForgeApiKey()). It never reaches cache keys, logs or error messages (tested). There is no key in code, tests or fixtures: tests useFAKE_CF_KEY = 'test-key-not-a-real-curseforge-key'against a fake server (test/helpers/fakeCurseForge.ts, data intest/fixtures/curseforge/api.json). src/curseforge/resolve.ts:resolveCurseForgeRefs()fills the file name, path, SHA-1 and size, plus the project name and slug. The engine then identifies the same jar on Modrinth by hash, and falls back to the CurseForge slug as a Modrinth slug (unverified).Session.prepare(pack)(src/commands/analyze.ts) runs the resolution foranalyzeandmigrate. Without a key it adds the warning "N CurseForge file reference(s) not identified: set CURSEFORGE_API_KEY…". The feature is disabled, not an error.- Fuller manifest reading:
author, and a warning for an unknownmanifestVersion.required: falseis kept on the reference. CliIo.envandCliIo.createCurseForgeApimake the environment and client injectable (tests never readprocess.env).- Docs:
docs/curseforge-api.md.
Decisions:
- Verification:
docs.curseforge.comandapi.curseforge.comare blocked here. Endpoints, header,datawrapper, fields and enums (hashes[].algo1 = SHA-1) were cross-checked in packwiz (curseforge/request.go) and Prism Launcher (launcher/modplatform/flame/*.cpp), which agree. Not run against the live API. - Terms of use: metadata only; never download from CurseForge, never write CurseForge URLs (the
.mrpackformat forbids them anyway). Mods are matched on Modrinth, which is also Prism Launcher's approach for mods whose distribution is disabled. allowModDistributionis not used (not confirmed by the reference clients).
Done:
modshift.config.json(src/config/config.ts, schema inschemas/modshift.config.schema.json):target.minecraftVersion/target.loader/target.loaderVersion: defaults for--mc,--loader,--loader-version(command-line options win);ignore: file names (*wildcard, case-insensitive), Modrinth slugs or project ids; ignored mods are skipped before any lookup and listed in every report (AnalysisResult.ignored);mappings:"old mod" → "Modrinth slug or id". The match uses the file name, slug or id, and also works for unidentified files. The mod becomesupdate-foundwithmappingand the reason "Replaced by X (mapping … in modshift.config.json)", ornot-foundwhen the replacement has no target version. An unknown replacement project gives a warning, and the mod is analysed normally.- Lookup:
--config <file>, else./modshift.config.jsonif it exists;--no-configdisables it. Validation is strict (unknown keys rejected, 1 MiB max) andConfigErrorcomes with a hint. CliIo.cwdis injectable; test IOs use a non-existent folder so no local config leaks into tests.
- Security review (
SECURITY.md):- zip bombs:
readZipchecks declared sizes and entry counts before inflating (fflate allocates from the declared size); limits are inDEFAULT_ZIP_LIMITS/METADATA_ZIP_LIMITS; pack files over 1 GiB are refused;collectOverridesuses the same bounded reader; - zip slip: entries are never written by their archive name, and paths are validated (already there since phases 2 and 6);
- jars are never executed (grep shows no
eval/ child process / dynamic import); - symbolic links are skipped in folders;
loadPackrefuses non-regular files.
- zip bombs:
- Fix:
migratenow checks the loader version before CurseForge resolution (no request before a usage error).
Decisions:
- Mappings are explicit user choices, so they are reported as replacements, not "suggestions".
- Limits are generous (packs of a few hundred MB work) but bounded; they are not configurable yet.
Done:
- npm package (
package.json):repository,homepage,bugs,author,main/types/exports,bin;files: built.jsand.d.ts,schemas/,CHANGELOG.md(README and LICENSE are added by npm). Build without source maps (tsconfig.build.json);prepack= clean + build;prepublishOnly= lint + typecheck + tests;npm pack --dry-run: 93 files, about 55 kB.
- Public API
src/index.ts(import { analyzePack, loadPack, ModrinthClient, … } from 'modshift'), with types. test/package.test.ts:src/version.ts=package.jsonversion, exports, and metadata.- Release workflow
.github/workflows/release.ymlonv*.*.*tags: checks that the tag matchespackage.json, runs lint, format, typecheck and tests with coverage, thennpm packandgh release createwith notes extracted fromCHANGELOG.md(scripts/release-notes.mjs, tested) and the tarball attached. Pre-release when the tag has a-. Nonpm publish. CHANGELOG.md(Keep a Changelog), with section[0.1.0].- Full
README.md: features, installation, quick start, commands, option tables, environment variables, exit codes, config, CurseForge, cache, real output, how it works, FAQ, limits, programmatic API, contributing, security, licence.- The example output was captured from the test fixtures with the mock API, and the README says so.
CONTRIBUTING.md, and.github/ISSUE_TEMPLATE/(bug report, feature request, wrong match/suggestion, security link).
Decisions:
- Release notes come from
CHANGELOG.mdrather than from commits: they are more readable and checked by a test. - The
modshiftname was free on npm on 2026-10-20 (npm view modshift→ 404), which may change.
Done:
src/loaders/registry.ts: a single registry (LOADER_DEFINITIONS) replaces the hard-coded lists. Each entry has an id, name, kind (mod-loader/server-plugin/proxy-plugin), the.mrpackkey (onlyforge,neoforge,fabric-loader,quilt-loader), the folder (mods/plugins), an optional website, and its fallbacks with their official source.Loader,LOADERS,acceptedLoaders,MRPACK_LOADER_KEYSand the loader-version hint all come from it.- Loaders added:
liteloader,modloader,rift,babric,bta-babric,legacy-fabric,ornithe;bukkit,spigot,paper,purpur,sponge;bungeecord,waterfall,velocity. - Documented fallbacks only:
- Quilt ← Fabric (QuiltMC/quilt-loader README);
- Paper ← Spigot, Bukkit (PaperMC docs,
getting-started.mdx: "drop-in replacement for both CraftBukkit and Spigot"); - Purpur ← Paper, Spigot, Bukkit (Purpur README);
- Waterfall ← BungeeCord (Waterfall README).
- A version picked through a fallback carries
fallback {loader, source, note: "fallback compatibility, to test"}(ModAnalysisandAddedDependency). It is explained in the reason and labelled in every report (table, Markdown,MIGRATION_REPORT.md, console plan). A native version is always preferred. migraterefuses targets that.mrpackcannot declare (Paper, Velocity…), before any request, and suggestsanalyze.- Plugin metadata (
src/input/plugin.ts):plugin.yml,paper-plugin.yml,bungee.yml(minimal YAML reader, top-level keys only),velocity-plugin.json. A folder withplugins/is read like an instance withmods/. - Docs:
docs/loaders.md(table, sources, rules left out); README "Loaders" section. - Tests:
- registry consistency;
- plugin metadata;
- server folders on Paper, Spigot, Purpur, Waterfall and Velocity targets (native, fallback and strict cases);
- Fabric → Quilt fallback in every report;
- a native-version check for each registered loader (synthetic catalog).
Decisions and verification:
- Loader names: the Modrinth API (
/v2/tag/loader) and docs are blocked here. The names were cross-checked in packwiz (modrinth/modrinth.go) and Prism Launcher (launcher/modplatform/ModIndex.cpp). Names confirmed by neither (e.g.folia) were left out. - Not applied, for lack of a reachable official source: NeoForge ← Forge (1.20.1), and Spigot ← Bukkit (SpigotMC's site is blocked). Velocity is not BungeeCord-compatible.
- Shader/resource-pack "loaders" (
iris,optifine,canvas,vanilla,minecraft,datapack) are not targets. plugin.ymldeclaresbukkit(the most general platform); Paper and Purpur accept it through their documented fallbacks.
Done:
modshift interactive [pack](aliasi, ormodshift -i), insrc/commands/interactive.ts:- pack (argument or prompt), target Minecraft version and loader (from the registry; defaults come from the config, else the source pack);
- analysis with the saved
mappings, then the table report; - review scope: mods that need attention (
needsReview: not a safe update, a fallback, or a mod-id match), all mods, or none; - per-mod choice: accept / use one of the alternatives / exclude / ignore;
- save to
modshift.config.json(writeConfig, validated), then optionally build the pack (runMigrate, loader version asked and saved intarget.loaderVersion). Plugin platforms skip that step.
- Pure decision logic in
src/interactive/decisions.ts:optionsFor,defaultOption(saved decision, else accept, else exclude, never an alternative nobody chose),applyDecision(returns a copy; replaces earlier choices for the same key),decisionKey(original slug, else file name),needsReview,summarizeDecisions. - Config: new
excludelist. Excluded mods are analysed and reported, but left out of the pack, together with the added dependencies that only they required.ignorestill means "not analysed". Prompterinterface (src/interactive/prompter.ts): the real implementation uses@inquirer/prompts8.7.3 (pinned exactly; MIT; active, latest release 2026-10-19;npm auditclean). It is imported on demand, so the other commands do not load it. Ctrl+C →PromptCancelledError→ exit code 130, nothing saved.- Non-interactive mode unchanged: without a TTY on stdin,
interactiverefuses and points toanalyze/migrate. - Node engines changed to
^20.17.0 || >=22.13.0(required by Inquirer). - Fix: the default cache directory and TTL come from the injected environment (
CliIo.env).test/setup.tsredirectsMODSHIFT_CACHE_DIRto a temp folder (one run had written to~/.cache/modshift). - Tests: decision logic, and the full flow with a scripted prompter
(
test/helpers/scriptedPrompter.ts): saving, replay throughanalyze, defaults from the config, plugin platform, cancel, missing TTY,--no-config.
Decisions:
- Choices are stored with the existing config keys (
mappings/exclude/ignore), not a new "decisions" format: they replay with every command, without a second format. - A version published more than two weeks ago (8.7.3) was preferred over the release from the day before (8.7.4).
Done:
modshift ui [--port <n>] [--no-open]plus the cache options (src/commands/ui.ts). It opens the browser throughxdg-open/open/explorer.exe, without a shell. Ctrl+C closes the server and deletes its temporary files.- Server
src/ui/server.ts(node:http, no framework):- listens on 127.0.0.1 only, random port by default;
- random token in the URL, then the
X-ModShift-Tokenheader (compared in constant time); Hostcheck against DNS rebinding;- static files from a whitelist (
STATIC_FILES); no path is built from the URL; - API:
GET /api/info,POST /api/analyze?mc&loader&maxAlternatives&name(raw pack body, 200 MiB max, 413 above),POST /api/migrate {sessionId, loaderVersion, includeAlternatives},GET /api/sessions/:id/download/{mrpack|report|analysis},DELETE /api/sessions/:id; - sessions in memory, one subfolder per session in
mkdtemp(modshift-ui-*), expiry after 1 h, everything deleted byclose(); - headers: CSP
default-src 'none',nosniff,X-Frame-Options: DENY,no-referrer, COOP/CORP,Permissions-Policy; - errors: upstream errors (network, quota, Modrinth/CurseForge, offline) → 502; input errors → 400, with the hint.
- Page
src/ui/public/(index.html,style.css,app.js,logic.js): drag-and-drop, target (loaders from the registry, grouped by kind), status chips and filter, search, sortable table, detail dialog (versions, loaders, fallback, reason, alternatives, dependencies, Modrinth link), build and downloads (throughfetch+ blob, since the token is a header), light/dark theme (system preference plus a toggle inlocalStorage), responsive, keyboard-accessible. Data goes in withtextContentonly. - Build:
scripts/copy-ui-assets.mjscopies the assets todist/ui/public; the npmfilesinclude them. ESLint declares browser globals forsrc/ui/public/**/*.js. - Tests:
test/ui/server.test.ts: exposure, headers, whitelist, Host check, token, analyze/migrate, validated download, plugin platforms, invalid uploads, zip bomb, 413, session ids, temp folder;test/ui/logic.test.ts: sorting, filters, labels, safe links;test/ui/browser.e2e.test.ts: headless Chromium throughplaywright-core1.63.0 (dev, pinned, downloads no browser). Upload, filters, detail, build, download of a valid.mrpack, no JS or CSP errors. It runs if a browser is found (MODSHIFT_CHROMIUM,/opt/pw-browsers/chromium,/usr/bin/google-chrome, …), otherwise it is skipped; GitHub's Ubuntu runners ship Google Chrome.
Decisions:
- No framework or bundler: the page is about 700 lines of HTML/CSS/JS served as is. The pure logic
(
logic.js+logic.d.ts) is tested in Node. - Folders of jars cannot be uploaded (only archives); use the CLI for folders.
- The 1 h sessions live in memory: restarting
modshift uiloses them, by design.
Done:
- README: Node badge (
20.17+ | 22.13+), two real UI screenshots (light and dark, taken with headless Chromium from the fixture pack and labelled as fake data, indocs/images/), features of phases 13–15, a link to the CLI reference, updated limitations. docs/cli.md: complete option reference generated from each command's--help(npm run docs:cli, scriptscripts/gen-cli-docs.mjs). CI regenerates it and fails if the committed file is stale.CHANGELOG.md: loaders, fallbacks, interactive mode, web UI and the engines change added to[0.1.0](not published yet).- UI fix found on the screenshots: class rules (
.downloads { display: flex }) overrode thehiddenattribute, so the download buttons showed before any build. A global[hidden]rule fixes it, and the browser test checks it (reproduced: it fails without the fix). - CI:
actions/checkout@v5andactions/setup-node@v5(v4 runs on Node 20, deprecated on GitHub). The browser E2E test runs in CI (GitHub's Chrome), confirmed in the job logs.
Done (branch feat/cross-loader-migration):
- Same project first. The engine already queried the same project for the target loader;
a version picked for another loader than the pack's is now recorded as
loaderChange {from, to}with the reason "Same project: its Fabric version replaces the Forge one (multi-loader mod)", shown in the analysis reports,MIGRATION_REPORT.md, the plan text and the UI. Not set when the same file is kept, nor for a fallback that keeps the pack's loader (Fabric version on Quilt). - Ranked alternatives (
src/core/alternatives.ts): both searches (similar name, same categories) always run, candidates are merged and scored byscoreAlternative: shared thematic categories 40, shared title words 30, popularity 20 (log10 of downloads / 7), description keywords 10. EachAlternativehasscore(0–100) andexplanation(e.g. "similar name (minimap) · same categories (adventure, utility) · 1.0M downloads"). Shown in every report, the interactive mode and the UI;MIGRATION_REPORT.mdhas a "Why these alternatives" section. The fixture order changed as intended: JourneyMap (same theme) now ranks above JEI (more downloads, other theme). - Compatibility layers (
src/loaders/compatLayers.ts), verified from the projects' own files on raw.githubusercontent.com:- Sinytra Connector,
devREADME: Fabric mods on NeoForge, 1.21.1 "primary supported version"; requiresconnector+forgified-fabric-api(which replaces Fabric API); - Sinytra Connector,
1.20.1branch README: Fabric mods on MinecraftForge 1.20.1, LTS (critical bugfixes only); - Kilt,
version/1.20.1README +fabric.mod.json: Forge mods on Fabric 1.20.1, "very experimental", "may break worlds"; requireskilt,fabric-api,fabric-language-kotlin. Its NeoForge 1.21.1 build is "in progress": not listed. A mod with no target version but a version for the layer's source loader and the target MC version getscompatLayer(note "experimental, not guaranteed"); one extra request per such mod and layer. The plan never includes it.analyzePack(..., { compatLayers: false })disables the check (no CLI flag, to keep the CLI small). Offline cache misses become warnings.
- Sinytra Connector,
- Fixtures:
test/fixtures/packs/mrpack-forge-to-fabric(JEI multi-loader, Create and Rubidium with alternatives, Storage Tweaks with no equivalent) and catalog additions (v1jeifabric, Create Fabric, Storage Tweaks). Tests:test/core/alternatives.test.ts,crossLoader.test.ts,compatLayers.test.ts. - README section "Changing loader (e.g. Forge → Fabric)" (ModShift does not convert mod code),
docs/loaders.md"Compatibility layers" with sources, CHANGELOG. - 335 tests; coverage core 94.6 %, input 94.6 %.
Done (branch feat/client-server-sides):
- Verified in Modrinth's OpenAPI spec (raw.githubusercontent.com
modrinth/codeapps/docs/public/openapi.yaml): projectclient_side/server_side(required,optional,unsupported,unknown) are deprecated in favour of anenvironmentfield (on versions:client_and_server,client_only,client_only_server_optional,singleplayer_only,server_only,server_only_client_optional,dedicated_server_only,client_or_server,client_or_server_prefers_both,unknown). The mapping between them is copied from labrinth'sconvert_v3_environment_to_v2_side_types(apps/labrinth/src/routes/v2_reroute.rs), including the fixed sides of plugins, data packs, shaders and resource packs. src/core/sides.ts:sideOf(project, version)(versionenvironmentfirst, then project fields, else unknown),sideCategory(client / server / both / unknown;unsupportedon both sides counts as unknown),neededOn(side, target),mrpackEnv.ModAnalysis.side,AddedDependency.side,AdoptedAlternative.side,VersionRef.environment,AnalysisResult.side(target installation,bothby default).--side client|server|bothonanalyzeandmigrate,target.sidein the config (validator and JSON Schema). Withserver(orclient), mods not needed are excluded with a reason, their own dependencies dropped; unknown sides are kept with a warning..mrpackenvcomes from the source pack, else from Modrinth when both sides are known.- Reports: Markdown section "Client and server" (client-only, server-only, unknown/ambiguous, not needed), one summary line in the table, side row in the UI detail panel.
- Fixtures:
environmenton some catalog versions (Sodium, Mod Menu, Xaero client-only; Fabric API both), Cloth Config with unknown sides. Tests:test/core/sides.test.ts,test/commands/side.test.ts, config validation. 357 tests; coverage core 95.2 %, input 94.6 %. - Not done (kept simple): no
--sideininteractiveor the web UI (they useboth).
Done (branch perf/concurrent-requests):
src/concurrency.ts:mapConcurrent(items, limit, fn), an ordered promise pool (results in input order, no new call after the first error),DEFAULT_CONCURRENCY4,MAX_CONCURRENCY16. No dependency added.- Engine: version lookups (step 3), alternatives + compatibility layer searches (new step "3 bis",
searchReplacements, prefetched for every identified mod without a target version) and each dependency round (resolveDependencies(..., { concurrency })) run in the pool. Adopting an alternative stays sequential (it depends on what is already selected), and warnings are pushed in pack order, so results are identical whatever the concurrency (tested with deep equality and with the CLI's JSON output). RateLimiteralready serialisesacquire(): tested with 12 parallel calls and a fake clock, never more thanmaxRequestsper window. It stays the only gate on the request rate.ModrinthClientcoalesces identical requests in flight (inFlightmap keyed like the cache): the benchmark showed duplicate category searches with concurrency > 1.--concurrency <n>(1–16, default 4) onanalyze,migrate,interactiveandui(parseConcurrency);docs/cli.mdregenerated.bench/(npm run bench):synthetic.mjs(deterministic 200/500-mod packs and catalog),fakeApi.mjs(indexed in-memory Modrinth, optional artificial latency),run.mjs(warm-up + median of N runs, Markdown or--json),bench/README.md(method). Usesdist/(build first). Results in the README "Performance" section, stated as local processing with a fake API. The rate limiter is disabled in the bench; the script prints the minimum time the real 300 requests/minute would impose (≈ 49 s for the 500-mod pack's 545 requests).- 366 tests.
Done (branch feat/source-plugins):
- Contract (
src/sources/types.ts):ModSource { id, name, description, primary?, validateOptions?, prepare?, findCandidates? },SourceContext { env, options, offline, warn, log, debug },CandidateRequest,SourceCandidate(note "external source, to verify"). Simplest design that needs no engine rewrite: Modrinth stays the primary source queried by the engine; plugins addprepare(before analysis) andfindCandidates(after it, fornot-found/alternative-suggestedmods). - Registry (
src/sources/registry.ts): id pattern, no duplicates, a single primary source,validateOptions(config.sources);createDefaultRegistryregistersmodrinth,curseforge(the former session code, unchanged behaviour) andgithub-releases. - GitHub Releases (
src/sources/githubReleases.ts), contract verified in GitHub's OpenAPI description (raw.githubusercontent.comgithub/rest-api-description) andgithub/docssources:GET /repos/{owner}/{repo}/releases, assetname,browser_download_url,size,state, nullabledigest;User-Agentrequired,Accept: application/vnd.github+json, optionalAuthorization: BearerfromGITHUB_TOKENonly; noX-GitHub-Api-Version(the default version is used; the current value could not be checked). Name matching by whole tokens (1.21.1 ≠ 1.21.10, forge ≠ neoforge), documented fallbacks accepted. - Config key
sources(structure checked byvalidateConfig, content by each source inloadSettings), JSON Schema updated.CliIo.fetchlets tests inject a fake GitHub. ModAnalysis.external; reports: "Other sources (to verify)" (Markdown,MIGRATION_REPORT.md), a table line, UI detail rows. The plan never includes them.- Public API exports the registry, the contract and the built-in sources.
- Tests: reusable
test/sources/contract.ts(describeSourceContract), run for the 3 built-ins and a third-party example; GitHub source, registry and CLI tests with fake release data (test/fixtures/github/releases.json). 407 tests. docs/plugins.md, README "Other sources (plugins)", SECURITY (GITHUB_TOKEN), CHANGELOG.- Not done (kept simple): the web UI does not use the registry (its CurseForge resolution is unchanged, no GitHub source there); the CLI never loads third-party code (programmatic API only, on purpose).
Done (branch feat/github-action):
action/action.yml: composite action (syntax checked againstgithub/docsmetadata-syntax.md):actions/setup-node@v5,npm ci && npm run buildin${{ github.action_path }}/..(ModShift is not on npm), thennode $GITHUB_ACTION_PATH/run.mjs. Inputs:pack,mc,loader,side,config,fail-on,comment,token(github.token),curseforge-api-key,node-version; outputs:report,jsonand one count per status. Every input reaches the script throughenv:(no${{ }}insiderun:, against script injection); the pack path goes after--.action/run.mjs+action/lib.mjs(typed bylib.d.mts): twoanalyzepasses (JSON for counts, Markdown served from the cache),$GITHUB_OUTPUT,$GITHUB_STEP_SUMMARY, a single PR comment found by a hidden marker (<!-- modshift-check -->) and updated in place via the REST "issue comments" endpoints (checked in GitHub's OpenAPI description), truncated under 65,536 characters; a refused write (fork) becomes a warning;fail-onfails the job.- Tests (
test/action.test.ts): input parsing, argument building, comment create/update/refusal with a fake GitHub API, and the runner against a stub CLI (no request). action/README.md, README "GitHub Action" with a workflow example, CHANGELOG.- Not run on GitHub yet (it needs a real pull request and the real Modrinth API): manual action below. Not published on the Marketplace (manual decision).
Done (branch docs/vitepress-site):
- VitePress 2.0.0-alpha.20, pinned exactly. Choice: the stable 1.6.4 pulls Vite/esbuild
versions with open advisories (dev server only, no fix available); this release (published
2026-09-04) has 0 advisories (
npm audit). Revisit when VitePress 2 is stable. docs/.vitepress/config.mts(base/ModShift/, clean URLs, local search, nav + sidebar),docs/index.md(home). Reference pages reused as they are:cli.md(generated),loaders.md,plugins.md,mrpack-format.md,curseforge-api.md.- Guide pages (
docs/guide/*,docs/faq.md,docs/limitations.md) are generated from the README sections,action/README.mdandbench/README.mdbyscripts/gen-site-pages.mjs(npm run docs:pages): repository links rewritten for the site, images kept relative so they are bundled, pages containing{{wrapped in::: v-pre(GitHub Actions expressions). - CI:
docs:pagesmust leavedocs/unchanged anddocs:buildmust pass (VitePress also fails on dead links). Checked locally, plus screenshots of three pages in headless Chromium, no JS error. .github/workflows/docs.yml: build,actions/upload-pages-artifact@v3,actions/deploy-pages@v4(versions andpages: write/id-token: writetaken from their READMEs), onmainpushes touching the docs, or by hand. GitHub Pages is not enabled (manual action).- README / CONTRIBUTING / CHANGELOG updated.
On 2026-10-20 the maintainer ran ModShift against the real Modrinth API: Fabulously Optimized
6.5.0 (48 mods, Fabric 1.21.1) analysed and migrated to Minecraft 26.3 (new year-based
numbering), Fabric Loader 0.19.5. The migrated .mrpack imported in a launcher and the world
started. The run found four bugs, each fixed in its own PR:
- #17: unrelated alternatives (Xaero's Minimap for CIT Resewn…) because a broad category plus popularity was enough; a candidate now needs a similar name or a shared keyword;
- #18: KotlinLangForge reported missing for Fabric (declared by Zoomify's single Fabric + NeoForge file); now a warning;
- #19: one generic shared keyword ("screen") still enough; two are now required;
- #20 and #21: placeholders (
<version>,X.Y.Z) accepted as loader versions; the format is now checked and must contain a digit.
0.1.0 was published on npm on 2026-10-20 (#22: CHANGELOG dated, tag
v0.1.0, GitHub release by the Release workflow, npm publish with 2FA).
On 2026-10-21 a second real run used a CurseForge export (SkyBlock Enhanced 5.4.1, 68 files,
Fabric 26.2 → 26.3) with a real CURSEFORGE_API_KEY: the 48 CurseForge references were
resolved. A first try towards NeoForge gave almost only "not found", which is correct (Hypixel
client mods are Fabric-only). Fixes:
- #23: a README edit made on
mainbroke CI (trailing space for Prettier, stale generateddocs/guide/installation.md); - #24: an update keeping the same version number (one file per Minecraft
version, e.g. Packet Fixer
3.3.6 → 3.3.6) is now explained ("Same version number, file built for Minecraft 26.3."); - #25: resource packs and shaders listed among the mods (Faithful 32x) were
searched under the mod loader.
src/core/contentTypes.tsnow picks Modrinth's loaders for them (minecraft;iris,optifine,canvas,vanilla, from labrinth's validators), the folder (resourcepacks/,shaderpacks/, also from the CurseForgeclassId12 / 6552) and the Modrinth page URL; no mod alternatives for them. Verified on the real pack: Faithful 32x26.2-june-2026 → 26.3-september-2026.
0.1.1 (#26, merged 2026-10-21) ships these fixes: version bumped in
package.json, package-lock.json (npm version), src/version.ts, docs/cli.md. Tag and
npm publish are manual (see "Manual actions"). 443 tests.
- Live APIs: tested by the maintainer on a Modrinth
.mrpack(Fabric) and a CurseForge export with a real key (see above). Still not run against the real services: a Forge/NeoForge pack (cross-loader, compatibility layers), the GitHub Releases source, the GitHub Action. migrateneeds a loader version (--loader-versionortarget.loaderVersion), except when the source pack already uses the same loader and Minecraft version.- Resource packs and shaders are analysed only when a CurseForge export (or a folder) lists them
with the mods. In a
.mrpackthey sit in the index's non-mod files and are copied unchanged (when they still satisfy the.mrpackformat), not checked. - Alternatives (name or category search) and mod-id/slug matches are heuristics: always check them.
- Unapplied fallbacks for lack of an official source: NeoForge ← Forge (1.20.1), Spigot ← Bukkit.
- Compatibility layers are only reported for the documented combinations (Connector on NeoForge 1.21.1 / Forge 1.20.1, Kilt on Fabric 1.20.1); exact MC versions only (no 1.21 or 1.20).
- Relevance weights are a heuristic tuned on fixtures, not on real search results.
- Sides depend on Modrinth metadata, which authors often leave as
optional/optional: a mod marked so stays in a server pack.interactiveand the web UI do not offer--sideyet. - With an empty cache, Modrinth's 300 requests/minute dominate big packs (≈ 50 s for 500 mods). The benchmark measures local processing only; no real-network benchmark exists.
- Conflicts (incompatible, pinned versions, duplicates) are reported, never resolved automatically.
- A dependency that only an excluded mod needed is dropped, but not its own transitive dependencies.
- Web UI: archives only (no folder upload), sessions in memory (lost on restart), English only.
plugin.ymlis read with a minimal YAML reader (top-level keys only).- Other sources (GitHub Releases) only produce suggestions matched by file name; they never enter the migrated pack (no SHA-1/SHA-512 from GitHub). Not tested against the live GitHub API.
- npm publishing, GitHub Pages and the Marketplace are manual steps (see "Manual actions").
- Optional automatic loader versions through the official meta services (Fabric/Quilt meta, NeoForge/Forge maven), behind an option, once they can be verified.
- Also check the resource packs and shaders of a
.mrpackindex (the lookup logic exists insrc/core/contentTypes.ts; today only CurseForge exports benefit from it). - Suggestions without a real link are still possible when names share a common word (e.g. "Simple Voice Chat" for "Enhanced Chat"): watch real reports before tightening further.
--upgrade-allto also update mods that are already compatible;--fail-on <status>for CI.- "Explain" mode per mod (full decision log), and a report diff between two analyses.
- UI translations; drag and drop of a whole instance folder (zipped in the browser).
- Export to other formats (packwiz, CurseForge manifest) for users of other launchers.
At the user's request, every phase now has its own branch, named after its task and stacked on the previous one, with its own draft PR whose base is the previous branch:
| Branch | Content | PR |
|---|---|---|
feat/modpack-migration-cli |
phases 1–8 | #2 → main |
feat/offline-cache |
phase 9 | #3 → #2 |
feat/curseforge-api |
phase 10 | #4 → #3 |
feat/config-and-security |
phase 11 | #5 → #4 |
chore/release-readiness |
phase 12 | #6 → #5 |
feat/loader-registry |
phase 13 | #7 → #6 |
feat/interactive-mode |
phase 14 | #8 → #7 |
feat/web-ui |
phase 15 | #9 → #8 |
docs/finishing-touches |
phase 16 | #10 → #9 |
feat/cross-loader-migration |
phase 17 | #11 → #10 |
feat/client-server-sides |
phase 18 | #12 → #11 |
perf/concurrent-requests |
phase 19 | #13 → #12 |
feat/source-plugins |
phase 20 | #14 → #13 |
feat/github-action |
phase 21 | #15 → #14 |
docs/vitepress-site |
phase 22 | #16 → #15 |
- All of them were merged into
mainon 2026-10-20 (merge commits, in order). - Since then, one branch per fix from
main, one PR intomain, merged with a merge commit once CI is green: #17 to #21 (first real run), #22 (release 0.1.0), #23 to #25 (second real run), #26 (release 0.1.1). Two PRs adding to the CHANGELOG'sUnreleasedconflict once the first is merged: mergemaininto the second and keep both entries. - PR #1 (old branch
claude/great-galileo-gi0422) is closed and superseded by #2. - Commits are authored as
NeyorDEV <180453958+NeyorDEV@users.noreply.github.com>(repo-local git config, unsigned), with no Claude trailer. All earlier commits were rewritten once to that author, at the user's explicit request.
- Done: GitHub Pages enabled, merged branches deleted (including
claude/great-galileo-gi0422), real runs (Fabric.mrpack, CurseForge export with a key), 0.1.0 published on npm. - Publish 0.1.1 if not done yet (#26 is merged):
git checkout main && git pull && git tag v0.1.1 && git push origin v0.1.1: theReleaseworkflow re-runs the checks and creates the GitHub release from the CHANGELOG;git checkout v0.1.1 && npm ci && npm publish(2FA code), thengit checkout main;- check from another folder:
npm view modshift versionprints0.1.1.
- Release procedure for the next versions: entries go under
Unreleasedin each fix PR; the release PR moves them to## [x.y.z] - date, updates the compare links, runsnpm version x.y.z --no-git-tag-version, updatessrc/version.ts, thennpm run build && npm run docs:cli. TheReleaseworkflow checks the tag againstpackage.json, andtest/releaseNotes.test.tschecks that the current version has a CHANGELOG section. npm publishruns lint, typecheck and tests first (prepublishOnly): dev dependencies must be installed (npm ci, not--omit=dev), and the npm account needs 2FA.- Try the GitHub Action on a test pull request (workflow example in
action/README.md, withpermissions: pull-requests: write). Publishing it on the Marketplace is optional and manual (it needsaction.ymlat the root of a dedicated public repository, or a release from this one: decide first). - Optional: make the repository public (Settings → General → Danger Zone), then enable secret scanning and push protection; GitHub "About" description and topics.
All phases (1–22) are merged, 0.1.0 is on npm and 0.1.1 is ready to publish. Next:
- Publish 0.1.1 (manual actions above).
- Real runs still missing: a Forge or NeoForge pack (cross-loader, compatibility layers), the GitHub Action on a real pull request, the GitHub Releases source.
- Then pick from "Ideas for later". Natural follow-ups:
- check resource packs and shaders of a
.mrpackindex too; --sideininteractiveand the web UI; the source registry in the web UI;- a
--no-compat-layersCLI flag if users find the hints noisy; - downloading and hashing GitHub release assets on explicit request, so they could enter a
.mrpack(today they are suggestions only); - install the action with
npx modshiftinstead of building it on each run; - move to VitePress 2 stable when it is released.
- check resource packs and shaders of a
Everything is on main (no pending branch). On the maintainer's machine:
cd ModShift && git checkout main && git pull && npm ci && npm run build, then start Claude Code
there (claude, or a local session in the desktop app) and ask it to read README.md,
PROGRESS.md and CONTRIBUTING.md. A cloud session can be pulled locally with
claude --teleport. Locally, ModShift can reach the real Modrinth and CurseForge APIs, which
the cloud development environment cannot.
Pitfalls:
test/fixtures/modrinth/catalog.jsonwas generated by a throw-away script (not committed). Edit the JSON directly; keep IDs and hashes fake and hashes as hex of the right length (40 / 128), or the.mrpackvalidator rejects them.- npm 10 crashes when resolving new dev dependencies from scratch (
edgesOut). Usenpx -y npm@11 install -D <pkg>;npm ciwith npm 10 then works. - Prettier formats
docs/andPROGRESS.md: runnpx prettier --write .before committing. - The test CLI IO (
test/helpers/cli.ts) uses a fake clock. A client built with the real clock but a no-opsleepbusy-waits on rate-limit pauses (a test once took 37 s). - The cloud development environment cannot reach Modrinth: real runs are done by the maintainer, whose output is the reference for real-world bugs.
- Placeholders in instructions (
<version>,X.Y.Z) get copied as-is: give concrete values or say how to find them (Fabric loader versions: https://meta.fabricmc.net/v2/versions/loader). - The maintainer's terminal is Nushell on Windows: Windows paths go in single quotes
(
'C:\Users\…'), environment variables are set with$env.NAME = "…", and commands run from the project folder (node dist/cli.jsresolves relative to it). - Editing
README.md(even on GitHub): runnpx prettier --write README.md && npm run docs:pagesand commit the regenerateddocs/guide/pages, or CI fails. - Test hashes: before adding a version to
catalog.jsonor a test catalog, check the hex prefix is unused (grep -c '"c3c3c3' test/fixtures/modrinth/catalog.json); collisions silently identify the wrong project. - Alternatives need a similar name or two shared keywords; test descriptions ending in "(fixture)" share the word "fixture", so give realistic descriptions to projects a test relies on for (or against) a link.
- Site pages under
docs/guide/are generated: edit the README and runnpm run docs:pages(CI fails otherwise). VitePress interprets{{ }}in Markdown: the generator wraps such pages in::: v-pre. - Search fixtures: the fake
/searchuses project-levelloadersandgame_versions, so a new project incatalog.jsoncan change alternatives in other tests (snapshots). Checknpx vitest run -udiffs before accepting them. - In tests,
createIo({ prompter })simulates a TTY; withoutprompter,interactiverefuses. Commander callsprocess.exiton unknown options: in tests, callrunInteractivedirectly to test those cases.
None blocking.