Files
msd-core/commands/msd/import.md
Jakub Zych a9a7a328e6 refactor: hard-fork GSD -> MSD (Make Software Done)
Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD
across contents and paths, upstream package/repo coordinates -> @golem15/msd-core
and golem15com/msd-core. Deep links into upstream history, sibling upstream
packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is.

Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line,
package/plugin identity, regenerated lockfile, install-tree fixtures, derived
registries and benchmark baseline; migration checksum baseline re-locked
(MSD keeps its own install state, so no install had applied the old sums);
sort-order and regex-escaped expectations in tests adjusted.
2026-10-06 01:47:40 +02:00

46 lines
5.3 KiB
Markdown

---
name: msd:import
description: Ingest external plans with conflict detection against project decisions before writing anything.
argument-hint: "--from <filepath> | --from-gsd2"
allowed-tools:
- Read
- Write
- Edit
- Bash
- Glob
- Grep
- AskUserQuestion
- Agent
---
<objective>
Import external plan files into the MSD planning system with conflict detection against PROJECT.md decisions.
- **--from**: Import an external plan file, detect conflicts, write as MSD PLAN.md, validate via msd-plan-checker.
- **--from-gsd2**: Reverse-migrate a GSD-2 project (`.gsd/` directory) back to MSD v1 (`.planning/`) format. Runs `msd_run from-gsd2`. Pass `--path <dir>` to migrate a project at a different path.
</objective>
<execution_context>
@~/.claude/msd-core/workflows/import.md
@~/.claude/msd-core/references/ui-brand.md
@~/.claude/msd-core/references/gate-prompts.md
@~/.claude/msd-core/references/doc-conflict-engine.md
</execution_context>
<context>
$ARGUMENTS
</context>
<process>
If `--from-gsd2` is in $ARGUMENTS:
Run the reverse-migration (append `--path <dir>` if provided):
```bash
_MSD_SHIM_NAME="msd-tools.cjs"; _MSD_RUNTIME_ROOT="${RUNTIME_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)}"; MSD_TOOLS="${_MSD_RUNTIME_ROOT}/msd-core/bin/${_MSD_SHIM_NAME}"; if [ -f "$MSD_TOOLS" ]; then msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${_MSD_RUNTIME_ROOT}/.claude/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${_MSD_RUNTIME_ROOT}/.claude/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif command -v msd-tools >/dev/null 2>&1; then MSD_TOOLS="$(command -v msd-tools)"; msd_run() { "$MSD_TOOLS" "$@"; }; elif [ -f "$HOME/.claude/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="$HOME/.claude/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${HERMES_HOME:-$HOME/.hermes}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${HERMES_HOME:-$HOME/.hermes}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${CURSOR_CONFIG_DIR:-$HOME/.cursor}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${CURSOR_CONFIG_DIR:-$HOME/.cursor}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${CODEX_HOME:-$HOME/.codex}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${CODEX_HOME:-$HOME/.codex}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${GEMINI_CONFIG_DIR:-$HOME/.gemini}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${GEMINI_CONFIG_DIR:-$HOME/.gemini}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${COPILOT_CONFIG_DIR:-$HOME/.copilot}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${COPILOT_CONFIG_DIR:-$HOME/.copilot}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${WINDSURF_CONFIG_DIR:-$HOME/.codeium/windsurf}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${AUGMENT_CONFIG_DIR:-$HOME/.augment}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${AUGMENT_CONFIG_DIR:-$HOME/.augment}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${TRAE_CONFIG_DIR:-$HOME/.trae}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${TRAE_CONFIG_DIR:-$HOME/.trae}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${QWEN_CONFIG_DIR:-$HOME/.qwen}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${QWEN_CONFIG_DIR:-$HOME/.qwen}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${CODEBUDDY_CONFIG_DIR:-$HOME/.codebuddy}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${CLINE_CONFIG_DIR:-$HOME/.cline}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${CLINE_CONFIG_DIR:-$HOME/.cline}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${GROK_AGENTS_HOME:-$HOME/.agents}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${GROK_AGENTS_HOME:-$HOME/.agents}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${ANTIGRAVITY_CONFIG_DIR:-$HOME/.gemini/antigravity}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${OPENCODE_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/opencode}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; elif [ -f "${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}/msd-core/bin/${_MSD_SHIM_NAME}" ]; then MSD_TOOLS="${KILO_CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/kilo}/msd-core/bin/${_MSD_SHIM_NAME}"; msd_run() { node "$MSD_TOOLS" "$@"; }; else echo "ERROR: msd-tools.cjs not found at $MSD_TOOLS and msd-tools is not on PATH. Run: npx -y @golem15/msd-core@latest --claude --local" >&2; exit 1; fi
msd_run from-gsd2
```
Present the migration result to the user.
Stop here (do not run the standard import workflow).
Otherwise, execute the import workflow end-to-end.
</process>