Kibi Wordmark

Status: Beta CI Coverage Kibi requirement health License: AGPL-3.0-or-later

Say what the software should do. Kibi makes agents follow it—and prove they did.

Kibi is an agent-native requirements compiler and enforcement layer. You describe product intent in natural language; the agent creates and maintains the structured requirements, scenarios, tests, semantic facts, and code links. Kibi then checks that the implementation remains coherent with that intent.

Unlike passive memory or retrieval systems, Kibi is designed to place itself in the agent's workflow. The agent does not have to remember to consult a ticket, board, or requirements folder: Kibi's hooks, tools, and validation gates continuously bring the relevant product context back into the work.

Project references: brand guide · proof readiness plan

Why Kibi

Most project knowledge is scattered across prompts, tickets, code, and conversations—and most AI agents eventually forget part of it. Kibi turns that knowledge into an enforceable, branch-local model:

  • Humans maintain intent, not artifacts — The prompt is the primary authoring interface. Agents own the routine work of creating and evolving requirements, scenarios, tests, facts, and symbol links; humans resolve genuine ambiguity and product decisions.
  • Memory is enforceable — Symbols need requirement ownership, requirements need complete semantics and scenarios, scenarios need tests, and proof-bearing tests need fresh execution evidence.
  • Prolog guards against drift — Typed properties, predicates, and safe rules let deterministic checks expose contradictions, unsupported invention, and incomplete semantics before they become accepted project knowledge.
  • E2E behavior is traceable — Kibi records what an end-to-end test proves, not merely which lines it happened to execute. You can navigate from a symbol to its requirement or from a test to the scenario and intent it verifies.
  • Intent survives branch changes — Each Git branch has its own KB snapshot, keeping feature context isolated and available when you return.
  • Keep knowledge local — KB state lives in your repository's .kb/ directory; Kibi does not send external telemetry or analytics.

Quick start

Kibi requires SWI-Prolog 9.0+ with swipl available on your PATH.

Install the core runtime, CLI, and MCP server in your project:

npm install --save-dev kibi-core kibi-cli kibi-mcp

Then initialize and explore your project memory:

# Verify prerequisites
npm exec -- kibi doctor

# Initialize .kb/ and install Git hooks
npm exec -- kibi init

# Import Markdown entities and code symbols
npm exec -- kibi sync

# Discover relevant knowledge
npm exec -- kibi search auth

# Confirm the active branch snapshot is fresh
npm exec -- kibi status

# Validate graph integrity and traceability
npm exec -- kibi check

kibi init installs Git hooks by default and adds the required .kb/ entries to .gitignore. The hooks keep branch-local knowledge synchronized after checkout and merge.

Use your project's local binary runner with pnpm, Yarn, or Bun. See the installation guide for package-manager equivalents, SWI-Prolog setup, global installation, and troubleshooting.

Explore gaps and coverage

# Start broad, then narrow to a source file
npm exec -- kibi search login
npm exec -- kibi query req --source src/auth/login.ts --format table

# Find under-specified or under-tested requirements
npm exec -- kibi gaps req --missing-rel specified_by,verified_by --format table
npm exec -- kibi coverage --by req --format table

# Generate a visual requirement-health report and open it locally
npm exec -- kibi report --open

The report directory contains a self-contained kibi-report/index.html and a matching badge.svg: no server, CDN, or external assets are required. The same directory can be uploaded as a CI artifact or published directly with GitHub Pages. On pushes to develop, this repository's CI publishes the report and its clickable README badge at https://looted.github.io/kibi/.

Publish a report badge with GitHub Actions

Like a coverage badge, the Kibi badge is an image wrapped in a link to the full report. Enable Settings → Pages → Source: GitHub Actions, then add a workflow like this (replace main if your release branch has a different name):

name: Kibi requirement health

on:
  push:
    branches: [main]
  workflow_dispatch:

permissions:
  contents: read

concurrency:
  group: kibi-requirement-health
  cancel-in-progress: true

