aim-init
Original:🇺🇸 English
Translated
Initialize or migrate a repo into the ai-memory pattern: the .ai-memory.toml routing marker (workspace/project), the recall/write routing snippet in CLAUDE.md/AGENTS.md, and the ai-memory MCP server entry. Includes the qmd→ai-memory migration for repos still on the old wiki/qmd stack. Use when the user asks to set up ai-memory in a project (greenfield or brownfield), wire the MCP, enable auto-capture, or migrate off qmd.
11installs
Sourcedjalmajr/skills
Added on
NPX Install
npx skill4agent add djalmajr/skills aim-initTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →aim-init
Wire a repo into ai-memory so its sessions auto-capture and the agent recalls
durable knowledge. Works greenfield or brownfield (incl. migrating off the old
/ stack — see wiki-init for the legacy pattern).
qmdwiki/ai-memory replaces the qmd+ local-index stack: knowledge lives server-side in the ai-memory instance (recalled via the MCP), not in a per-repowiki/folder. Full usage model in references/usage.md.wiki/
Route intent
- "como está?", "preciso migrar?", "doctor" → run doctor (read-only diagnosis).
- "configura ai-memory aqui", "liga a captura", "init" → install (greenfield).
- "migra do qmd", "tira o qmd e põe ai-memory" → migrate (brownfield).
Before writing anything, confirm the three routing parameters with the user — there can be
multiple ai-memory instances (e.g. a personal , a separate org
instance), so never hardcode the endpoint:
memory.djalmajr.dev- MCP endpoint — the ai-memory instance URL (e.g. ) and the server name to register it under (e.g.
https://memory.djalmajr.dev/mcp,memory-personal). Ask which instance this repo should talk to.memory-zomme - Workspace — personal → ; org repo → its own workspace (e.g.
default).zommehq - Project — defaults to the repo basename; let the user override.
The endpoint chosen here is what / will target later (by server name).
aim-queryaim-writeWhat a wired repo has
- at the repo root — routes captures + recall to a workspace/project. Operator-local: it must be git-ignored (add
.ai-memory.tomlto the global gitignore,.ai-memory.toml, so it never lands in shared/public repos).git config --global core.excludesfiletomlworkspace = "default" project = "<repo-name>" - Routing snippet in and
CLAUDE.md— theAGENTS.mdblock (template: templates/routing-snippet.md). Drives proactive recall mid-session. The canonical block can also be fetched from the MCP via the<!-- ai-memory:start -->…end -->tool.memory_install_self_routing - MCP server entry in (Claude),
.mcp.json(OpenCode),opencode.json(Codex) — points at the ai-memory instance (template: templates/mcp-entry.json). This is operator-local routing (the endpoint is per-operator — your instance, your auth), so keep it out of git the same way as the marker: add.codex/config.tomlto the global gitignore. (.mcp.jsonis pure MCP config — safe to ignore wholesale..mcp.json/opencode.jsonhold other settings too, so handle per your existing convention.) If the file is already tracked,.codex/config.tomlto untrack it (keeps the file). Committing it forces collaborators onto your instance and leaks the endpoint in shared/public repos.git rm --cached .mcp.json - Auto-capture hooks are global (+
~/.claude/settings.json), marker-gated: they fire in any repo that has~/.config/ai-memory/hooks/. So a repo needs no per-repo hook scripts — just the marker. (Legacy qmd repos have per-repo.ai-memory.tomlhooks; migration removes them.)wiki-reindex
doctor (read-only)
Report, without writing:
- Is there a ? What workspace/project? Is it git-ignored?
.ai-memory.toml - Is the routing snippet present in CLAUDE.md / AGENTS.md?
- Is an ai-memory MCP entry present in /
.mcp.json/opencode.json? Is.codex/config.tomlgit-ignored (operator-local) rather than tracked?.mcp.json - Legacy qmd? Flag any of: a MCP entry, a
qmddir withwiki/, per-repoCONVENTIONS.md, a "Wiki (*/hooks/wiki-reindex.sh)" block in CLAUDE.md/AGENTS.md,wiki/..wiki-guardrails.yml
install (greenfield)
- Confirm workspace + project with the user.
- Ensure is git-ignored globally (see step 1 above), then write the marker.
.ai-memory.toml - Insert the routing snippet into and
CLAUDE.md(idempotent — between theAGENTS.md/<!-- ai-memory:start -->markers; replace if already present).<!-- ai-memory:end --> - Add the ai-memory MCP entry to the agent configs the repo uses, and ensure is git-ignored (operator-local — see item 3 above);
.mcp.jsonif already tracked.git rm --cached .mcp.json - Tell the user auto-capture is now live (global hooks + the new marker); recall is via the session-start handoff + the routing snippet.
migrate (brownfield: qmd → ai-memory)
Run doctor first; then, with the user's confirmation:
- Marker — write (workspace/project), git-ignored.
.ai-memory.toml - MCP — in /
.mcp.json/opencode.json, replace the.codex/config.tomlserver entry with the ai-memory entry. Ensureqmdis git-ignored (operator-local);.mcp.jsonif it was tracked.git rm --cached .mcp.json - CLAUDE.md / AGENTS.md — replace the "Wiki ()" / qmd-MCP block with the routing snippet. Drop instructions that tell the agent to query
wiki/or maintainqmd.wiki/ - Remove ALL qmd-era artifacts. installs more than hooks — enumerate against wiki-init and remove every one:
wiki-init- (guardrails config).
.wiki-guardrails.yml - Hooks — (policy-check, reindex, drift-audit, suggest-ingest);
.claude/hooks/wiki-*.sh(policy-check, reindex, drift-audit, consider) +.codex/hooks/wiki-*.sh;.codex/hooks.json+.opencode/hooks/wiki-*.sh. Remove the matching hook entries from.opencode/plugins/wiki-guardrails.js, and.claude/settings.jsonfrom[features] codex_hooks = true(it only existed to enable the codex wiki hooks)..codex/config.toml opencode.json(swap topermission.skill."wiki-*"or drop)."aim-*"- ANTIGRAVITY (if the repo uses it) — the managed instruction block + any hooks/config.
.antigravity* - Auto-capture now comes from the global ai-memory hooks — no per-repo hook scripts needed.
- Global QMD checkout/wrapper (operator-level, outside the repo) — the per-project wrapper
(, or the legacy
~/.local/share/skills/qmd/wrappers/<project>-qmd) and the managed~/.local/share/essential-skills/qmd/...checkout/cache are now orphaned. Remove the wrapper; remove the shared checkout only if no other repo still uses qmd.qmd - content — leave it in place as history by default. If the user wants it in ai-memory, ingest the markdown into the chosen workspace/project (one page per file, redact any literal secrets) and then they can remove
wiki/. Do not deletewiki/without explicit confirmation.wiki/ - Re-run doctor to confirm: marker present + git-ignored, snippet in CLAUDE/AGENTS,
ai-memory MCP wired, and no qmd remnants (no , no
.wiki-guardrails.ymlhooks/ plugins, no qmd MCP entry, nowiki-*/codex_hookspermission leftovers).wiki-*
Verify
- → ignored (not committed).
git check-ignore .ai-memory.toml - Routing snippet present once (between the markers) in CLAUDE.md + AGENTS.md.
- No MCP entry /
qmdhooks remain (for migrate).wiki-reindex - A capture round-trips: a real agent session in the repo lands a page under the chosen
workspace/project (check via /
aim-statusormemory_status)./api/v1/projects
See references/usage.md for the recall model (handoff per project,
auto-capture, the MCP tools) and aim-query / aim-write
for manual recall/write.