@yottameta/yotta-chain 0.1.0 → 0.1.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/CHANGELOG.md +6 -0
- package/README.md +47 -9
- package/README.zh-CN.md +47 -9
- package/SKILL.md +3 -3
- package/package.json +1 -1
- package/references/rules.md +1 -1
- package/scripts/test_yotta_chain.py +2 -2
- package/scripts/yotta_chain.py +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.1 (2026-08-27)
|
|
4
|
+
|
|
5
|
+
- 修复:README 安装方式统一为三方式(方式一 npx `-g` / `--dir` 指定目录,方式二 install.sh(`--agent` 仅示例用),方式三手动复制+目录表),删除 npx 固定 `--agent codex` 的写法;README 中英双版同步。
|
|
6
|
+
- 对齐:package.json / SKILL.md / CHANGELOG / README / references/rules.md 的版本锚点统一到 v0.1.1;引擎 `version` 输出与测试断言同步。
|
|
7
|
+
- 引擎无功能变更,测试保持 52/52。
|
|
8
|
+
|
|
3
9
|
## 0.1.0 (2026-08-27)
|
|
4
10
|
|
|
5
11
|
- 初始版本:零依赖供应链依赖校验引擎(Python 3.8+ 标准库,纯本地离线)。
|
package/README.md
CHANGED
|
@@ -81,15 +81,53 @@ python3 scripts/yotta_chain.py version
|
|
|
81
81
|
|
|
82
82
|
## Installation
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
Pick any of the three methods; skill files are always fetched from **npm** (GitHub can be slow without a proxy; npm supports mirrors).
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
### Method 1: npm (recommended, one-liner)
|
|
87
|
+
```bash
|
|
88
|
+
# Optional China mirror: npm config set registry https://registry.npmmirror.com
|
|
89
|
+
npx -y @yottameta/yotta-chain -g
|
|
90
|
+
npx -y @yottameta/yotta-chain --dir <your skills dir> # any agent: install to a custom directory
|
|
91
|
+
```
|
|
92
|
+
> Agent not in the preset list? Use `--dir` to point at its skills directory, or copy manually (Method 3). `--list` shows the default directory of each agent.
|
|
93
|
+
|
|
94
|
+
### Method 2: install.sh
|
|
95
|
+
After obtaining the skill folder (`npm pack` unpack or `git clone`), enter the folder:
|
|
96
|
+
```bash
|
|
97
|
+
bash install.sh -g # user-level; bash install.sh --list shows all directories
|
|
98
|
+
bash install.sh --agent codex # a specific agent (see --list)
|
|
99
|
+
bash install.sh # project-level: auto-detect existing skills directories
|
|
100
|
+
bash install.sh --dir /path/to/skills
|
|
101
|
+
```
|
|
102
|
+
> Covers 17 agent families, including Trae / Qwen / Comate / CodeBuddy / Kimi.
|
|
103
|
+
|
|
104
|
+
### Method 3: manual copy
|
|
105
|
+
Copy the whole `yotta-chain` folder into the target agent's skills directory. Common user-level locations (`%USERPROFILE%` on Windows, `~` on Linux/macOS):
|
|
106
|
+
|
|
107
|
+
| Agent | User-level directory | Project-level directory |
|
|
108
|
+
|---|---|---|
|
|
109
|
+
| Codex | `%USERPROFILE%\.codex\skills\yotta-chain\` | `.codex\skills\` |
|
|
110
|
+
| Claude Code | `%USERPROFILE%\.claude\skills\yotta-chain\` | `.claude\skills\` |
|
|
111
|
+
| Cursor | `%USERPROFILE%\.cursor\skills\yotta-chain\` | `.cursor\skills\` |
|
|
112
|
+
| Windsurf | `%USERPROFILE%\.codeium\windsurf\skills\yotta-chain\` | `.windsurf\skills\` |
|
|
113
|
+
| opencode | `%USERPROFILE%\.config\opencode\skills\yotta-chain\` | `.opencode\skills\` |
|
|
114
|
+
| Gemini | `%USERPROFILE%\.gemini\skills\yotta-chain\` | `.gemini\skills\` |
|
|
115
|
+
| Goose | `%USERPROFILE%\.config\goose\skills\yotta-chain\` | `.goose\skills\` |
|
|
116
|
+
| Amp | `%USERPROFILE%\.config\agents\skills\yotta-chain\` | `.agents\skills\` |
|
|
117
|
+
| Kiro | `%USERPROFILE%\.kiro\skills\yotta-chain\` | `.kiro\skills\` |
|
|
118
|
+
| WorkBuddy | `%USERPROFILE%\.workbuddy\skills\yotta-chain\` | `.workbuddy\skills\` |
|
|
119
|
+
| Trae Code CLI | `%USERPROFILE%\.traecli\skills\yotta-chain\` | `.traecli\skills\` |
|
|
120
|
+
| Trae IDE (CN) | `%USERPROFILE%\.trae-cn\skills\yotta-chain\` | `.trae\skills\` |
|
|
121
|
+
| Qwen Code | `%USERPROFILE%\.qwen\skills\yotta-chain\` | `.qwen\skills\` |
|
|
122
|
+
| Comate | `%USERPROFILE%\.comate\skills\yotta-chain\` | `.comate\skills\` |
|
|
123
|
+
| CodeBuddy | `%USERPROFILE%\.codebuddy\skills\yotta-chain\` | `.codebuddy\skills\` |
|
|
124
|
+
| Kimi | `%USERPROFILE%\.kimi\skills\yotta-chain\` | `.kimi\skills\` |
|
|
125
|
+
| Generic AGENTS.md | `%USERPROFILE%\.agents\skills\yotta-chain\` | `.agents\skills\` |
|
|
126
|
+
|
|
127
|
+
> If Codex's `CODEX_HOME` is set, it overrides the default; the same applies to opencode's `XDG_CONFIG_HOME`. `.agents\skills` is not a universal directory — only OpenCode / Cursor / Cline / Amp / Kimi / Gemini CLI / GitHub Copilot etc. read it; **Claude Code and Codex do not read it by default**. When unsure, use `--dir` or let the agent install it.
|
|
128
|
+
|
|
129
|
+
> Project-level: run `npx -y @yottameta/yotta-chain` or `bash install.sh` inside the project to install into the detected project-level directory.
|
|
91
130
|
|
|
92
|
-
Installing into a project: run `npx -y @yottameta/yotta-chain` or `bash install.sh` inside the project to install into the detected project-level directory.
|
|
93
131
|
|
|
94
132
|
## Usage with an AI agent
|
|
95
133
|
|
|
@@ -121,12 +159,12 @@ The agent runs the engine, reports findings by severity, and explains each rule
|
|
|
121
159
|
| `typosquat` | low | Name within edit distance 2 of a well-known package — review manually |
|
|
122
160
|
| `snapshot` | low | Maven dependency uses a SNAPSHOT version |
|
|
123
161
|
|
|
124
|
-
## Supported ecosystems (v0.1.
|
|
162
|
+
## Supported ecosystems (v0.1.1)
|
|
125
163
|
|
|
126
164
|
- **npm** — `package.json` + `package-lock.json` (v1 / v2 / v3) / `npm-shrinkwrap.json` + `.npmrc` (per-scope registries);
|
|
127
165
|
- **Python** — `requirements*.txt` (with `--index-url` / `--extra-index-url` / `-r` recursion), `pyproject.toml` (PEP 621 / poetry), `poetry.lock`, `Pipfile` / `Pipfile.lock`;
|
|
128
166
|
- **Maven** — `pom.xml` (basic: unpinned / SNAPSHOT / suspicious repository URLs / property + dependencyManagement resolution).
|
|
129
|
-
- `yarn.lock` / `pnpm-lock.yaml` / `go.mod` / `Cargo.lock` are not yet supported in v0.1.
|
|
167
|
+
- `yarn.lock` / `pnpm-lock.yaml` / `go.mod` / `Cargo.lock` are not yet supported in v0.1.1 (see CHANGELOG).
|
|
130
168
|
|
|
131
169
|
## Boundaries
|
|
132
170
|
|
package/README.zh-CN.md
CHANGED
|
@@ -81,15 +81,53 @@ python3 scripts/yotta_chain.py version
|
|
|
81
81
|
|
|
82
82
|
## 安装
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
三种方式任选其一,技能文件统一从 **npm** 获取(GitHub 无代理时较慢,npm 可配国内镜像加速)。
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
86
|
+
### 方式一:npm(推荐,一行安装)
|
|
87
|
+
```bash
|
|
88
|
+
# 国内加速(可选):npm config set registry https://registry.npmmirror.com
|
|
89
|
+
npx -y @yottameta/yotta-chain -g
|
|
90
|
+
npx -y @yottameta/yotta-chain --dir <你的技能目录> # 任意智能体:指定目录安装
|
|
91
|
+
```
|
|
92
|
+
> 智能体不在预置列表里?用 `--dir` 指定它的 skills 目录,或手动复制(方式三)。`--list` 可查看各智能体对应的默认目录。想手动拿文件也可 `npm pack @yottameta/yotta-chain` 解包后按方式二/三安装。
|
|
93
|
+
|
|
94
|
+
### 方式二:install.sh 一键安装
|
|
95
|
+
获取技能文件夹后(`npm pack` 解包或 `git clone`),进入技能文件夹:
|
|
96
|
+
```bash
|
|
97
|
+
bash install.sh -g # 用户级;bash install.sh --list 查看全部目录
|
|
98
|
+
bash install.sh --agent codex # 指定智能体(--list 可查看可用项)
|
|
99
|
+
bash install.sh # 项目级:自动检测已存在的 .claude/.cursor/.codex 等 skills 目录
|
|
100
|
+
bash install.sh --dir /path/to/skills
|
|
101
|
+
```
|
|
102
|
+
> 覆盖 17 类智能体,含国内 Trae / Qwen / Comate / CodeBuddy / Kimi。Windows 用户:装有 Git Bash 即可用;否则用方式三手动复制。
|
|
103
|
+
|
|
104
|
+
### 方式三:手动复制
|
|
105
|
+
把整个 `yotta-chain` 文件夹复制到目标智能体的 skills 目录。常见位置(用户级;Windows 用 `%USERPROFILE%`,Linux/macOS 用 `~`):
|
|
106
|
+
|
|
107
|
+
| 智能体 | 用户级目录 | 项目级目录 |
|
|
108
|
+
|---|---|---|
|
|
109
|
+
| Codex | `%USERPROFILE%\.codex\skills\yotta-chain\` | `.codex\skills\` |
|
|
110
|
+
| Claude Code | `%USERPROFILE%\.claude\skills\yotta-chain\` | `.claude\skills\` |
|
|
111
|
+
| Cursor | `%USERPROFILE%\.cursor\skills\yotta-chain\` | `.cursor\skills\` |
|
|
112
|
+
| Windsurf | `%USERPROFILE%\.codeium\windsurf\skills\yotta-chain\` | `.windsurf\skills\` |
|
|
113
|
+
| opencode | `%USERPROFILE%\.config\opencode\skills\yotta-chain\` | `.opencode\skills\` |
|
|
114
|
+
| Gemini | `%USERPROFILE%\.gemini\skills\yotta-chain\` | `.gemini\skills\` |
|
|
115
|
+
| Goose | `%USERPROFILE%\.config\goose\skills\yotta-chain\` | `.goose\skills\` |
|
|
116
|
+
| Amp | `%USERPROFILE%\.config\agents\skills\yotta-chain\` | `.agents\skills\` |
|
|
117
|
+
| Kiro | `%USERPROFILE%\.kiro\skills\yotta-chain\` | `.kiro\skills\` |
|
|
118
|
+
| WorkBuddy | `%USERPROFILE%\.workbuddy\skills\yotta-chain\` | `.workbuddy\skills\` |
|
|
119
|
+
| Trae Code CLI | `%USERPROFILE%\.traecli\skills\yotta-chain\` | `.traecli\skills\` |
|
|
120
|
+
| Trae IDE(国内) | `%USERPROFILE%\.trae-cn\skills\yotta-chain\` | `.trae\skills\` |
|
|
121
|
+
| Qwen Code | `%USERPROFILE%\.qwen\skills\yotta-chain\` | `.qwen\skills\` |
|
|
122
|
+
| Comate | `%USERPROFILE%\.comate\skills\yotta-chain\` | `.comate\skills\` |
|
|
123
|
+
| CodeBuddy | `%USERPROFILE%\.codebuddy\skills\yotta-chain\` | `.codebuddy\skills\` |
|
|
124
|
+
| Kimi | `%USERPROFILE%\.kimi\skills\yotta-chain\` | `.kimi\skills\` |
|
|
125
|
+
| 通用 AGENTS.md | `%USERPROFILE%\.agents\skills\yotta-chain\` | `.agents\skills\` |
|
|
126
|
+
|
|
127
|
+
> 若设置了 Codex 的 `CODEX_HOME`,安装自动以该变量为准;opencode 同理(`XDG_CONFIG_HOME`)。`.agents\skills` 不是通用目录——仅 OpenCode / Cursor / Cline / Amp / Kimi / Gemini CLI / GitHub Copilot 等读取;**Claude Code 与 Codex 默认不读**。不确定时用 `--dir` 或让智能体自行安装。
|
|
128
|
+
|
|
129
|
+
> 装到项目:在项目内运行 `npx -y @yottameta/yotta-chain` 或 `bash install.sh`,会装到检测到的项目级目录。
|
|
91
130
|
|
|
92
|
-
装到项目:在项目内运行 `npx -y @yottameta/yotta-chain` 或 `bash install.sh`,会装到检测到的项目级目录。
|
|
93
131
|
|
|
94
132
|
## 让智能体使用
|
|
95
133
|
|
|
@@ -121,12 +159,12 @@ python3 scripts/yotta_chain.py version
|
|
|
121
159
|
| `typosquat` | low | 名字与知名包编辑距离 ≤ 2,疑似拼写仿冒 |
|
|
122
160
|
| `snapshot` | low | Maven 依赖使用 SNAPSHOT 版本 |
|
|
123
161
|
|
|
124
|
-
## 支持的生态(v0.1.
|
|
162
|
+
## 支持的生态(v0.1.1)
|
|
125
163
|
|
|
126
164
|
- **npm** — `package.json` + `package-lock.json`(v1 / v2 / v3)/ `npm-shrinkwrap.json` + `.npmrc`(作用域仓库映射);
|
|
127
165
|
- **Python** — `requirements*.txt`(含 `--index-url` / `--extra-index-url` / `-r` 递归)、`pyproject.toml`(PEP 621 / poetry)、`poetry.lock`、`Pipfile` / `Pipfile.lock`;
|
|
128
166
|
- **Maven** — `pom.xml`(基础:未固定版本 / SNAPSHOT / 可疑仓库 URL / 属性与 dependencyManagement 解析)。
|
|
129
|
-
- `yarn.lock` / `pnpm-lock.yaml` / `go.mod` / `Cargo.lock` v0.1.
|
|
167
|
+
- `yarn.lock` / `pnpm-lock.yaml` / `go.mod` / `Cargo.lock` v0.1.1 暂不支持(见 CHANGELOG)。
|
|
130
168
|
|
|
131
169
|
## 边界
|
|
132
170
|
|
package/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: yotta-chain
|
|
3
|
-
version: 0.1.
|
|
3
|
+
version: 0.1.1
|
|
4
4
|
description: 元链 —— 跨智能体的供应链依赖校验技能:零依赖自研引擎本地解析 npm(package.json / package-lock v1-v3 / .npmrc)与 Python(requirements / pyproject.toml / poetry.lock / Pipfile)及 Maven pom.xml,检测依赖混淆(私有包名被公共仓库同名抢占 / 混合仓库 / 可疑仓库 URL / extra-index 回退)、lockfile 与清单不一致、缺失锁文件、未固定版本、typo-squat 仿冒命名,并生成 SBOM-lite(CycloneDX 1.5 子集)。触发:用户要在构建 / 发布 / CI 前检查项目依赖是否存在供应链风险、核对锁文件与清单是否一致、排查依赖混淆风险或生成 SBOM 时。边界:纯本地离线解析,不做在线 CVE 比对、不查询公共包仓库、不发送任何数据;结果只是「需人工复核的风险信号」,是否真实需人工核实;仅用于已获授权 / 自有资产 / 教学环境。
|
|
5
5
|
license: MIT
|
|
6
6
|
---
|
|
@@ -77,13 +77,13 @@ python3 scripts/yotta_chain.py version
|
|
|
77
77
|
|
|
78
78
|
完整规则、判定逻辑与修复指引见 `references/rules.md`。
|
|
79
79
|
|
|
80
|
-
## 支持的生态(v0.1.
|
|
80
|
+
## 支持的生态(v0.1.1)
|
|
81
81
|
|
|
82
82
|
- **npm**:package.json + package-lock.json(v1 / v2 / v3)/ npm-shrinkwrap.json + .npmrc(作用域仓库映射);
|
|
83
83
|
- **Python**:requirements*.txt(含 --index-url / --extra-index-url / -r 递归)、pyproject.toml(PEP 621 / poetry)、
|
|
84
84
|
poetry.lock、Pipfile / Pipfile.lock;
|
|
85
85
|
- **Maven**:pom.xml(基础:未固定版本 / SNAPSHOT / 可疑仓库 URL / dependencyManagement 属性解析)。
|
|
86
|
-
- yarn.lock / pnpm-lock.yaml / go.mod / Cargo.lock:v0.1.
|
|
86
|
+
- yarn.lock / pnpm-lock.yaml / go.mod / Cargo.lock:v0.1.1 暂不支持,见 CHANGELOG 后续计划。
|
|
87
87
|
|
|
88
88
|
## 与家族协同
|
|
89
89
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yottameta/yotta-chain",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Yuanlian — a zero-dependency supply-chain dependency validator for AI agents: detects dependency confusion (private package names resolved from public registries, mixed registries, suspicious registry URLs), lockfile consistency issues (missing entries, unsatisfied ranges, dangling references, missing integrity), missing lockfiles, unpinned versions, SNAPSHOT deps and typosquatting across npm (package.json + package-lock v1/v2/v3), Python (requirements.txt, pyproject.toml, poetry.lock, Pipfile/Pipfile.lock) and Maven (pom.xml); generates SBOM-lite (CycloneDX 1.5 subset). Pure Python 3.8+ standard library, fully local and offline, no online CVE lookups. Triggers when the user needs to check a project dependencies for supply-chain risks before build/release, verify a lockfile matches its manifest, detect dependency-confusion exposure, or generate an SBOM. Boundaries: local and offline; no CVE databases, no package-registry queries, no data leaves the machine; findings are review signals to be verified by humans; authorized / own-asset / educational use only.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
package/references/rules.md
CHANGED
|
@@ -115,7 +115,7 @@
|
|
|
115
115
|
- **npm semver**:`^` `~` `>=` `<=` `>` `<` `=`、x 范围(`1.x` / `1.2.x`)、`*`、`||` 或、连字符范围(`1.2.3 - 2.3.4`)、预发布规则(预发布版本默认不满足不含预发布的比较器)。
|
|
116
116
|
- **PEP 440**:`==` `!=` `>=` `<=` `>` `<` `~=` `===`、逗号 AND、`||` 或、`==1.2.*` 通配;`~=1.2` = `>=1.2,==1.2.*`。
|
|
117
117
|
|
|
118
|
-
## 六、已知限制(v0.1.
|
|
118
|
+
## 六、已知限制(v0.1.1)
|
|
119
119
|
|
|
120
120
|
- 不做在线 CVE 比对(那是 snyk / trivy / npm audit 的地盘)。
|
|
121
121
|
- 依赖混淆为本地近似:真正确认「私有包名被公共仓库抢占」需要在线核对,引擎给强信号供人工复核。
|
|
@@ -115,7 +115,7 @@ class TestToml(unittest.TestCase):
|
|
|
115
115
|
doc = '''
|
|
116
116
|
[project]
|
|
117
117
|
name = "demo"
|
|
118
|
-
version = "0.1.
|
|
118
|
+
version = "0.1.1"
|
|
119
119
|
dependencies = [
|
|
120
120
|
"requests>=2.28",
|
|
121
121
|
'flask<3.0',
|
|
@@ -547,7 +547,7 @@ class TestCli(unittest.TestCase):
|
|
|
547
547
|
self.assertEqual(data["bomFormat"], "CycloneDX")
|
|
548
548
|
|
|
549
549
|
def test_version(self):
|
|
550
|
-
self.assertEqual(yc.VERSION, "0.1.
|
|
550
|
+
self.assertEqual(yc.VERSION, "0.1.1")
|
|
551
551
|
|
|
552
552
|
|
|
553
553
|
class TestNpmLockV1(unittest.TestCase):
|
package/scripts/yotta_chain.py
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Zero-dependency Python 3.8+ implementation (standard library only).
|
|
6
6
|
|
|
7
|
-
Scope (v0.1.
|
|
7
|
+
Scope (v0.1.1):
|
|
8
8
|
- npm : package.json + package-lock.json (v1/v2/v3) + npm-shrinkwrap.json + .npmrc
|
|
9
9
|
- python: requirements*.txt + pyproject.toml (PEP 621 / poetry) + poetry.lock
|
|
10
10
|
+ Pipfile / Pipfile.lock
|
|
@@ -35,7 +35,7 @@ try:
|
|
|
35
35
|
except Exception:
|
|
36
36
|
pass
|
|
37
37
|
|
|
38
|
-
VERSION = "0.1.
|
|
38
|
+
VERSION = "0.1.1"
|
|
39
39
|
|
|
40
40
|
SEVERITY_ORDER = ["info", "low", "medium", "high"]
|
|
41
41
|
SEVERITY_RANK = {s: i for i, s in enumerate(SEVERITY_ORDER)}
|