SuperAPI AI Directory

shengjiang-knowledge

Office & productivity

View repository

Updated 10-15 17:47

About this skill

shengjiang-knowledge: systematic knowledge base setup, material intake, and health check

One-sentence definition

Turn the user's existing folders into a knowledge base where AI can work stably: with input intake, execution constraints, original facts, business output, and feedback checks and experience write-back; and let this knowledge base expose broken links, conflicts, and maintenance risks on its own.

The knowledge base here is not "putting files in order," but a Harness that can run, provide feedback, and evolve:

录音、笔记、网页、对话和项目资料有固定归口
  → Guides 约束:入口、用户画像、人格、规则、导航和 Skill
  → Model 执行:读取原始资料、判断、执行并产出
  → 业务输出:内容、课程、项目交付或企业服务
  → Sensors 反馈:启动自检、输出自检、纠正捕获、知识库巡检
  → 经验写回规则和 Skill,下一次执行更稳

Navigation is only responsible for pointing the way. When answering questions, continue to read the original files; do not treat index summaries as the facts themselves.

The current version is directly responsible for the local knowledge base's Harness Core, material intake, navigation, source of truth, and Sensors. Automatic synchronization of external tools, vector databases, cloud RAG, and specific business output systems are independent integrations or downstream capabilities, and are not pretended to be ready-made features in this Skill.

Task routing

User intent Mode
Enterprise knowledge base, company materials, product library / customer library / skills library Enterprise three libraries mode, prioritize reading references/enterprise-mode.md
Build from scratch, turn a folder into a knowledge base Setup
Set up a self-media, personal IP, or content production workbench Self-media mode
Already has a lot of materials, hopes AI can read, classify, and later retrieve them Material intake
Check broken links, conflicts, entrances, and directory health Health check
Fix issues found by inspection Fix (confirm first, then write)
Corrected AI, asked it to remember the lesson, and not make the same type of mistake again Self-correction loop (trigger anytime)

When the user simultaneously requests setup, importing materials, and checking, first audit the current state, then initialize or supplement entrances, then connect materials, and finally save a health status once.

For enterprise three libraries requests, first complete the necessary questions in the next section, then start the above steps. Enterprise mode's directory and classification rules take precedence over the general material area, output area, and project archive rules below; when official account content appears in enterprise materials, enterprise mode is still used.

Enterprise three libraries mode

For the complete execution flow, see references/enterprise-mode.md. The installation name remains shengjiang-knowledge, no need to install another Skill.

  1. First understand the company's business, target audience, material paths, storage locations, and the scope of use of customer materials. Only ask for missing information; when the user says "ask first before starting," ask first and wait for answers.
  2. For a new library use --profile enterprise, generate the product library, customer library, skills library, and necessary system entrances. For a mature library, only map the existing directories.
  3. Read the three usage instructions in the enterprise reference and design sub-libraries by organizational role. The product library manages everything from planning and supply resources to departure delivery and iteration; the customer library manages customer relationships, business opportunities, transactions, and services; the skills library manages processes, tools, and acceptance. The 24 industry categories are adjustable suggestions; enable them based on real materials.
  4. Keep originals in their original location, filename, and content; read them in batches and then index references. Register unreadable items and version conflicts truthfully.
  5. Following the Harness approach, establish task navigation, input conditions, fact sources, execution permissions, output locations, acceptance, failure continuation, and feedback update rules; the three libraries are linked through products, departure dates, customers, and orders.
  6. Each library's description states which sub-libraries are enabled, what has been placed, and what is still missing; read back the originals and verify cross-library tasks, update system/三库交付清单.md. Generating only a template does not mean data integration is complete.

If building, integrating, or fixing has been explicitly requested and the scope is clear, reversible writes within that scope are already authorized; continue after giving a preview and do not repeatedly ask for file-by-file approval. Requests that are read-only or ask to see the plan first do not write files, logs, or health status. Moving originals, destructive overwriting, external sending, etc. require separate specific authorization. This authorization judgment applies to the 'after confirmation' steps below and to referenced processes.

Work Boundaries

Can be done directly by default

  • Read-only scan of the directory specified by the user.
  • Read root-level entries, main directory entries, and the original files needed to complete the task.
  • Run scripts/audit_knowledge_base.py to perform deterministic checks.
  • Run scripts/scan_materials.py to build the list of materials pending integration.
  • Output the build plan, modification preview, and inspection report.

Must first ask the user to confirm

  • Create or modify files.
  • Copy, move, rename, or archive materials.
  • Rewrite entry rules such as AGENT.md、AGENTS.md、CLAUDE.md .
  • Designate a conflicted file as the currently effective version.
  • Use --save-state to save health status.

