knowledge-hook-engine

A three-layer Knowledge→Application→Project automatic hooking engine. Automatically tags YAML with L1/L2/L3, creates entities/relations/constraints, detects failures, and feeds lessons back. Intended for any scenario of “I have knowledge files + scripts + projects” that needs automatic hooking. Trigger: enabled when terms like “knowledge hooking / three-layer architecture / ontology / knowledge management / automatic archiving / automatic feedback / entity / relation graph” are mentioned.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "knowledge-hook-engine" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-96ee0b6391023ae80ecf2fb0fca2ff0cd3f7ac66ab1df4c3524f8d44135fa7f0. Verify the upstream source and version against https://skillhub.cn/skills/user_14a2a304/knowledge-hook-engine before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

A three-layer Knowledge→Application→Project automatic hooking engine. Automatically tags YAML with L1/L2/L3, creates entities/relations/constraints, detects failures, and feeds lessons back. Intended for any scenario of “I have knowledge files + scripts + projects” that needs automatic hooking. Trigger: enabled when terms like “knowledge hooking / three-layer architecture / ontology / knowledge management / automatic archiving / automatic feedback / entity / relation graph” are mentioned.

0 Downloads

Introduction source: third_party · user_14a2a304 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
slug: knowledge-hook-engine
displayName: 知识三层挂钩引擎
version: 1.0.0
name: knowledge-hook-engine
description: "知识→应用→项目 三层自动挂钩引擎 — 给 yaml 自动标 L1/L2/L3,自动建 entity/relation/constraint,自动失效检测,自动回流教训。适用于任何\"我有知识文件+脚本+项目\"想自动挂钩的场景。Trigger: 提到 \"知识挂钩 / 三层架构 / ontology / 知识管理 / 自动归档 / 自动回流 / entity / 关系图谱\" 时启用。"

Knowledge Hook Engine · 三层挂钩引擎

三层架构

L1 知识层 (knowledge/)      ← 任何 .md / .yaml / .txt 心术/方法/标准
L2 应用层 (skills/)         ← 可调用 skill / script  
L3 项目层 (05_项目执行/)    ← 实际消费应用的项目

核心:每个 yaml 自动建 entity,每个跨层引用自动建 relation,每个约束自动入 constraint 表。

何时使用

✅ 使用:

  • 有散落的 yaml/md 知识文件想挂钩
  • 想知道"这个知识文件被哪个项目用过几次"
  • 改了知识文件想知道"哪些 skill/project 会失效"
  • 项目跑出新教训想自动回流到知识库

❌ 不使用:

  • 没有 yaml/md 知识(先建)
  • 没项目执行(先跑通一个最小项目)
  • 不关心自动挂钩(手维护也行)

快速开始

# 1. 扫描三层
python scripts/scan_three_layers.py --root D:\workspace

# 2. 建 entity
python scripts/build_entities.py --root D:\workspace

# 3. 建 relation
python scripts/build_relations.py --root D:\workspace

# 4. 失效检测(改了 L1 自动通知 L2/L3)
python scripts/check_invalidation.py --root D:\workspace

# 5. 回流(项目跑完把教训回写到 L1)
python scripts/sediment_back.py --project 05_项目执行/wangyisheng_meirenqiang --pitfall "L0 排除清单加网红整容脸"

5 模块职责

模块 职责 输入 输出
scan_three_layers 扫 L1/L2/L3 文件 workspace 路径 layers_index.json
build_entities 给每个文件建 entity layers_index.json entities.json
build_relations 找跨层引用建 relation entities.json relations.json
check_invalidation 检测 L1 改动 → 通知 L2/L3 entities + relations invalidation_alerts.json
sediment_back 项目教训 → 回写 L1 project + pitfall text L1 yaml 更新

Entity schema

- id: knowledge/WYX_001_card    # 唯一 ID
  layer: L1                      # L1/L2/L3
  type: model_card               # 类型
  path: 05_项目执行/wangyisheng_meirenqiang/model_cards/WYX_001_card.yaml
  created: 2026-07-25
  last_modified: 2026-07-26
  tags: [王医生, 美人墙, 入模卡]
  hash: sha256_xxxxxx           # 内容指纹
  usage_count: 3                # 被 L2/L3 引用次数
  last_used: 2026-07-26

Relation schema

- id: rel_001
  from_entity: knowledge/WYX_001_card
  to_entity: skills/mrq-wyx-pipeline/scripts/mrq_v30_wyx_full_pipeline.py
  relation_type: references      # references / depends_on / produced_by / validates
  evidence: "prompts.step1: mrq_v30_wyx_full_pipeline.build_step1_prompt"
  weight: 1.0                     # 引用强度

Constraint schema

- id: cstr_001
  type: iron_law                # 铁律约束
  rule: "铁律 39: 所有输出文档默认 docx"
  applies_to: [L1, L2]          # 约束适用层
  check: "find . -name '*.md' -newer ... | grep -v node_modules"
  last_checked: 2026-07-26
  status: ok / violated

自动失效检测逻辑

if L1.hash changed:
    for relation in relations where from = L1:
        mark relation as stale
        notify L2/L3: "上游改了,重新跑"
        if constraint.violated:
            BLOCK task

自动回流逻辑

project_run_finished:
    pitfall = extract_lesson(log)
    if pitfall.type == "exclusion_missing":
        append_to model_card.exclusions
        bump model_card.version
    if pitfall.type == "iron_law_violated":
        add iron_law to HEARTBEAT
        add runtime_check

铁律

  • 铁律 38:遇问题自循环(不查 skill 直接问)
  • 铁律 40:缺口自动补全(本 skill 就是补 knowledge hook 缺口)
  • 铁律 41:缺口零拖延
  • 铁律 43:知识缺口自动补(拒绝硬答)

版本

  • v1.0.0 (2026-07-26 期淮-001 实战 1300 创建)
    • 从 ontology skill(已装未用)抽核心思想
    • 5 模块(scan/build_*/check/sediment)
    • 验证:王医生美人墙作为首个 L3 项目,WYX_001_card 作为首个 L1 entity

作者

期淮-001 · 实战 1300 · 张霖松分身
主人击中 #241/#243 触发

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 提供知识→应用→项目三层自动挂钩能力,解决知识文件自动归档、失效检测、教训回流等明确痛点
  • 适用于有知识管理需求的用户,属于明确场景的通用工具
Trigger Precision92/100

Highlights

  • 触发词覆盖完整(知识挂钩/三层架构/ontology/知识管理/自动归档/自动回流/entity/关系图谱),边界清晰
Structure and Standards95/100

Highlights

  • Phase/步骤清晰(快速开始5步),有出口条件(何时使用✅/❌),含端到端示例,frontmatter完整
Execution Reliability88/100

Highlights

  • 工具来源明确(scripts/目录下5个.py脚本),参数正确,覆盖主要异常(失效检测/约束检查),不可逆操作有确认机制
Evidence Verifiability (mean of the first four)88/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.