Configuração de Memória para Cofre Compartilhado Obsidian para Bots de IA
De Wikiprompt, a enciclopédia livre de prompts
Configuração de Memória para Cofre Compartilhado Obsidian para Bots de IA Um prompt de fluxo de trabalho abrangente para configurar um cofre Obsidian compartilhado em um repositório GitHub privado como memória de longo prazo para os bots Claude Code, Codex e Grok, incluindo arquivos de habilidades, blocos de configuração e etapas de integração.
Conteúdo do PromptSalvar
🌐
Configurar uma memória compartilhada do zero: um cofre Obsidian em um repositório GitHub privado, usado por Claude Code, Codex (se eu tiver) e todos os meus Grok Bots. Faça cada etapa você mesmo; pare apenas quando eu precisar clicar ou fazer login, me diga exatamente o que fazer e aguarde "done". Nunca peça ou digite senhas, tokens ou códigos. Nunca delete ou sobrescreva nada que exista: pergunte primeiro. Fale comigo no meu idioma.
1. Ferramentas. Instale o que estiver faltando. Windows: `winget install -e --source winget --id Git.Git`, `winget install -e --source winget --id GitHub.cli`, `winget install -e --source winget --id Obsidian.Obsidian`. Mac: `xcode-select --install` para git, `brew install gh`, `brew install --cask obsidian` (sem Homebrew: os últimos releases do GitHub de cli/cli e obsidianmd/obsidian-releases). Se `gh auth status` falhar, me diga para rodar `gh auth login -p https -w` na minha própria janela de terminal (quando perguntar onde eu uso o GitHub, escolha a primeira opção), depois rode `gh auth setup-git`. OWNER = `gh api user --jq .login`.
2. Repositório. `gh repo create ai-memory --private` (se existir, me pergunte; se você não tiver permissão para rodar, me diga para criá-lo no GitHub com New repository: nome ai-memory, Private, sem README, depois aguarde "done"). VAULT = ~/ai-memory (Windows: %USERPROFILE%\ai-memory). Lá: `git init -b main`; se o git não tiver email de commit, defina o email de commit deste repositório como o email noreply do GitHub do OWNER (id = `gh api user --jq .id`) e o nome de commit como OWNER. Adicione os arquivos abaixo, faça commit, adicione OWNER/ai-memory como remote origin via HTTPS, `git push -u origin main`.
- ./index.md: "# Index", a linha "Map of this vault: read it first, then only the notes you need.", e "## Notes". ./log.md: "# Log".
- inbox/README.md: "Bots write new notes here." trash/README.md: "Files go here instead of being deleted."
- .gitattributes: `* text=auto eol=lf`. .gitignore: `.obsidian/workspace*.json`
- _bots/vault-memory/SKILL.md, palavra por palavra:
~~~
---
name: vault-memory
description: Shared long-term memory for all bots, an Obsidian vault in the private GitHub repo named in the bot's instructions. Use at the start of any task that may depend on past work (projects, decisions, posts, people, preferences, "remember", "what did we decide") and at the end of every real task. Skip only small talk and one-line answers.
---
# vault-memory
All bots share ONE memory: this repo of Markdown notes. Read it with the GitHub connector (main branch); never ask the user for it.
Read before you answer
- Read ./index.md (the map) and your own _bots/<bot-name>.md if it exists, then only the 1-5 notes the task needs. Never scan the whole vault.
- Trust the notes: don't re-research or re-ask what is written there. If the user now says otherwise, the user wins: write the correction.
Write at the end of every real task (always when the user says "remember" or "save"), one note per task
- New file inbox/YYYY-MM-DD-HHMM-<bot-name>-<topic>.md (UTC; never overwrite): a header (bot, date, topic), then 3-10 lines on what was asked, done, decided, liked or rejected and why, with sources. <bot-name> = your name in the bot list, lowercase with hyphens ("Grok Bot" -> grok-bot); never invent a name like bot or assistant.
- You may keep a short page about yourself in _bots/<bot-name>.md (what you do, what you learned).
- No tool that writes to the repo? Launch a cloud agent on it: "create this exact file with this content and commit it directly to main", then read it back from main. Can't write at all? Tell the user. Never skip silently.
Never
- Delete a file (to remove one: create the same file in trash/, then remove the original), edit notes outside inbox/ and your own _bots/<bot-name>.md unless the user names that note, reorganize the vault, force-push, or write passwords, tokens, keys or codes.
- If a push fails: pull and push again; if it still fails, tell the user.
~~~
3. Claude Code e Codex. Adicione este bloco ao final de ~/.claude/CLAUDE.md e, se `codex --version` funcionar, de ~/.codex/AGENTS.md (crie se estiver faltando, não mude mais nada; escreva VAULT como o caminho real; se você não puder editar um arquivo, imprima o bloco e me diga onde colar):
~~~
## Shared memory
- My long-term memory is the Obsidian vault at VAULT (private repo OWNER/ai-memory). Before any task about past work, posts, projects, decisions or "remember": `git -C VAULT pull`, read VAULT/index.md, then only the notes you need. Don't ask me what is written there.
- After a decision, a result, a verified fact (with source) or something I liked or rejected: update or create the right note, list new notes in VAULT/index.md, add a line to VAULT/log.md, commit and push. When I say "remember", always write it.
- "Sort the inbox": move useful notes from inbox/ (my bots write there) into the right notes, move processed files to trash/. Never delete anything. Never write passwords, tokens or keys.
~~~
4. Obsidian. Abra-o e me diga para clicar em "Open folder as vault" e escolher VAULT. Pule Obsidian Sync: o GitHub sincroniza de graça.
5. Grok Bot. Imprima esta mensagem em um bloco de código com OWNER preenchido. Me diga para colá-la no meu Grok Bot principal, faça o que ela diz se o GitHub não estiver conectado, e daqui em diante crie novos bots apenas através deste bot principal.
~~~
Set up shared memory for all my bots (one time):
1. Check that the GitHub connector can read my private repo OWNER/ai-memory. If not, tell me exactly what to click, then stop.
2. Save _bots/vault-memory/SKILL.md from that repo, word for word, as the skill vault-memory in my shared skill library (replace it if it exists).
3. Add these two lines to your own instructions, once each: "Long-term memory: the private GitHub repo OWNER/ai-memory (Obsidian vault). Before and after each task, use the vault-memory skill." and "Whenever a bot is created or you see a bot without the Long-term memory line, add that line to its instructions once, change nothing else, and tell me."
4. Add the Long-term memory line once to every other bot's instructions. Change nothing else. Skip group chats.
5. Test: read ./index.md and list its headings. Then create inbox/<YYYY-MM-DD-HHMM>-<your-bot-name>-memory-test.md with "memory test from <your-bot-name>", commit it to main (if you can only read GitHub, use a cloud agent as the skill says) and tell me the path.
~~~
6. Verificação. Quando eu escrever "done", rode `git -C VAULT pull` e me mostre a nota de teste do bot. Se estiver faltando, me diga o que corrigir. Termine com 3 linhas: onde minha memória vive, "create new bots through your main bot", "say remember to save something".
Entre para ver o prompt completo
Continuar com:
Ao entrar, você concorda com nossos Termos de uso e Política de privacidade
Uso
Este prompt foi projetado para uso com productivity. Copie o conteúdo acima e cole na sua ferramenta de IA preferida.
Para melhores resultados, personalize os marcadores (indicados por colchetes ou maiúsculas) com seus requisitos específicos.
Referências
- Categoria: Prompts de productivity
- Fonte: https://x.com/0xCodila/status/2118763721526817169
Discussão
0 comentários