agentleFS
marinvchmarinvch/Cortex/skills/migrate-engine/SKILL.md

migrate-engine

Skill1 starsChanged 2 months agoMITView on GitHub

Move a repo off the retired `.ai-os/` engine onto plain-files Cortex without losing its memory — harvest first, delete second.

  • Deletes or force-pushes

The file

We split this skill into the rules it gives an agent

11 rules. About 0 are common, 6 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Check git status is clean (or stash).

    line 24
  2. Very specific:

    If there's no new brain yet (AGENTS.md absent), run /install-project first — this ritual *enriches* the brain, it doesn't create it.

    line 26
  3. Distinctive:

    Read these, pull only durable, verified facts, and fold them in:

    line 41
  4. Distinctive:

    Dedupe: If AGENTS.md already says it, skip it.

    line 53
  5. Distinctive:

    Route to the right brief: If a fact is specific to a critical area that has (or should have) a scoped AGENTS.md leaf, put it in that leaf — …

    line 57
  6. Very specific:

    Do NOT copy engine *mechanics* (MCP tool names, get_session_context, session protocols) — those die with the engine.

    line 61
  7. Very specific:

    Before any rm, archive the full old-engine footprint so nothing is ever truly lost:

    line 69
  8. Very specific:

    Keep the tarball outside the repo (or add it to .gitignore).

    line 77
  9. Distinctive:

    Delete only what you backed up and harvested:

    line 80
  10. Very specific:

    .mcp.json / .vscode/mcp.json: remove just the ai-os server entry.

    line 84
  11. Distinctive:

    No engine artifacts remain: re-run the Step 1 scan → empty.

    line 92

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/migrate-engine — move the old brain into Cortex, then retire it safely

The earlier AI OS was an engine: a Node/MCP-server system that scattered generated context, a durable memory store, agents, and prompts across .ai-os/ and .github/. Cortex replaced it with plain files (AGENTS.md + shims + docs/decisions.md). This ritual moves any hand-verified knowledge out of the old engine into the new brain, then removes the old files.

The one rule: harvest before you delete

Engine memory is the only thing that isn't re-derivable from the code. Never rm an engine artifact until its knowledge is in AGENTS.md or docs/decisions.md. Re-generatable scaffolding (agents, prompts, dependency graphs, stack/architecture auto-dumps) can be dropped freely.

Step 0 — Confirm scope & require a clean git tree

  • Work ONLY inside the target repo (default: cwd). Never touch the personal vault.
  • Check git status is clean (or stash). The migration is recoverable via git + the backup archive, but a clean tree makes the diff reviewable.
  • If there's no new brain yet (AGENTS.md absent), run /install-project first — this ritual enriches the brain, it doesn't create it.

Step 1 — Detect the old engine

Scan for any of these (presence of one = engine installed):

  • .ai-os/ (the MCP server) and an ai-os entry in .mcp.json / .vscode/mcp.json
  • .github/ai-os/ (config.json, manifest.json, context/, memory/, recommendations.md, tools.json)
  • .github/agents/*.agent.md, .github/copilot/**, .github/instructions/*.instructions.md, .github/skills/**, .github/COPILOT_CONTEXT.md, .github/workflows/ai-os-*.yml
  • .vscode/*.chatprompt.md, .vscode/toolsets.json
  • An engine-style .github/copilot-instructions.md (references MCP tools like get_session_context)

List exactly what exists before touching anything.

Step 2 — Harvest (high-signal → into the brain)

Read these, pull only durable, verified facts, and fold them in:

Source (old engine)What to takeWhere it goes (new brain)
.github/ai-os/memory/memory.jsonlEvery active fact (title + content). This is the crown jewels — hand-verified repo knowledge.AGENTS.md → ## Conventions / ## Gotchas / a new ## Security & data section
.github/ai-os/memory/session/failure-ledger.jsonlRecurring failure patterns, if non-emptyAGENTS.md → ## Gotchas
.github/ai-os/context/protected-blocks.mdThe @ai-os:protect convention, if used in codeAGENTS.md → ## Conventions (rename marker if desired)
.github/COPILOT_CONTEXT.md + config.json.persistentRules"MUST-ALWAYS" rulesAGENTS.md → ## Conventions (dedupe against what's already there)
.github/ai-os/context/{architecture,conventions,stack}.mdAnything TRUE not already in AGENTS.md. These are mostly auto-generated — cross-check, don't blindly copy.AGENTS.md (only the gaps)
.github/copilot/skills/*.md, .github/instructions/*.mdGenuine domain rules a human wroteAGENTS.md or a repo docs/ note

Rules while harvesting:

  • Dedupe. If AGENTS.md already says it, skip it.
  • Verify against the code. Memory can be stale. If a fact names a file/flag, confirm it still exists before promoting it. Drop or correct anything wrong.
  • Keep it factual and concise — one line per fact, evidence-based.
  • Route to the right brief. If a fact is specific to a critical area that has (or should have) a scoped AGENTS.md leaf, put it in that leaf — not root. (e.g. RAG/embedding facts → src/lib/AGENTS.md, webhook/raw-body facts → the webhooks leaf.) Offer to run /cortex-brief for areas the harvested memory clusters around. Global facts go in root; area facts go in the leaf.
  • Do NOT copy engine mechanics (MCP tool names, get_session_context, session protocols) — those die with the engine.

Step 3 — Record the migration

Append a dated entry to docs/decisions.md: what was migrated, how many memory facts were folded in, and what was removed. This is the audit trail.

Step 4 — Back up everything you're about to delete

Before any rm, archive the full old-engine footprint so nothing is ever truly lost:

tar -czf ai-os-engine-backup-$(date +%Y%m%d).tar.gz \
  .ai-os .github/ai-os .github/agents .github/copilot .github/instructions \
  .github/skills .github/COPILOT_CONTEXT.md .github/workflows/ai-os-*.yml \
  .github/copilot-instructions.md.bak* .vscode/*.chatprompt.md .vscode/toolsets.json \
  .mcp.json .vscode/mcp.json 2>/dev/null || true

Keep the tarball outside the repo (or add it to .gitignore). Git history is the second safety net.

Step 5 — Remove the old engine

Delete only what you backed up and harvested:

  • rm -rf .ai-os .github/ai-os .github/agents .github/copilot .github/instructions .github/skills
  • rm -f .github/COPILOT_CONTEXT.md .github/workflows/ai-os-*.yml
  • rm -f .vscode/*.chatprompt.md .vscode/toolsets.json (leave the user's own settings.json)
  • .mcp.json / .vscode/mcp.json: remove just the ai-os server entry. If it was the only entry, delete the file.
  • .github/copilot-instructions.md: replace engine content with a shim → AGENTS.md (or leave the Cortex shim if /install-project already wrote one). Move old *.bak into the tarball.
  • Clean stragglers: .gitignore lines that only referenced .ai-os/.github/ai-os; the eslint.config.mjs .ai-os/** ignore.

Step 6 — Verify

  • No engine artifacts remain: re-run the Step 1 scan → empty.
  • AGENTS.md now contains the harvested facts; docs/decisions.md has the migration entry.
  • The backup tarball exists.
  • npm run lint (or the repo's lint) still passes.
  • Show the user the diff and the list of removed paths. Done.

Rules

  • Harvest-before-delete is non-negotiable.
  • Idempotent: safe to re-run; if nothing matches Step 1, report "no engine found" and stop.
  • One repo at a time. Never promote company code/data into the personal vault.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.