{"id":"mode-creator","name":"mode-creator","summary":"ドメイン固有の観察タイプ、コンセプトタグ、オプションのTelegramアラート、ボット設定、ワーカー再起動、起動コンテキスト検証など、カスタムClaude-memモードをインタラクティブに作成、インストール、有効化、検証できます。","body":"# Mode Creator\n\nCreate 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.\n\n## Ground rules\n\n- Use the available interactive question tool (`AskUserQuestion`, `request_user_input`, or equivalent) for the interview. Ask in small batches and wait for each response.\n- Explain observation types as mutually exclusive kinds of notes and concepts as reusable tags. Avoid jargon unless the user uses it first.\n- Inspect existing bundled and user modes before inventing a new one. Reuse or remix a close match when that serves the user better.\n- Do not edit a plugin cache or bundled mode. Install custom files under the resolved claude-mem data directory's `modes/` folder.\n- Do not expose a Telegram token in chat, command arguments, logs, or tool output. Treat it like a password.\n- Preserve unrelated settings and existing Telegram triggers. The helpers make timestamped backups and merge requested triggers.\n- Custom modes are supported by the local worker runtime. If `CLAUDE_MEM_RUNTIME` is `server`, explain that this workflow cannot safely install a per-user mode into the shared server and stop before mutation.\n- Existing observations keep their original types. The new mode applies to future observation generation.\n\n## 1. Open with the purpose\n\nBegin with this message inside the first interactive question:\n\n> 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?\n\nDo not start by asking for a mode name or JSON fields. Learn the work first.\n\nIf the answer is code-related, say:\n\n> 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?\n\nUse 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.\n\n## 2. Discover what is worth remembering\n\nUse follow-up questions to obtain:\n\n1. Three examples of moments or findings they would want available next week.\n2. Routine activity that should be skipped.\n3. The nouns and decisions they search for later: people, cases, materials, clients, constraints, experiments, incidents, and so on.\n4. Anything sensitive that should never be recorded or sent to Telegram.\n5. Whether notes should be selective or detailed.\n\nInfer 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.\n\n## 3. Propose the mode\n\nRead [references/mode-authoring.md](references/mode-authoring.md) before drafting.\n\nPropose:\n\n- A clear mode name and lowercase ID.\n- Usually 4–8 observation types. Each observed item gets exactly one type.\n- Usually 4–8 concept tags. An item may get several concepts.\n- One-sentence recording and skipping policies.\n- Two realistic notes the mode would record and two it would skip.\n\nPresent 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.\n\nPrefer 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.\n\n## 4. Ask about Telegram alerts\n\nAfter the taxonomy is approved, ask:\n\n> 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.\n\nIf yes:\n\n- Let the user select exact observation types and/or concept tags from the approved mode.\n- Explain that matching is OR: any selected type or any selected concept sends an alert.\n- Ask whether they already have a Telegram bot connected to claude-mem.\n- Read [references/telegram.md](references/telegram.md), then guide new users through BotFather and the secure setup helper.\n\nIf no, leave every Telegram setting unchanged.\n\n## 5. Draft, validate, and install\n\nResolve the absolute directory containing this `SKILL.md`; all helper paths are relative to that directory.\n\nWrite the approved mode to a temporary JSON file. Use the exact inherited override shape in the authoring reference. Then validate without mutating anything:\n\n```bash\nnode <skill-directory>/scripts/install-mode.mjs \\\n  --mode <temporary-mode.json> \\\n  --mode-id <parent--custom-id> \\\n  --dry-run\n```\n\nFix every validation error before installation. Then install and activate it:\n\n```bash\nnode <skill-directory>/scripts/install-mode.mjs \\\n  --mode <temporary-mode.json> \\\n  --mode-id <parent--custom-id> \\\n  --telegram-types <comma-separated-approved-types> \\\n  --telegram-concepts <comma-separated-approved-concepts>\n```\n\nOmit both Telegram flags when alerts were declined. The installer:\n\n- Merges the override with its parent and validates the complete mode.\n- Installs the source override under `<data-dir>/modes/`.\n- Sets `CLAUDE_MEM_MODE` in `settings.json`.\n- Merges approved alert triggers without deleting existing triggers.\n- Writes atomically and reports any backup paths.\n\nReview its JSON result. Do not claim success if `ok` is not `true`.\n\n## 6. Connect Telegram when needed\n\nIf 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.\n\nRun the credential helper only after explicit consent:\n\n```bash\nnode <skill-directory>/scripts/configure-telegram.mjs \\\n  --types <comma-separated-approved-types> \\\n  --concepts <comma-separated-approved-concepts>\n```\n\nThe 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.\n\nIf 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.\n\n## 7. Restart and prove the result\n\nRead the configured runtime before restarting. For a worker runtime, use the verified CLI restart path:\n\n```bash\nnpx claude-mem restart\nnpx claude-mem status\n```\n\nIf 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.\n\nVerify all of the following:\n\n1. Restart reports a new healthy worker and exits successfully.\n2. The installed file exists under the resolved data directory.\n3. `settings.json` names the intended `CLAUDE_MEM_MODE` without displaying secrets.\n4. Request full startup context with the `session_start_context` MCP tool when available. Otherwise call `/api/context/inject?project=mode-creator-verification&full=true` on the configured local worker.\n5. Startup context contains `Mode: <mode name> (<mode id>)`.\n6. If Telegram was configured, the test message arrived.\n\nIf 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.\n\n## 8. Hand off clearly\n\nConclude with:\n\n- Active mode name and ID.\n- Installed path.\n- Observation types and concepts.\n- Telegram trigger types/concepts, or “unchanged.”\n- Restart and startup-context verification result.\n- Backup paths for rollback.\n- One short example of what the new mode will now remember.\n\nNever include the Telegram bot token in the handoff.","author":"@thedotmack","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/thedotmack/claude-mem/tree/main/plugin/skills/mode-creator","license":"Apache-2.0","category":"review","lang":"en","tokens":1815,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[{"path":"evals/evals.json","size":1592,"sha256":"80517934355adc63c37c7f6b624116c7fe9571e9fde7cf6cef7d99e4f59d5ef3"},{"path":"references/mode-authoring.md","size":7262,"sha256":"e528775ad7357b365221a2fbaf1c09ad56f91fb6c543a1c919eebfc16b306579"},{"path":"references/telegram.md","size":3137,"sha256":"2e6dae29ce1c0023820a504b3671fc83555cc3adfce1194c1e88a4f22d7cbf05"},{"path":"scripts/configure-telegram.mjs","size":8390,"sha256":"4d67d868b1519d09f2dd3b47bf7b3920a78d2c8409d58e096f5cecdc3b983621"},{"path":"scripts/install-mode.mjs","size":9965,"sha256":"80f9c7a5c8df2e7ca7ce90b7d37c7fea48d093cda43c5fbf2847f4d0fe2122e5"}],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[{"code":"injection.bypass","kind":"injection","where":"evals/evals.json:13","excerpt":"without approval","message":"instructs the agent to bypass the human","severity":"warn"},{"code":"net.endpoints","kind":"exfiltration","excerpt":"api.telegram.org, core.telegram.org, t.me","message":"bundled scripts reach 3 external host(s)","severity":"warn"}],"scannedAt":"2026-08-22","hasScripts":true,"networkEndpoints":["api.telegram.org","core.telegram.org","t.me"]}}