@wangzheng1105/travel-skill 0.0.0-stage → 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/README.md +31 -2
- package/bin/install.mjs +130 -0
- package/bin/skills.mjs +33 -0
- package/bundle/LICENSE +21 -0
- package/bundle/skills/attraction-selector/LICENSE +21 -0
- package/bundle/skills/attraction-selector/README.md +10 -0
- package/bundle/skills/attraction-selector/SKILL.md +308 -0
- package/bundle/skills/content-writer/LICENSE +21 -0
- package/bundle/skills/content-writer/README.md +14 -0
- package/bundle/skills/content-writer/SKILL.md +421 -0
- package/bundle/skills/content-writer/references/xiaohongshu-style.md +213 -0
- package/bundle/skills/food-planner/LICENSE +21 -0
- package/bundle/skills/food-planner/README.md +10 -0
- package/bundle/skills/food-planner/SKILL.md +274 -0
- package/bundle/skills/food-planner/references/cities//344/270/211/344/272/232.md +19 -0
- package/bundle/skills/food-planner/references/cities//344/270/212/346/265/267.md +15 -0
- package/bundle/skills/food-planner/references/cities//344/271/214/351/262/201/346/234/250/351/275/220.md +21 -0
- package/bundle/skills/food-planner/references/cities//345/214/227/344/272/254.md +16 -0
- package/bundle/skills/food-planner/references/cities//345/215/227/344/272/254.md +17 -0
- package/bundle/skills/food-planner/references/cities//345/216/246/351/227/250.md +19 -0
- package/bundle/skills/food-planner/references/cities//345/221/274/344/274/246/350/264/235/345/260/224.md +17 -0
- package/bundle/skills/food-planner/references/cities//345/223/210/345/260/224/346/273/250.md +20 -0
- package/bundle/skills/food-planner/references/cities//345/244/247/347/220/206-/344/270/275/346/261/237.md +16 -0
- package/bundle/skills/food-planner/references/cities//345/271/277/345/267/236.md +16 -0
- package/bundle/skills/food-planner/references/cities//345/274/240/345/256/266/347/225/214.md +14 -0
- package/bundle/skills/food-planner/references/cities//346/210/220/351/203/275.md +17 -0
- package/bundle/skills/food-planner/references/cities//346/213/211/350/220/250.md +20 -0
- package/bundle/skills/food-planner/references/cities//346/230/206/346/230/216.md +16 -0
- package/bundle/skills/food-planner/references/cities//346/235/255/345/267/236.md +14 -0
- package/bundle/skills/food-planner/references/cities//346/241/202/346/236/227.md +15 -0
- package/bundle/skills/food-planner/references/cities//346/255/246/346/261/211.md +17 -0
- package/bundle/skills/food-planner/references/cities//346/267/261/345/234/263.md +18 -0
- package/bundle/skills/food-planner/references/cities//350/213/217/345/267/236.md +16 -0
- package/bundle/skills/food-planner/references/cities//350/245/277/345/256/211.md +16 -0
- package/bundle/skills/food-planner/references/cities//350/264/265/351/230/263.md +20 -0
- package/bundle/skills/food-planner/references/cities//351/207/215/345/272/206.md +20 -0
- package/bundle/skills/food-planner/references/cities//351/225/277/346/262/231.md +15 -0
- package/bundle/skills/food-planner/references/cities//351/235/222/345/262/233.md +16 -0
- package/bundle/skills/food-planner/references/cities//351/273/204/345/261/261.md +11 -0
- package/bundle/skills/food-planner/references/cities//351/273/204/345/261/261_auto.md +89 -0
- package/bundle/skills/food-planner/references/regional-cuisine.md +53 -0
- package/bundle/skills/hotel-selector/LICENSE +21 -0
- package/bundle/skills/hotel-selector/README.md +12 -0
- package/bundle/skills/hotel-selector/SKILL.md +339 -0
- package/bundle/skills/hotel-selector/references/hotel-brands.md +125 -0
- package/bundle/skills/route-planner/LICENSE +21 -0
- package/bundle/skills/route-planner/README.md +17 -0
- package/bundle/skills/route-planner/SKILL.md +470 -0
- package/bundle/skills/route-planner/references/gaode-mcp-guide.md +25 -0
- package/bundle/skills/transport-planner/LICENSE +21 -0
- package/bundle/skills/transport-planner/README.md +14 -0
- package/bundle/skills/transport-planner/SKILL.md +260 -0
- package/bundle/skills/transport-planner/references/transport-reference.md +94 -0
- package/bundle/skills/travel-calculator/LICENSE +21 -0
- package/bundle/skills/travel-calculator/README.md +12 -0
- package/bundle/skills/travel-calculator/SKILL.md +236 -0
- package/bundle/skills/travel-calculator/scripts/budget_calculator.py +490 -0
- package/bundle/skills/travel-pipeline/LICENSE +21 -0
- package/bundle/skills/travel-pipeline/README.md +21 -0
- package/bundle/skills/travel-pipeline/SKILL.md +328 -0
- package/bundle/skills/travel-plan/LICENSE +21 -0
- package/bundle/skills/travel-plan/README.md +180 -0
- package/bundle/skills/travel-plan/SKILL.md +456 -0
- package/bundle/skills/travel-plan/references/api-calling-guide.md +302 -0
- package/bundle/skills/travel-plan/references/bing-search.md +145 -0
- package/bundle/skills/travel-plan/references/data-bus-guide.md +103 -0
- package/bundle/skills/travel-plan/references/data-schema.md +962 -0
- package/bundle/skills/travel-plan/references/itinerary-template.md +91 -0
- package/bundle/skills/travel-plan/references/map-link-builder.md +31 -0
- package/bundle/skills/travel-plan/references/orchestration-rules.md +213 -0
- package/bundle/skills/travel-plan/references/pricing-rules.md +45 -0
- package/bundle/skills/travel-plan/references/scenario-matching-guide.md +221 -0
- package/bundle/skills/travel-plan/references/scenario-registry.md +154 -0
- package/bundle/skills/travel-plan/references/scenarios/accom-bnb.md +35 -0
- package/bundle/skills/travel-plan/references/scenarios/accom-chain.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/accom-hostel.md +35 -0
- package/bundle/skills/travel-plan/references/scenarios/accom-resort.md +36 -0
- package/bundle/skills/travel-plan/references/scenarios/area-border.md +46 -0
- package/bundle/skills/travel-plan/references/scenarios/area-city-walk.md +45 -0
- package/bundle/skills/travel-plan/references/scenarios/area-cruise.md +48 -0
- package/bundle/skills/travel-plan/references/scenarios/area-cycling.md +48 -0
- package/bundle/skills/travel-plan/references/scenarios/area-deep.md +48 -0
- package/bundle/skills/travel-plan/references/scenarios/area-hsr-hop.md +51 -0
- package/bundle/skills/travel-plan/references/scenarios/area-multi-city-loop.md +48 -0
- package/bundle/skills/travel-plan/references/scenarios/companion-child.md +39 -0
- package/bundle/skills/travel-plan/references/scenarios/companion-elderly.md +47 -0
- package/bundle/skills/travel-plan/references/scenarios/companion-infant.md +41 -0
- package/bundle/skills/travel-plan/references/scenarios/companion-multigen.md +26 -0
- package/bundle/skills/travel-plan/references/scenarios/companion-pet.md +37 -0
- package/bundle/skills/travel-plan/references/scenarios/companion-solo.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/companion-teen.md +33 -0
- package/bundle/skills/travel-plan/references/scenarios/dest-border-port.md +50 -0
- package/bundle/skills/travel-plan/references/scenarios/dest-high-altitude.md +50 -0
- package/bundle/skills/travel-plan/references/scenarios/dest-historical.md +50 -0
- package/bundle/skills/travel-plan/references/scenarios/dest-island.md +51 -0
- package/bundle/skills/travel-plan/references/scenarios/dest-religious.md +49 -0
- package/bundle/skills/travel-plan/references/scenarios/dest-rural.md +45 -0
- package/bundle/skills/travel-plan/references/scenarios/dest-t1-city.md +52 -0
- package/bundle/skills/travel-plan/references/scenarios/dest-theme-park.md +57 -0
- package/bundle/skills/travel-plan/references/scenarios/diet-halal.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/diet-kid-meal.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/diet-no-spicy.md +33 -0
- package/bundle/skills/travel-plan/references/scenarios/diet-seafood-allergy.md +33 -0
- package/bundle/skills/travel-plan/references/scenarios/diet-vegetarian.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/pace-hotel-chill.md +45 -0
- package/bundle/skills/travel-plan/references/scenarios/pace-normal.md +40 -0
- package/bundle/skills/travel-plan/references/scenarios/pace-resort.md +47 -0
- package/bundle/skills/travel-plan/references/scenarios/pace-slow.md +46 -0
- package/bundle/skills/travel-plan/references/scenarios/pace-special-forces.md +47 -0
- package/bundle/skills/travel-plan/references/scenarios/purpose-anniversary.md +44 -0
- package/bundle/skills/travel-plan/references/scenarios/purpose-getaway.md +46 -0
- package/bundle/skills/travel-plan/references/scenarios/purpose-graduation.md +44 -0
- package/bundle/skills/travel-plan/references/scenarios/purpose-may-day.md +43 -0
- package/bundle/skills/travel-plan/references/scenarios/purpose-mini-holiday.md +44 -0
- package/bundle/skills/travel-plan/references/scenarios/purpose-national-day.md +44 -0
- package/bundle/skills/travel-plan/references/scenarios/purpose-spring-festival.md +44 -0
- package/bundle/skills/travel-plan/references/scenarios/purpose-weekend.md +45 -0
- package/bundle/skills/travel-plan/references/scenarios/season-foliage.md +51 -0
- package/bundle/skills/travel-plan/references/scenarios/season-heatwave.md +49 -0
- package/bundle/skills/travel-plan/references/scenarios/season-heavy-rain.md +44 -0
- package/bundle/skills/travel-plan/references/scenarios/season-peak.md +59 -0
- package/bundle/skills/travel-plan/references/scenarios/season-severe-cold.md +53 -0
- package/bundle/skills/travel-plan/references/scenarios/season-typhoon.md +48 -0
- package/bundle/skills/travel-plan/references/scenarios/special-accessibility.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/special-altitude-sick.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/special-car-rental.md +35 -0
- package/bundle/skills/travel-plan/references/scenarios/special-insurance.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/special-monday.md +33 -0
- package/bundle/skills/travel-plan/references/scenarios/special-permit.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/special-photo-crew.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/special-reservation.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/style-adventure.md +45 -0
- package/bundle/skills/travel-plan/references/scenarios/style-bleisure.md +43 -0
- package/bundle/skills/travel-plan/references/scenarios/style-budget.md +46 -0
- package/bundle/skills/travel-plan/references/scenarios/style-cultural.md +43 -0
- package/bundle/skills/travel-plan/references/scenarios/style-foodie.md +43 -0
- package/bundle/skills/travel-plan/references/scenarios/style-groupfun.md +43 -0
- package/bundle/skills/travel-plan/references/scenarios/style-luxury.md +43 -0
- package/bundle/skills/travel-plan/references/scenarios/style-nature.md +43 -0
- package/bundle/skills/travel-plan/references/scenarios/style-photography.md +44 -0
- package/bundle/skills/travel-plan/references/scenarios/style-relaxation.md +43 -0
- package/bundle/skills/travel-plan/references/scenarios/style-romance.md +43 -0
- package/bundle/skills/travel-plan/references/scenarios/style-shopping.md +43 -0
- package/bundle/skills/travel-plan/references/scenarios/trans-hsr-only.md +33 -0
- package/bundle/skills/travel-plan/references/scenarios/trans-lcc.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/trans-long-rail.md +34 -0
- package/bundle/skills/travel-plan/references/scenarios/trans-mixed.md +33 -0
- package/bundle/skills/travel-plan/references/scenarios/trans-self-driving.md +34 -0
- package/bundle/skills/travel-plan/references/skill-standards.md +99 -0
- package/bundle/skills/travel-plan/references/travel-evidence.md +33 -0
- package/bundle/skills/travel-plan/references/travel-evidence.schema.json +302 -0
- package/bundle/skills/travel-plan/scripts/budget_calculator.py +150 -0
- package/bundle/skills/travel-plan/scripts/consistency_check.py +161 -0
- package/bundle/skills/travel-plan/scripts/date_validator.py +74 -0
- package/bundle/skills/travel-plan/scripts/delivery_timing.py +80 -0
- package/bundle/skills/travel-plan/scripts/gaode_deadline.py +56 -0
- package/bundle/skills/travel-plan/scripts/geocode_attractions.py +185 -0
- package/bundle/skills/travel-plan/scripts/itinerary_builder.py +212 -0
- package/bundle/skills/travel-plan/scripts/itinerary_overview.css +87 -0
- package/bundle/skills/travel-plan/scripts/itinerary_overview.py +264 -0
- package/bundle/skills/travel-plan/scripts/query_trace.py +65 -0
- package/bundle/skills/travel-plan/scripts/route_map_html.py +423 -0
- package/bundle/skills/travel-plan/scripts/travel_readiness.py +414 -0
- package/bundle/skills/travel-plan/scripts/weather_fetcher.py +386 -0
- package/bundle/skills/trip-research/LICENSE +21 -0
- package/bundle/skills/trip-research/README.md +12 -0
- package/bundle/skills/trip-research/SKILL.md +382 -0
- package/package.json +29 -4
package/README.md
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @wangzheng1105/travel-skill
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> travel-skill 套件的 npm 安装器。一条命令安装全部 10 个 Skill。
|
|
4
|
+
|
|
5
|
+
## 安装到当前项目
|
|
6
|
+
|
|
7
|
+
在项目根目录运行,再用助手打开该项目。
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @wangzheng1105/travel-skill
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
需要在自己的多个项目中使用时,可安装到用户目录:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx @wangzheng1105/travel-skill --global
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 技能发现
|
|
20
|
+
|
|
21
|
+
| 助手 | 项目目录 |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| Codex、Gemini CLI、OpenCode、OpenClaw | `.agents/skills/` |
|
|
24
|
+
| Claude Code | `.claude/skills/` |
|
|
25
|
+
|
|
26
|
+
包内附带 10 个技能、参考资料和 Python 脚本。Codex 可用 `$travel-plan`,Claude Code 可用 `/travel-plan`。重复运行可更新安装器管理且未被修改的技能。同名技能有本地改动时,安装器会停止并提示备份。
|
|
27
|
+
|
|
28
|
+
旧的 `CLAUDE_SKILLS_DIR` 仍可指定单一目标目录。完整 Demo 与可选高德 MCP 服务端见源码仓库。
|
|
29
|
+
|
|
30
|
+
## 源码
|
|
31
|
+
|
|
32
|
+
https://github.com/wangzheng1105/travel-skill
|
package/bin/install.mjs
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { cpSync, lstatSync, mkdirSync, mkdtempSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
import { join, resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
import { fingerprint, installRecord, skillNames } from "./skills.mjs";
|
|
8
|
+
|
|
9
|
+
const packageName = "@wangzheng1105/travel-skill";
|
|
10
|
+
const bundledSkills = fileURLToPath(new URL("../bundle/skills/", import.meta.url));
|
|
11
|
+
|
|
12
|
+
function stat(path) {
|
|
13
|
+
try {
|
|
14
|
+
return lstatSync(path);
|
|
15
|
+
} catch (error) {
|
|
16
|
+
if (error.code !== "ENOENT") throw error;
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function destinations(args) {
|
|
22
|
+
if (args.length && (args.length !== 1 || args[0] !== "--global")) {
|
|
23
|
+
throw new Error("用法:npx " + packageName + " [--global]");
|
|
24
|
+
}
|
|
25
|
+
const custom = process.env.CLAUDE_SKILLS_DIR?.trim();
|
|
26
|
+
if (custom) return [resolve(custom)];
|
|
27
|
+
|
|
28
|
+
const root = args[0] === "--global" ? homedir() : process.cwd();
|
|
29
|
+
return [join(root, ".agents", "skills"), join(root, ".claude", "skills")];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function inspect(destination, expected) {
|
|
33
|
+
const existing = stat(destination);
|
|
34
|
+
if (!existing) return "missing";
|
|
35
|
+
if (!existing.isDirectory()) throw new Error("技能路径已被占用:" + destination);
|
|
36
|
+
|
|
37
|
+
const current = fingerprint(destination);
|
|
38
|
+
if (current === expected) return "ready";
|
|
39
|
+
const stateFile = join(destination, installRecord);
|
|
40
|
+
if (stat(stateFile)?.isFile()) {
|
|
41
|
+
const record = JSON.parse(readFileSync(stateFile, "utf8"));
|
|
42
|
+
if (record.package === packageName && record.fingerprint === current) return "upgrade";
|
|
43
|
+
}
|
|
44
|
+
throw new Error("已有的同名技能包含其他内容。请先备份或改名:" + destination);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function install(roots) {
|
|
48
|
+
const sources = skillNames.map(name => {
|
|
49
|
+
const path = join(bundledSkills, name);
|
|
50
|
+
if (!stat(join(path, "SKILL.md"))?.isFile()) {
|
|
51
|
+
throw new Error("npm 包缺少技能文件:" + name);
|
|
52
|
+
}
|
|
53
|
+
return { name, path, fingerprint: fingerprint(path) };
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// Validate every destination before writing either assistant's skill tree.
|
|
57
|
+
const pending = roots.flatMap(root => sources.map(source => {
|
|
58
|
+
const destination = join(root, source.name);
|
|
59
|
+
return { root, source, destination, state: inspect(destination, source.fingerprint) };
|
|
60
|
+
})).filter(item => item.state !== "ready");
|
|
61
|
+
|
|
62
|
+
const staging = new Map();
|
|
63
|
+
const changes = [];
|
|
64
|
+
let rollbackFailed = false;
|
|
65
|
+
try {
|
|
66
|
+
for (const item of pending) {
|
|
67
|
+
if (!staging.has(item.root)) {
|
|
68
|
+
mkdirSync(item.root, { recursive: true });
|
|
69
|
+
staging.set(item.root, mkdtempSync(join(item.root, ".travel-skill-")));
|
|
70
|
+
}
|
|
71
|
+
const temp = staging.get(item.root);
|
|
72
|
+
const incoming = join(temp, item.source.name);
|
|
73
|
+
cpSync(item.source.path, incoming, { recursive: true });
|
|
74
|
+
writeFileSync(join(incoming, installRecord), JSON.stringify({
|
|
75
|
+
package: packageName,
|
|
76
|
+
fingerprint: item.source.fingerprint,
|
|
77
|
+
}) + "\n");
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
for (const item of pending) {
|
|
81
|
+
const observed = inspect(item.destination, item.source.fingerprint);
|
|
82
|
+
if (observed === "ready") continue;
|
|
83
|
+
if (observed !== item.state) throw new Error("安装目录发生变更:" + item.destination);
|
|
84
|
+
|
|
85
|
+
const temp = staging.get(item.root);
|
|
86
|
+
const incoming = join(temp, item.source.name);
|
|
87
|
+
const backup = join(temp, item.source.name + ".previous");
|
|
88
|
+
const change = { destination: item.destination, incoming, backup: null, installed: false };
|
|
89
|
+
changes.push(change);
|
|
90
|
+
if (observed === "upgrade") {
|
|
91
|
+
renameSync(item.destination, backup);
|
|
92
|
+
change.backup = backup;
|
|
93
|
+
}
|
|
94
|
+
renameSync(incoming, item.destination);
|
|
95
|
+
change.installed = true;
|
|
96
|
+
}
|
|
97
|
+
} catch (error) {
|
|
98
|
+
for (const change of changes.reverse()) {
|
|
99
|
+
try {
|
|
100
|
+
if (change.installed) renameSync(change.destination, change.incoming);
|
|
101
|
+
if (change.backup) renameSync(change.backup, change.destination);
|
|
102
|
+
} catch {
|
|
103
|
+
rollbackFailed = true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (rollbackFailed) {
|
|
107
|
+
throw new Error(error.message + "。部分备份保留在:" + [...staging.values()].join("、"));
|
|
108
|
+
}
|
|
109
|
+
throw error;
|
|
110
|
+
} finally {
|
|
111
|
+
if (!rollbackFailed) {
|
|
112
|
+
for (const temp of staging.values()) rmSync(temp, { recursive: true, force: true });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
for (const root of roots) {
|
|
117
|
+
if (sources.some(source => inspect(join(root, source.name), source.fingerprint) !== "ready")) {
|
|
118
|
+
throw new Error("安装后校验失败:" + root);
|
|
119
|
+
}
|
|
120
|
+
console.log("已安装 " + sources.length + "/" + sources.length + " 个技能:" + root);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
install(destinations(process.argv.slice(2)));
|
|
126
|
+
console.log("在助手中重新打开该项目,然后输入「帮我规划重庆+成都四天行程」。");
|
|
127
|
+
} catch (error) {
|
|
128
|
+
console.error("安装失败:" + error.message);
|
|
129
|
+
process.exitCode = 1;
|
|
130
|
+
}
|
package/bin/skills.mjs
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { readdirSync, readFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
|
|
5
|
+
export const skillNames = [
|
|
6
|
+
"travel-plan", "travel-pipeline", "trip-research", "attraction-selector",
|
|
7
|
+
"hotel-selector", "route-planner", "food-planner", "transport-planner",
|
|
8
|
+
"travel-calculator", "content-writer",
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
export const installRecord = ".travel-skill-install.json";
|
|
12
|
+
|
|
13
|
+
export function fingerprint(directory) {
|
|
14
|
+
const hash = createHash("sha256");
|
|
15
|
+
function visit(base, prefix = "") {
|
|
16
|
+
for (const entry of readdirSync(base, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name, "en"))) {
|
|
17
|
+
if (entry.isDirectory() && entry.name === "__pycache__") continue;
|
|
18
|
+
if (!prefix && entry.isFile() && entry.name === installRecord) continue;
|
|
19
|
+
const path = join(base, entry.name);
|
|
20
|
+
const relative = prefix + entry.name;
|
|
21
|
+
if (entry.isDirectory()) {
|
|
22
|
+
hash.update(JSON.stringify(["dir", relative]));
|
|
23
|
+
visit(path, relative + "/");
|
|
24
|
+
} else if (entry.isFile()) {
|
|
25
|
+
hash.update(JSON.stringify(["file", relative, createHash("sha256").update(readFileSync(path)).digest("hex")]));
|
|
26
|
+
} else {
|
|
27
|
+
throw new Error("技能目录包含不支持的文件类型:" + path);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
visit(directory);
|
|
32
|
+
return hash.digest("hex");
|
|
33
|
+
}
|
package/bundle/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.
|
|
@@ -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.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# 🎯 Attraction Selector — 景点筛选专家
|
|
2
|
+
|
|
3
|
+
筛选 20-50 个候选景点 → 基于用户偏好(美食/拍照/文化/亲子/综合)和人流/路线/时段优化 → 每日 2-3 核心 + 弹性备选。
|
|
4
|
+
|
|
5
|
+
**触发词:** "帮我筛选景点"、"哪些景点值得去"、"帮我排一下景点优先级"
|
|
6
|
+
|
|
7
|
+
**输入:** `01_research.json`(Research Brief 的候选景点池)
|
|
8
|
+
**输出:** `02_attractions.json`(每日精选+同质化检测+体力约束)
|
|
9
|
+
|
|
10
|
+
> 本 Skill 是 [travel-skill](https://github.com/wangzheng1105/travel-skill) 套件的一部分。详见上层 [README](../../../README.md)。
|
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: attraction-selector
|
|
3
|
+
description: Use when selecting and ranking attractions for a travel itinerary - filters 20-50 candidates down to the actual itinerary based on user preferences (美食/拍照/文化/亲子/综合), popularity, route logic, time-of-day optimization, and crowd avoidance. Scores on 8 dimensions with style-specific multipliers. Triggers on "帮我筛选景点", "哪些景点值得去", "帮我排一下景点优先级", "景点怎么选".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Attraction Selector — 景点筛选专家
|
|
7
|
+
|
|
8
|
+
> 📡 **数据总线:** 从 `01_research.json` 读取景点候选池。写入 `02_attractions.json`。字段定义见 `travel-plan/references/data-schema.md` 的 AttractionSelection 结构。
|
|
9
|
+
|
|
10
|
+
## 职责
|
|
11
|
+
|
|
12
|
+
从 Research Brief 的 20-50 个候选景点中,**精选出每天 2-3 个核心 + 1-2 个弹性景点**。核心景点 = 必去,弹性 = 有时间/有精力就去。
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 筛选流程(5步)
|
|
17
|
+
|
|
18
|
+
### Step 1: 硬过滤(直接排除)
|
|
19
|
+
|
|
20
|
+
| 排除条件 | 说明 |
|
|
21
|
+
|----------|------|
|
|
22
|
+
| 🚫 季节性关闭 | 出行日期不开门(查开园时间) |
|
|
23
|
+
| 🚫 用户明确不要 | "不想看寺庙""不爬山"等 |
|
|
24
|
+
| 🚫 超出体力极限 | 亲子/老人出行→排除高强度徒步 |
|
|
25
|
+
| 🚫 距离过远 | 单程 > 2h 且不是世界级景点 |
|
|
26
|
+
| 🚫 评分 < 40 | 低分 + 低频次 = 不值得占时间 |
|
|
27
|
+
| 🚫 **周一闭馆(自动检测)** | 故宫/国博/三峡博物馆等周一闭馆→出行日期含周一自动排除或换日 |
|
|
28
|
+
|
|
29
|
+
### Step 2: 8维评分(总分 100)
|
|
30
|
+
|
|
31
|
+
**基准权重**(综合型),其他风格在此基础上调整:
|
|
32
|
+
|
|
33
|
+
| 维度 | 综合 | 美食 | 拍照 | 文化 | 亲子 | 权重说明 |
|
|
34
|
+
|------|------|------|------|------|------|----------|
|
|
35
|
+
| 🏆 提及频次 | 25% | 20% | 20% | 25% | 20% | 攻略中被提及次数 |
|
|
36
|
+
| 🎯 用户偏好匹配 | 20% | **30%** | **30%** | **28%** | 20% | 与用户风格契合度 |
|
|
37
|
+
| ⭐ 经典/标志性 | 15% | 12% | 10% | 18% | 15% | "不去等于白来"级别 |
|
|
38
|
+
| 🗺️ 顺路程度 | 15% | 15% | 15% | 12% | 12% | 与其他高分景点同区域 |
|
|
39
|
+
| ⏱️ 时间效率 | 10% | 8% | 10% | 8% | 10% | 1-3h最佳,>5h扣分 |
|
|
40
|
+
| 💰 性价比 | 5% | 5% | 5% | 4% | 5% | 门票阈值见预算档位修正 |
|
|
41
|
+
| 👥 拥挤可控 | 5% | 5% | 5% | 3% | 5% | 错峰可行性 |
|
|
42
|
+
| ♿ 体力友好 | 5% | 5% | 5% | 2% | **13%** | 同行人员修正见下方 |
|
|
43
|
+
|
|
44
|
+
**预算档位修正(💰 性价比维度):**
|
|
45
|
+
|
|
46
|
+
| 预算档位 | 门票扣分阈值 | 说明 |
|
|
47
|
+
|----------|-------------|------|
|
|
48
|
+
| 💰 穷游 | > ¥100 扣分 | 控制总花费 |
|
|
49
|
+
| 🏨 舒适 | > ¥200 扣分 | 可接受中等票价 |
|
|
50
|
+
| 👑 奢华 | > ¥500 扣分 | 基本不因价格扣分 |
|
|
51
|
+
|
|
52
|
+
**同行人员修正(♿ 体力友好维度):**
|
|
53
|
+
|
|
54
|
+
| 同行人员 | 体力友好权重 | 说明 |
|
|
55
|
+
|----------|-------------|------|
|
|
56
|
+
| 👶 婴幼儿(0-3) | ×4.0 (→20%) | 必须无障碍/有母婴室/室内优先 |
|
|
57
|
+
| 👴 老人(65+) | ×3.0 (→15%) | 少爬坡/有座位/有电梯 |
|
|
58
|
+
| 🧒 儿童(4-12) | ×2.0 (→10%) | 互动性强优先 |
|
|
59
|
+
| 🧑 青少年/成人 | ×1.0 (保持) | 正常 |
|
|
60
|
+
|
|
61
|
+
> ⚠️ **顺路程度是估分。** 此维度基于"是否与其他高分景点同区域"来估算。最终顺路性由 route-planner 根据实际坐标和交通方式确认。如果 route-planner 发现某个高分景点实际不顺路 → 回退到 attraction-selector,用下一个候选替换。
|
|
62
|
+
|
|
63
|
+
### Step 3: 偏好匹配评分指南
|
|
64
|
+
|
|
65
|
+
在 Step 2 的"🎯 用户偏好匹配"维度中,按以下标准打分(0-100):
|
|
66
|
+
|
|
67
|
+
| 风格 | 高分特征(80-100分) | 中分特征(50-70分) | 低分特征(0-40分) |
|
|
68
|
+
|------|---------------------|---------------------|---------------------|
|
|
69
|
+
| 🍜 美食 | 美食街/夜市/老字号街区/菜市场 | 有特色餐厅的综合商圈 | 纯自然风光无餐饮 |
|
|
70
|
+
| 📸 拍照 | 视觉冲击力强/夜景/建筑/色彩丰富 | 一般好看但不出片 | 纯体验型无视觉亮点 |
|
|
71
|
+
| 🏛️ 文化 | 博物馆/古迹/老街/非遗体验/寺庙 | 有文化解说的一般景点 | 纯商业/纯娱乐 |
|
|
72
|
+
| 👶 亲子 | 互动性强/动物园/科技馆/乐园 | 可逛但无儿童设施 | 纯购物/酒吧街/高强度 |
|
|
73
|
+
| 🧩 综合 | 各类型均衡,每天尽量不同主题 | — | 同一天同类型过多 |
|
|
74
|
+
|
|
75
|
+
### Step 4: 同质化检测(新增)
|
|
76
|
+
|
|
77
|
+
**原则:一天内同类型景点不超过 2 个。** 避免审美疲劳。
|
|
78
|
+
|
|
79
|
+
| 检测项 | 阈值 | 超标处理 |
|
|
80
|
+
|--------|------|----------|
|
|
81
|
+
| 同类型景点数/天 | ≤ 2 个 | 超过则保留 Top 2,其余替换为不同类型 |
|
|
82
|
+
| 连续同类景点 | 不连续 2 个 | 插入不同类型景点隔开 |
|
|
83
|
+
| 同质化组合 | 🚫 古镇→古镇→古镇 / 寺庙→寺庙 / 博物馆→博物馆→博物馆 | 保留评分最高的 2 个,换掉第 3 个 |
|
|
84
|
+
|
|
85
|
+
**替换优先级:** 从被排除的候选中选评分次高 + 不同类型 + 距离可接受的景点。
|
|
86
|
+
|
|
87
|
+
```
|
|
88
|
+
示例:
|
|
89
|
+
Day2 入选了 磁器口(古镇) + 洪崖洞(夜景) + 十八梯(古镇) + 山城巷(古镇)
|
|
90
|
+
→ 检测:3个古镇超标
|
|
91
|
+
→ 保留:磁器口(最高分古镇) + 洪崖洞(夜景,不同类型)
|
|
92
|
+
→ 替换十八梯/山城巷 → 选评分次高的三峡博物馆(博物馆,不同类型)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Step 5: 时间分配合并
|
|
96
|
+
|
|
97
|
+
相同区域且游玩时间 < 1h 的景点,合并为"路过打卡",不单独占半天。
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
示例:
|
|
101
|
+
李子坝轻轨(30min) + 鹅岭二厂(2h) + 鹅岭公园(1h) → 合并为一个"下午"
|
|
102
|
+
洪崖洞必须是晚上 → 分配到Day1晚餐后
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Step 5+: 多城映射(单城自动跳过)
|
|
106
|
+
|
|
107
|
+
**先检测行程类型:**
|
|
108
|
+
|
|
109
|
+
```
|
|
110
|
+
01_research.json 的 attractions_by_city 有 ≥2 个城市?
|
|
111
|
+
├─ 否 → 单城模式:直接进入输出模板
|
|
112
|
+
└─ 是 → 多城模式:按城市→日期映射后逐城精选
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**多城模式:对每个城市独立运行精选流程。**
|
|
116
|
+
|
|
117
|
+
```
|
|
118
|
+
for city in cities(按行程顺序):
|
|
119
|
+
├─ 从 attractions_by_city[city] 取该城候选池
|
|
120
|
+
├─ 对该城独立跑 Step 1-4(硬过滤/评分/同质化/检测)
|
|
121
|
+
├─ 按该城分配的天数确定 core(2-3/天) + flexible(1-2/天) 数量
|
|
122
|
+
└─ 写入 daily_plan: [{day, city, core:[景点], flexible:[景点], theme}]
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
**城市→日期映射规则:**
|
|
126
|
+
|
|
127
|
+
| 城市天数 | core/天 | flexible/天 | 示例 |
|
|
128
|
+
|----------|---------|-------------|------|
|
|
129
|
+
| 1天(途经) | 2个 | 1个 | 兰州(D1抵达日,精简) |
|
|
130
|
+
| 1天(完整) | 2-3个 | 1-2个 | 嘉峪关(D4) |
|
|
131
|
+
| 2天 | 2-3个/天 | 1-2个/天 | 敦煌(D5+D6) |
|
|
132
|
+
|
|
133
|
+
**跨城日注意:** 跨城日(如"兰州→张掖")游玩时间减半,core ≤ 2 个。
|
|
134
|
+
|
|
135
|
+
> ⚠️ **此步骤确保 daily_plan[day].core 非空。** 如果任何 Day 的 core=[] 且 flexible=[],说明该城市的景点未被正确映射——回退到该城市的 Step 1 重跑。
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## 景点时段分配
|
|
140
|
+
|
|
141
|
+
每类景点有最佳时段:
|
|
142
|
+
|
|
143
|
+
| 景点类型 | 最佳时段 | 原因 |
|
|
144
|
+
|----------|----------|------|
|
|
145
|
+
| 🌃 夜景/灯光 | 19:00-21:00 | 天黑才好看 |
|
|
146
|
+
| 🏛️ 博物馆/室内 | 上午或雨天 | 不受天气影响 |
|
|
147
|
+
| 🏔️ 山/户外 | 上午 8:00-11:00 | 凉快+人少 |
|
|
148
|
+
| 🏯 古镇/街区 | 上午 9:00-11:00 | 避开人流高峰 |
|
|
149
|
+
| 🛍️ 商圈/步行街 | 下午或晚上 | 白天太热 |
|
|
150
|
+
| 🌅 日落观景台 | 日落后30min | 查当天日落时间 |
|
|
151
|
+
| 🎡 主题乐园 | 全天 | 建议工作日去 |
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## 拥挤度预判
|
|
156
|
+
|
|
157
|
+
| 景点热度 | 周末/节假日 | 平日 | 建议 |
|
|
158
|
+
|----------|-----------|------|------|
|
|
159
|
+
| 🔥 超级热门 | 排队 2h+ | 排队 1h | 开门前到/错峰/买快速通道 |
|
|
160
|
+
| ⭐ 热门 | 排队 1h | 排队 20min | 上午早点去 |
|
|
161
|
+
| 👍 一般 | 排队 30min | 不排队 | 正常安排 |
|
|
162
|
+
| 🍃 冷门 | 不排队 | 不排队 | 随时去 |
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## 雨天备选
|
|
167
|
+
|
|
168
|
+
**每个目的地至少列 2 个雨天备选景点。** 当天气查询显示出行期间有雨 → 自动将雨天替换推入当日核心。
|
|
169
|
+
|
|
170
|
+
| 天气 | 行动 |
|
|
171
|
+
|------|------|
|
|
172
|
+
| 🌧️ 全天雨概率>80% | 自动替换:户外景点 → 雨天备选 |
|
|
173
|
+
| 🌧️ 阵雨概率30-60% | 保留户外但按 route-planner 天气修正调整时段 |
|
|
174
|
+
| ☀️ 晴/阴 | 不动 |
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## 输出模板
|
|
179
|
+
|
|
180
|
+
### 🎯 Attraction Selection: [目的地] [天数]天
|
|
181
|
+
|
|
182
|
+
#### 📊 候选池 → 精选结果
|
|
183
|
+
|
|
184
|
+
| 处理 | 数量 |
|
|
185
|
+
|------|------|
|
|
186
|
+
| 候选池 | 25个 |
|
|
187
|
+
| 硬过滤排除 | -5个 (关闭/距离远/用户不要) |
|
|
188
|
+
| 评分 < 40 排除 | -3个 |
|
|
189
|
+
| 剩余候选 | 17个 |
|
|
190
|
+
| **最终入选** | **10个** (核心6+弹性4) |
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
#### 📋 入选景点
|
|
195
|
+
|
|
196
|
+
| 排名 | 景点 | 评分 | 类型 | 最佳时段 | 建议时长 | 门票 | 拥挤 |
|
|
197
|
+
|------|------|------|------|----------|----------|------|------|
|
|
198
|
+
| 1 | 洪崖洞 | 92 | 夜景 | 🌃 19:30起 | 2h | ¥0 | 🔥 |
|
|
199
|
+
| 2 | 解放碑 | 85 | 地标 | ☀️ 上午 | 1h | ¥0 | ⭐ |
|
|
200
|
+
| ... | ... | ... | ... | ... | ... | ... | ... |
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
#### 📅 每日分配
|
|
205
|
+
|
|
206
|
+
| Day | 核心景点 (必去) | 弹性备选 | 主题 |
|
|
207
|
+
|-----|---------------|---------|------|
|
|
208
|
+
| 1 | 洪崖洞🌃 | 千厮门大桥 | 抵达+夜景 |
|
|
209
|
+
| 2 | 解放碑→长江索道→李子坝→鹅岭二厂→南山一棵树🌅 | 山城步道 | 渝中经典 |
|
|
210
|
+
| 3 | 磁器口→来福士 | 观音桥 | 古镇+城市 |
|
|
211
|
+
| 4 | 眼镜小面→观音桥 | — | 半日收尾 |
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
#### 📸 拍照优先景点
|
|
216
|
+
(仅打卡型用户出此项)
|
|
217
|
+
|
|
218
|
+
| 景点 | 最佳机位 | 最佳时间 |
|
|
219
|
+
|------|----------|----------|
|
|
220
|
+
| 洪崖洞 | 千厮门大桥中段 | 20:00亮灯后 |
|
|
221
|
+
| ... | ... | ... |
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
#### 👶 亲子适配
|
|
226
|
+
(仅亲子型用户出此项)
|
|
227
|
+
|
|
228
|
+
| 景点 | 亲子友好度 | 备注 |
|
|
229
|
+
|------|-----------|------|
|
|
230
|
+
| 磁器口 | ⭐⭐⭐⭐ | 有小吃+手工体验 |
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
#### ⚠️ 拥挤预警
|
|
235
|
+
|
|
236
|
+
| 日期 | 高风险景点 | 建议 |
|
|
237
|
+
|------|-----------|------|
|
|
238
|
+
| 6/19(周五) | 洪崖洞/长江索道 | 索道上午去,洪崖洞21:00后去 |
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
#### 🌧️ 雨天备选
|
|
243
|
+
|
|
244
|
+
| 替换 | 雨天去哪 | 原因 |
|
|
245
|
+
|------|----------|------|
|
|
246
|
+
|南山一棵树 | 重庆中国三峡博物馆 | 室内+免费 |
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
#### ❌ 排除景点
|
|
251
|
+
|
|
252
|
+
| 景点 | 评分 | 排除原因 |
|
|
253
|
+
|------|------|----------|
|
|
254
|
+
| 武隆天生三桥 | 65 | 单程2h,一天往返太赶 |
|
|
255
|
+
| XX | 38 | 多个攻略说"坑" |
|
|
256
|
+
|
|
257
|
+
> 🔒 **场景约束强制排除:** 以下场景激活时,对应类型的景点必须写入 `excluded_attractions` 数组:
|
|
258
|
+
> - companion-elderly 激活 → 步行>2h/爬坡/高强度景点必须排除
|
|
259
|
+
> - companion-infant 激活 → 海拔>3000m/无婴儿车通道景点必须排除
|
|
260
|
+
> - special-monday 激活 → 周一闭馆的博物馆必须排除,reason 写明"周一闭馆"
|
|
261
|
+
> - dest-historical 激活 → 无历史价值的纯商业景点可排除
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
#### 🏋️ 强度总览
|
|
266
|
+
|
|
267
|
+
| Day | 景点数 | 步行 | 游玩时间 | 强度 |
|
|
268
|
+
|-----|--------|------|----------|------|
|
|
269
|
+
| 1 | 1 | 2km | 2h | 轻松 |
|
|
270
|
+
| 2 | 5 | 5km | 8h | 较累 |
|
|
271
|
+
| 3 | 3 | 4km | 6h | 适中 |
|
|
272
|
+
| 4 | 1 | 1km | 2h | 轻松 |
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
## 容错处理
|
|
277
|
+
|
|
278
|
+
| 场景 | 处理 |
|
|
279
|
+
|------|------|
|
|
280
|
+
| 候选池 < 10个 | 降低评分门槛至 30 分 + 扩大搜索(周边区域) |
|
|
281
|
+
| 某天景点太多 | 按评分切掉最低的,移到弹性 |
|
|
282
|
+
| 同质化超标 | Step 4 自动替换;替换候选不够时放宽类型限制 + 保留评分最高的 |
|
|
283
|
+
| 同行含婴幼儿/老人 | 硬过滤加强:排除所有爬坡/长步行/无座位景点 |
|
|
284
|
+
| route-planner 反馈不顺路 | 用评分次高 + 同区域的候选替换,重跑 Step 4-5 |
|
|
285
|
+
| 某天没有合适景点 | 从邻近 Day 借调 / 缩小搜索半径 / 标注"此天内容较少" |
|
|
286
|
+
| 用户临时增减天数 | 重新分配核心/弹性 |
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## 🚫 禁止事项
|
|
291
|
+
|
|
292
|
+
| # | 禁止行为 | 正确做法 |
|
|
293
|
+
|---|---------|---------|
|
|
294
|
+
| 1 | **忽略"已知特征"表不扣分** | 测试用例的"已知特征"表标注了商业化/停运等风险 → 对应景点在相关维度自动降权 |
|
|
295
|
+
| 2 | **同一天排 3+ 个同类型景点** | Step 4 同质化检测:同日同类型 ≤2,超过则替换为不同类型 |
|
|
296
|
+
| 3 | **老人/婴幼儿场景不排除高强度景点** | companion-elderly 激活 → 步行>2h/爬坡景点写入 excluded_attractions |
|
|
297
|
+
| 4 | **周一闭馆的博物馆不排除** | special-monday 激活 → 自动检测周一,排除闭馆博物馆 |
|
|
298
|
+
| 5 | **排除景点不写原因** | 每个 excluded 景点必须在 reason 字段写明原因 |
|
|
299
|
+
| 6 | **多城行程产出全空 core/flexible** | daily_plan[day] 只有 `{day, city, theme}` 的元数据壳,景点数为 0 | 多城时逐城跑 Step 1-4 + Step 5+ 城市→日期映射,确保每 Day core ≥ 2 个 |
|
|
300
|
+
| 7 | **单城模式正常但多城跳过同质化检测** | 每个城市的同质化独立检测,跨城不共享 | 多城模式:对每城独立运行 Step 4,不可只跑一次 |
|
|
301
|
+
|
|
302
|
+
> 🔴 **CHECKPOINT(原有):每日分配完成后,确认同质化检测通过、已知特征已应用、排除原因已标注,再写入 02_attractions.json。**
|
|
303
|
+
|
|
304
|
+
> 🔴 **CHECKPOINT-B(多城非空检测):写入前逐日验证 daily_plan[day].core 非空。多城模式下任何 Day 的 core=[] 且 flexible=[] → 该城市景点映射失败,回退到 Step 5+ 对该城市重跑。**
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
> 📋 通用规范(数据总线协议/输出校验/场景注入/通用禁止事项)见 `travel-plan/references/skill-standards.md`。本文件只含本技能特有的禁止事项和容错规则。
|
|
@@ -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.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# 📕 Xiaohongshu Writer — 小红书内容编辑
|
|
2
|
+
|
|
3
|
+
将 travel-plan 融合后的行程数据 → 高收藏率的小红书攻略笔记。5 步流程:选标题(3选项+CTR预测)→ 封面 → 正文排版 → 关键词布局 → Hashtag 策略。
|
|
4
|
+
|
|
5
|
+
**触发词:** "写成小红书笔记"、"生成小红书攻略"、"排版攻略"
|
|
6
|
+
|
|
7
|
+
**输入:** `02~07.json`(全量行程数据)
|
|
8
|
+
**输出:** `08_content.json`(多标题+正文+关键词+Hashtag)
|
|
9
|
+
|
|
10
|
+
**骨架模式:** 上游数据不完整时不跳过,自动补标题+路线+费用最低输出。
|
|
11
|
+
|
|
12
|
+
**风格参考:** `references/xiaohongshu-style.md`
|
|
13
|
+
|
|
14
|
+
> 本 Skill 是 [travel-skill](https://github.com/wangzheng1105/travel-skill) 套件的一部分。详见上层 [README](../../../README.md)。
|