Skip to content

Looted/kibi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

397 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kibi Wordmark

Kibi is a repo-local, per-git-branch, queryable knowledge base for software projects. It stores requirements, scenarios, tests, architecture decisions, and more as linked entities, ensuring end-to-end traceability between code and documentation.

Why Kibi

Kibi is designed to boost AI agents' memory during software development. It maintains a living, verifiable project memory that:

  • Tracks context across branches — Every git branch gets its own KB snapshot, preserving context as you switch between features
  • Enforces traceability — Links code symbols to requirements, preventing orphan features and technical debt
  • Validates automatically — Rules catch missing requirements, dangling references, and consistency issues
  • Agent-friendly — LLM assistants can query and update knowledge base via MCP without risking file corruption

What You Get

Kibi provides concrete, day-to-day benefits for developers and teams:

  • Requirements Traceability — Track every code symbol back to its requirement. Know why code exists and what business need it addresses.

  • Test Coverage Visibility — See which requirements have tests, which don't, and what's covered at a glance. Ensure nothing slips through the cracks.

  • Architectural Constraints — Link code to ADRs. Know what constraints apply to each symbol and verify architecture decisions are honored.

  • Feature Flag Blast Radius — See what code depends on a flag before toggling it. Understand the impact of enabling or disabling a feature.

  • Event-Driven Architecture — Map who publishes and consumes each domain event. Trace event flows and identify couplings across the system.

  • Branch-Local Memory — Every git branch keeps its own KB snapshot. Switch contexts without losing traceability or polluting other branches.

For OpenCode users, bootstrap an existing repo with /init-kibi.

Key Components

  • kibi-core — Prolog-based knowledge graph that tracks entities across branches
  • kibi-cli — Command-line interface for automation and hooks
  • kibi-mcp — Model Context Protocol server for LLM integration
  • kibi-opencode — OpenCode plugin that injects Kibi guidance and runs background syncs
  • kibi-vscode — VS Code extension for exploring the knowledge base

Prerequisites

  • SWI-Prolog 9.0+ — Kibi's knowledge graph runs on Prolog

Installation

# Using npm (recommended)
npm install -g kibi-cli kibi-mcp

# Optional: OpenCode plugin (project or global install)
npm install kibi-opencode

# Using bun
bun add -g kibi-cli kibi-mcp

# Optional: OpenCode plugin
bun add kibi-opencode

After installation, verify that kibi is available:

kibi --version

For complete installation steps and SWI-Prolog setup, see detailed installation guide.

Quick Start

Initialize kibi in your repository:

# Verify environment prerequisites
kibi doctor

# Initialize .kb/ and install git hooks
kibi init

# Parse markdown docs and symbols into branch KB
kibi sync

# Run integrity checks
kibi check

Note: kibi init installs git hooks by default. Hooks automatically sync your KB on branch checkout and merge.

Dogfooding (Local Development)

This repository uses kibi-opencode from source rather than the published npm package. The local plugin shim at .opencode/plugins/kibi.ts re-exports from packages/opencode/dist/, allowing you to test changes immediately.

Quick Start for Development

# Initial build
cd packages/opencode && bun run build

# Watch mode (auto-rebuild on changes)
cd packages/opencode && bun run dev

See packages/opencode/DEV.md for complete dogfood setup details.

Documentation

Release and Versioning

All publishable npm packages in this repo (kibi-core, kibi-cli, kibi-mcp, kibi-opencode) follow the same Changesets workflow for versioning and changelog generation.

# Add release metadata for changed package(s)
bun run changeset

# Preview pending releases
bunx changeset status

# Apply version bumps and update package changelogs
bun run version-packages

⚠️ Alpha Status: Kibi is in early alpha. Expect breaking changes. Pin exact versions of kibi-cli, kibi-mcp, and kibi-opencode in your projects, and expect to occasionally delete and rebuild your .kb folder when upgrading.