Token导航 LogoToken导航TokenDH.com
研究检索敏感数据clawhub未标认证来源可访问clear审计通过

safety-kb-query安全知识库查询

Agent Skill

safety-kb-query 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,901

周安装

80

GitHub Stars

公开资料未说明

下载量

666
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:safety-kb-query(安全知识库查询)
来源仓库:https://github.com/cyz9827/safety-kb-query
安装命令:
openclaw skills install safety-kb-query
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install safety-kb-query

简介

安全生产法规知识库查询工具。当用户需要查标准是否存在、搜索法规、对比标准清单、查看条款内容、统计知识库规模、检查数据质量时使用。触发词:查知识库、搜法规、标准存在吗、对比标准、查条款、KB查询、safety-review、法规检索、标准时效、数据质量检查

SKILL.md

name
safety-kb-query
description
安全生产法规知识库查询工具。当用户需要查标准是否存在、搜索法规、对比标准清单、查看条款内容、统计知识库规模、检查数据质量时使用。触发词:查知识库、搜法规、标准存在吗、对比标准、查条款、KB查询、safety-review、法规检索、标准时效、数据质量检查
version
1.0.0
author
WorkBuddy Agent
license
MIT
tags

Safety KB Query — 安全生产法规知识库查询工具

Overview

This skill provides unified, schema-adaptive query access to the safety-review knowledge base (SQLite database). It eliminates the need to manually write connection scripts, guess field names, or handle encoding issues every time.

Database location: ~/.openclaw-autoclaw/skills/safety-review/db/knowledge.db

When to Use This Skill

  • User asks about whether a standard/regulation exists in the knowledge base
  • User needs to search for regulations by keyword, number, or title
  • User wants to compare a list of standards against what's in the database (gap analysis)
  • User needs to view clause content of a specific regulation
  • User requests statistics or health checks on the knowledge base
  • Any task involving the safety-review SQLite database

Trigger phrases (Chinese): 查知识库、搜法规、标准有没有、对比标准、查条款、数据质量、法规检索

How to Use

Prerequisites

  1. Detect available Python command first:
   python --version

Use python or python3 based on availability.

  1. The knowledge base path defaults to:
   C:\Users\13503\.openclaw-autoclaw\skills\safety-review\db\knowledge.db

Override via environment variable KB_PATH if needed.

Core Commands

All commands are executed via scripts/kb_query.py. Output is JSON for programmatic consumption.

1. Search Regulations (search)

Find regulations matching a keyword across multiple fields.

python scripts/kb_query.py search <keyword> [--mode fuzzy|exact] [--limit N]
ParameterDescriptionDefault
keywordSearch term (standard number, title fragment, etc.)Required
--modefuzzy (LIKE match) or exact (equality)fuzzy
--limitMaximum results20

Example scenarios:

  • "看看 GB16423 有没有" → search GB16423
  • "搜一下紧急避险相关的" → search 紧急避险
  • "精确查找 AQ/T 2033-2023" → search "AQ/T 2033-2023" --mode exact

2. Check Standard Existence (check) ⭐ Most Useful

Given a list of standards, report which exist and which are missing — the primary gap analysis tool.

python scripts/kb_query.py check <standard1> <standard2> <standard3> ...

Output fields per result:

  • found: boolean
  • id: regulation ID (if found)
  • document_number: stored document number
  • title: regulation title (truncated)
  • status: current status
  • text_length: character count of full_text
  • clause_count: number of associated clauses

Example:

python scripts/kb_query.py check "GB 16423" "AQ/T 2033" "AQ 2034" "国发[2010]23号"

3. Regulation Details (info)

Get comprehensive info about a specific regulation by ID.

python scripts/kb_query.py info <regulation_id>

Returns all columns from regulations table + clause count + linked std_registry entry (if any).

4. Query Clauses (clauses)

Retrieve clauses of a regulation, with optional filtering.

python scripts/kb_query.py clauses <regulation_id> [--filter <keyword>]

5. Database Statistics (stats)

Overview of knowledge base contents.

python scripts/kb_query.py stats

Returns: total regulations, total clauses, total books, status breakdown, domain distribution.

6. Schema Inspection (schema)

Auto-detect and print table structures (useful when DB schema changes).

python scripts/kb_query.py schema

7. Data Quality Check (conflicts) ⭐ Important

Detect potential data quality issues:

  • Empty content: Regulations with NULL or very short full_text (<100 chars)
  • No clauses: Regulations without any associated clause records
  • Title/doc_no mismatch: Document number suggests a topic but title doesn't match (e.g., ID:94 containing "粮油加工" instead of mining safety content)
python scripts/kb_query.py conflicts

Workflow Integration

Typical Gap Analysis Workflow (for courseware/training materials)

When user provides a document that references standards and asks "which ones are missing":

  1. Extract referenced standards from the user's document
  2. Run check command with the extracted list
  3. Present results as a table showing: ✅ Found / ❌ Missing / ⚠️ Data Issue
  4. If data issues found, run conflicts for deeper analysis
  5. Recommend next steps (import missing ones via safety-kb-import)

Typical Search Workflow

  1. Run search with user's keywords
  2. If results found, use info to get details on relevant entries
  3. If user needs clause-level detail, use clauses
  4. Present findings in readable format (table, summary)

Known Limitations

  • Read-only: This skill only queries; use safety-kb-import for writing
  • Encoding: Script uses UTF-8 output; ensure terminal supports it
  • Fuzzy search performance: On large databases (>2000 records), LIKE queries may be slower; use --mode exact when possible
  • Clause truncation: clauses command truncates content to 200 chars for readability; use info to get full text

Relationship with Other Skills

SkillRole
safety-kb-query (this one)Query/read operations only
safety-kb-importImport/write new regulations into the database
standard-update-coursewareUpdate training courseware based on standard changes

Troubleshooting

ErrorCauseSolution
Database not foundWrong path or DB movedCheck DEFAULT_DB_PATH or set KB_PATH env var
no such columnDB schema changedRun schema command to see actual columns
Empty search resultsKeyword too specific or not in DBTry --mode fuzzy with shorter keywords
Garbled outputTerminal encoding issuePipe output through chcp 65001 (Windows) or redirect to file

Version History

  • 1.0.0 (2026-04-25): Initial release with 7 commands (search, check, info, clauses, stats, schema, conflicts)

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

94.15%
按下载量换算627

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills