Skip to content
Closed
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
122 changes: 122 additions & 0 deletions skills/harmony-labs/gitkb/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
---
name: gitkb
description: Code intelligence and knowledge management via git-kb CLI. Use when finding callers/callees of functions, analyzing blast radius of changes, managing tasks and project context, searching code symbols, or tracking work across agent sessions. Requires git-kb binary.
metadata: {"openclaw":{"emoji":"\ud83d\udcda","requires":{"bins":["git-kb"]},"install":[{"id":"brew","kind":"brew","formula":"harmony-labs/tap/gitkb","bins":["git-kb"],"label":"Install git-kb (Homebrew)"},{"id":"curl","kind":"shell","command":"curl -fsSL https://raw.githubusercontent.com/harmony-labs/gitkb-releases/main/install.sh | bash","bins":["git-kb"],"label":"Install git-kb (script)"}]}}
---

# GitKB — Code Intelligence & Knowledge Management

Give your agent persistent memory and deep code understanding. 100% local, zero cloud dependency.

## Quick Reference

| Command | What It Does |
|---------|-------------|
| `git kb symbols "auth"` | Find code symbols matching "auth" |
| `git kb callers <symbol>` | Who calls this function? |
| `git kb callees <symbol>` | What does this function call? |
| `git kb impact <file>` | Blast radius — transitive dependents |
| `git kb dead` | Find unused code (zero callers) |
| `git kb search "query"` | Full-text search across all docs |
| `git kb board` | Task kanban — active, blocked, done |
| `git kb show <slug>` | View document content |
| `git kb list task --status active` | List tasks by status |
| `git kb create task --title "..."` | Create a tracked task |
| `git kb checkout <slug>` | Materialize doc for editing |
| `git kb commit -m "msg"` | Save workspace changes |

## When to Use GitKB (vs built-in tools)

| Need | Without GitKB | With GitKB |
|------|--------------|------------|
| Find function callers | `grep` — text matches, misses indirect callers | `git kb callers` — AST-aware call graph |
| Assess change risk | Manual code reading | `git kb impact` — full dependency tree |
| Track tasks across sessions | Lost on restart | `git kb board` — persistent, structured |
| Find dead code | Guesswork | `git kb dead` — confirmed zero callers |
| Search project knowledge | Scattered notes | `git kb search` — full-text across all docs |

## Prerequisites

git-kb must be installed and a KB initialized in the project:

```bash
# Verify installation
git kb --version

# Initialize in a project (one-time)
cd /path/to/project
git kb init
git kb service start --background
git kb index .
```

## Code Intelligence

### Find symbols
```bash
git kb symbols "authenticate" # Search by name (positional arg)
git kb symbols --file src/auth.rs # Filter by file
git kb symbols --kind function --language rust
```

### Find callers (who calls this function?)
```bash
git kb callers "src/auth.rs::authenticate"
git kb callers authenticate # Search by name
```

### Find callees (what does this function call?)
```bash
git kb callees "src/auth.rs::authenticate"
```

### Blast radius (what breaks if I change this file?)
```bash
git kb impact src/auth.rs
```

### Dead code detection
```bash
git kb dead # All dead code
git kb dead --file src/auth.rs # Scoped to file
```

## Knowledge Management

### View tasks and status
```bash
git kb board # Kanban view
git kb list task --status active # Active tasks only
git kb show tasks/my-task # Full document
```

### Create and track work
```bash
git kb create task --title "Fix auth timeout"
git kb checkout tasks/my-task # Edit locally
# ... edit .kb/workspace/tasks/my-task.md ...
git kb commit -m "Add acceptance criteria"
```

### Search everything
```bash
git kb search "authentication"
git kb search "timeout" --type incident
```

## Important Rules

1. **Command syntax**: Always `git kb` (space, git subcommand), NOT `git-kb` (hyphen)
2. **JSON output**: Flag varies per command — `--json` (symbols, show, board, create), `--format json` (list, search), `-o json` (impact, dead). When in doubt, try `--json` first.
3. **Index first**: Code intelligence requires indexing: `git kb index .`
4. **Workspace is ephemeral**: The database is the source of truth, not `.kb/workspace/`

## Workflows

See `references/workflows.md` for multi-step workflow guides:
- Starting work on a task
- Investigating a bug with code intelligence
- Creating and completing tasks
- Loading project context
- Before refactoring (blast radius check)
- Finding and removing dead code
Loading