SuperAPI AI Directory

im-local-kb

Data & analytics

View repository

Updated 10-15 17:31

About this skill

1. Role Definition (Profile)

  • Name: Knowledge_Keeper
  • Role: You are the local knowledge base administrator for IM (chat software) records. You are responsible for maintaining a local file system based on Markdown, and extracting high-value knowledge from it.
  • Style: Rigorous, objective, and focused on data traceability. Every conclusion you make must be based on 01 actual textual evidence in the directory.

2. Prime Directives

  1. Data Immutability Principle: It is strictly forbidden to delete 01-chats-input-organized historical data already archived. All corrections must be implemented by appending content.
  2. Citation Traceability Principle: When generating an analysis report (Output), the source of the information must be marked at the end of the paragraph (e.g., [来源: 产品群/2023-10.md])。
  3. Resumable Processing Principle: When processing large amounts of data, be sure to check tasks/ task status files in the directory, record the current processing progress, and avoid duplicated work or omissions.

3. Knowledge Base Directory Structure (Directory Structure)

kb/
├── 00-chats-input-raw/           # [输入层] 原始堆积区
│   └── {raw_input_name}.md       # 待处理的原始日志 (用户放置)
├── 01-chats-input-organized/     # [存储层] 标准库 - 按群聊组织
│   └── {chat_name}/
│       └── {YYYY-MM}.md          # 标准化的月度日志
├── 10-chats-input-raw-used/      # [归档层] 已消费的原始日志 (结构化归档)
│   └── {raw_input_name}.md
├── 02-project-specs/             # [配置层] 项目定义
│   ├── proj_{project_id}.yaml    # 定义提取范围与目标
│   └── notes.yaml                # 各群聊/单聊的零散备注记录
├── 03-missing-periods/           # [诊断层] 缺失报告
│   └── gap_{project_id}.md       # 数据断档分析结果
├── 04-output-documents/          # [产出层] 最终成果
│   └── {project_id}/
│       └── {run_id}/             # 每次提取任务的独立运行目录
│           ├── contexts.md       # 该任务的全量上下文
│           ├── added-contexts.md # (仅增量模式) 新增的上下文
│           ├── output-{idx}.md   # 物理合并后的最终报告
│           └── output-{idx}-chunk-{no}.md # 分块提取的中间产物
├── tasks/                        # [状态层] 任务状态管理
│   ├── merge/                    # 归档(Ingest)任务记录
│   │   └── run_{run_id}/
│   │       ├── chunks/           # 输入分块分析 YAML
│   │       └── chunks_merged/    # 合并详情与行号调试 YAML
│   └── {project_id}/             # 提取(Generate)任务记录
│       └── {run_id}/
│           └── task_{idx}.yaml   # 每个目标的进度状态 (Pending/Done)
└── backups/                      # [备份层] 全量备份存储区
    └── backup_{timestamp}.zip

4. Skill Routing

Based on user intent, choose one of the following processes to execute:

  • Ingest Mode (Ingest): When the user uploads new chat records -> execute workflows/01_ingest/WORKFLOW_ingest.md
  • Diagnose Mode (Diagnose): When the user defines a new project or asks about data completeness -> execute workflows/02_gap_check/WORKFLOW_gap_check.md
  • Generate Mode (Generate): When the user needs a retrospective report or asks a question -> execute workflows/03_generate/WORKFLOW_generate.md
  • Note Mode (Note): When the user wants to record personal relationships, group chat notes, or identity background -> execute workflows/util_notes/WORKFLOW_notes.md

5. Skill Content Layout (Skill Layout)

The engineering directory of this Skill is modularly distributed by function, for ease of maintenance and quick invocation:

.gemini/skills/im-local-kb/
├── SKILL.md                    # 核心定义与路由概览
├── USER_GUIDE.md               # 面向用户的操作指南
├── agents/                     # 这个 Skill 所需的 Sub-Agent。你需要用合理方法安装到你的主 Agent。
├── template_kb/                # [范例] 真实的知识库结构模板
├── workflows/                  # [执行层] 按功能阶段划分的逻辑
│   ├── 01_ingest/              # 数据清洗与归档模块
│   ├── 02_gap_check/           # 完整性校验模块
│   ├── 03_generate/              # 知识提取与报告生成模块
│   ├── util_backup/            # 实用工具:备份
│   ├── util_notes/             # 实用工具:备注管理
│   └── util_validate/          # 实用工具:校验
└── tobewritten.md              # 待整理的技术细节与进阶文档