AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Okp Import

skill-talesofai-okp-okp-import · by talesofai

将领域知识清洗并导入 Open Knowledge Protocol。面向各领域 owner 的 agent:读 domain README → 查重 → 蒸馏 → 校验 → 写入。

No reviews yet
0 installs
32 views
0.0% view→install

Install

$ agentstack add skill-talesofai-okp-okp-import

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-talesofai-okp-okp-import)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
1mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Okp Import? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

okp-import — 知识导入 Skill

CRITICAL — 开始前 MUST 确认 okp CLI 已安装并可连接 API:

npm install -g @markbangwu/okp
okp domains    # 确认 API 可达

权限模型

public: admin/host > writer > reader

private: host > writer > reader

  • admin:全局管理员,可管理公开 domain。对 private domain 没有任何旁路权限,必须接受 reader/writer 邀请后才能读取或写入,且仍不能管理 private domain。
  • host:每个 domain 有且只有一个 host,由 domain 创建者自动获得。负责管理 domain README、成员和邀请码。host 不可转让。
  • writer:domain 写入者。可通过 invitation 获得。可写入概念,不能管理成员和邀请码。
  • reader:公开 domain 的默认只读权限;在 private domain 中必须通过邀请显式获得。

domain 默认公开。创建者可选择 private;private domain 不会向非成员出现在 domains、search、sample、links 或 export 中。

新建 domain → 自动成为 host

写 README 即创建 domain,创建者自动成为该 domain 唯一 host:

okp domain  --set readme.md

返回 201 即创建成功,创建者已持有 host 角色。

创建 private domain:

okp domain  --set readme.md --visibility private

获得 writer 权限

put / batch / domain --set 返回 403(write access denied):

  1. 让该 domain 的 host(公开 domain 也可由 admin)生成邀请码:

``bash okp invite create --expires-hours 72 --max-uses 1 ``

  1. 当前用户接受:

``bash okp invite accept OKP-XXXX-XXXX ``

  1. 确认成员身份:

``bash okp invite members ``

公开 domain 邀请码授予 writer。private domain 可邀请 readerwriter,不能授予 hostadmin

okp invite create  --role reader
okp invite create  --role writer

邀请码是短码,不是链接路由。门户右上角「邀请」也可输入同一邀请码。

工作流(严格按顺序)

Step 1: 读 domain README

每个 domain 有自己的 README,定义了 frontmatter 字段规范。必须先读。

okp domain           # 打印 README(含 schema 定义)
okp domains                  # 查看所有 domain
okp domains -q      # 模糊搜索领域名

如果是新 domain,先写 README 再导入(写 README 即定义 domain,之后 okp domains 立即可见):

okp domain  --set readme.md

README 格式(YAML frontmatter 定义 schema):

---
fields:
  sender:
    type: string
    required: true
    description: 飞书发送者用户名
  group:
    type: string
    required: true
    description: 来源飞书群
  platform:
    type: enum
    required: false
    enum: [bilibili, douyin, xiaohongshu, github, youtube]
  date:
    type: string
    required: false
    description: 发布日期 YYYY-MM-DD
---

# feishu-social

飞书社媒分享数据...

## How to contribute
每条 concept 的 frontmatter 必须包含 sender 和 group。

Step 2: 查重(search-before-insert)

okp search "" --domain  --type 
  • 命中语义相近的结果 → 判断是否同一概念 → 是则用已有 id 更新,否则改 title 区分

Step 3: 蒸馏 concept JSON

关键字段:

{
  "id": "feishu-social/Link/太离谱了居然可以在自己画的虚拟世界游玩",
  "domain": "feishu-social",
  "type": "Link",
  "title": "太离谱了!居然可以在自己画的虚拟世界游玩!",
  "description": "一句话摘要,不超过 500 字符",
  "tags": ["AI视频", "虚拟世界"],
  "body": "markdown 正文",
  "frontmatter": {
    "sender": "寇佳新",
    "group": "the World Builders",
    "platform": "bilibili",
    "date": "2026-07-06",
    "url": "https://b23.tv/zyhaEno",
    "likes": "225",
    "views": "6357"
  },
  "provenance": {
    "source": "feishu-sync",
    "agent": "okp-import/1.6",
    "raw_ref": "https://..."
  }
}

frontmatter 按 domain README 的 schema 填写。required 字段不能缺省,否则写入返回 422。

Step 4: 写入

# 单个
okp put  -f concept.json

# 批量(NDJSON,每行一个 concept)
okp batch concepts.ndjson

putbatch 行为一致:

  • 新写入 / 内容有变更 → 落库后自动进入可检索索引(异步,通常数秒内)
  • 内容未变的幂等重导 → 跳过写入;若该条此前未建好索引,服务端会补上
  • 不要再找单独的「建索引 / embed」命令——没有,也不需要

常见失败:

| 状态 | 含义 | 处理 | |---|---|---| | 403 | 无 domain 写权限 | 联系 host/admin 生成邀请码,再 okp invite accept | | 422 | frontmatter/校验失败 | 按 fix 补字段或改写 | | 401 | token 无效/过期 | 检查 OKP_API_TOKEN / sandbox execution token |

422 的 fix 常见项:

  • frontmatter. 是必填字段 → 补填该字段
  • 疑似重复 → 用 okp search 确认是否已有
  • provenance.source 为空 → 填数据来源

Step 5: 验证

写入返回成功后稍等片刻再搜(大批量导入可多等几秒):

okp sample --domain  --limit 3     # 随机抽样确认数据结构
okp search "" --domain  --limit 5
okp search --domain  --sort date:desc --limit 5   # 时序类看最新
okp get                                # 确认单条完整

若刚写入的 concept 暂时搜不到:再等几秒重试 okp search / okp get;不要重写一遍,除非内容本身要改。

id 命名规范

{domain}/{type}/{slug}   # slug 用 kebab-case,避免中文和空格

provenance 必填字段

| 字段 | 说明 | |---|---| | source | 数据来源,如 feishu-syncmanualfandom-crawl | | agent | 写入方,如 okp-import/1.6 | | raw_ref | 原始数据 URL 或路径 |

邀请相关 CLI(host/admin)

okp invite create  [--expires-hours 72] [--max-uses 1]
okp invite list 
okp invite revoke  
okp invite accept 
okp invite members 
  • create 时明文 code 只显示一次
  • list 不返回明文 code
  • 公开 domain 的邀请角色固定为 writer
  • private domain 的邀请角色可以是 readerwriter

删除

# writer/host 可删除有写权限 domain 中的 concept;公开 domain 的 admin 也可删除
okp delete  --yes

# private domain 只有 host 可删除;公开 domain 的 host/admin 可删除
okp domain  --delete --yes

domain 删除会永久清理该 domain 的 concepts、links、revisions、members 和 invites。

不在本 skill 范围

  • 知识搜索 → okp-search
  • domain README 维护之外的门户 UI 操作
  • 数据爬取 → 各 domain 自己的数据管道

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

  • Author: talesofai
  • Source: talesofai/okp
  • License: MIT
  • Homepage: https://cohub.live/koujiaxin/real-canvas/w/okp

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.