{"id":"hivemind-goals","name":"hivemind-goals","summary":"Deeplakeの仮想ファイルシステムを通じて、memory/goal/およびmemory/kpi/でチーム目標+KPIを作成、追跡、更新できます。","body":"# Hivemind Goals\n\nTrack goals and KPIs as Markdown files inside the Deeplake virtual filesystem. Each file is one row in a dedicated team-shared table — the path encodes the structural metadata, the file body holds the human-readable description.\n\n## When to use this skill\n\nActivate when the user expresses any of:\n- \"I want to track X / aim for X / track my progress on Y\"\n- \"add a goal\", \"add a KPI\", \"what are my goals?\"\n- \"mark this as done\", \"close that goal\"\n- \"shipping X by Friday\", \"5 PRs this week\", any measurable target\n- \"create a task\", \"add a todo\", \"remind me to fix X\", any work item (the goals system absorbs the old `hivemind tasks` CLI — there is no separate task store)\n\nFor \"list my goals\" → run `ls ~/.deeplake/memory/goal/<userName>/opened/` and `ls ~/.deeplake/memory/goal/<userName>/in_progress/`. If empty, ask the user if they want to create one.\n\n## Path conventions (LEARN THESE)\n\n```\n~/.deeplake/memory/goal/<owner>/<status>/<goal_id>.md\n~/.deeplake/memory/kpi/<goal_id>/<kpi_id>.md\n```\n\n- `<owner>` — user identifier (use the userName from `hivemind whoami` or the credentials)\n- `<status>` — one of `opened`, `in_progress`, `closed`\n- `<goal_id>` — UUIDv4 you generate at create time\n- `<kpi_id>` — short slug like `k-prs` or `k-demos`\n\n**Path encoding is the source of truth.** The owner, status, goal_id, and kpi_id come from the path — NOT from the file body. Do NOT write owner/status/goal_id/kpi_id inside the file content.\n\n## File body format\n\nGoal file body — plain markdown, free form:\n```\nship the goals-graph feature\n\nNotes: focus on KPI tracking via VFS, no separate CLI.\nDue: 2026-05-30.\n```\n\nKPI file body — markdown with a few mandatory key:value lines so the commit-driven auto-progress worker can parse and bump:\n```\nPRs merged\n\n- target: 5\n- current: 2\n- unit: count\n```\n\nThe `target:`, `current:`, `unit:` lines must stay on a single line each. The first line is the human-readable name. Anything else is free notes.\n\n## Operations\n\n### 1. Create a new goal\n\nWhen the user expresses a new goal:\n\n1. Get the current owner with `hivemind whoami` (use the userName, e.g. `emanuele.fenocchi`).\n2. Generate a UUIDv4: `uuidgen` (do NOT use `node -e` — Node is not available under the VFS path).\n3. Write the goal file via **Bash** (Write / Edit are denied on memory paths; only Bash is intercepted and routed to SQL):\n   ```bash\n   cat > ~/.deeplake/memory/goal/<owner>/opened/<uuid>.md <<'EOF'\n   <goal description here, multiple lines OK>\n   EOF\n   ```\n   For a single-line goal, `echo '<text>' > ~/.deeplake/memory/goal/<owner>/opened/<uuid>.md` is equivalent.\n4. Respond to the user that the goal is created.\n\n**Do NOT auto-generate KPIs.** A goal is created with zero KPI files by default. Generate KPIs ONLY when the user explicitly asks you to (\"aggiungi KPI per …\", \"add metrics for this goal\", \"track these metrics: …\"). When the user asks, write each KPI as a separate file at `~/.deeplake/memory/kpi/<goal_id>/<kpi-slug>.md` with the body format documented above.\n\n### 1a. Capture a task for later (with resumable context)\n\nUse this when the user **parks a tangential task** mid-session — \"save this for later\", \"remind me to …\", \"don't let me forget …\", \"let's do X later\", \"capture this in Hivemind\". The value is NOT the one-liner — it's storing enough **context to resume cold** in a future session without the user re-explaining anything.\n\nWrite it via the **CLI** (not the VFS heredoc) so the row is tagged `agent: capture`, which separates parked side-tasks from hand-made goals:\n\n```bash\nhivemind goal add --agent capture \"Add rate-limiting to the webhook handler\n\nStart here: add a per-IP token bucket on the handler entry path\nFiles: src/webhook/handler.ts:120-160, src/webhook/limits.ts\nBranch: feat/webhook-hardening\nRun: pnpm test webhook\nWhy: bursty clients hammer the endpoint; agreed to defer until the retry-backoff work lands\"\n```\n\n- **Line 1 is the label** — keep it short; it's what `goal list` and the SessionStart banner show.\n- Fill `Start here / Files / Branch / Run / Why` from the live conversation — you already know the files you just touched and the branch. Include only the lines you can fill; omit the rest. **`Start here:` is the most important** — the concrete first action.\n- Pass the whole package as **one double-quoted argument** (the newlines are preserved into the stored body).\n- Confirm to the user: the label + that it'll resume cleanly next session.\n\n### 1b. Resume a parked task (automatic context transfer)\n\nWhen the user says \"let's work on that task / that goal\", \"let's start the `<X>` task\", or \"pick up the parked `<X>`\", pull its stored context back into the session and continue — the user should NOT have to re-explain anything.\n\n1. **Find it:** `hivemind goal list --mine` and match the user's reference to a `goal_id` (by label / topic). If ambiguous, show the candidates and ask which one.\n2. **Transfer the context:** `hivemind goal get <goal_id>` prints the full package (`Start here / Files / Branch / Run / Why`). Read it as your working context — `goal list` only shows the first line, so always use `goal get` for the full body.\n3. **Flip to in_progress:** `mv ~/.deeplake/memory/goal/<owner>/opened/<uuid>.md ~/.deeplake/memory/goal/<owner>/in_progress/<uuid>.md`\n4. **Act on it:** open the `Files:`, switch to the `Branch:` if given, and begin from `Start here:`. You are now resumed — continue as if the context was never lost. Close it (section 5) when the work is done.\n\n### 2. List goals\n\n```bash\nls ~/.deeplake/memory/goal/<owner>/opened/\nls ~/.deeplake/memory/goal/<owner>/in_progress/\n```\n\nThen `cat` each `<uuid>.md` to read the body. Optionally `ls ~/.deeplake/memory/kpi/<uuid>/` and `cat` each KPI to surface progress.\n\n### 3. Edit a goal description\n\n```bash\n# Read the existing body, then overwrite via Bash heredoc. Edit / Write\n# tools are denied on memory paths in claude-code (the hook can only\n# rewrite Bash). The VFS handles version-bumping — every overwrite\n# produces a fresh row in the hivemind_goals table.\ncat ~/.deeplake/memory/goal/<owner>/opened/<uuid>.md   # read current\ncat > ~/.deeplake/memory/goal/<owner>/opened/<uuid>.md <<'EOF'\n<new body here>\nEOF\n```\n\n### 4. Move a goal to in_progress\n\n```bash\nmv ~/.deeplake/memory/goal/<owner>/opened/<uuid>.md ~/.deeplake/memory/goal/<owner>/in_progress/<uuid>.md\n```\n\n`mv` between status folders is an atomic version-bump. The file body carries over unchanged.\n\n### 5. Close a goal\n\nTwo equivalent ways:\n\n```bash\n# Explicit mv to closed (recommended — clearest intent)\nmv ~/.deeplake/memory/goal/<owner>/in_progress/<uuid>.md ~/.deeplake/memory/goal/<owner>/closed/<uuid>.md\n\n# Or: rm (the VFS interprets rm on a goal path as a soft-close)\nrm ~/.deeplake/memory/goal/<owner>/opened/<uuid>.md\n```\n\n**Important:** `rm` does NOT actually delete the goal. It is a soft-close — the VFS writes a new version with status=closed. The goal remains in the team-shared table for audit. There is no hard-delete in v1.\n\n### 6. Add a KPI manually\n\n```bash\ncat > ~/.deeplake/memory/kpi/<uuid>/<kpi-slug>.md <<'EOF'\n<KPI name>\n\n- target: <N>\n- current: 0\n- unit: <unit>\nEOF\n```\n\n### 7. Record progress on a KPI\n\nRead the KPI file, increment the `current:` line, write it back via Bash. The\nEdit tool is denied on memory paths — overwrite the full file via heredoc:\n\n```bash\ncat ~/.deeplake/memory/kpi/<uuid>/<kpi-slug>.md   # read current\ncat > ~/.deeplake/memory/kpi/<uuid>/<kpi-slug>.md <<'EOF'\n<KPI name>\n\n- target: 5\n- current: 3\n- unit: count\nEOF\n```\n\nA surgical `sed -i 's/^- current: .*/- current: 3/'` also works since `sed`\nis an allowed builtin under the VFS path.\n\n### 8. Reassign a goal (transfer ownership)\n\n```bash\nmv ~/.deeplake/memory/goal/<old-owner>/<status>/<uuid>.md ~/.deeplake/memory/goal/<new-owner>/<status>/<uuid>.md\n```\n\nGoal ownership lives in the path. KPI files do NOT have an owner segment — they are linked to the goal by `<uuid>`, so they need no change when a goal is reassigned.\n\n## Constraints — DO NOT do these\n\n- Do NOT put `owner`, `status`, `goal_id`, or `kpi_id` inside the file body. The path is the source of truth — duplicating in the body causes drift.\n- Do NOT use status values other than `opened`, `in_progress`, `closed`.\n- Do NOT rename the goal_id (the UUID in the filename) via `mv`. The VFS rejects goal_id renames.\n- Do NOT block on the KPI generator subprocess — always spawn it detached (`nohup … &`).\n\n## Auto-progress from `git commit`\n\nA PostToolUse hook listens for `git commit`. When it fires, it spawns the agent's native LLM in the background with the commit diff + the list of the current user's open goals. The LLM reads each goal + its KPIs, judges whether the commit advanced any KPI, and edits the relevant KPI file to bump `current:`. This is fire-and-forget; the user does not block on it.\n\nTo disable globally: `HIVEMIND_AUTO_KPI_FROM_COMMITS=false`.\n\n## Team visibility\n\nEvery write goes to a team-shared table on Deeplake (`hivemind_goals` or `hivemind_kpis`). Other team members see your goals in their SessionStart context and via direct `ls` / `cat` on the same paths in their own VFS. No explicit sharing step needed.","author":"@activeloopai","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/activeloopai/hivemind/tree/main/harnesses/claude-code/skills/hivemind-goals","license":"Apache-2.0","category":"writing","lang":"en","tokens":2528,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[],"requires":{"mcp":[],"tools":["Read Bash"]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":[]}}