SuperAPI AI Directory

init-simple-memorix

Agents & models

View repository

Updated 10-16 09:59

About this skill

init-simple-memorix

Overview

This skill is used to slim down Memorix hooks and check the Memorix MCP configuration. The core principle is to first determine whether the problem is hooks noise or an MCP connection/tool exposure problem, then address only the corresponding layer.

  • Hooks goal: remove high-frequency triggers such as tool calls, file edits, and command execution, keeping only session lifecycle events.
  • MCP goal: confirm that the memorix server entry uses serve --mode full, and avoid Node parameters injected by WorkBuddy breaking stdio MCP startup.
  • Distribution perspective: scripts, templates, and source indexes are all rooted at the skill installation directory, and do not reference repository source paths or development-time artifacts.

When to Use

  • The user explicitly mentions init-simple-memorix, initializing Memorix, slimming down Memorix hooks, removing memory noise.
  • After the user completes Memorix setup or upgrade, they suspect the default hooks have reintroduced high-frequency noise.
  • The user needs a project-level or global-level hooks template for reference.
  • The user reports missing Memorix MCP tools, not being in full mode, or MCP server startup failure.
  • The user sees the memorix MCP repeatedly disconnecting in WorkBuddy, still unavailable after approval,NODE_OPTIONS or Node ABI-related errors.

When Not to Use

  • The user is only asking how to use existing Memorix tools to read and write memories, and has no hooks/MCP configuration issues.
  • When the user asks to record an incident, consolidate experience, or sync memories, prefer to use record-bug-fix-memory。
  • When the user asks to release a version, write a changeset, commit code, or generate a report, this skill only provides background information and does not take over these processes.
  • The on-site symptoms are ordinary business code bugs, test failures, or build failures, with no Memorix hooks/MCP clues.

Decision Path

  1. First characterize the problem.
    • Too many, too cluttered memories, recording on every tool call: handle hooks.
    • Missing MCP tools, full mode unavailable, server disconnected: check the MCP configuration.
    • WorkBuddy approval, Node parameters, better-sqlite3 errors: go to WorkBuddy Notes.
  2. Then determine the scope.
    • Affects only the current project: use the project-level template under templates/ .
    • Affects the user's global Agent: refer to templates-global/, but do not write to the user's home directory configuration without explicit authorization.
  3. Finally choose the execution method.
    • Only need to confirm script behavior: run help or dry-run.
    • Real writes needed: must be explicitly requested by the user, and before execution state which user configuration files will be modified.
  4. For hooks noise scenarios, handle hooks first; do not put WorkBuddy MCP trust chain troubleshooting on the main path.

Reference Routing

The body of this skill only retains the decision entry points and high-frequency rules. When details are needed, read the corresponding reference file by scenario; do not load all references at once.

Reference file When to read
references/hooks-reference.md The user asks to slim down hooks, check for noise, merge project-level/global-level hooks, or needs the legacy full hooks table and template format details.
references/workbuddy-mcp-notes.md The user reports memorix MCP connection failure in WorkBuddy, untrusted/disabled,Connection closed、Node/ABI、NODE_OPTIONS or approval hash issues.
references/memorix-setup-notes.md The user has just executed memorix setup, a global install, upgraded the Memorix plugin, or needs to understand which hooks/MCP configurations may be overwritten after setup.

If the user only complains that "memory is too noisy" or that "every tool call is logged", read references/hooks-reference.mdfirst. Only when MCP connection, missing tools, approval, or Node errors also appear, read references/workbuddy-mcp-notes.md。

Safety Rules

  • Do not proactively run Memorix setup or cleanup; if a command needs to be suggested, only provide the --help or --dry-run / -DryRun / -d form.
  • Do not modify the user's home directory configuration without explicit authorization.
  • Do not delete the user's non-Memorix configuration fields, such as permissions, custom hooks, or other MCP server entries.
  • Do not promise templates that do not exist: there is no project-level Codex hooks template; Codex only appears in the global template.
  • Do not hardcode the number of tools in full mode; only require that full mode exposes the complete tool surface.
  • Do not reference development-period paths, test directories, CI configurations, report directories, or dependency installation directories in body commands or resource indexes.
  • When merging configurations, preserve unknown fields and only precisely adjust Memorix-related entries.