Not done by default

  • Do not install vector databases, Embedding services, or cloud RAG.
  • Do not upload user materials to third-party platforms.
  • Do not overwrite, delete, or mass-move.
  • Do not guess body content or authority based on filenames.
  • Do not read .env, keys, cookies, browser data, chat databases, or password files.
  • Do not pre-create a large number of empty directories just to 'look complete'.

Step 1: Determine the root directory

Judge in order:

  1. The user gives an explicit path: use that path.
  2. The user says 'this folder' and the current working directory boundary is clear: use the current directory.
  3. The current directory is the user's home directory, disk root, downloads directory, or contains multiple unrelated projects: ask the user to narrow the scope.
  4. The directory does not yet exist: ask only for the minimal information that would change the real path, such as name and save location.

Use normalized absolute paths. The Skill's own installation directory is not the user's knowledge base.

Step 2: Read-only audit

First look at the root level and 1-2 levels of directories; do not read all body content right away.

Check in priority order:

  • AGENT.md、AGENTS.md、CLAUDE.md
  • INDEX.md, root-level and in main directories README.md
  • system/SOUL.md、system/USER.md、system/PROCEDURES.md
  • _本周.md or other current working files
  • system/log.md、system/MEMORY_LOG.md、system/state/
  • Files whose names contain dates, versions, final version, latest version, original, summary, or archive

Default exclusions:

  • .git/、node_modules/, caches, build artifacts, and dependency directories
  • Recycle Bin, explicitly archived areas, and historical backups
  • Keys, credentials, cookies, browser data, and chat databases
  • Large binary files unrelated to the current task; record only the type, size, and path

During the audit, answer six questions:

  1. What work does this knowledge base mainly serve?
  2. What is the user's most important matter right now?
  3. Which directories are inputs, outputs, business assets, and project archives?
  4. Which files are candidate sources of truth? What is the basis?
  5. Where does the Agent start, and how does it find the original materials?
  6. Which conflicts or gaps must the user confirm?

When evidence is insufficient, write "pending confirmation"; do not declare an authoritative version on the user's behalf.

Step 3: Identify the state

State A: Empty directory or very little material

Use the minimal template and do not pre-build a complex business tree:

知识库根目录/
├── AGENT.md
├── AGENTS.md
├── CLAUDE.md
├── INDEX.md
├── _本周.md
├── 00.收件箱/
├── 01.资料库/
│   └── _资料索引.md
├── 02.输出区/
├── 03.项目档案/
├── skills/
└── system/
    ├── SOUL.md
    ├── USER.md
    ├── PROCEDURES.md
    ├── HEALTH.md
    ├── MEMORY_LOG.md
    ├── log.md
    └── state/

First run a preview:

python3 scripts/init_knowledge_base.py --root "<绝对路径>" --name "<知识库名称>"

After the user confirms, add --apply. The initialization script will not overwrite existing files.

If the user explicitly wants to do self-media, personal IP, or content production, switch to the self-media template:

python3 scripts/init_knowledge_base.py \
  --root "<绝对路径>" \
  --name "<知识库名称>" \
  --profile creator

After the user confirms, add --apply. This mode adds account positioning, benchmark research, user insights, a material library, a topic pool, drafts, review, final drafts, pending publication, and publication retrospectives on top of the general Harness; for the complete routing, see references/creator-mode.md。

State B: Existing materials, but no stable entry point

Keep the existing structure and first provide:

  1. Material domains and main directories;
  2. Candidate sources of truth and version conflicts;
  3. Entry files recommended to be added or supplemented;
  4. INDEX.md quick lookup items ready to be registered;
  5. Original materials that explicitly will not be moved.

After the user confirms, add entry points and navigation. Move files only when directory responsibilities are genuinely chaotic and the user agrees.

State C: Existing entry points and navigation

Go directly to material onboarding or a health check. Do not rebuild a mature knowledge base just to fit a template.

Mode 1: Build a knowledge base

1. First establish minimal context

Extract from the user's existing materials and conversations:

  • USER.md: who the user is, what they are doing, preferences, and goals;
  • SOUL.md: how AI should collaborate and express itself;
  • PROCEDURES.md: recurring "when X happens, do Y";
  • _本周.md: the current 1-3 most important things.

Ask only about what is missing. Do not invent information just to fill out a template.

2. Then establish navigation

INDEX.md At minimum, explain:

  • What each core entry point does;
  • What goes in the main directories;
  • Where to look first for high-frequency tasks;
  • What rules to follow when multiple versions conflict;
  • Which directories are not read by default.

Do not register file by file. For large numbers of similar files, registering the main directory, a local index, or naming rules is sufficient.

