Files
knowledge-base-framework/Makefile
TotenKnopfandClaude Fable 5.1 96780317a7 refactor: extract kb_framework package, build graph in memory
Scripts become thin CLIs over kb_framework (graph, query, query_tools,
vault, instructions) so the hosted read-only connector shares one
implementation with the stdio server. The MCP server builds the graph
from Markdown on demand and invalidates it on writes; refresh_graph
rebuilds in memory and reports validation problems. Pre-commit hook
validates only; index/graph.json is no longer read, written or staged
(generate-graph.py --write remains for operators). Golden fixtures pin
graph and tool payloads to the previous output. Agent and skill docs
updated to match.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-06 20:40:13 +02:00

47 lines
1.8 KiB
Makefile

# Run framework tools and install integrations against the selected data vault.
PYTHON ?= python3
VAULT_ROOT ?= $(if $(KNOWLEDGE_BASE_ROOT),$(KNOWLEDGE_BASE_ROOT),$(CURDIR))
CLAUDE_HOME ?= $(HOME)/.claude
MCP_NAME ?= knowledge-database
.PHONY: test generate-graph validate-graph graph install-hooks install-global-claude install-mcp-claude
test:
$(PYTHON) -m unittest discover -s tests
generate-graph:
$(PYTHON) scripts/generate-graph.py --vault-root "$(VAULT_ROOT)"
validate-graph:
$(PYTHON) scripts/generate-graph.py --vault-root "$(VAULT_ROOT)" --validate
# `graph` is the everyday gate: validate only, nothing written.
graph: validate-graph
install-hooks:
$(PYTHON) scripts/install-hooks.py --vault-root "$(VAULT_ROOT)"
# Link this framework's skills and agents into the global Claude context
# (~/.claude/skills, ~/.claude/agents) so they are invocable from any repo.
install-global-claude:
mkdir -p "$(CLAUDE_HOME)/skills" "$(CLAUDE_HOME)/agents"
@for d in skills/*/; do \
name=$$(basename "$$d"); \
[ -f "$$d/SKILL.md" ] || continue; \
ln -sfn "$(CURDIR)/$$d" "$(CLAUDE_HOME)/skills/$$name"; \
echo "skill -> $(CLAUDE_HOME)/skills/$$name"; \
done
@for f in agents/*.md; do \
name=$$(basename "$$f"); \
[ "$$name" = "README.md" ] && continue; \
ln -sfn "$(CURDIR)/$$f" "$(CLAUDE_HOME)/agents/$$name"; \
echo "agent -> $(CLAUDE_HOME)/agents/$$name"; \
done
# Register scripts/mcp-server.py as an MCP server in Claude Code (user scope,
# so it is available from any repo). Re-run to update; removes stale entry first.
install-mcp-claude:
-claude mcp remove --scope user "$(MCP_NAME)" 2>/dev/null
claude mcp add --scope user "$(MCP_NAME)" -- $(PYTHON) "$(CURDIR)/scripts/mcp-server.py" --vault-root "$(VAULT_ROOT)"
@echo "mcp -> $(MCP_NAME) ($(CURDIR)/scripts/mcp-server.py)"