Hooks Quick Reference

Scope model:

Scenario Behavior
Project level When the user has not requested global configuration, only handle the IDE hooks configuration under the current project root directory.
Global level Only when the user explicitly requests global,--global, or global streamlining after setup, handle the global hooks configuration under the user's home directory.
Dual scope When the user needs both global and project level, handle global first, then the current project; do not mix the two types of paths in a single write.

Supported hooks configuration targets:

Tool Project-level target Global-level target
Claude Code .claude/settings.local.json ~/.claude/plugins/cache/memorix-local/memorix/{version}/hooks/hooks.json
Codex No project-level template provided ~/.codex/plugins/memorix/hooks/hooks.json
Cursor .cursor/hooks.json ~/.cursor/hooks.json
Windsurf .windsurf/hooks.json Not yet supported
Gemini CLI .gemini/settings.json Not yet supported
Kiro .kiro/hooks/memorix-file-save.kiro.hook Not yet supported
WorkBuddy .workbuddy/hooks/hooks.json(experimental, pending runtime verification) Not yet supported
ZCode .zcode/config.json or zcode.json Not yet supported
Antigravity .agents/hooks.json ~/.gemini/config/plugins/memorix/hooks.json

Project-level templates:

Tool Template Target form
Claude Code templates/claude-code.settings.local.json .claude/settings.local.json
Cursor templates/cursor.hooks.json .cursor/hooks.json
Windsurf templates/windsurf.hooks.json .windsurf/hooks.json
Gemini CLI templates/gemini-cli.settings.json .gemini/settings.json
Kiro templates/kiro.memorix-file-save.kiro.hook .kiro/hooks/memorix-file-save.kiro.hook
WorkBuddy templates/workbuddy.hooks.json(experimental, pending runtime verification) .workbuddy/hooks/hooks.json
ZCode templates/zcode.config.json .zcode/config.json or zcode.json
Antigravity templates/antigravity.hooks.json .agents/hooks.json

Global templates:

Tool Template Description
Claude Code templates-global/claude.hooks.json Version directories need to be discovered dynamically
Codex templates-global/codex.hooks.json Global template only
Cursor templates-global/cursor.hooks.json Global hooks
Antigravity templates-global/antigravity.hooks.json Global hooks

High-frequency events that should be removed or disabled:

Tool High-frequency noise events
Claude Code PreToolUse, PostToolUse
Codex PostToolUse
Cursor afterFileEdit, afterMCPExecution, beforeShellExecution
Windsurf post_write_code, post_run_command, post_mcp_tool_use
Gemini CLI AfterTool
Kiro File save hook keeps enabled: false
WorkBuddy PreToolUse, PostToolUse
ZCode PreToolUse, PermissionRequest, PostToolUse, PostToolUseFailure
Antigravity PreToolUse, PostToolUse

Lifecycle events that should be retained:

Tool Lifecycle events
Claude Code SessionStart, UserPromptSubmit, PreCompact, Stop
Codex SessionStart, UserPromptSubmit, Stop
Cursor sessionStart, beforeSubmitPrompt, preCompact, stop
Windsurf pre_user_prompt, post_cascade_response
Gemini CLI SessionStart, PreCompress, AfterAgent
WorkBuddy SessionStart, UserPromptSubmit, PreCompact, Stop
ZCode SessionStart, UserPromptSubmit, Stop
Antigravity PreInvocation, PostInvocation, Stop

