/memex:upgrade [--dry-run] [--force]from memex
Upgrades a Memex workspace to the current major version with state detection, dry-run, and force options. Runs only needed steps (resummarize, reindex, lint) for an idempotent upgrade.
Ships in memex. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Wikilink rule: When referencing files in any markdown you write, use [[filename]] format.
Bring a workspace from any older Memex layout to the current one in a single, idempotent pass. The skill is a thin orchestrator over /memex:resummarize and /memex:reindex; it adds state detection (so re-runs are cheap) and sequencing (resummarize before reindex so closets entries inherit the v2 summary rules).
For the v1 → v2 upgrade specifically, see references/v1-to-v2.md. For the v2.0 → v2.1 increment, see references/v2-to-v2_1.md. Future major versions add their own playbooks under references/.
Run WORKSPACE_ROOT=$(pwd) && echo "$WORKSPACE_ROOT" via Bash.
Read _MANIFEST.md. If the file is missing or has no <!-- memex-managed marker, tell the user "Memex isn't managing this workspace yet. Run /memex:init to set up." and stop.
Acquire memory/.upgrade.lock and check the 24-hour cooldown in memory/.upgrade-runs.log. Both follow the shared bulk-write convention. See ../consolidate/references/locking.md.
Parse $ARGUMENTS:
--dry-run. Detect state and print the upgrade plan, but do not execute. Skip the lock acquisition.--force. Re-run every step regardless of state. Useful after a closets format change, or to verify cleanliness.Read five signals from the workspace:
<!-- memex-managed:N.N.N --> from _MANIFEST.md. Compare to the current Memex VERSION. If older or missing, the workspace was scaffolded by an earlier Memex release.<!-- summary-format-version:N --> from _MANIFEST.md. If missing or < 2, summaries follow pre-v2 conventions and need /memex:resummarize.<hub>/_CLOSETS.md exists. Count hubs with coverage vs hubs without._CLOSETS.md, read the <!-- memex-closets:N.N --> marker. If < 1.1 and the hub has > 30 files, pagination needs to engage.memory/_CLOSETS.md exists. If missing on a manifest version < 2.1.0, this signals a v2.0 → v2.1 migration step.Build a state report:
Memex Upgrade — workspace state
Manifest version: <found> (current: <CURRENT>)
Summary format version: <found> (current: 2)
Closets coverage: <K>/<N> hubs (<P>%)
Closets format: <oldest version found> (current: 1.1, paginates >30 files)
Memory closets: <present | missing>
For each detected state mismatch, queue the right step. Skip steps that are already current unless --force was passed.
| Detected state | Action |
|---|---|
| Summary format < 2 OR missing | /memex:resummarize (rewrites manifest + hub summaries to the 8-rule format) |
Any hub missing _CLOSETS.md | /memex:reindex (backfills missing closets; skips current ones via mtime check) |
| Closets format < 1.1 AND any hub has > 30 files | /memex:reindex --force (pagination engages on rewrite) |
| Memory closets missing AND manifest < 2.1.0 | /memex:reindex --hub memory (creates memory/_CLOSETS.md and seeds entries for Tier 1 files) |
| Manifest version < current | bump the marker to the current version after other steps complete |
The order is fixed: resummarize first, reindex second. Reindex reads file content to populate closets entries, and the closets entries follow the same 8 retrieval-tuned summary rules as manifest summaries (see ../session-end/references/summary-rules.md). If summaries were rewritten in this run, closets need to be rewritten with those rules in primary context.
--dry-run)Print the plan:
Upgrade plan for <workspace>:
1. /memex:resummarize — refresh <K> manifest + hub summaries to v2 format
2. /memex:reindex — backfill <H> hubs (<F> files) with _CLOSETS.md
3. Update manifest marker — <old> → <current>
Estimated time: <T> seconds. Proceed? (y/n)
If --dry-run, stop after printing. Don't execute.
If the user says no, clear the lock and stop.
If yes (or no confirmation needed because --force), proceed to Step 4.
For each queued step, invoke the constituent skill and surface its output:
/memex:resummarize. If it asks "Manifest is already v2-format. Resummarize anyway? (y/n)" because of --force, answer y./memex:reindex (or /memex:reindex --force if pagination needs to engage). Pass --hub only if the user limited the scope.<!-- memex-managed:OLD --> → <!-- memex-managed:CURRENT --> in _MANIFEST.md. The current version comes from memex/.claude-plugin/plugin.json if accessible, otherwise hardcode the value documented in references/v1-to-v2.md.If any step fails, stop and surface the error. Do not roll back. The changes from earlier steps are valid on their own.
Run /memex:lint and capture its output. The expected post-upgrade state:
If lint surfaces issues that didn't exist before the upgrade, surface them prominently in the report. They're regressions caused by the upgrade and need user attention.
Append to memory/.upgrade-runs.log:
YYYY-MM-DDTHH:MM:SS from=<old-version> to=<current-version> resummarize=<ok|skipped> reindex=<ok|skipped> hubs=<N> files=<K> status=<ok|partial>
Clear memory/.upgrade.lock. Output:
Memex Upgrade Complete
From version: <old> (or "fresh upgrade")
To version: <current>
resummarize: <ok / skipped — already v2>
reindex: <ok — H hubs, F files / skipped — full coverage>
Manifest marker: <old> → <current>
Lint: <PASS / N issues>
Next session-start will load the upgraded workspace at full v2 retrieval quality.
If lint surfaced new issues, append:
⚠ Post-upgrade lint flagged issues that didn't exist before:
<issue 1>
<issue 2>
...
Resolve with /memex:lint --fix where applicable, or open the relevant files.
--force, this skill is a no-op on a workspace that's already current. The state detection in Step 1 catches that and Step 2's plan is empty. Cheap to run defensively after pulling a new Memex release._MANIFEST.md but no <!-- memex-managed marker is in compatible mode (see /memex:session-start). Upgrade refuses to operate on those. The user should run /memex:init first to opt into full Memex management. This is intentional: silently rewriting summaries on a workspace the user hasn't explicitly opted in to could surprise them.--force to reindex on a second pass./memex:upgrade will re-detect the work-in-progress state and resume from where the previous run failed.--dry-run. Dry-run still acquires the lock (briefly) to prevent two concurrent dry-runs from reading inconsistent state. If a previous upgrade crashed, the lock is honored as stale after 30 minutes. See locking reference./memex:reindex --hub <name> directly.references/v2-to-v3.md and extend the state detection in Step 1 with whatever signals v3 cares about. The skill's flow stays the same. Only the version-specific knowledge moves.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub skyfox-io/memex --plugin memex17 skills in this plugin
/add-domainAdds a new domain folder with a hub index and wires it into `_MANIFEST.md` -- for a new topic area, or splitting an existing domain into its own folder.
/archiveMoves a file from active (Tier 2) to archived (Tier 3) so Memex stops loading it automatically -- for a wrapped project, a stale reference, or a superseded file. The file stays on disk; only its manifest tier and hub status change.
/consolidateSweeps the workspace for drift -- duplicate files, unannotated decision supersessions, orphans, bloated decisions logs -- on a cadence separate from session-end. Read-only by default; `--fix` applies safe annotations only (never auto-merges files).
Other plugins' skills for the same job