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:
<project>/.crewly/docs/*.md→ still on disk (NOT deleted) but no agent skill reads them; all content is in the wiki<project>/.crewly/knowledge/*→ same — preserved as source of truth but consumers now usewiki-query- The single replacement skill is
wiki-query(v2.1) — same query verb, richer vault routing (global / team / project)
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:
- Org-wide SOPs / cross-team decisions / OKR →
~/.crewly/global-wiki - Team SOPs / team norms →
~/.crewly/teams/<team-uuid>/wiki - Project decisions / customers / project runbooks →
<project-root>/.crewly/wiki
Guarantees
- Default dry-run. No writes happen unless
--apply(orconfirm: truein JSON body) is passed. - Idempotent. A manifest at
<vault>/.migration-state.jsonrecords every migrated entry's content hash + sourceId. Re-runs skip duplicates. - Legacy preserved.
.crewly/knowledge/andmemory.jsonfiles are NEVER deleted. Rollback is just "ignore the new vault." - Bootstrap on apply. If the project / global / team vaults are missing
SCHEMA.md, they're created with the v2.1 skeleton before any content lands. - Routing default. Everything goes to the project vault. Items whose body looks cross-project (mention foreign team UUIDs, "company-wide", OKR lingo, cross-project codenames) are tagged
routing_uncertain: truein frontmatter;wiki-lintsurfaces them later for human review / promotion to global.
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"
}
byCategoryis keyed bysourceType;netNew= pages without askipReason.netNewSamplelists the first 10 net-new target paths (WIKI_MIGRATE_SAMPLE_SIZEenv overrides the count).- Apply-only keys (
applied,skipped,bootstrapped,manifestPath) pass through unchanged.
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):
netNew == 0→ nothing to do; stop here.- Read
byCategory/netNewSampleto sanity-check what will land; use--fullonly if a specific row needs inspection. - Look at
bootstrapNeeded— confirms which vaults will be created. - Look at
summary— counts per source type. routingUncertaincounts rows that will land in the project vault but flagged for later human review (--fullshows which).
On apply:
- Confirm
appliedcount matches the proposal. bootstrappedlists the vault dirs newly created.manifestPathis the persistent ledger —catit to audit the migration.- Run
wiki-lint --vault <project-vault>afterwards to surface anyrouting_uncertainitems.
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
400 invalid_input—projectRootis not absolute, orconfirmwas missing on apply (skill handles this automatically).404 project_root_missing— the directory doesn't exist.