Wiki migrate

From stevehuang0115/crewly · View interactive version

Wiki migrate is an AI agent skill from the GitHub repository stevehuang0115/crewly. One-shot conversion from legacy `.crewly/knowledge/*.json` + loose `.md` + agent `memory.json` into the v2.1 three-scope vault structure. Default dry-run; idempotent; never deletes legacy files.

How to use this skill

Skill file

Wiki Migrate

For users who installed Crewly BEFORE the v2.1 LLM-wiki landed (2026-05-22+). The legacy knowledge stores live at:

| Legacy source | New target |

|---|---|

| <project>/.crewly/knowledge/decisions.json[] | <project>/.crewly/wiki/llm-curated/decisions/<date>-<slug>.md |

| <project>/.crewly/knowledge/patterns.json[] | <project>/.crewly/wiki/llm-curated/patterns/<date>-<slug>.md |

| <project>/.crewly/knowledge/gotchas.json[] | <project>/.crewly/wiki/llm-curated/patterns/<date>-<slug>.md |

| <project>/.crewly/knowledge/relationships.json[] | <project>/.crewly/wiki/llm-curated/people/<date>-<slug>.md |

| <project>/.crewly/knowledge/learnings.md | appended to <project>/.crewly/wiki/llm-curated/log.md |

| <project>/.crewly/knowledge/*.md (loose) | <project>/.crewly/wiki/llm-curated/decisions/<slug>.md |

| <project>/.crewly/docs/*.md ← legacy query-knowledge storage | <project>/.crewly/wiki/llm-curated/docs/<slug>.md |

| <project>/CLAUDE.md / AGENTS.md / DEPLOYMENT*.md | <project>/.crewly/wiki/llm-curated/runbooks/<slug>.md |

| <project>/deploy/*.md, <project>/docs/deploy*.md, <project>/.claude/commands/deploy*.md | <project>/.crewly/wiki/llm-curated/runbooks/<slug>.md |

| ~/.crewly/agents/<id>/memory.json roleKnowledge[] — opt-in only (--include-memory) | <project>/.crewly/wiki/llm-curated/{patterns,decisions}/<date>-<slug>.md (copy; original retained) |

| <crewly-src>/config/sops/<role>/*.md (OSS-distributed) | ~/.crewly/global-wiki/llm-curated/sops/<role>/<slug>.md (via migrate/oss-sops) |

| <crewly-src>/config/domain-sops/*.sop.md | ~/.crewly/global-wiki/llm-curated/sops/domain/<slug>.md |

Agent memory is a shared cross-team pool, so a project vault does NOT receive it by default (scan, apply and the bridge auto-run all skip it). Per spec §6 the agent's memory.json stays put — with --include-memory this skill copies its roleKnowledge entries to the wiki rather than moving them, so private agent memory keeps working unchanged.

What the legacy stores were (and what replaces them)

The migration fully retires the legacy query-knowledge skill (2026-05-27). After migration:

If you're updating prompts that referenced query-knowledge, swap to:

bash {{AGENT_SKILLS_PATH}}/core/wiki-query/execute.sh --vault <vault-path> --query "<topic>" --top-k 5

Vault picker:

Guarantees

Inputs

| Flag | Required | Default | Description |

|---|---|---|---|

| --project-root <abs path> | yes | — | The dir containing .crewly/. |

| --apply | no | off | Execute writes. Without this, run a dry-run scan. |

| --include-memory | no | off | Also copy the shared per-agent memory.json pool into this vault. Off by default: a project vault only gets that project's own sources. (--no-memory is accepted and is the default.) |

| --full (or "full": true) | no | off | Return the raw backend payload including the full proposedPages array. Default output is the compact report below. |

Output: compact by default

The backend payload carries one row per proposed page — hundreds of entries on a real project — and re-reading it on every scan is a context-cost problem, not a decision aid. By default the skill therefore returns a compact report:

{
  "ok": true, "vaultPath": "...", "legacyDetected": true,
  "bootstrapNeeded": { "project": true, "global": false, "teams": [] },
  "summary": { "decisions": 10, "patterns": 8, "...": 0, "alreadyMigrated": 8 },
  "totalProposed": 25, "alreadyMigrated": 8, "skippedOther": 1, "netNew": 16,
  "routingUncertain": 2,
  "byCategory": { "decision": { "proposed": 10, "netNew": 6 }, "pattern": { "...": 0 } },
  "netNewSample": [ "llm-curated/decisions/2026-05-01-foo.md", "..." ],
  "hint": "compact view — pass --full for the complete proposedPages array"
}

Only pass --full when you actually need per-row detail (a specific sourceFile, sourceId, or the routingUncertain rows). Even then the shared skill output cap applies: very large payloads are parked under $CREWLY_HOME/tmp/skill-output/ and you get a {"truncated":true,"file":...} envelope — read the file with jq and select the fields you need.

What you do with the report

On scan (dry-run):

On apply:

Examples

Dry-run:

bash execute.sh --project-root /Users/me/code/myproject

Apply for real:

bash execute.sh --project-root /Users/me/code/myproject --apply

Apply and also copy shared agent memory.json (opt in):

bash execute.sh --project-root /Users/me/code/myproject --include-memory --apply

Inspect every proposed row (raw payload):

bash execute.sh --project-root /Users/me/code/myproject --full

Failure modes

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.