email-draft
Use when the user asks to draft, polish, translate, or reply to an email. Produces a clean draft with subject line, greeting,…
Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires
Claude Code
$ npx -y skills add shiwenwen/hope-agent --skill ha-data-stores --agent claude-code
Codex
$ npx skills add shiwenwen/hope-agent --skill ha-data-stores -a codex -y
Cursor
$ npx skills add shiwenwen/hope-agent --skill ha-data-stores -a cursor -y
Gemini CLI
$ npx skills add shiwenwen/hope-agent --skill ha-data-stores -a gemini-cli -y
GitHub Copilot
$ npx skills add shiwenwen/hope-agent --skill ha-data-stores -a github-copilot -y
OpenCode
$ npx skills add shiwenwen/hope-agent --skill ha-data-stores -a opencode -y
Windsurf
$ npx skills add shiwenwen/hope-agent --skill ha-data-stores -a windsurf -y
name: ha-data-stores description: "Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger phrases: data stores, database path, sessions.db, memory.db, logs.db, background_jobs.db, knowledge index, where is data stored, query app data, 查数据库, 数据存储, 会话记录在哪, 记忆库在哪." version: 1.0.0 author: Hope Agent license: MIT status: active aliases: - data-stores - storage-map - app-data
Use this skill when you need to locate or inspect Hope Agent's persisted local data. Prefer product tools first; use direct SQLite only for diagnostics or ad-hoc analysis that existing tools do not cover.
1. Use dedicated model tools when they answer the question:
messages.
known.
2. Use read-only SQLite queries only when a dedicated tool is missing, too coarse, or the task is diagnostic/audit work. 3. Never mutate app databases directly. Do not run `UPDATE`, `DELETE`, `INSERT`, `DROP`, `CREATE`, `ALTER`, `VACUUM`, `REINDEX`, or `ATTACH`.
All app-managed data lives under the Hope Agent data root:
Shell helper:
ROOT="${HA_DATA_DIR:-$HOME/.hope-agent}"Use this helper instead of hard-coding `~/.hope-agent` when running queries.
Use the sqlite CLI with `-readonly`:
ROOT="${HA_DATA_DIR:-$HOME/.hope-agent}"
sqlite3 -readonly -cmd ".headers on" -cmd ".mode column" "$ROOT/sessions.db" \
"SELECT id, title, agent_id, updated_at FROM sessions ORDER BY updated_at DESC LIMIT 10;"Python fallback:
python3 - <<'PY'
import os, sqlite3
root = os.environ.get("HA_DATA_DIR") or os.path.expanduser("~/.hope-agent")
path = os.path.join(root, "sessions.db")
con = sqlite3.connect(f"file:{path}?mode=ro", uri=True)
for row in con.execute("SELECT id, title, updated_at FROM sessions ORDER BY updated_at DESC LIMIT 10"):
print(row)
PY| Store | Path | Purpose | |---|---|---| | Sessions | `$ROOT/sessions.db` | Sessions, messages, chat context snapshots, projects, knowledge registry/bindings, channel mappings, subagent runs, tasks, learning events | | Memory | `$ROOT/memory.db` | Long-term memories, memory FTS/vector data, Dreaming claims/evidence/profile data | | Logs | `$ROOT/logs.db` | Structured app logs emitted by `app_info!` / `app_warn!` / `app_error!` / `app_debug!` | | Background jobs | `$ROOT/background_jobs.db` | Unified background job cache for async tools and subagent/group projections | | Cron | `$ROOT/cron.db` | Scheduled tasks managed by `manage_cron` | | Wakeups | `$ROOT/wakeups.db` | Agent self-scheduled wakeups from `schedule_wakeup` | | Recap | `$ROOT/recap/recap.db` | Cached recap/report facets and summaries | | Knowledge index | `$ROOT/knowledge/index.db` | Rebuildable note/chunk/link/tag search cache; real notes are Markdown files | | Canvas | `$ROOT/canvas/canvas.db` | Canvas projects and versions | | Local model jobs | `$ROOT/local_model_jobs.db` | Ollama/local-model install, pull, preload jobs | | Local LLM cache | `$ROOT/local_llm_library_cache.db` | Cached Ollama Library search/tag metadata |
`async_jobs.db` is legacy. Current code uses `background_jobs.db`; an old `async_jobs.db` file may be leftover cache and should not be treated as current truth.
| Path | Purpose | |---|---| | `$ROOT/config.json` | AppConfig: settings, providers metadata, feature toggles | | `$ROOT/user.json` | User profile and UI preferences | | `$ROOT/agents/` | Agent definitions and agent prompt files | | `$ROOT/{agent_id}-home/` | Per-agent scratch/home directory | | `$ROOT/home/` | Shared directory across agents | | `$ROOT/attachments/{session_id}/` | Persisted chat attachments | | `$ROOT/sessions/{session_id}/transcript.jsonl` | Hook transcript mirror | | `$ROOT/tool_results/{session_id}/` | Large tool-result spill files | | `$ROOT/background_jobs/` | Background job result spool | | `$ROOT/knowledge/{kb_id}/notes/` | Internal knowledge-base Markdown files | | `$ROOT/credentials/` | OAuth/API credentials. Do not read unless the user explicitly asks and it is necessary. Never print secrets. |
Prefer `sessions_search` first. For raw SQL:
SELECT id, session_id, role, timestamp, substr(content, 1, 500) AS content FROM messages WHERE session_id = ? ORDER BY id ASC LIMIT 100;
Use `messages_fts` for keyword search over user/assistant content:
SELECT m.id, m.session_id, m.role, m.timestamp,
snippet(messages_fts, 0, '[', ']', '...', 16) AS snippet
FROM messages_fts
JOIN messages m ON m.id = messages_fts.rowid
WHERE messages_fts MATCH ?
ORDER BY rank
LIMIT 20;Global searches must exclude private/non-user surfaces unless the task explicitly targets them:
... JOIN sessions s ON s.id = m.session_id WHERE s.incognito = 0 AND s.kind != 'knowledge'
SELECT timestamp, level, category, source, message
FROM logs
WHERE level IN ('ERROR', 'WARN')
ORDER BY timestamp DESC
LIMIT 50;SELECT job_id, kind, session_id, status, tool_name, created_at, completed_at, error FROM background_jobs ORDER BY created_at DESC LIMIT 50;
Prefer `recall_memory` and `memory_get`. Use SQL
🦭 A cross-device desktop AI agent with memory, autonomous goals, dynamic workflows, and headless deployment | 会记忆、能持续推进目标、会动态编排多 Agent 的跨端桌面 AI 助手,也可服务化常驻 NAS / 云端
Use when the user asks to draft, polish, translate, or reply to an email. Produces a clean draft with subject line, greeting,…
Use when the user mentions 飞书 / Feishu / Lark workspace operations: docx (云文档) read/write, bitable (多维表格) records / views /…
Hope Agent browser automation — the standard `status → tabs → snapshot → act` loop, stale-ref recovery rules, and what to do when…
Hope-native review of uncommitted, staged, commit, branch, or PR changes: discover concrete regressions, independently verify…
Hope-native baseline for implementing, fixing, refactoring, and maintaining code: inspect the repository first, protect user…
Hope-native implementation planning for non-trivial code changes: ground the plan in repository evidence, order dependencies,…
Direct browser control via CDP for web interaction: automation, scraping, testing, screenshots, and site/app work. Also covers…
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling…