Note: We are not accepting contributions at this moment. Feel free to post an issue if you have feedback or suggestions.
Prerequisites
- SWI-Prolog >= 9.0
- Bun (latest)
- Git
Installation
bun installpackages/
core/ # Prolog KB core (kb.pl, schema/*.pl)
cli/ # Node.js CLI (commands, extractors, Prolog wrapper)
mcp/ # MCP server (stdio, JSON-RPC)
vscode/ # VS Code extension (TreeView)
tests/
integration/ # End-to-end tests
benchmarks/ # Performance benchmarks
Unit Tests (TypeScript/CLI)
bun run test # Project test pipeline (unit + packed local e2e)
bun run test:unit # All unit tests (packages/*)
bun test packages/cli/ # CLI tests only
bun test packages/mcp/ # MCP tests onlyIntegration Tests
bash ./scripts/run-integration-tests.shProlog Tests (plunit)
swipl -g "load_test_files([]),run_tests" -t halt packages/core/tests/kb.plt
swipl -g "load_test_files([]),run_tests" -t halt packages/core/tests/schema.pltRun performance benchmarks:
bun run tests/benchmarks/sync.bench.ts
bun run tests/benchmarks/query.bench.ts
bun run tests/benchmarks/mcp-latency.bench.ts- Formatting and linting use Biome.
- Run lint:
bun run check - Run format:
bun run format
To simulate CI steps:
- Install SWI-Prolog (via apt-get or package manager)
- Install Bun
- Run
bun install - Run
bun run test - Run integration tests and benchmarks as above
Use the following prefixes:
feat(scope): description— New featurefix(scope): description— Bug fixdocs(scope): description— Documentation changestest(scope): description— Test changeschore(scope): description— Build/config changes
- All tests pass (
bun run test) - Code passes linting (
bun run check) - Integration tests pass (34/34)
- Documentation updated if needed
- Tests added for new features
- Commit messages follow conventions
When documenting issues or workarounds in the KB:
- Use
factwithfact_kind: observationormetafor bug records and workaround notes - Use
flagonly for actual runtime/config gates (not for bug records) - See Entity Schema and AGENTS.md for the canonical entity-choice guidance
Clear, practical, and ready for contributors.
To help maintain traceability between code and requirements, all new or modified code symbols (functions, classes, modules) must be linked to at least one documented requirement before commit.
When you add or change a function, class, or module, include a comment with the requirement ID(s) it implements. Example:
export function myFunc() { } // implements REQ-001For multiple requirements:
export class MyClass { } // implements REQ-001, REQ-002This applies to TypeScript (.ts, .tsx) and JavaScript (.js, .jsx) files by default.
If you ran kibi init, a pre-commit hook will automatically check your staged changes for missing requirement links. If any new or modified symbols are not linked to a requirement, your commit will be blocked with an error message. To proceed, add the appropriate implements REQ-xxx directive to your code.
You can test your staged changes manually with:
kibi check --stagedFor more details, see the "Staged Symbol Traceability" section in the README.