plugin/skills/mode-creator/SKILL.md
Create a useful note-taking system, not merely a valid JSON file. Interview the user, propose a small taxonomy, obtain approval, install it durably, configure optional alerts, restart the worker, and prove the active mode appears in startup context.
AskUserQuestion, request_user_input, or equivalent) for the interview. Ask in small batches and wait for each response.modes/ folder.CLAUDE_MEM_RUNTIME is server, explain that this workflow cannot safely install a per-user mode into the shared server and stop before mutation.Begin with this message inside the first interactive question:
Custom modes let you take notes for whatever you're working on. If you're a law student, you may want to write down every time a case establishes a rule, a professor flags an exam trap, or doctrines conflict. If you're an architect, you may want to capture every design decision, code constraint, client preference, or site discovery. What are you working on?
Do not start by asking for a mode name or JSON fields. Learn the work first.
If the answer is code-related, say:
Code mode already works well for software work. A custom variant may work better if it also tracks [2–4 specific kinds of notes inferred from their work] and tags [2–4 useful cross-cutting themes]. Would you like to keep standard code mode or customize it?
Use concrete suggestions. For an ML platform engineer, for example, suggest experiment outcomes, data-contract changes, production incidents, model decisions, cost findings, and reproducibility risks—not generic “custom notes.” If the user chooses standard code mode, do not create a redundant file; continue to the optional notification and verification steps.
Use follow-up questions to obtain:
Infer answers already present in the conversation instead of asking twice. When the user gives a broad answer, propose examples and let them select or edit them.
Read references/mode-authoring.md before drafting.
Propose:
Present the proposal in plain language and use the interactive question tool for approval. Let the user rename, add, remove, or reword categories. Do not write or install until they approve the taxonomy and privacy boundary.
Prefer an inherited ID such as code--architecture-practice so the mode reuses claude-mem's stable output protocol while replacing the domain taxonomy and behavioral prompts. The code parent is an implementation base; the override must remove code-specific semantics from the prompts. Use a standalone mode only when inheritance is genuinely unsuitable.
After the taxonomy is approved, ask:
Would you like Telegram notifications when claude-mem records any particular types or tags? Alerts include the observation type, title, subtitle, project, and observation ID, so avoid selecting categories that may expose sensitive material.
If yes:
If no, leave every Telegram setting unchanged.
Resolve the absolute directory containing this SKILL.md; all helper paths are relative to that directory.
Write the approved mode to a temporary JSON file. Use the exact inherited override shape in the authoring reference. Then validate without mutating anything:
node <skill-directory>/scripts/install-mode.mjs \
--mode <temporary-mode.json> \
--mode-id <parent--custom-id> \
--dry-run
Fix every validation error before installation. Then install and activate it:
node <skill-directory>/scripts/install-mode.mjs \
--mode <temporary-mode.json> \
--mode-id <parent--custom-id> \
--telegram-types <comma-separated-approved-types> \
--telegram-concepts <comma-separated-approved-concepts>
Omit both Telegram flags when alerts were declined. The installer:
<data-dir>/modes/.CLAUDE_MEM_MODE in settings.json.Review its JSON result. Do not claim success if ok is not true.
If alerts were requested and both bot token and chat ID are already present, ask permission to reuse them and send a test. If credentials are missing, explain the BotFather steps from the Telegram reference.
Run the credential helper only after explicit consent:
node <skill-directory>/scripts/configure-telegram.mjs \
--types <comma-separated-approved-types> \
--concepts <comma-separated-approved-concepts>
The helper accepts the token through hidden terminal input, validates it with getMe, discovers or asks for the chat ID, sends a test message, and stores the settings with owner-only permissions. Never pass the token as an argument.
If the agent environment cannot give the user control of an interactive terminal, show the exact helper command and pause for the user to run it locally. This is the only acceptable manual boundary; do not ask them to paste the token into chat as a workaround. After they confirm, inspect only whether the credential fields are present—never print their values.
Read the configured runtime before restarting. For a worker runtime, use the verified CLI restart path:
npx claude-mem restart
npx claude-mem status
If the CLI shim is unavailable, run the installed plugin's scripts/worker-service.cjs restart with Bun. Do not use a bare restart HTTP request when the verified CLI path is available.
Verify all of the following:
settings.json names the intended CLAUDE_MEM_MODE without displaying secrets.session_start_context MCP tool when available. Otherwise call /api/context/inject?project=mode-creator-verification&full=true on the configured local worker.Mode: <mode name> (<mode id>).If the worker falls back to code, inspect the worker log for a mode validation or lookup error, repair the mode, and repeat the restart. Do not describe a fallback as successful activation.
Conclude with:
Never include the Telegram bot token in the handoff.