3. Establish the entry invocation chain

  • AGENT.md / AGENTS.md Keep the mirror consistent, and write the startup order and global red lines.
  • CLAUDE.md Make a thin entry point, import AGENT.md or provide equivalent startup rules.
  • The entry point is only responsible for "what to read first and when to query the database"; do not copy the entire knowledge base content.
  • After modifying any entry point, check whether the mirror, referenced paths, and startup files actually exist.

4. Provide a preview before writing

Use this format:

准备修改:

| 路径 | 动作 | 为什么 | 是否保留原件 |
| --- | --- | --- | --- |
| `{真实路径}` | 新建 / 补充 / 移动 | {原因} | 是 / 不涉及 |

不会做:{本轮明确排除的动作}

After the user confirms, execute the same set of actions. After adding facts, rules, or structures, append a record in system/log.md .

Self-media workspace mode

See the full rules in references/creator-mode.md。

  1. First confirm the account direction, target audience, content platforms, and main output formats; mark unknowns as "to be confirmed" and do not fabricate positioning.
  2. New repositories use --profile creator preview; existing repositories are not rebuilt—first provide a directory mapping and write preview.
  3. For benchmark source texts, comments, and verbatim transcripts, retain the platform, author, link, capture date, and original path.
  4. Topics, drafts, final drafts, and published content flow by status; do not duplicate multiple "final versions".
  5. After publishing, write the platform, publish time, title, link, and actual data back into the publishing retrospective; if there is no data, leave it blank.
  6. After batch importing benchmark materials, adjusting the content workflow, or accumulating a round of publishing data, rerun the health check.

Mode 2: Data ingestion and structuring

See the full rules in references/material-intake.md。

1. First build a read-only data inventory

python3 scripts/scan_materials.py --source "<资料文件或目录>" --format markdown

The script only records paths, formats, sizes, and sensitive file risks; it does not copy, move, or modify files.

2. Then read representative content

  • First read the source description, directory, index, and a small number of representative files; do not stuff all full text into the context at once.
  • For PDFs, Word, Excel, images, audio recordings, and videos, call the corresponding reading or transcription capabilities already available to the current Agent.
  • For sensitive files, only record the path and risk; reading content is prohibited.
  • Mark unreadable formats as "to be converted"; do not fabricate summaries based on file names.

3. Distinguish four types of knowledge

  1. Original facts: retain the source, date, and original path.
  2. External viewpoints: may be researched and cited, but must not be written as the user's position.
  3. User judgments: must have explicit user expression or real business validation.
  4. Procedural experience: after it occurs repeatedly and can be accepted, upgrade it to PROCEDURES.md or a Skill.

4. Generate an ingestion preview

| 原始资料 | 来源 / 所有者 | 建议归属 | 准备新建或更新 | 原件处理 | 依据 |
| --- | --- | --- | --- | --- | --- |

Default placement:

  • Pending-judgment input → 00.收件箱/
  • Long-term reusable raw materials, cases, and references → 01.资料库/
  • Copywriting, reports, proposals, and deliverables → 02.输出区/
  • Real project inputs, decisions, deliverables, and retrospectives → 03.项目档案/
  • Repeatable processes → skills/ or system/PROCEDURES.md

Write only after user confirmation. After completion, update 01.资料库/_资料索引.md, the relevant local indexes, and system/log.md; only modify the root INDEX.mdwhen adding high-frequency entry points. Keep only one source of truth for originals; place links, ingestion cards, summaries, or business outputs elsewhere.

Mode 3: Knowledge base health check

First run the read-only script:

python3 scripts/audit_knowledge_base.py --root "<绝对路径>" --format markdown

Script results are only clues. For P0 and P1 items, continue reading the relevant entry points or original files to rule out template examples, intentionally retained historical versions, and legitimate nested projects.

See the detailed judgment criteria in references/audit-rules.md. Focus on checking:

  1. Whether startup entry points and core files exist;
  2. AGENT.md / AGENTS.md Whether they are consistent;
  3. INDEX.md Whether the local path in the entry point is valid;
  4. Whether the main directories are included in navigation;
  5. Whether multiple "final version / latest version" items appear without a version rule;
  6. 00.收件箱/ Whether there is a long-term backlog;
  7. Whether the current working files have not been updated for a long time;
  8. Whether sensitive files, dependency directories, caches, or build artifacts are mixed in;
  9. Whether there are a large number of scattered root-level files, duplicate file names, or dangling references;
  10. system/MEMORY_LOG.md Whether there are similar corrections in it that have reached 3 times but have not yet been upgraded to a fixed rule.

After the user confirms and saves the current state, run:

python3 scripts/audit_knowledge_base.py \
  --root "<绝对路径>" \
  --format markdown \
  --save-state

This will write:

  • system/state/YYYY-MM-DD-知识库健康检查.md
  • system/state/latest-health.json