Format key points:

  • Cursor hooks are an array of objects, for example { "command": "memorix.cmd hook" }, not an array of command strings.
  • WorkBuddy hooks use a matcher nested structure, with each event array containing { "matcher": "*", "hooks": [...] }; project-level targets and templates are experimental and pending runtime verification.
  • ZCode configuration file hooks use top-level hooks.enabled: true + hooks.events, event entries use nested matcher + hooks, and the hook command is memorix.cmd hook, do not write it as a plugin hooks structure;matcher is a case-sensitive regex, may be omitted, and must not be written as *, when matching all use .*。
  • ZCode config file hooks are disabled by default; templates must explicitly set hooks.enabled: true, you can use hooks.timeoutMs to set the overall timeout.
  • The config file events currently supported by ZCode are SessionStart、UserPromptSubmit、PreToolUse、PermissionRequest、PostToolUse、PostToolUseFailure、Stop; it does not support PreCompact, lifecycle templates must not include it.
  • The Antigravity project-level template actually exists in templates/antigravity.hooks.json。
  • The project-level Codex hooks template does not exist; Codex is only described in the global template.
  • The Claude Code global path includes {version}, and the installed latest Memorix plugin version directory must be dynamically discovered.
  • The Kiro file-save hook is disabled via enabled: false , rather than deleting the file.

Merge strategy:

  • When configuration already exists, do not perform a full overwrite; only remove the clearly high-frequency Memorix hooks, and fill in or retain lifecycle hooks.
  • Retain user fields, such as permissions、not-use-now-hooks, custom hooks, non-Memorix MCP server entries.
  • WorkBuddy configuration must retain structural fields such as matcher、description , and must not be replaced by templates in a way that causes semantic loss.
  • When the same event already has a qualified lifecycle hook, do not add it again.
  • When the user requests cleaning up historical noise memories, first explain the risks; do not proactively run memorix cleanup。

MCP Full Mode

The general core requirement for the memorix MCP server entry is command and args point to full mode:

{
	"mcpServers": {
		"memorix": {
			"command": "memorix",
			"args": ["serve", "--mode", "full"]
		}
	}
}

TOML form:

[mcpServers.memorix]
command = "memorix"
args = ["serve", "--mode", "full"]

The script entry is only used under the skill installation directory:

tsx scripts/install-mcp.ts --help
tsx scripts/install-mcp.ts --dry-run

Windows PowerShell fallback:

.\fallback\install-mcp.ps1 -DryRun

Bash fallback:

./fallback/install-mcp.sh -d

Maintenance points:

  • scripts/install-mcp.ts supports dry-run and additional config file parameters; dry-run first before actual writing.
  • When an MCP configuration already has a memorix entry, only check whether args includes --mode full。
  • WorkBuddy-related MCP entries should additionally retain or recommend env.NODE_OPTIONS = "", to avoid inheriting Node parameters injected by the parent process; the current script's main responsibility is to calibrate full args, and it should not claim that dry-run will definitely fill in the WorkBuddy env.

Known MCP configuration platforms:

Platform Configuration path Format
Codex ~/.codex/config.toml, ~/.codex/config-2026-6-13-bg.toml TOML
Claude Code ~/.claude.json JSON
Cursor ~/.cursor/mcp.json JSON
WorkBuddy ~/.workbuddy/mcp.json, ~/.workbuddy/.mcp.json JSON
ZCode ~/.zcode/cli/config.json JSON
Qoder ~/AppData/Roaming/Qoder/SharedClientCache/mcp.json JSON
Kiro ~/.kiro/settings/mcp.json JSON

Script output statuses:

Status Meaning
created The configuration file does not exist, and the script will create a new file; under dry-run it only previews.
updated The configuration file exists, and the memorix entry needs to be changed to full mode; under dry-run it only previews.
skipped The configuration already meets the requirements, or actual writing is skipped under dry-run.
error Configuration parsing, reading/writing, or format handling failed, and the issue with that file must be ruled out first.

