Skip to content

Graph Movement

Graph movement commands support reusable planning templates and multi-repo demos.

They are powerful enough to change graph shape, so treat them as planned operations with receipts.

Common surfaces include:

Terminal window
mdkg graph clone --help
mdkg graph fork --help
mdkg graph import-template --help
mdkg fix ids --help
  • Preserve ids when moving a graph into a separate repository.
  • Rewrite ids when importing a template into the same graph.
  • Preserve links during rewrite.
  • Prefer explicit --dry-run receipts before --apply.

When importing a template that should become active work, use an explicit start goal.

Terminal window
mdkg graph import-template ./template --start-goal goal-1 --select-goal --dry-run --json
mdkg graph import-template ./template --start-goal goal-1 --select-goal --apply --json

The selected imported goal should activate cleanly and competing local active root goals should pause. Import should not leave multiple active root goals.

When separate branches create the same numeric ids, repair should keep the main-branch ids stable and rewrite the incoming ids with link preservation.

Use repair planning before apply:

Terminal window
mdkg fix plan --json
mdkg fix ids --base-ref main --dry-run --json
mdkg fix ids --base-ref main --apply --json

Do not use graph movement commands to bypass review. Validate after every apply.