Knowledge Engineering

Everything is context. Software engineering becomes knowledge engineering.

Knowledge engineering is the discipline of building systems where knowledge is structured, versioned, connected to code and queryable by both people and agents, so that what a team knows compounds over time.

For agents to build working software, a team engineers the knowledge system they work from: the specifications, invariants, decisions, research and tasks that define what correct means. Code and working software emerge from that knowledge base. GitKB is the set of tools for engineering it.

Knowledge first, software follows

Each layer narrows the one below it. Research informs decisions, decisions shape specifications and their invariants, specifications define tasks, and agents turn tasks into code. Tests, reviews and incidents return as evidence that changes the next decision.

evidenceResearchDecisionsSpecifications andinvariantsTasksAgents write the codeTests, reviews andincidents
flowchart

The document is the plan. A task says what to do and links to the specification it implements; the specification says what must hold; the decision says why. An agent that reads the task through those links has the intent behind the code, not only the code.

What a knowledge base holds

KnowledgeWhat it capturesHow GitKB stores it
SpecificationsBehavior the system provides and the contracts it keepsspec documents
InvariantsProperties every implementation and migration preservesSections of the specification they belong to
DecisionsWhat was chosen, the alternatives and whydecision documents
ResearchFindings, measurements and sources behind a decisionnote documents
TasksExecutable work, acceptance criteria and progresstask documents
IncidentsWhat failed, why and what changedincident documents

Every document is Markdown with YAML frontmatter, stored in .kb/ beside your code. See Documents for types, statuses and fields.

The practices GitKB supports

PracticeMechanism
StructureTyped documents with status, priority, tags and custom fields
ConnectionGraph edges such as implements, depends_on and blocked_by, plus wikilinks to documents, code symbols and commits (Knowledge Graph)
Grounding in codeA code intelligence index of symbols, callers and callees, linked from documents with [[code:path::symbol]] (Code Intelligence)
VersioningA per-document commit history with SHA-256 hashes, separate from your repository’s Git history
SharingPush and pull commits, and check out only the documents you need
Agent accessAn MCP server and the git-kb CLI; kb_smart_context assembles a task’s linked documents and code within a token budget

A working loop

A specification states what must hold, a task implements it, and the agent starts from both:

markdown
---
title: Make the login handler async
type: task
implements: [specs/session-auth]
---

Keep the refresh behind the lock: [[decisions/jwt-rotation]].
The entrypoint is [[code:src/auth.rs::login_handler]].
shell
# Inspect what the task connects to
git-kb graph tasks/login-async --direction both --depth 2 --json

# See what an edit to the entrypoint reaches
git-kb code callers 'src/auth.rs::login_handler' --json

# Record progress and share it
git-kb commit -m "Login handler async; refresh stays behind the lock" tasks/login-async
git-kb push origin

The next session, in any agent, reads the same task, its specification and its decisions, and continues from the recorded progress.

Next steps