Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ Generation shells out to a host agent's own CLI (`claude -p`, `codex exec`, …)

## Rules (cross-agent team principles)

Hivemind **shares team rules across every agent in the org**, injected at SessionStart so every claude-code / cursor / hermes session starts knowing them. For personal or team work items with progress tracking, use [Goals + KPIs](#goals--kpis) (VFS-backed) instead.
Hivemind **shares team rules across every agent in the org**, injected at SessionStart so every claude-code / cursor / hermes session starts knowing them. For personal or team work items with progress tracking, use [Goals](#goals) (VFS-backed) instead.

```bash
hivemind rules add "no DROP TABLE on prod creds"
Expand Down Expand Up @@ -525,9 +525,9 @@ fall back to `hivemind context`):
- `HIVEMIND_RULES_TABLE`: table name (default `hivemind_rules`).
- `HIVEMIND_CAPTURE=false`: full read-only mode. Skips placeholder + ensure DDL; renderer still injects.

## Goals + KPIs
## Goals

Personal / team objectives + measurable targets live in the Deeplake virtual filesystem under `~/.deeplake/memory/goal/<owner>/<status>/<uuid>.md` and `~/.deeplake/memory/kpi/<goal_id>/<kpi-slug>.md`. Path encodes structure (owner, status, goal_id); the file body holds the human-readable description.
Personal / team objectives live in the Deeplake virtual filesystem under `~/.deeplake/memory/goal/<owner>/<status>/<uuid>.md`. Path encodes structure (owner, status, goal_id); the file body holds the human-readable description.

```bash
# CLI fallback for runtimes that can't route VFS writes (cursor/hermes/pi)
Expand All @@ -537,7 +537,7 @@ hivemind goal done <goal_id>
hivemind goal progress <goal_id> opened|in_progress|closed
```

For VFS-capable runtimes (claude-code/codex) the `hivemind-goals` skill creates and edits goals/KPIs directly via Bash heredoc against the VFS path. `mv` between `opened/`, `in_progress/`, and `closed/` is the canonical status transition. KPIs are manual files; the body format is documented in the skill (`target:`, `current:`, `unit:`).
For VFS-capable runtimes (claude-code/codex) the `hivemind-goals` skill creates and edits goals directly via Bash heredoc against the VFS path. `mv` between `opened/`, `in_progress/`, and `closed/` is the canonical status transition.

## Architecture

Expand Down
1 change: 0 additions & 1 deletion esbuild.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,6 @@ const openclawGraphWorkerDefine = {
"process.env.HIVEMIND_SKILLS_TABLE": "globalThis.__hivemind_tuning__.HIVEMIND_SKILLS_TABLE",
"process.env.HIVEMIND_RULES_TABLE": "globalThis.__hivemind_tuning__.HIVEMIND_RULES_TABLE",
"process.env.HIVEMIND_GOALS_TABLE": "globalThis.__hivemind_tuning__.HIVEMIND_GOALS_TABLE",
"process.env.HIVEMIND_KPIS_TABLE": "globalThis.__hivemind_tuning__.HIVEMIND_KPIS_TABLE",
"process.env.HIVEMIND_MEMORY_PATH": "globalThis.__hivemind_tuning__.HIVEMIND_MEMORY_PATH",
"process.env.HIVEMIND_GRAPH_PUSH": "globalThis.__hivemind_tuning__.HIVEMIND_GRAPH_PUSH",
"process.env.HIVEMIND_GRAPHS_HOME": "globalThis.__hivemind_tuning__.HIVEMIND_GRAPHS_HOME",
Expand Down
73 changes: 11 additions & 62 deletions harnesses/claude-code/skills/hivemind-goals/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
name: hivemind-goals
description: Create, track and update team goals + KPIs via the Deeplake virtual filesystem at memory/goal/ and memory/kpi/. Use whenever the user mentions a goal, objective, KPI, target, milestone, or asks to track progress on something measurable. ALSO use when the user says "task", "todo", "work item", "remind me to", "fix X", or any actionable work item — the goal system replaced the legacy `hivemind tasks` CLI and now covers both objectives and tasks.
description: Create, track and update team goals via the Deeplake virtual filesystem at memory/goal/. Use whenever the user mentions a goal, objective, target, milestone, or asks to track progress on something measurable. ALSO use when the user says "task", "todo", "work item", "remind me to", "fix X", or any actionable work item — the goal system replaced the legacy `hivemind tasks` CLI and now covers both objectives and tasks.
allowed-tools: Read Bash
---

# Hivemind Goals

Track 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.
Track goals 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.

## When to use this skill

Activate when the user expresses any of:
- "I want to track X / aim for X / track my progress on Y"
- "add a goal", "add a KPI", "what are my goals?"
- "add a goal", "what are my goals?"
- "mark this as done", "close that goal"
- "shipping X by Friday", "5 PRs this week", any measurable target
- "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)
Expand All @@ -23,36 +23,25 @@ For "list my goals" → run `ls ~/.deeplake/memory/goal/<userName>/opened/` and

```
~/.deeplake/memory/goal/<owner>/<status>/<goal_id>.md
~/.deeplake/memory/kpi/<goal_id>/<kpi_id>.md
```

- `<owner>` — user identifier (use the userName from `hivemind whoami` or the credentials)
- `<status>` — one of `opened`, `in_progress`, `closed`
- `<goal_id>` — UUIDv4 you generate at create time
- `<kpi_id>` — short slug like `k-prs` or `k-demos`

**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.
**Path encoding is the source of truth.** The owner, status, and goal_id come from the path — NOT from the file body. Do NOT write owner/status/goal_id inside the file content.

## File body format

Goal file body — plain markdown, free form:
```
ship the goals-graph feature

Notes: focus on KPI tracking via VFS, no separate CLI.
Notes: route every write through the VFS, no separate CLI.
Due: 2026-05-30.
```

KPI file body — markdown with a few mandatory key:value lines so the commit-driven auto-progress worker can parse and bump:
```
PRs merged

- target: 5
- current: 2
- unit: count
```

The `target:`, `current:`, `unit:` lines must stay on a single line each. The first line is the human-readable name. Anything else is free notes.
The first line is the human-readable label (what `goal list` and the SessionStart banner show). Anything else is free notes.

## Operations

Expand All @@ -71,8 +60,6 @@ When the user expresses a new goal:
For a single-line goal, `echo '<text>' > ~/.deeplake/memory/goal/<owner>/opened/<uuid>.md` is equivalent.
4. Respond to the user that the goal is created.

**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.

### 1a. Capture a task for later (with resumable context)

Use 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.
Expand Down Expand Up @@ -110,7 +97,7 @@ ls ~/.deeplake/memory/goal/<owner>/opened/
ls ~/.deeplake/memory/goal/<owner>/in_progress/
```

Then `cat` each `<uuid>.md` to read the body. Optionally `ls ~/.deeplake/memory/kpi/<uuid>/` and `cat` each KPI to surface progress.
Then `cat` each `<uuid>.md` to read the body.

### 3. Edit a goal description

Expand Down Expand Up @@ -147,58 +134,20 @@ rm ~/.deeplake/memory/goal/<owner>/opened/<uuid>.md

**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.

### 6. Add a KPI manually

```bash
cat > ~/.deeplake/memory/kpi/<uuid>/<kpi-slug>.md <<'EOF'
<KPI name>

- target: <N>
- current: 0
- unit: <unit>
EOF
```

### 7. Record progress on a KPI

Read the KPI file, increment the `current:` line, write it back via Bash. The
Edit tool is denied on memory paths — overwrite the full file via heredoc:

```bash
cat ~/.deeplake/memory/kpi/<uuid>/<kpi-slug>.md # read current
cat > ~/.deeplake/memory/kpi/<uuid>/<kpi-slug>.md <<'EOF'
<KPI name>

- target: 5
- current: 3
- unit: count
EOF
```

A surgical `sed -i 's/^- current: .*/- current: 3/'` also works since `sed`
is an allowed builtin under the VFS path.

### 8. Reassign a goal (transfer ownership)
### 6. Reassign a goal (transfer ownership)

```bash
mv ~/.deeplake/memory/goal/<old-owner>/<status>/<uuid>.md ~/.deeplake/memory/goal/<new-owner>/<status>/<uuid>.md
```

Goal 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.
Goal ownership lives in the path; the file body carries over unchanged.

## Constraints — DO NOT do these

- 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.
- Do NOT put `owner`, `status`, or `goal_id` inside the file body. The path is the source of truth — duplicating in the body causes drift.
- Do NOT use status values other than `opened`, `in_progress`, `closed`.
- Do NOT rename the goal_id (the UUID in the filename) via `mv`. The VFS rejects goal_id renames.
- Do NOT block on the KPI generator subprocess — always spawn it detached (`nohup … &`).

## Auto-progress from `git commit`

A 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.

To disable globally: `HIVEMIND_AUTO_KPI_FROM_COMMITS=false`.

## Team visibility

Every 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.
Every write goes to a team-shared table on Deeplake (`hivemind_goals`). 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.
2 changes: 1 addition & 1 deletion harnesses/codex/SUBMISSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Each includes the prompt, expected behavior, and any required test data.
- Expected: hivemind-graph skill queries `memory/graph/query/...`; returns callers/callees.
- Test data: a built graph snapshot for the repo.

5. **Goal/KPI tracking**
5. **Goal tracking**
- Prompt: "Track a goal: ship the Codex plugin submission this month."
- Expected: hivemind-goals skill writes to `memory/goal/`; confirms creation.
- Test data: authenticated workspace.
Expand Down
67 changes: 11 additions & 56 deletions harnesses/codex/skills/hivemind-goals/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---
name: hivemind-goals
description: Create, track and update team goals + KPIs via the Deeplake virtual filesystem at memory/goal/ and memory/kpi/. Use whenever the user mentions a goal, objective, KPI, target, milestone, or asks to track progress on something measurable. ALSO use when the user says "task", "todo", "work item", "remind me to", "fix X", or any actionable work item — the goal system replaced the legacy `hivemind tasks` CLI and now covers both objectives and tasks.
description: Create, track and update team goals via the Deeplake virtual filesystem at memory/goal/. Use whenever the user mentions a goal, objective, target, milestone, or asks to track progress on something measurable. ALSO use when the user says "task", "todo", "work item", "remind me to", "fix X", or any actionable work item — the goal system replaced the legacy `hivemind tasks` CLI and now covers both objectives and tasks.
allowed-tools: Bash
---

# Hivemind Goals

Track 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.
Track goals 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.

## When to use this skill

Activate when the user expresses any of:
- "I want to track X / aim for X / track my progress on Y"
- "add a goal", "add a KPI", "what are my goals?"
- "add a goal", "what are my goals?"
- "mark this as done", "close that goal"
- "shipping X by Friday", "5 PRs this week", any measurable target
- "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)
Expand All @@ -23,36 +23,25 @@ For "list my goals" → run `ls ~/.deeplake/memory/goal/<userName>/opened/` and

```
~/.deeplake/memory/goal/<owner>/<status>/<goal_id>.md
~/.deeplake/memory/kpi/<goal_id>/<kpi_id>.md
```

- `<owner>` — user identifier (use the userName from `hivemind whoami` or the credentials)
- `<status>` — one of `opened`, `in_progress`, `closed`
- `<goal_id>` — UUIDv4 you generate at create time
- `<kpi_id>` — short slug like `k-prs` or `k-demos`

**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.
**Path encoding is the source of truth.** The owner, status, and goal_id come from the path — NOT from the file body. Do NOT write owner/status/goal_id inside the file content.

## File body format

Goal file body — plain markdown, free form:
```
ship the goals-graph feature

Notes: focus on KPI tracking via VFS, no separate CLI.
Notes: route every write through the VFS, no separate CLI.
Due: 2026-05-30.
```

KPI file body — markdown with a few mandatory key:value lines so the commit-driven auto-progress worker can parse and bump:
```
PRs merged

- target: 5
- current: 2
- unit: count
```

The `target:`, `current:`, `unit:` lines must stay on a single line each. The first line is the human-readable name. Anything else is free notes.
The first line is the human-readable label (what `goal list` and the SessionStart banner show). Anything else is free notes.

## Operations

Expand All @@ -65,8 +54,6 @@ When the user expresses a new goal:
3. Write the goal file at `~/.deeplake/memory/goal/<owner>/opened/<uuid>.md` with the goal description as body.
4. Respond to the user that the goal is created.

**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.

### 1a. Capture a task for later (with resumable context)

Use 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". 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.
Expand Down Expand Up @@ -104,7 +91,7 @@ ls ~/.deeplake/memory/goal/<owner>/opened/
ls ~/.deeplake/memory/goal/<owner>/in_progress/
```

Then `cat` each `<uuid>.md` to read the body. Optionally `ls ~/.deeplake/memory/kpi/<uuid>/` and `cat` each KPI to surface progress.
Then `cat` each `<uuid>.md` to read the body.

### 3. Edit a goal description

Expand Down Expand Up @@ -136,52 +123,20 @@ rm ~/.deeplake/memory/goal/<owner>/opened/<uuid>.md

**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.

### 6. Add a KPI manually

```bash
Write the file at ~/.deeplake/memory/kpi/<uuid>/<kpi-slug>.md with:
<KPI name>

- target: <N>
- current: 0
- unit: <unit>
```

### 7. Record progress on a KPI

Read the KPI file, increment the `current:` line, write it back:

```
<KPI name>

- target: 5
- current: 3 ← incremented from 2
- unit: count
```

Use the Edit tool for the most surgical change (just the line with `current:`).

### 8. Reassign a goal (transfer ownership)
### 6. Reassign a goal (transfer ownership)

```bash
mv ~/.deeplake/memory/goal/<old-owner>/<status>/<uuid>.md ~/.deeplake/memory/goal/<new-owner>/<status>/<uuid>.md
```

Goal 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.
Goal ownership lives in the path; the file body carries over unchanged.

## Constraints — DO NOT do these

- 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.
- Do NOT put `owner`, `status`, or `goal_id` inside the file body. The path is the source of truth — duplicating in the body causes drift.
- Do NOT use status values other than `opened`, `in_progress`, `closed`.
- Do NOT rename the goal_id (the UUID in the filename) via `mv`. The VFS rejects goal_id renames.
- Do NOT block on the KPI generator subprocess — always spawn it detached (`nohup … &`).

## Auto-progress from `git commit`

A 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.

To disable globally: `HIVEMIND_AUTO_KPI_FROM_COMMITS=false`.

## Team visibility

Every 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.
Every write goes to a team-shared table on Deeplake (`hivemind_goals`). 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.
Loading