With memorix setup / upgrade coordination:

  • memorix setup may reinstall the default hooks; after setup, if the user requests noise reduction, hooks streamlining should be executed again.
  • After a Memorix plugin upgrade, the global hooks file may be overwritten by the new version directory or default content; especially since the Claude Code global path contains a version number, it needs to be dynamically rediscovered.
  • MCP full mode and hooks streamlining are two separate chains: for missing tools, check MCP first; for memory noise, check hooks first.

WorkBuddy Notes

  • WorkBuddy may inject into child processes NODE_OPTIONS. Old Node versions do not recognize --use-system-ca , the stdio MCP will exit during the startup phase. In the memorix MCP entry, it is recommended to explicitly set env.NODE_OPTIONS = ""。
  • WorkBuddy's MCP trust hash is based on the server entry's JSON.stringify result and then SHA-256. Any mcp.json entry change may trigger re-approval.
  • After modifying mcp.json , WorkBuddy needs a full restart; merely refreshing the window or reopening the session may still use the old trust state.
  • Node 22.x's ABI is 127. Within the same major, generally no need to rebuild better-sqlite3; only after a cross-major upgrade or downgrade should rebuild be prioritized.
  • trustLevel=gray is not a sufficient failure condition. The key point of judgment is the server status=connected, and whether the Memorix tools are actually exposed.
  • When users complain about memory noise, prioritize checking the hooks templates and high-frequency events; do not first attribute the problem to the MCP trust chain.

Verification Checklist

  • YAML frontmatter is valid,metadata.version has been updated.
  • description Only write trigger conditions, do not write process descriptions, do not use first person.
  • The project-level template table includes templates/antigravity.hooks.json。
  • The project-level template table includes templates/zcode.config.json, the target form is .zcode/config.json or zcode.json。
  • The project-level template table does not have Codex; Codex only appears in templates-global/codex.hooks.json。
  • The ZCode documentation clearly states that the configuration file hooks must hooks.enabled: true and the events are written in hooks.events, not including unsupported PreCompact。
  • The Cursor format specification is an array of objects, not an array of command strings.
  • The documentation does not hardcode the number of full mode tools.
  • The command examples are only help or dry-run, and will not write to user configuration.
  • The resource index only lists relative paths within the skill installation directory.

You can suggest the user or main thread run:

tsx scripts/install-mcp.ts --help
tsx scripts/install-mcp.ts --dry-run
.\fallback\install-mcp.ps1 -DryRun
./fallback/install-mcp.sh -d

Resource Index

Path Purpose
scripts/install-mcp.ts MCP configuration check and installation CLI entry
fallback/install-mcp.ps1 Windows PowerShell fallback entry
fallback/install-mcp.sh Bash fallback entry
src/platforms.ts MCP platform registry
src/install-mcp.ts MCP configuration read/write logic
templates/ Project-level hooks template directory
templates/claude-code.settings.local.json Claude Code project-level template
templates/cursor.hooks.json Cursor project-level template
templates/windsurf.hooks.json Windsurf project-level template
templates/gemini-cli.settings.json Gemini CLI project-level template
templates/kiro.memorix-file-save.kiro.hook Kiro project-level template
templates/workbuddy.hooks.json WorkBuddy project-level template
templates/zcode.config.json ZCode project-level configuration file hooks template, can be used for .zcode/config.json or zcode.json
templates/antigravity.hooks.json Antigravity project-level template
templates-global/ Global hooks template directory
templates-global/claude.hooks.json Claude Code global template
templates-global/codex.hooks.json Codex global template
templates-global/cursor.hooks.json Cursor global template
templates-global/antigravity.hooks.json Antigravity global template
references/hooks-reference.md Detailed explanation of hooks scope, noise events, lifecycle events, template format and merge strategy
references/workbuddy-mcp-notes.md WorkBuddy MCP connection, trust approval,NODE_OPTIONS, Node ABI and log inspection details
references/memorix-setup-notes.md memorix setup / Global configuration impact after plugin upgrade and re-streamlining strategy