| name | upgrade |
| description | Reconcile this project's .codex/idev/ state with the currently installed plugin version — add missing directories and config keys, refresh the AGENTS.md snippet, and update stale idev git hooks, without touching caches or user content. |
$idev:upgrade
Bring a project initialized under an older idev version up to date with the
installed plugin. Never touches caches, journal, lessons, or any
user-authored content.
Arguments: $ARGUMENTS (--dry-run: report drift, change nothing).
Steps
-
Versions: read the installed version from
${PLUGIN_ROOT}/.codex-plugin/plugin.json and the project's
.codex/idev/.idev-version (treat missing as "pre-0.9.0"). If equal,
report "up to date" and stop.
-
Directory drift: run the mkdir -p from idev-init step 2 — it is
idempotent and only creates what's missing. Report which directories
were added.
-
Config drift (merge, never overwrite values):
.codex/idev/project-config.json: add keys that exist in
${PLUGIN_ROOT}/templates/project-config.json but not in the
project's copy (e.g. the git section). Preserve every existing
value. List added keys and tell the user which need filling in.
.codex/idev/commit-style.md missing → copy from templates.
-
AGENTS.md snippet: if the project's AGENTS.md contains the
===== idev plugin marker, compare against
${PLUGIN_ROOT}/templates/claude-md-snippet.md. If the guide
sections differ, replace the snippet block — but first extract any
user-tuned policy values (API config, branch list, migration policy)
from the old block and re-apply them to the new one. Show the diff
before writing.
-
Git hooks: for prepare-commit-msg and commit-msg in the repo's
hooks dir that carry the # idev marker, diff against
${PLUGIN_ROOT}/templates/git-hooks/. If stale, reinstall
(chmod +x). Never touch non-idev hooks.
-
Stamp: write the installed version to .codex/idev/.idev-version.
-
Report: table of component → action taken (added / merged /
replaced / up-to-date / skipped), plus anything needing user input.
With --dry-run, the same table with proposed actions only.