Each session reads the most recent state; if it has not been checked for more than 7 days, remind once. Recheck immediately after batch onboarding materials, modifying entry points, or relocating main directories. See the full cycle in references/health-cycle.md。

Inspection report format

# 知识库自检

## 结论
{一句话说明当前能不能稳定使用}

## 立即处理(P0)
- `{路径}`:{风险、证据、建议}

## 建议处理(P1)
- `{路径}`:{问题、影响、建议}

## 保持现状(P2)
- {哪些结构虽然不整齐,但有明确用途,不要乱动}

## 修复预览
| 路径 | 建议动作 | 是否需要用户确认 |
| --- | --- | --- |

## 本次检查范围与缺口
{检查了什么;哪些内容没有读取;哪些判断仍待确认}

If there is no issue at a certain priority, omit that section. Do not force issues just to appear professional.

Mode 4: Repair

  1. Divide inspection items into "certain repairs" and "requires business judgment".
  2. First handle entry points, broken links, and version conflicts that would cause the Agent to misread.
  3. Provide a modification preview precise to the path.
  4. Execute after user confirmation; do not expand to unconfirmed issues.
  5. After repair, rerun the inspection to prove the issue has disappeared.
  6. In system/log.md record this repair; when the user corrects the judgment, write to system/MEMORY_LOG.md。

Built-in capability: self-correction loop

Product, customer, schedule facts, and specific SOP corrections in the enterprise three repositories are returned to their respective authorized master files or processes; the system memory loop below is used for cross-task collaboration rules and does not write business content into global rules.

This knowledge base comes with a "learn from corrections" mechanism and does not require installing an additional memory or self-improvement Skill. It does not give the model permanent memory out of thin air, but writes lessons into files that are read every time.

  1. When the user corrects the output or judgment, or explicitly says "remember this lesson" or "don't make this mistake again", immediately follow the format of system/MEMORY_LOG.md and append an entry.
  2. Clearly write the scenario, user correction, and follow-up action, and mark "the Nth time for this type of correction". To judge whether it is the same type, look at the error pattern, not whether the wording is identical.
  3. When similar corrections reach 3 times, proactively propose upgrading to system/PROCEDURES.md. Upgrades must be confirmed by the user, and long-term rules cannot be changed automatically.
  4. Before starting an important task, first read the most recent corrections in MEMORY_LOG.md ; after upgrading, PROCEDURES.md is loaded along with the entry point.
  5. Do not record keys, privacy, or sensitive content; record only error patterns and correct practices; records are append-only by default.

Completion criteria

Setup completed

  • The root directory is clear;
  • The Agent has a usable entry point;
  • Persona, user, rules, navigation, and current work can be loaded in order;
  • The paths in navigation have undergone existence checks;
  • The initial health status can be generated and saved;
  • The user knows how to place materials, how to ask questions, and how to initiate self-checks.

Material onboarding completed

  • Each batch of materials has source, ownership, date, status, and original path;
  • External viewpoints, user judgments, and business facts are not mixed together;
  • The original has only one source of truth;
  • 01.资料库/_资料索引.md and local navigation have been updated;
  • Unreadable and to-be-confirmed items are explicitly retained.

Health check complete

  • The inspection scope is clear;
  • every issue has a path and evidence;
  • template examples and actual broken links are distinguished;
  • risks are sorted by P0 / P1 / P2;
  • the latest status is saved to system/state/(when the user requests saving);
  • no files were moved, overwritten, or deleted without confirmation.

Usage guidance after the first delivery

Generate 4 directly copyable examples based on the real directory, covering "intake materials, find materials, produce output, health check":

1. 从知识库找一下与 {真实主题} 有关的资料,并告诉我依据文件。
2. 读取这批 {真实资料类型},区分外部观点和我的判断,先给接入预览。
3. 根据知识库里的 {真实业务资料},帮我完成 {真实产出}。
4. 检查知识库健康状态,保存报告但不要自动修复。

The examples must come from the real content scanned this time; do not write empty phrases like "some file" or "some business".

Boundaries with other tasks

  • General knowledge base setup and self-check: stays in shengjiang-knowledge。
  • Large-scale content atomization, topic maps, and topic assembly: handed over to the content system Skill.
  • Multi-Agent platform migration and bridging: handed over to the Agent workbench migration Skill.
  • Feishu, Notion, vector databases, or enterprise permission systems: as subsequent independent integrations, not stuffed into the first version.

When a more complete structural explanation is needed, read references/architecture.md; before intake of materials, read references/material-intake.md; before executing inspections, read references/audit-rules.md and references/health-cycle.md. When building or maintaining a self-media knowledge base, you must read references/creator-mode.md。