@code2knowledge/skill 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -12
- package/README.md +32 -7
- package/THIRD_PARTY_NOTICES.md +23 -0
- package/package.json +12 -3
package/LICENSE
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2026 Code2Knowledge contributors
|
|
4
4
|
|
|
5
|
-
Permission
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
# Code2Knowledge
|
|
1
|
+
# Code2Knowledge Skill
|
|
2
|
+
|
|
3
|
+
[官方源码](https://github.com/Muke-Coding/code2knowledge-skill) · [npm 包](https://www.npmjs.com/package/@code2knowledge/skill) · [问题反馈](https://github.com/Muke-Coding/code2knowledge-skill/issues)
|
|
4
|
+
|
|
5
|
+
**本仓库是 Code2Knowledge 唯一持续维护的版本。旧 [Web 仓库](https://github.com/Muke-Coding/code2knowledge) 停止维护,仅保留历史记录。**
|
|
2
6
|
|
|
3
7
|
**企业知识链路中的知识生产层:把授权源码与业务资料整理成可追溯、可审核、可版本管理的 Markdown/YAML 资产。**
|
|
4
8
|
|
|
@@ -34,7 +38,7 @@ Code2Knowledge 是一个面向多仓库、多业务域的 Agent Skill。它从
|
|
|
34
38
|
|
|
35
39
|
支持注册到 Claude Code、Codex、Cursor、Gemini CLI 和 GitHub Copilot(VS Code)。下面以 **Claude Code** 为例。
|
|
36
40
|
|
|
37
|
-
### npm
|
|
41
|
+
### npm 安装(推荐)
|
|
38
42
|
|
|
39
43
|
```bash
|
|
40
44
|
npm install -g @code2knowledge/skill
|
|
@@ -46,10 +50,11 @@ code2knowledge --agent claude --scope user
|
|
|
46
50
|
|
|
47
51
|
### 2. 安装本地项目依赖
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
也可从官方仓库安装源码;将项目保存在固定目录:
|
|
50
54
|
|
|
51
55
|
```bash
|
|
52
|
-
|
|
56
|
+
git clone https://github.com/Muke-Coding/code2knowledge-skill.git
|
|
57
|
+
cd code2knowledge-skill
|
|
53
58
|
npm ci --ignore-scripts
|
|
54
59
|
```
|
|
55
60
|
|
|
@@ -135,6 +140,11 @@ Agent:选择代码仓库
|
|
|
135
140
|
② 添加或选择其他仓库
|
|
136
141
|
你:①
|
|
137
142
|
|
|
143
|
+
Agent:是否添加 PRD、ERD 等文档资料?
|
|
144
|
+
① 不添加,仅分析代码
|
|
145
|
+
② 添加文档资料(提供本地目录)
|
|
146
|
+
你:①
|
|
147
|
+
|
|
138
148
|
Agent:这次要整理哪个业务域?输入名称即可。
|
|
139
149
|
你:退款
|
|
140
150
|
Agent:建议目录标识为 refund。① 采用建议 ② 自定义标识
|
|
@@ -304,7 +314,7 @@ npm ci --ignore-scripts
|
|
|
304
314
|
npm run register
|
|
305
315
|
```
|
|
306
316
|
|
|
307
|
-
源码注册入口指向本目录,应保留完整项目及依赖。移动目录后需移除旧入口并重新注册。npm
|
|
317
|
+
源码注册入口指向本目录,应保留完整项目及依赖。移动目录后需移除旧入口并重新注册。npm 已发布首版 `1.0.0`,普通用户推荐使用 npm 全局安装;开发者可从本仓库安装源码。
|
|
308
318
|
|
|
309
319
|
## 开发与贡献
|
|
310
320
|
|
|
@@ -322,7 +332,7 @@ npm run check
|
|
|
322
332
|
| `assets/project-context/` | 本体与规则模板 |
|
|
323
333
|
| `test/` | 注册、向导和工作流测试 |
|
|
324
334
|
|
|
325
|
-
|
|
335
|
+
以下为维护者发布流程;npm 同一版本不可覆盖,修改后必须递增版本并更新 CHANGELOG。发布需有 `@code2knowledge` 权限:
|
|
326
336
|
|
|
327
337
|
```bash
|
|
328
338
|
npm login --registry=https://registry.npmjs.org
|
|
@@ -336,7 +346,7 @@ npm publish --access public --registry=https://registry.npmjs.org
|
|
|
336
346
|
|
|
337
347
|
## 许可证
|
|
338
348
|
|
|
339
|
-
采用 [
|
|
349
|
+
采用 [MIT License](LICENSE)。继承的旧版代码和模板保留原许可声明,详见 [第三方及历史许可](THIRD_PARTY_NOTICES.md)。已发布的 1.0.0 仍采用原 ISC 协议。
|
|
340
350
|
|
|
341
351
|
默认代码上下文模式为 `repomix`,通过 `npx -y repomix` 执行;首次使用可能需要联网下载。显式设置 `contextMode: "source-index"` 可仅生成文件索引。已有向导与复用原料沿用已保存的模式。
|
|
342
352
|
|
|
@@ -351,3 +361,18 @@ Agent 在生成代码原料及正式分析前,逐一检查所有依赖服务
|
|
|
351
361
|
支持“需要人工介入”和“校验并导出成功”两类通知,默认关闭。在 `~/.code2knowledge/config.yml` 配置 `notification.feishu.enabled`、`webhook_url` 与可选 `secret` 后启用;不复用其他 skill 凭证。完成通知自动随导出触发,阻塞通知由 Agent 按协议调用。成功通知防重,发送结果保存在工作区 notifications/,失败不影响导出。配置和使用详见 [通知协议](references/notifications.md)。
|
|
352
362
|
|
|
353
363
|
安装 npm 包时自动初始化 `~/.code2knowledge/config.yml`(通知默认关闭、凭证为空);注册 Agent 时也会补齐缺失模板。已有配置始终保留,不覆盖。使用 `--ignore-scripts` 安装会跳过安装钩子,但之后注册仍会生成模板。配置文件以仅当前用户可读写的权限创建。
|
|
364
|
+
|
|
365
|
+
## 从旧 Web 版迁移
|
|
366
|
+
|
|
367
|
+
1. 安装本 Skill 并注册到 Agent,无需运行旧 Web 服务、终端代理或配置额外模型密钥。
|
|
368
|
+
2. 保留旧 workspace 和已导出资产,明确告诉 Agent 原工作区的绝对路径。默认只发现当前目录的 `.code2knowledge/`,不会自动搜索旧数据。
|
|
369
|
+
3. 旧 material/run 可读取,但继续分析前会检查并更新 origin/master。源码版本变化需要生成新原料,不能用当前 HEAD 替代历史证据。
|
|
370
|
+
4. 旧资产缺少契约 2.0 元数据、来源指纹或英文目录标识时,需要按诊断补齐或新建任务;不保证无缝迁移,不自动改写、删除旧资产。
|
|
371
|
+
|
|
372
|
+
## 使用限制
|
|
373
|
+
|
|
374
|
+
- 分析使用宿主 Agent 的模型和权限。源码及资料会进入宿主模型上下文,请自行确认组织授权与数据使用范围。
|
|
375
|
+
- 默认会切换依赖仓库到 master 并快进同步 origin/master;没有该远程分支、脏代码、本地领先/分叉或认证失败时阻塞,不自动改用 main,不强制覆盖。
|
|
376
|
+
- 图片型 ERD、扫描 PDF 的图形关系不保证完整提取,建议提供文本化实体关系与规则。资料不能单独证明代码已经实现。
|
|
377
|
+
- 注册及脚本有自动化测试;不同 Agent 的 UI 表现、真实业务分析完整性仍需在目标环境验证。校验通过不是业务正确性或安全审计保证。
|
|
378
|
+
- 配置启用飞书意味着授权将任务摘要、任务标识和本机路径发送到机器人所在会话。测试默认隔离真实通知。
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# 第三方及历史许可声明
|
|
2
|
+
|
|
3
|
+
知识模型、本体模板及部分实现继承自 Code2Knowledge Web 版。为保留历史许可,以下列出原 ISC 声明;这些继承部分仍保留该许可,项目新增和维护代码采用根目录 MIT 协议。
|
|
4
|
+
|
|
5
|
+
来源:https://github.com/Muke-Coding/code2knowledge
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
ISC License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2026 Code2Knowledge contributors
|
|
11
|
+
|
|
12
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose
|
|
13
|
+
with or without fee is hereby granted, provided that the above copyright notice
|
|
14
|
+
and this permission notice appear in all copies.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
17
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
18
|
+
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
19
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
20
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
21
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
22
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
23
|
+
```
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code2knowledge/skill",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Agent Skill for evidence-based multi-repository business knowledge.",
|
|
6
|
-
"license": "
|
|
6
|
+
"license": "MIT",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=20"
|
|
9
9
|
},
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"references/",
|
|
28
28
|
"scripts/",
|
|
29
29
|
"LICENSE",
|
|
30
|
-
"README.md"
|
|
30
|
+
"README.md",
|
|
31
|
+
"THIRD_PARTY_NOTICES.md"
|
|
31
32
|
],
|
|
32
33
|
"keywords": [
|
|
33
34
|
"agent-skills",
|
|
@@ -39,5 +40,13 @@
|
|
|
39
40
|
"publishConfig": {
|
|
40
41
|
"access": "public",
|
|
41
42
|
"registry": "https://registry.npmjs.org/"
|
|
43
|
+
},
|
|
44
|
+
"repository": {
|
|
45
|
+
"type": "git",
|
|
46
|
+
"url": "git+https://github.com/Muke-Coding/code2knowledge-skill.git"
|
|
47
|
+
},
|
|
48
|
+
"homepage": "https://github.com/Muke-Coding/code2knowledge-skill#readme",
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "https://github.com/Muke-Coding/code2knowledge-skill/issues"
|
|
42
51
|
}
|
|
43
52
|
}
|