@wangzheng1105/travel-skill 0.0.0-stage → 1.0.0
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 +21 -0
- package/README.md +23 -2
- package/bin/install.mjs +107 -0
- package/package.json +25 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 travel-plan contributors
|
|
4
|
+
|
|
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,3 +1,24 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @wangzheng1105/travel-skill
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> travel-skill 套件的 npm 安装器。一条命令安装全部 10 个 Skill。
|
|
4
|
+
|
|
5
|
+
## 使用
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx @wangzheng1105/travel-skill
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
或全局安装:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm i -g @wangzheng1105/travel-skill
|
|
15
|
+
travel-skill
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 作用
|
|
19
|
+
|
|
20
|
+
自动检测 Claude Code / Codex / OpenClaw / Cursor 的 skills 目录,从 GitHub 克隆 travel-skill 套件,并验证 10 个子技能完整性。
|
|
21
|
+
|
|
22
|
+
## 源码
|
|
23
|
+
|
|
24
|
+
https://github.com/wangzheng1105/travel-skill
|
package/bin/install.mjs
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execSync } from "child_process";
|
|
4
|
+
import { existsSync, mkdirSync } from "fs";
|
|
5
|
+
import { homedir } from "os";
|
|
6
|
+
import { join } from "path";
|
|
7
|
+
import { createInterface } from "readline";
|
|
8
|
+
|
|
9
|
+
const REPO_URL = "https://github.com/wangzheng1105/travel-skill.git";
|
|
10
|
+
const REPO_NAME = "travel-skill";
|
|
11
|
+
|
|
12
|
+
const REQUIRED_SKILLS = [
|
|
13
|
+
"travel-plan", "travel-pipeline", "trip-research", "attraction-selector",
|
|
14
|
+
"hotel-selector", "route-planner", "food-planner", "transport-planner",
|
|
15
|
+
"travel-calculator", "content-writer",
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
function detectSkillsDir() {
|
|
19
|
+
const candidates = [
|
|
20
|
+
process.env.CLAUDE_SKILLS_DIR,
|
|
21
|
+
join(homedir(), ".claude", "skills"),
|
|
22
|
+
join(homedir(), ".codex", "skills"),
|
|
23
|
+
join(homedir(), ".opencode", "skills"),
|
|
24
|
+
join(homedir(), ".cursor", "skills"),
|
|
25
|
+
].filter(Boolean);
|
|
26
|
+
|
|
27
|
+
for (const dir of candidates) {
|
|
28
|
+
if (existsSync(dir)) return dir;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const defaultDir = join(homedir(), ".claude", "skills");
|
|
32
|
+
mkdirSync(defaultDir, { recursive: true });
|
|
33
|
+
return defaultDir;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function run(cmd) {
|
|
37
|
+
return execSync(cmd, { stdio: "inherit", encoding: "utf-8" });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function verify(targetDir) {
|
|
41
|
+
console.log("\nℹ️ 校验安装完整性...");
|
|
42
|
+
let missing = 0;
|
|
43
|
+
for (const skill of REQUIRED_SKILLS) {
|
|
44
|
+
const skillFile = join(targetDir, ".claude", "skills", skill, "SKILL.md");
|
|
45
|
+
if (existsSync(skillFile)) {
|
|
46
|
+
console.log(` ✅ ${skill}`);
|
|
47
|
+
} else {
|
|
48
|
+
console.log(` ❌ ${skill} — 缺失 SKILL.md`);
|
|
49
|
+
missing++;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (missing > 0) {
|
|
54
|
+
console.log(`\n❌ 有 ${missing} 个子技能不完整,请检查网络后重试。`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
console.log("\n✅ 安装完成!10/10 子技能就绪\n");
|
|
59
|
+
console.log("触发示例:");
|
|
60
|
+
console.log(' "端午重庆3天2夜,上海出发,和女朋友,舒适型,帮我规划"');
|
|
61
|
+
console.log(' "带65岁老妈去北京3天,高铁去,看历史文化,预算8千内"');
|
|
62
|
+
console.log(' "简单说下西安有什么好玩的"');
|
|
63
|
+
console.log(`\n📂 安装位置: ${targetDir}`);
|
|
64
|
+
console.log("📖 文档: https://github.com/wangzheng1105/travel-skill");
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function main() {
|
|
68
|
+
console.log(`
|
|
69
|
+
╔══════════════════════════════════════════════╗
|
|
70
|
+
║ travel-skill — 中国家庭出行约束引擎 ║
|
|
71
|
+
║ 78 场景 × 11 步流水线 × 10 技能套件 ║
|
|
72
|
+
╚══════════════════════════════════════════════╝
|
|
73
|
+
`);
|
|
74
|
+
|
|
75
|
+
const skillsDir = detectSkillsDir();
|
|
76
|
+
const targetDir = join(skillsDir, REPO_NAME);
|
|
77
|
+
|
|
78
|
+
if (existsSync(targetDir)) {
|
|
79
|
+
console.log(`⚠️ 检测到已有安装: ${targetDir}`);
|
|
80
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
81
|
+
const answer = await new Promise((resolve) => {
|
|
82
|
+
rl.question(" 更新它?(Y/n): ", resolve);
|
|
83
|
+
});
|
|
84
|
+
rl.close();
|
|
85
|
+
if (answer.toLowerCase() === "n") {
|
|
86
|
+
console.log(" 跳过。");
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
console.log("ℹ️ 正在更新...");
|
|
90
|
+
try {
|
|
91
|
+
run(`git -C "${targetDir}" pull --ff-only origin main`);
|
|
92
|
+
} catch {
|
|
93
|
+
run(`git -C "${targetDir}" pull --ff-only origin master`);
|
|
94
|
+
}
|
|
95
|
+
verify(targetDir);
|
|
96
|
+
} else {
|
|
97
|
+
console.log(`ℹ️ 正在安装到: ${targetDir}`);
|
|
98
|
+
mkdirSync(skillsDir, { recursive: true });
|
|
99
|
+
run(`git clone ${REPO_URL} "${targetDir}"`);
|
|
100
|
+
verify(targetDir);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
main().catch((e) => {
|
|
105
|
+
console.error("❌ 安装失败:", e.message);
|
|
106
|
+
process.exit(1);
|
|
107
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wangzheng1105/travel-skill",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "中国家庭出行约束引擎 — 78场景×11步流水线×10技能套件(一键安装)",
|
|
5
|
+
"keywords": ["travel", "trip-planning", "china", "itinerary", "xiaohongshu", "constraint-engine", "family-travel", "claude-code"],
|
|
6
|
+
"homepage": "https://github.com/wangzheng1105/travel-skill",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/wangzheng1105/travel-skill.git"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": {
|
|
13
|
+
"name": "wangzheng1105"
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"travel-skill": "bin/install.mjs"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"bin/"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
}
|
|
27
|
+
}
|