migrate-state

A migration command that converts older NOVA-STATE.md project-state files into the current v3 work-item registry, a structured record of tasks and their status. It supports checking and previewing the conversion before applying it.

In plain words
What is it for?
Use it when converting v1 or v2 state files, when the work-item registry is missing, or when you need to check the current schema; it can also apply the conversion and run drift checks.
Why use it?
It helps projects move to the newer state format while reducing the risk of losing information. The normal process lets you inspect the proposed result before changes are made and keeps a backup.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/teamspwk/nova/migrate-state
Clone the repo
git clone --depth 1 https://github.com/TeamSPWK/nova

Made for: Claude Code.

Per session 78 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,086 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00078 $0.03086
Opus 5 $0.00039 $0.01543
Sonnet 5 $0.00016 $0.00617
Haiku 4.5 $0.00008 $0.00309

Measured yesterday against content hash 344c851bd7b8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

migrate-state scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/migrate-state.md · 228 lines

How it starts

The opening of the file, as written. The whole thing — 228 lines — stays where its author put it; the contents beside it link to each section on GitHub.

NOVA-STATE.md v1 → v2 schema 마이그레이션을 사용자 검수 흐름으로 수행한다.

적용 규칙 (on-demand 로드)

  • docs/specs/nova-state-schema-v2.md §9 마이그레이션 절차
  • docs/specs/nova-state-schema-v2.md §3 v2 frontmatter 스키마
  • docs/specs/nova-state-schema-v2.md §4 v2 본문 섹션 구조

Role

너는 Nova STATE 마이그레이션 안내자다. 자동 변환은 절대 하지 않는다. 사용자가 dry-run 결과를 보고 OK해야만 apply.

"사용자별로 NOVA-STATE.md 변형이 다양해 정형 변환 손실이 있을 수 있다." "이 커맨드는 변환 결과를 먼저 보여주고, 사용자 명시 동의를 받은 후에만 적용한다."

Options

  • (기본) : v3 work-item registry로 변환 (v1/v2 입력 모두 직접 가능). dry-run → 사용자 검수 → apply + drift-check 자동
  • --apply : dry-run 건너뛰고 바로 apply (사용자가 이미 검수 완료 시)
  • --check : 현재 schema 점검만 (변환 안 함)
  • --target=v2 : v1→v2까지만 (구버전 호환, deprecated). 일반 사용자에게는 v3 권장

기본 흐름 (v3 변환 — 단일 명령)

v5.43.1+: /nova:migrate-state 한 줄로 v1/v2 → v3 직행. 메인 에이전트가 자동 처리:

# Step 1: 자동 schema 감지 + dry-run
bash "$NOVA_PLUGIN_ROOT/scripts/migrate-state-v3.sh" --dry-run

# Step 2: 사용자 검수 후 적용
bash "$NOVA_PLUGIN_ROOT/scripts/migrate-state-v3.sh" --apply
# 자동 처리: .nova/{schema,work-items,README.md} 부트스트랩 + NOVA-STATE.md.v2.bak 백업
#            marker 영역 추가 + registry-render-state.sh 자동 호출

# Step 3: drift 18 룰 자동 검증
bash "$NOVA_PLUGIN_ROOT/scripts/registry-drift-check.sh"

v1 입력도 직접 v3 가능 (multi-hop 불필요): migrate-state-v3.sh 파서가 frontmatter 부재 + 본문 표 (Tasks/Recent/KG/Active Tree)를 직접 추출. v1→v2 거쳐갈 이유 없음 (그래도 원하면 --target=v2).

의사 결정 (Step 2 사용자 검수):

  • A. 결과 OK → --apply + drift-check 실행
  • B. 보존율 (a) < 80% → 중단 + Nova 본 레포 issue 등록
  • C. 추가 검토 → 가이드 ($NOVA_PLUGIN_ROOT/docs/guides/sibling-migration-v3.md)
  • D. 변환 안 함 → 현 STATE 유지

Procedure

Step 1 — schema 점검 (모든 옵션 공통)

head -10 NOVA-STATE.md
test -f .nova/work-items/index.json && echo "v3-registry-ready" || echo "no-v3-registry"
grep -qF "<!-- nova:registry-rendered:start -->" NOVA-STATE.md && echo "v3-marker-present"

분기:

  • NOVA-STATE.md 부재 → "STATE 없음 — /nova:setup 또는 새 세션 시작 시 자동 생성" 안내 후 종료
  • .nova/work-items/index.json 존재 + v3 marker 존재 → 이미 v3, 종료: "이미 v3 registry 적용 상태입니다. /nova:check로 drift 검증 가능."
  • .nova/work-items/index.json 의 work_items 존재 + v3 marker 부재hybrid 상태 (registry 는 이미 v3, NOVA-STATE.md 포맷만 미정합): Step 6 진입하되, migrate-state-v3.sh 가 idempotency 가드로 STATE 본문 재파싱을 자동 생략하고 v3 marker 삽입만 수행한다 — registry work-item 은 그대로 보존(재생성·강등·append 없음). dry-run 출력이 "registry 는 v3 완비 — marker 만 삽입 예정"이면 보존율(B)·4지선다 없이 결과 확인 후 바로 --apply.
  • --check 옵션 → 위 정보만 보고 후 종료
  • --target=v2 옵션 → Step 2 (legacy v1→v2 흐름) 진입
  • 그 외 (기본) → Step 6 (v3 변환) 진입. v1/v2 입력 모두 동일 처리

Read the full file on GitHub · 228 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 228 lines · 78 tokens per session scan A 344c851bd7b8

Subscribe to this mod's changes

migrate-state is a command published in the GitHub repository TeamSPWK/nova (2 stars, last pushed 2d ago), licensed MIT. It adds 78 tokens to every session and 3,086 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.