| name | Ewan-kb-git |
| description | Commit and version knowledge base layers (source, knowledgeBase, graph) to git. |
Ewan-kb-git Skill
Version-control your knowledge base in four git-committed layers.
When to Use
After running ewankb build, you want to commit the results to git. This skill handles:
- Staging the correct files in each layer
- Writing meaningful commit messages
- Tracking version metadata
Layer Commit Strategy
Each layer has its own commit history and commit message convention:
Layer 1: source/
Raw source material — documents and code snapshots. Append-only — never overwrite historical commits.
ewankb-git commit-source "chore: pull docs 2026-04-13"
Layer 2: domains/
Auto-discovered domain definitions (README.md, PROCESSES.md, domains.json). Overwritable — re-discovery creates new commits.
ewankb-git commit-domains "feat: re-discover domains after code update"
Layer 3: knowledgeBase/
AI-refined knowledge files (flat by doc type, domain in frontmatter). Overwritable — each build creates a new commit.
ewankb-git commit-kb "refactor: re-extract 订单管理 domain"
Layer 4: graph/
Graph data and analysis results. Overwritable — rebuilds are new commits.
ewankb-git commit-graph "feat: add surprising connections for 订单管理"
Combined Workflow
ewankb build
ewankb-git commit-all
This creates four separate commits (one per layer) with auto-generated messages.
Commit Message Format
<type>(<layer>): <description>
<optional body with details>
[skip-ci]
Types: feat, refactor, fix, chore, docs
Layers: source, domains, kb, graph, all
Branch Strategy
For a shared knowledge base (team collaboration):
main # Latest approved knowledge base
├── kb/
│ ├── proposal/ # WIP domain proposals
│ └── review/ # Under review
└── ...
Use feature branches for domain-level changes:
git checkout -b domain/订单管理
git push -u origin domain/订单管理
Push to Remote
ewankb-git push
Pushes all layers to the configured remote.
Git Hooks
Recommended .git/hooks/pre-commit:
#!/bin/sh
KB_HASH=$(git log -1 --format="%H" -- knowledgeBase/)
GRAPH_HASH=$(git log -1 --format="%H" -- graph/)
Quick Commands
| Command | Description |
|---|
ewankb-git status | Show unstaged changes per layer |
ewankb-git log --layer kb | Show kb commit history |
ewankb-git diff <layer> | Show changes since last commit |
ewankb-git rollback <layer> | Revert last commit on layer |