技能装了却没反应:三个静默失效场景与排查顺序
技能装了却没反应:三个静默失效场景与排查顺序
绝大多数关于 taste-skill 的教程都停在安装命令那一行:npx skills add,回车,重启编辑器,然后期待 AI 突然开始输出有品味的页面。现实是,装完之后页面还是那副三行居中大标题加一排图标卡片的样子,而且什么错误都没有。没有红色报错,没有 401,没有 "skill not found",agent 依旧礼貌地回你"已经为您完成设计"。
这才是最难查的一类故障。本文把 taste-skill 的安装机制、frontmatter 校验、脚本依赖和 gate 流程从源码层面拆开,给出三个真实存在的静默失效场景,以及一个不会说谎的排查顺序。
先分清两种"没反应"
在动手改任何配置之前,先做一个二分判断:这次失效有没有伴随报错?
这个判断之所以有效,是因为 taste-skill 本身的依赖面极窄。项目 README 里写得很直白:
The skill runs its scripts with Node 22+ and an installed Chrome, Edge or Chromium. It installs nothing and needs no API keys. Finding pictures needs network access.
它不装任何 npm 包,不需要任何 API Key。 技能本体就是一堆 Markdown、JSON 加四个零依赖的 .mjs 脚本。所以当你在 Cursor 或 Claude Code 里看到 401 Unauthorized、Connection failed、model not found,这些错误在因果链上排在 skill 之前,是模型通道的问题,不是技能包的问题。改 skill 目录、重装技能、换版本,全都不可能修好它。
反过来,如果一切正常回复、语气正常、代码也能跑,只是产出的页面毫无变化,那才是本文要处理的三类静默失效。
场景一:目录对了,名字错了
这是最高频、也最容易被忽略的一种。
taste-skill 的仓库里,技能文件夹叫 skills/taste-skill,但它的安装名不是 taste-skill。看 SKILL.md 的 frontmatter 第一行:
---
name: design-taste-frontend
description: >-
tasteskill v2, the anti-slop frontend skill. ...
---
真正的技能标识是 design-taste-frontend。这个差异会一路传导到调用侧。
install.sh 处理这件事的方式很干脆,它不信任文件夹名,而是从 frontmatter 里读 name::
# install_name <SKILL.md> -- frontmatter `name:`, falling back to folder name
install_name() {
awk '
NR==1 && $0!="---" { exit }
NR>1 && /^---[[:space:]]*$/ { exit }
NR>1 && /^name:/ { sub(/^name:[[:space:]]*/,""); gsub(/^["'\'']|["'\'']$/,""); print; exit }
' "$1"
}
然后用这个名字建软链接:
for target in "${targets[@]}"; do
mkdir -p "$target"
link="$target/$name"
...
ln -s "$dir" "$link"
echo "linked $link -> skills/$(basename "$dir")"
done
结果就是 ~/.claude/skills/design-taste-frontend,而不是 ~/.claude/skills/taste-skill。默认目标目录在脚本第 40 行:
[[ ${#targets[@]} -eq 0 ]] && targets=("$HOME/.claude/skills")
于是同一个技能,在三种安装方式下会得到三个不同的引用名:
| 安装方式 | 落地位置 | 引用名 |
|---|---|---|
npx skills add --skill "design-taste-frontend" |
复制到技能目录 | design-taste-frontend |
./install.sh |
软链到 ~/.claude/skills/design-taste-frontend |
design-taste-frontend |
| Claude Code 插件 | /plugin install taste-skill@taste-skill |
taste-skill:design-taste-frontend |
README 里明确写了插件的命名空间行为:"The skill is namespaced under taste-skill:, so it does not collide with your other skills."
而网上流传的"git clone 到 ~/.cursor/skills/taste-skill 然后 @taste-skill"的写法,用的是文件夹名。如果你的客户端按 frontmatter 或安装名解析,@taste-skill 就指向一个不存在的技能。它不会报错,只是没有任何技能被挂载,模型退回它自己的默认审美,也就是那个你熟悉的模板。
一个不报错的坑:软链被跳过
即使名字对了,还有一层静默跳过。看同一段循环的完整分支:
if [[ -L $link ]]; then
if owned_by_repo "$link"; then
rm "$link"
else
echo "skip $link (symlink to another install -- remove it first)" >&2
continue
fi
elif [[ -e $link ]]; then
echo "skip $link (real file/dir, not a symlink -- move it aside first)" >&2
continue
fi
如果你之前用 npx skills add 装过一次,~/.claude/skills/design-taste-frontend 是一个真实目录而不是软链。此时再跑 ./install.sh,它会走 elif [[ -e $link ]] 分支,打印一行 skip,然后 continue。
关键在于:脚本最终退出码仍然是 0。你看到满屏 linked,以为全部成功,而实际上那条链接被跳过了。之后 git pull 拿不到任何更新,你却在期待"最新版应该修好了"。
正确的自检动作只有一个:
./install.sh --list
它会把每个安装名和真实目录并排列出来:
printf '%-28s %s\n' "$name" "skills/$(basename "$dir")"
输出缺失或名字对不上,就是问题所在。清理冲突后再 ./install.sh --all-agents(Claude Code 和 Codex 同时链入)。
场景二:文件在,但 agent 根本没读到
目录和名字都对了,技能仍然可能被客户端静默丢弃。这不是假设,是这个项目真实踩过的坑。
CHANGELOG.md 的 2.1.2 条目写得很清楚:
Fix:
design-taste-frontenddid not load in Claude Code ([#151]). The description added in 2.1.0 contained an unquoted:, so its YAML frontmatter failed to parse and the skill was silently dropped ("Unknown skill"). It is now a folded block scalar.
一个没加引号的冒号,整份技能就消失了。YAML 里 description: tasteskill v2, the anti-slop frontend skill. 后面若再出现 Use this whenever you build: ... 这样的写法,解析器会在冒号处截断并报错,而客户端选择不提示用户,直接跳过该技能。
为了防止复发,仓库加了 tests/frontmatter.mjs,文件开头就点明了这个风险:
// Every skill must load in every agent. Claude Code and Codex read SKILL.md frontmatter with a strict
// YAML parser and silently drop a skill whose frontmatter fails to parse (an unquoted "word: word" in
// a description is enough), so this check parses each one the same way and fails loudly.
它不只是解析 YAML,还有三条硬约束:
if (typeof fm.name !== 'string' || !/^[a-z0-9]+(-[a-z0-9]+)*$/.test(fm.name) || fm.name.length > 64) fail(where, `name must be kebab-case, 64 characters at most (got ${JSON.stringify(fm.name)})`);
if (typeof fm.description !== 'string' || !fm.description.trim()) fail(where, 'description must be a non-empty string');
else if (fm.description.length > 1024) fail(where, `description is ${fm.description.length} characters; agents allow 1024 at most`);
description 上限 1024 字符。 而当前这份 SKILL.md 的 description 实测是 971 字符,距离上限只剩 53 个字符的余量。这个数字值得记住:如果你为了让它更容易被触发,在 description 里补一句"also use for X",很容易越过红线。越界之后,技能又是静默消失,错误信息依旧只有一句含糊的 "Unknown skill"。
description 才是触发器
这里必须澄清一个常见误解:agent 并不是每次都读完整份 SKILL.md。SKILL.md 有 542 行,加上 11 个 reference 文件和 9 个 library JSON,不可能全量塞进上下文。真正常驻在系统提示里的,只有 frontmatter 的 description 字段。它就是那份"什么时候该调用我"的索引。
所以 SKILL.md 的 description 写得极其啰嗦,刻意堆满了触发词:
Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML/CSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, "AI-made", sloppy, or asks to make it look designed, premium, award-level or less like every other site.
这段话的作用不是给人看的,是给检索用的。如果你用中文说"帮我做个落地页",而客户端又不做语言无关的语义匹配,触发就可能落空。 这不是 bug,是概率问题:描述里全是英文场景词。遇到这种情况,显式点名技能比反复重装有效得多。
被主动关掉的隐式调用
还有一类"设计如此"的静默失效。CHANGELOG 2.1.1 记录,仓库里那批经典技能(soft、minimalist、brutalist、gpt-taste、Stitch、v1、v2-experimental)被改成了显式调用:
The classic skills are opt-in. soft, minimalist, brutalist, gpt-taste, Stitch, v1 and v2-experimental run only when called by name:
disable-model-invocation: truefor Claude Code,allow_implicit_invocation: false(agents/openai.yaml) for Codex.
如果你从旧教程里装的是 high-end-visual-design 或 minimalist-ui,它们永远不会自动触发。你得在对话里点名。这不算故障,但你排查时会误判成"装了没用"。tests/frontmatter.mjs 也把这两个字段纳入了类型校验:
if ('disable-model-invocation' in fm && typeof fm['disable-model-invocation'] !== 'boolean') fail(where, 'disable-model-invocation must be true or false');
场景三:跑起来了,但悄悄降级了
这是三个场景里最隐蔽的,因为它的表现是"技能明明生效了,页面还是不够好"。
taste-skill 的核心不是提示词,而是一个 look-and-fix 闭环。SKILL.md 的 run 一共十步,其中第七步 Gate 和第八步 Look 是质量的分水岭:
node <skill>/scripts/lint.mjs <source files or folder>
node <skill>/scripts/inspect.mjs <url or path/to/index.html>
node <skill>/scripts/scenes.mjs <url or path/to/index.html> # when the page has scroll scenes
inspect.mjs 用真实的 Chrome 在 1440 / 768 / 390 三个宽度下渲染页面,量标题行数、实际加载的字体、颜色、阴影、渐变、对比度、外边距、空白段落,然后把截图存进 .taste-skill/inspect/,让 agent 自己看,自己改,最多三轮。
这个闭环依赖两个外部条件:Node 22+ 和浏览器。skills/taste-skill/scripts/lib/cdp.mjs 把它们写成两条硬错误:
static async launch({ width = 1440, height = 900, extraArgs = [] } = {}) {
if (typeof WebSocket === 'undefined') {
throw new Error('Node 22+ is required (built-in WebSocket missing). Current: ' + process.version);
}
const exe = findChrome();
if (!exe) {
throw new Error('No Chrome/Edge/Chromium found. Install one or set CHROME_PATH to its executable.');
}
findChrome() 会去扫一堆常见路径,Linux 下是 /usr/bin/google-chrome、/usr/bin/chromium、/snap/bin/chromium 这几个。如果都没有,它返回 null,不会自己下载。 你可以用 CHROME_PATH 指定一个非常规安装位置。
问题在于,SKILL.md 给了 agent 一条退路:
No Chrome or Node 22. Run
lint.mjs(Node 18+), take screenshots with whatever browser tool you have, and critique those. Say in the report that the inspector could not run.
这条 fallback 是对的,但它制造了一个合法的降级。agent 会老老实实在报告里写一句"inspector could not run",然后继续交付。你看到的是一个已经套用了 house rules 的页面,却少了那个"看截图、找问题、重做"的循环。页面的模板感降低了一半,依然不达标。
同一节还有另一条:
No network. If
assets.mjsreaches no source, draw the pictures and say in the report that the open collections could not be searched.
assets.mjs 要访问 Openverse、Wikimedia Commons、Art Institute of Chicago、Met 这些开放馆藏,不需要 key,但需要出网。断网或公司代理拦截时,它会搜不到图,agent 退回"用代码画"。这一步同样是静默的,只留一句报告。
还有一个真正的脏状态陷阱
第三条降级路径藏在工作目录里。draw.mjs 把每次抽签的结果写进 .taste-skill/direction.json,而另外两个脚本会回头读这个文件来改变自己的行为。
lint.mjs 第 16 行:
let appMode = args.includes('--app');
try { if (JSON.parse(readFileSync('.taste-skill/direction.json', 'utf8')).kind === 'app') appMode = true; } catch {}
inspect.mjs 第 40 至 41 行:
for (const p of ['.taste-skill/direction.json', join(outDir, '..', 'direction.json')]) {
if (existsSync(p)) { try { const d = JSON.parse(readFileSync(p, 'utf8')); allow = [...new Set([...allow, ...(d.allow || [])])]; if (d.kind === 'app') appMode = true; ... } catch {} break; }
后果很实际。如果你上一个项目是做 dashboard,.taste-skill/direction.json 里 kind 是 app,那么这个残留文件会让下一个落地页项目的 lint.mjs 自动进入 app 模式。而 app 模式会放宽一整批规则:
const APP_LEVEL = { hairline: null, 'outlined-box': null, 'default-font': null, numbering: 'WARN', mono: 'WARN', shadow: 'WARN', eyebrow: 'WARN', 'cta-copy': null, 'h-screen': null };
hairline(细线分隔)、outlined-box(1px 描边盒子)、default-font(Inter / Poppins 这类默认字体)从 FAIL 直接降级为不检查。于是你的落地页带着一堆本该被拦下的东西,顺利通过 gate。
这不是理论推演,SKIP 名单里明确排除了 .taste-skill 目录本身:
const SKIP = new Set(['node_modules', '.git', '.next', '.nuxt', '.svelte-kit', 'dist', 'build', 'out', '.vercel', '.taste-skill', 'coverage', '.turbo', 'vendor']);
它不会被当成源码扫描,但它会持续影响扫描规则。跨项目复用工作目录,或者在一个仓库里做多个方向完全不同的页面时,记得先看一眼这个文件。
类似的静默点还有 draw.mjs 的历史记录写入:
const writeHist = (entry) => { try { mkdirSync(dirname(userHist), { recursive: true }); const h = readHist(); h.unshift(entry); writeFileSync(userHist, JSON.stringify(h.slice(0, 24), null, 1)); } catch {} };
try/catch {},空捕获。历史文件写不进去时(权限、路径不可写),抽签的"避免重复"能力会失效,但整个命令照样成功返回。你会觉得"怎么每次抽到的方向都差不多",而没有任何一行日志告诉你原因。历史默认在 ~/.taste-skill/history.json,可以用 TASTE_SKILL_HISTORY 改位置。
鉴权失败与代理失败,表现完全不同
回到开头那个二分。社区里关于"401 鉴权、代理失败、技能不生效"的讨论经常把三件事混成一锅,但它们的位置和症状差别很大:
| 症状 | 出错层 | 具体表现 | 是否与 skill 有关 |
|---|---|---|---|
401 / 403 |
模型通道 | 请求被直接拒绝,对话里出现明确错误横幅,agent 不产出内容 | 无关 |
Connection failed / 502 / Bad gateway |
模型通道 | 重试、超时、回复截断,或整轮对话失败 | 无关 |
model not found |
模型通道 | 模型 ID 不在服务端列表里,请求直接失败 | 无关 |
| 回复正常,页面风格毫无变化 | 技能加载 | 无任何错误提示,输出就是模型的默认审美 | 有关 |
| 回复正常,页面变好但没达标 | 运行时降级 | 报告里出现 "inspector could not run" 或 "could not be searched" | 有关 |
前三条的共同点是有错误文本。你可以直接把报错贴进搜索框。它们和 skill 目录、frontmatter、Node 版本全部无关。
有一个反复出现的配置细节值得单独说:很多 OpenAI 兼容通道要求 Base URL 精确到 /api,而不是 /api/v1,更不能填官网首页地址。客户端通常会在你给的基础路径上自行拼接请求路径,你多写一级或少写一级,表现就是连接失败。这个坑和 taste-skill 完全无关,但因为它们总在同一篇教程里出现,排查时极易互相甩锅。
判断方法很简单:把模型通道单独验一次。用同一个 Key、同一个 Base URL,发一条最普通的"你好"。如果这条都失败,先去修通道;如果这条通了,而 taste-skill 依旧不生效,再往下走本文的排查链。
确认生效的最小验证动作
不要靠"感觉页面变好看了"来判断。有三个成本极低的动作,能在一分钟内把范围压缩到唯一一层。
第一步:验证文件在位且可执行。 draw.mjs 是零依赖、Node 18+ 就能跑的纯本地脚本:
node <skill>/scripts/draw.mjs --sector saas --brief "a booking tool for small studios" \
--sections hero,features,pricing,footer --options 3
它不需要浏览器,不需要网络,不需要 key。如果这条命令能打印出三个 direction 的摘要,目录、文件完整性、Node 版本这三项就全部排除了。 如果它报 Cannot find module,问题在路径;如果报语法错误,问题在 Node 版本太旧,或者文件被某个编辑器改坏了(仓库专门有 tests/text-encoding.mjs 在防这个,它检测的是"UTF-8 被当成 Latin-1 再存回去"这类双重编码,那种文件 JSON 依然能解析,但字符已经全烂了)。
第二步:验证抽签结果真的落盘。 上一步的 --options 3 是"只看不写",它不生成 sheet。跑完整版之后:
node <skill>/scripts/draw.mjs --show
这条命令读的是 .taste-skill/direction.json。如果没有文件,它会明确报错并退出码 2:
if (!saved) { console.error('No saved direction. Run a draw first.'); process.exit(2); }
这一步同时验证了两件事:agent 确实跑过 draw(而不是绕过流程直接写代码),以及它是在项目根目录跑的。SKILL.md 开头专门强调过这点:"Run them from the project's root, so the working files land in .taste-skill/ there."在子目录里执行,sheet 会落到错误位置,后续的 inspect.mjs 就读不到 allow 列表,规则匹配全部走偏。
第三步:验收 agent 的报告,而不是验收页面。
这是最有效的一招,因为 SKILL.md 第十步对报告内容做了强制规定:
Tell the user, briefly: the direction dealt (name and seed) and any redraws with reasons; the idea sentence and the live thing; the final scores from your last critique round and what still falls short; every found picture and clip with its title, creator, licence and source page (
assets.mjs --creditsprints the list) and where its credit sits on the page.
一个真正跑完流程的 agent,报告里必然包含:
- 抽到的 direction 名称和随机种子(seed 是
draw.mjs用randomInt(1, 2 ** 31 - 1)生成的,编不出来) - 至少一次 redraw 的理由,或者明确说没有 redraw
- 最后一轮 critique 的评分,以及仍然不达标的地方
- 每张找到的图片的标题、作者、许可证、来源页
一个没跑流程的 agent,报告里只有"我为您设计了一个现代化的落地页,采用了渐变和卡片布局"。这两者的差距,比任何截图对比都明显。
顺带说一句,--credits 是纯本地读取:
node <skill>/scripts/assets.mjs --credits
--get 下载时会把标题、作者、许可证、来源写进 assets/credits.json,这条命令只是把它打印出来。它能在断网状态下运行,所以即使 assets.mjs 搜索失败,这一项仍然可查。
上面这张来自 examples/v2 的产出,是判断"闭环有没有跑完"的参照物:首屏有一个明确标题、两行以内、单一主视觉、没有 eyebrow 标签、没有渐变、没有阴影。这些不是审美偏好,而是 SKILL.md 的 house rules 里逐条可测量的项,inspect.mjs 会逐条判定 FAIL。页面缺了这些特征,通常不是模型不会设计,而是那一步检查根本没跑。
排查顺序:从最便宜的一层开始
把上面所有内容压成一张可执行的顺序表。原则是每一层都能独立证伪,且成本递增:
第 0 层:先确认报错的性质。 有 401 / 403 / 502 / model not found,直接去修模型通道,不要碰技能目录。
第 1 层:目录与名字。 跑 ./install.sh --list,确认安装名是 design-taste-frontend 而非 taste-skill;确认目标目录是 ~/.claude/skills 或 ~/.codex/skills;如果之前用 npx skills add 装过,先移走那个真实目录,否则软链会以 skip 静默跳过且退出码仍为 0。
第 2 层:frontmatter 与触发。 检查 SKILL.md 开头三行是否完整;检查 description 有没有未加引号的 : (这是 #151 的原样事故);确认长度没超过 1024(当前 971,余量 53);确认装的不是被 disable-model-invocation: true 关掉隐式调用的 classic 技能;中文提示词触发不稳定时,显式点名技能。
第 3 层:运行时依赖。 跑第一步的 draw.mjs --options 3 排除路径和文件问题;然后单独验 node --version 是否 ≥ 22,以及 findChrome() 能不能找到浏览器,必要时设 CHROME_PATH。
第 4 层:降级与脏状态。 翻 agent 的报告,找 "inspector could not run"、"could not be searched" 这两句;检查项目根的 .taste-skill/direction.json 是不是上一个 app 项目留下的,它会悄悄改写 lint.mjs 的规则等级;检查 ~/.taste-skill/history.json 是否可写。
第 5 层:验收产物。 要 direction 名和 seed,要 .taste-skill/inspect/ 里的截图清单,要 --credits 的输出。给不出来,就是流程没跑,和"技能有没有装好"是两个完全不同的问题。
三个静默失效场景归结起来是同一件事:taste-skill 的设计哲学是"让 agent 自己检查自己",而一个不检查的 agent 不会报错,只会交付一个平庸的结果。 所以排查的重点从来不是"技能装上没有",而是"那条从抽签到渲染再到看截图的链路,在哪一环被悄悄掐断了"。链路完整时,页面会自己证明;链路断了时,只有代码和日志会告诉你。
