360 Secure SkillHub
360 安全技能中心

Workspace Database Manager

该 Skill 通过 Python 脚本扫描工作区文档与目录结构,写入 docs.db 和 tree.db 两个 SQLite 数据库,并自动导出文档、技能、符号链接及目录树的 CSV/JSON 文件,便于后续用 SQL 查询。SKILL.md 中引用的 scripts/db_manager.py、tree_indexer.py、update_docs_db.py 未包含在文件列表内。

kikikari
kikikari
热度 36.62
最近更新 2026-05-11 17:44:14
分类:知识依赖:代码执行 / 读写文件应用场景:数据处理 / 工作流 / 文件转换

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add workspace-db
Metadata
name
workspace-db
description
Workspace Documentation and Tree Database Manager. SQLite-based indexing for all documentation, files, and directory structures with CSV/JSON export capabilities.

Workspace Database Manager

Hybrid database solution for OpenClaw workspace documentation and file indexing.

Features

  • docs.db: Documentation index (256+ documents, skills, symlinks)
  • tree.db: Directory tree structures (152+ entries)
  • Auto-Export: CSV and JSON formats
  • Git-Ready: Skill structure for easy publishing

Database Schema

docs.db

documents: id, name, path, category, description, type, has_symlink, symlink_path, last_update
skills: id, name, version, status, description, path
symlinks: id, name, target, source_path, description
categories: id, name, description, priority

tree.db

tree_entries: id, root_path, relative_path, name, type, depth, parent_path, size
tree_scans: id, root_path, max_depth, total_files, total_dirs, total_symlinks

Scripts

Script Purpose
db_manager.py Initialize and populate docs.db
tree_indexer.py Scan directories with tree command
update_docs_db.py Re-scan all documentations

Usage

# Initialize databases
python3 scripts/db_manager.py

# Index tree structures
python3 scripts/tree_indexer.py

# Update documentation index
python3 scripts/update_docs_db.py

# Query databases
sqlite3 db/docs.db "SELECT * FROM documents WHERE category='websearch'"
sqlite3 db/tree.db "SELECT * FROM tree_entries WHERE type='symlink'"

Exports

Auto-generated in workspace root:

  • db_documents.csv/json
  • db_skills.csv/json
  • db_symlinks.csv/json
  • export_tree_*.csv

Installation

clawhub install workspace-db

Requirements

  • Python 3.8+
  • SQLite3
  • tree command (optional, for indexing)