jobs:
  build-report:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
      - uses: actions/setup-node@v5
        with:
          node-version: 24
          cache: npm
      - name: Install SWI-Prolog
        run: |
          sudo apt-get update
          sudo apt-get install -y swi-prolog
      - run: npm ci
      - run: npm exec -- kibi sync
      - run: npm exec -- kibi report --output kibi-report
      - uses: actions/configure-pages@v6
      - uses: actions/upload-pages-artifact@v5
        with:
          path: kibi-report

  deploy-report:
    needs: build-report
    runs-on: ubuntu-latest
    permissions:
      pages: write
      id-token: write
    environment:
      name: github-pages
      url: ${{ steps.deployment.outputs.page_url }}
    steps:
      - name: Deploy requirement health
        id: deployment
        uses: actions/deploy-pages@v5

The command generates both Pages files from one coverage snapshot: kibi-report/index.html and kibi-report/badge.svg. Add the badge to your README and replace the placeholders with the lowercase Pages owner and repository path:

[![Kibi requirement health](https://OWNER.github.io/REPOSITORY/badge.svg)](https://OWNER.github.io/REPOSITORY/)

The image URL must be anonymously reachable for GitHub to render it. For a private report, publish both files to an authenticated static host and use URLs that your intended README audience can access.

How it works

Kibi combines probabilistic interpretation with deterministic verification:

Human prompt
    |
    v
Agent updates code and product knowledge
    |
    v
Requirements + semantic facts/rules + scenarios + tests + symbol links
    |
    v
Prolog coherence checks + traceability gates + fresh E2E evidence
    |
    v
Proven result or explicit, repairable gaps

The agent never writes arbitrary Prolog as trusted truth. It works through typed facts, predicate schemas, and safe logic representations; Kibi validates those encodings before the Prolog layer uses them for inference.

What Kibi enforces

Kibi maintains a canonical traceability and proof chain:

Requirement -> Scenario -> Test
     ^                       ^
     |                       |
 Production symbol     Executable test symbol

For a requirement to be proven rather than merely documented:

  • Every production symbol must trace to the requirement it implements.
  • Every normative requirement clause must have one complete semantic grounding or remain explicitly unresolved.
  • Requirements must be specified by scenarios, and tests must verify those scenarios.
  • Executable test symbols must identify the code that actually performs the verification.
  • Proof-bearing production symbols must be covered by qualifying tests.
  • End-to-end evidence must be fresh and bound to the current code snapshot.

This makes questions answerable in both directions:

  • Why does this symbol exist, and which requirement owns it?
  • What requirement and scenario does this E2E test actually verify?
  • Which requirements have no scenario, semantic grounding, or passing behavioral evidence?
  • What changes when a feature flag is toggled?
  • Do two current requirements impose contradictory constraints?
  • Is the knowledge snapshot for this branch fresh?

Code coverage alone cannot provide this proof. It can show that an E2E run touched a line, but not which product behavior was exercised or whether the test still represents the intended scenario.

Prolog as the safety layer

Suppose the product defines exactly three user roles. Once that constraint is encoded as a strict property or predicate, an agent cannot quietly invent a fourth role and treat it as established intent: Kibi can surface the contradiction or missing authorization deterministically.

Prolog does not decide whether the original human intent was correct. It verifies the knowledge that was encoded, while Kibi keeps ambiguity, missing ontology, incomplete grounding, and stale evidence explicit instead of calling them proof. This gives agents guardrails against hallucination and context drift without pretending probabilistic interpretation is infallible.

Why this is possible now

Traditional knowledge bases required specialists to design ontologies, interpret semantics, write formal logic, and maintain every mapping by hand. That cost made them a poor fit for fast-moving software requirements.

LLMs change the economics of the authoring step. They can interpret natural-language intent, navigate a codebase, and propose structured semantic representations. Kibi and Prolog supply the complementary discipline:

Participant Strength and responsibility
Human States product intent and resolves real ambiguity or policy choices
AI agent Maps intent to the codebase and maintains requirements, scenarios, tests, facts, and symbol links
Kibi + Prolog Validates schemas, checks coherence and contradictions, enforces traceability, and evaluates proof evidence

The result uses LLM strengths to address LLM weaknesses: limited memory, hallucination, context drift, and the loss of the product-to-code mapping traditionally spread across product owners, ticket systems, and planning boards.

What Kibi models

Kibi intentionally supports eight core entity types:

Entity Purpose
req Functionality, behavior, or constraints the system must satisfy
scenario User or system behavior expressed as concrete flows
test Unit, integration, or end-to-end verification evidence
fact Domain facts and invariants, plus contextual observations and notes
adr Architecture decisions and their rationale
flag Runtime or configuration gates such as feature flags and kill switches
event Domain or system events published and consumed by components
symbol Functions, classes, modules, and other code-level ownership anchors

Use flag only for real runtime or configuration gates. Bugs and workarounds belong in fact entities with fact_kind: observation or meta; contradiction-sensitive invariants use the strict fact or predicate lanes. See the entity schema for the complete model.

Connect an AI client

Every MCP client starts the same project-local kibi-mcp binary. Most stdio clients need this configuration:

command: npx
args: --no-install kibi-mcp
transport: stdio

If the client supports a working-directory setting, point it at the project where Kibi is installed.

Add Kibi to opencode.json:

{
  "mcp": {
    "kibi": {
      "type": "local",
      "enabled": true,
      "command": ["npx", "--no-install", "kibi-mcp"]
    }
  }
}

The optional kibi-opencode plugin adds prompt guidance and background maintenance:

{
  "plugin": ["kibi-opencode"]
}

Add Kibi to .vscode/mcp.json:

{
  "servers": {
    "kibi": {
      "type": "stdio",
      "command": "npx",
      "args": ["--no-install", "kibi-mcp"]
    }
  }
}

Add Kibi with the Codex CLI:

codex mcp add kibi -- npx --no-install kibi-mcp

Or configure it in ~/.codex/config.toml or $CODEX_HOME/config.toml:

[mcp_servers.kibi]
command = "npx"
args = ["--no-install", "kibi-mcp"]
enabled = true

The optional kibi-codex plugin bundles Kibi skills, MCP configuration, and warning-only lifecycle hooks. Add the Kibi repository marketplace, open Codex, then run /plugins, choose Kibi Plugins, and install kibi-codex:

codex plugin marketplace add Looted/kibi
codex

The repository marketplace is not the official OpenAI Plugin Directory; self-serve plugin publishing is not available there yet. Manual MCP configuration remains fully supported.

Add Kibi to .cursor/mcp.json:

{
  "mcpServers": {
    "kibi": {
      "command": "npx",
      "args": ["--no-install", "kibi-mcp"]
    }
  }
}

The optional kibi-cursor plugin adds rules, bundled skills, commands, and advisory hooks. See the Cursor package guide for supported installation and behavior.

Bundled agent guidance

Kibi's skill subsystem provides reusable, bundled skills for discovery, initialization, freshness, and traceability workflows. MCP-capable agents can discover them with kb_skills_list and load the relevant guidance with kb_skills_load. The same read-only operations are available through the trusted project-local CLI.

See generic agent onboarding for the progressive-disclosure and safety contract.

Packages

Package Role
kibi-core Prolog-backed knowledge graph, inference, and validation
kibi-cli Human, agent, automation, and Git-hook interface
kibi-mcp MCP surface exposing the same 18 public operations
kibi-opencode Optional OpenCode guidance and maintenance adapter
kibi-codex Optional Codex skills, MCP, and lifecycle adapter
kibi-cursor Optional Cursor rules, skills, MCP, and advisory hooks
kibi-vscode VS Code knowledge explorer and traceability integration

Documentation

Beta status

Kibi is in beta and ready for use in real projects. Public interfaces may still evolve before 1.0, so pin exact package versions when reproducibility matters.

Kibi is licensed under AGPL-3.0-or-later.