From 0aa3b06fec120fd0bf4f6b3746b1a570056f4cad Mon Sep 17 00:00:00 2001 From: Ernie Cook Date: Sun, 8 Mar 2026 21:52:12 -0400 Subject: [PATCH] Add skill definition --- .gitignore | 2 +- README.md | 55 ----------------------------------------------- opencode_skill.md | 25 +++++++++++++++++++++ 3 files changed, 26 insertions(+), 56 deletions(-) create mode 100644 opencode_skill.md diff --git a/.gitignore b/.gitignore index e6743d8..a7ee475 100644 --- a/.gitignore +++ b/.gitignore @@ -22,7 +22,7 @@ wheels/ # Virtual environments venv/ -.venv/ +.venv*/ env/ .env/ diff --git a/README.md b/README.md index f77fb85..43ac359 100644 --- a/README.md +++ b/README.md @@ -78,61 +78,6 @@ await search_knowledge({ }) ``` -## Auto-Start on Boot - -### Option 1: Systemd Service - -Create `/etc/systemd/system/knowledge-rag.service`: - -```ini -[Unit] -Description=Knowledge Base RAG MCP Server -After=network.target - -[Service] -Type=simple -User=ernie -WorkingDirectory=/home/ernie/knowledge-base -Environment="VAULT_PATH=/home/ernie/knowledge" -Environment="PATH=/home/ernie/.local/bin:/usr/bin:/bin" -ExecStart=/home/ernie/knowledge-base/.venv/bin/python -m knowledge_rag.server -Restart=always - -[Install] -WantedBy=multi-user.target -``` - -Then enable: - -```bash -sudo systemctl daemon-reload -sudo systemctl enable knowledge-rag.service -sudo systemctl start knowledge-rag.service -``` - -### Option 2: tmux/screen - -```bash -# Start in tmux -tmux new -s knowledge-rag -source .venv/bin/activate -VAULT_PATH=./knowledge python -m knowledge_rag.server -# Detach: Ctrl+b, then d -``` - -### Option 3: rc.local or startup script - -Add to your `~/.bashrc` or startup script: - -```bash -# Only start if not already running -if ! pgrep -f "knowledge_rag.server" > /dev/null; then - cd ~/knowledge-base - source .venv/bin/activate - VAULT_PATH=./knowledge nohup python -m knowledge_rag.server > /tmp/knowledge-rag.log 2>&1 & -fi -``` - ## Project Structure ``` diff --git a/opencode_skill.md b/opencode_skill.md new file mode 100644 index 0000000..ffacd2a --- /dev/null +++ b/opencode_skill.md @@ -0,0 +1,25 @@ +--- +name: knowledge-rag-usage +description: Use the knowledge-rag MCP server for building/using a growing knowledge base +--- + +## What I do + +Provide guidelines on the use and building of the knowledge base. + +## When to use me + +- When you need to see if there is available knowledge to help complete the task + - Use the `search_knowledge` tool to get this knowledge +- When you need to add what you have learned to the knowledge base + - Add the knowledge in the form of a markdown file to `~/knowledge-base/knowledge` directory + - Index the knowledge with the `index_knowledge` with the `force=false` parameter so that it is available for searching + +## Guidelines + +- Upon the start of any task, you must check the knowledge base to see if there is existing information on the subject +- Upon completion of any task, you must add any useful knowledge learned to the knowledge base +- Any time you are corrected, you must add the correction to the knowledge base so that no mistake happens twice +- When adding new knowledge to the knowledge base, try to keep related knowledge to the same files + - Create new files only when no existing file contains information on that topic +- New knowledge must be brief. Use as little words possible to express the knowledge \ No newline at end of file