npc-learning

Automatically learns advanced usages and design patterns of NPC (AI programming agents) from the CNB public repository and consolidates them into a reusable knowledge base. This skill is triggered when users mention phrases like “learn NPC,” “NPC tips,” “scan NPC repo,” “consolidate NPC patterns,” “night learning,” “npc-learning,” or “extract NPC best practices.” Not to be used for NPC task scheduling or NPC code generation (those are handled by npc-dispatch-skill or the corresponding programming NPC).

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 "npc-learning" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-a13a85e4ba14acdf3c8032ee948806abe5cecf100c4d7f2eef5af91656fcac31. Verify the upstream source and version against https://skillhub.cn/skills/user_f12a44b7/self-dev-npc-learning 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

Automatically learns advanced usages and design patterns of NPC (AI programming agents) from the CNB public repository and consolidates them into a reusable knowledge base. This skill is triggered when users mention phrases like “learn NPC,” “NPC tips,” “scan NPC repo,” “consolidate NPC patterns,” “night learning,” “npc-learning,” or “extract NPC best practices.” Not to be used for NPC task scheduling or NPC code generation (those are handled by npc-dispatch-skill or the corresponding programming NPC).

0 Downloads

Introduction source: third_party · user_f12a44b7 · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Software, accounts and paid services
pip install -r requirements.txt
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: npc-learning
slug: self-dev-npc-learning
version: 1.0.0
displayName: "Self Dev Npc Learning"
description: >
  从 CNB 公开仓库中自动学习 NPC(AI 编程代理)的高级用法与设计模式,沉淀为可复用知识库。
  当用户提到"学习 NPC""NPC 技巧""扫描 NPC 仓库""沉淀 NPC 模式""夜间学习"
  "npc-learning""NPC 最佳实践提取"时触发此技能。
  不适用于 NPC 任务调度(→ npc-dispatch-skill)或 NPC 代码生成(→ 对应编程 NPC)。
alwaysApply: false
compatibility: "Python 3.8+ + CNB_TOKEN 环境变量 + CNB API 访问权限"
allowed-tools: "Bash(python:*) Bash(pip:*) Read Write Edit"

npc-learning — NPC 学习与知识沉淀

何时使用

  • 需要扫描 CNB 公开仓库中 NPC 的 SKILL.md / system prompt / 代码结构
  • 提取 NPC 高级用法模式(工具编排、容错策略、记忆管理等)
  • 生成 NPC 模式库或每日学习报告
  • 定时任务自动学习新出现的优质 NPC

何时不使用

场景 替代 Skill / 方式
派任务给 NPC 执行 ai-pipeline-factory 或直接 @NPC
查询 NPC 列表/库存 CNB OpenAPI GET /orgs/npc/-/repos
修改 NPC 代码 直接在目标仓库开 Issue @NPC
生成 NPC 报告摘要 auto-report

学习来源

来源 提取内容 获取方式
NPC 仓库 SKILL.md 触发条件、工具声明、执行步骤 CNB API GET /repos/{repo}/contents/SKILL.md
热门 NPC 代码结构 目录组织、入口文件、配置模式 Git clone + 文件遍历
NPC 实战 PR/Issue 对话策略、错误恢复、边界处理 CNB API Issues/Comments
NPC system prompt 人设、约束、输出格式 SKILL.md frontmatter + 正文

已沉淀的 NPC 模式(持续更新)

1. Skill 结构模式

  • Frontmatter 规范:name + description + alwaysApply + compatibility + allowed-tools
  • 分级触发:description 精确匹配优先,宽泛关键词兜底

2. 工具编排模式

  • 链式调用:搜索 → 读取 → 执行(减少无效调用)
  • 容错降级:主工具失败 → 备选方案 → 友好提示
  • 批量合并:多个 API 调用合并减少请求次数

3. 记忆管理模式

  • 分层存储:长期 MEMORY.md + 每日 memory/YYYY-MM-DD.md + 规则 rules/
  • 按需加载:只读相关文件,避免上下文膨胀

4. 质量保障模式

  • 输入验证:检查环境变量、文件存在性后再执行
  • 结构化输出:JSON Schema / Markdown 模板
  • 防御性编程:不信任外部输入,全路径容错

安装与运行

# 克隆仓库
git clone https://cnb.cool/cnbll/npc-learning.git
cd npc-learning

# 安装依赖
pip install -r requirements.txt

# 运行学习模块
python main.py

环境变量要求:

  • CNB_TOKEN:CNB API 认证令牌(必须)

执行步骤

  1. 扫描目标仓库:通过 CNB API 获取 NPC 组织下所有公开仓库列表
  2. 提取 SKILL.md:逐个获取仓库中的 SKILL.md 内容
  3. 模式识别:解析 frontmatter + 正文,识别工具编排、记忆管理、容错等模式
  4. 归档沉淀:将识别到的模式写入模式库 output/npc-pattern-library.md
  5. 生成报告:输出每日学习报告 output/npc-learning-YYYY-MM-DD.md

输出格式

每日学习报告

# NPC 学习报告 YYYY-MM-DD

## 扫描概要
- 扫描仓库数:N
- 新增模式数:N
- 更新模式数:N

## 新发现模式

### 模式名:<模式名称>
- **来源仓库**:<repo-path>
- **模式类型**:工具编排 / 记忆管理 / 容错策略 / 触发优化
- **描述**:<一段话描述>
- **代码示例**:
  <关键代码片段>
- **可复用场景**:<适用于哪些 NPC 开发场景>

## 模式库更新摘要
- 模式库总计:N 个模式
- 本日新增:N 个

模式库结构

{
  "pattern_id": "tool-chaining-search-read-execute",
  "name": "搜索→读取→执行链式调用",
  "category": "tool_orchestration",
  "source_repos": ["npc/open-code", "npc/claude-code"],
  "description": "先搜索定位目标,再读取确认内容,最后执行修改。减少盲操作。",
  "example": "...",
  "applicable_scenarios": ["代码修改", "文件重构", "配置更新"]
}

错误处理与降级

错误 处理方式
CNB API 返回 429(限流) 等待 Retry-After 后重试,最多 3 次
仓库无 SKILL.md 跳过,记录到日志,不中断流程
SKILL.md 解析失败 记录原始内容和错误信息,人工复查
网络超时 单仓库超时 30s,跳过继续下一个
CNB_TOKEN 无效 立即终止并提示检查 Token 配置

与其他 Skill 的协作

  • ai-pipeline-factory:学习到的 NPC 模式可反馈到流水线工厂,优化 NPC 编排
  • cnb-openapi-skills:底层依赖 CNB API 进行仓库扫描和内容获取
  • auto-report:学习报告可由 auto-report 格式化后推送

许可

MIT

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value78/100

Highlights

  • 从 CNB 公开仓库自动学习 NPC 高级用法与设计模式,沉淀为可复用知识库,具有明确实用价值
  • 覆盖工具编排、容错策略、记忆管理等多个 NPC 开发核心场景
Trigger Precision85/100

Highlights

  • 触发词覆盖合理,边界清晰,明确排除 NPC 任务调度和代码生成场景
Structure and Standards92/100

Highlights

  • Phase/步骤清晰,有出口条件,含端到端示例,frontmatter完整
Execution Reliability88/100

Highlights

  • 工具来源明确,参数正确,覆盖主要异常,不可逆操作有确认机制
Evidence Verifiability (mean of the first four)86/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.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 77
Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • cnb.cool

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.

pip install -r requirements.txt

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