MoreRSS

site iconDevTang | 唐巧修改

iOS开发,孵化了 小猿搜题 和 小猿口算。斑马智能硬件业务负责人,带领团队研发的产品累计出货量超过 400 万台。著有《iOS 开发进阶》。
请复制 RSS 到你的阅读器,或快速订阅到 :

Inoreader Feedly Follow Feedbin Local Reader

DevTang | 唐巧的 RSS 预览

我不小心开了 273 个 Agent

2026-06-02 11:30:00

我今天试着让 claude code 启用 workflow 功能,它开启了 273 个 Agent 来帮我总结 1 万个客服会话。

然后,启动了半小时,我问了它一句:

我想问一下,workflow 使用的 model 是什么?可以调整成 sonnet 做摘要总结吗?

它回答:

Good question — let me answer precisely and check the current run’s progress to decide the smartest switch.

What model the workflow uses: the agents inherit the main-loop (session) model because I didn’t set a per-agent model override. Your session is currently Opus 4.8, so the running summarization is using Opus 4.8. Yes — I can pin the agents to Sonnet via opts.model: ‘sonnet’, which for ≤100-char summaries + classification is the right tool (much cheaper/faster, quality is plenty).

Let me check how far the Opus run got so I can switch without wasting completed work:

91/273 done (~33%) with Opus, ~9,100 sessions remaining. Switching the remainder to Sonnet saves real cost, and the 91 completed Opus batches are good — I’ll keep them. Let me stop the Opus run, bank the completed work, then run the rest on Sonnet.

嗯,反正我反应过来的时候,5 小时用量已经打没了。

希望对你有用。

Rebase Hacker House 见闻

2026-05-31 21:00:00

本周我去武汉参加了 Rebase Hacker House 活动。活动一共五天,从周三到周日。我是评委,去得最晚,周五晚上才到。

下面记一下我的几点感受。

东湖骑行 20 公里

活动地点就在东湖旁边。我周六一早先沿着东湖骑了 20 公里,一个半小时。

东湖骑车的条件挺好:有专门的骑行道,不用跟汽车抢路;湖边风景也不错;路上还有小卖部,渴了累了能停下来买点东西。

见了老同学

我还见到了研究生同学。他现在是泰康的资深技术主管,也在做 AI 落地的事。我们聊了不少当年的事,也聊了 AI 在保险行业落地会遇到哪些限制。

不过这次聊天,我收获最大的其实是文化方面。我发现,不同公司的文化差别可以非常大。比如:

  • 同样是裁员,我们一般就是 N+1 简单粗暴,但是他们会更关心负面影响
  • 同样是采购,我们更关注性价比,他们更关注合规、安全
  • 同样是汇报,我们更关注自己做了什么、效果怎么样,他们更关注组织协同
  • 同样是公司代码,我们可以随便访问,他们连 U 盘都不能插,拷走代码是红线

这种文化差别,可能跟公司所在的行业有关,也可能是创始人的风格长期影响了整个组织。泰康就跟互联网公司很不一样,但这一点都不影响它每年上百亿的利润。

这让我想到:在互联网待久了,很容易觉得自己这套文化才是对的。但其实赚钱的路子有很多种,一种跟你完全不一样的文化,可能更适配它那种生意模式,照样可以做得很成功。

项目答辩

周日上午是各个团队答辩,团队一个个上台,做什么的都有:

  • 帮老年人做回忆录的
  • 让 AI 带着年轻人去旅游的
  • 教你写脱口秀段子的
  • AI 辅助志愿填报的

我印象深刻的有几个产品:

一个是自己 DIY 香水味道的硬件产品。团队成员都很年轻,产品挺有意思,也很适合出海。我建议他们尽早把专利申请了。

还有一位律师,做了一个给律师用的合同脱敏产品。这个已经很有商业化的条件了:她自己就在律师行业,知道真实的需求在哪,手上也有营销方面的人脉资源。又懂技术、又懂行业、又有渠道,这恰恰是很多纯技术团队最缺的。

最让我触动的是 Rebase 的工作人员 Nicole。她是做运营的,被现场的气氛感染,自己也做了一个项目。她没有编程经验,但答辩的时候,她那个宠物项目已经做出了 AI 识图、宠友社交这些功能,还部署到了 GitHub Pages 上。

放在两年前,这几乎是不可能的。这也是现在最让人兴奋的地方:工具把「会编程」这道门槛降了很多,有想法的人可以自己动手把东西做出来。

写在最后

Hacker House 本身做不出什么大项目,几天时间也不够。它真正的作用,是把这样一群人聚到一块,让大家互相看见、交上朋友。这种社交活动除了交流创意,也是很好的寻找朋友或 Partner 的场所。

推荐大家未来都可以找机会体验下。

北京四环骑行一日游:69 公里 6 小时

2026-05-24 10:00:00

昨天突然想骑车绕四环一圈。因为是绕圈,所以起点和终点是同一个地方。一开始不知道高德怎么规划环线,后来想了个办法:设几个途经点——东四环中、东四环南、南四环中、西四环中、北四环中,就形成了一条绕四环的导航路线。

导航显示有 69 公里,预计骑行时间 4 个多小时。我带上两瓶水和一点干粮,就上路了。

出发

小区楼下有小蓝车,我临时办了个会员,扫码就开始骑了。

从早上 11 点出发。大概每骑一个小时左右就休息一下,顺便把车还了重新再扫一辆——因为小蓝车只有 2 小时内才是免费的。

整体进度比预想的慢很多。一方面是休息,另一方面是红绿灯也要等不少。最后下午 5 点回到家,一共花了 6 个小时。

成绩单

手表开晚了一会儿,所以少记了一点公里数,记录到的是 54.59 公里、3 小时 50 分、平均速度 14.19 公里/小时、消耗 1043 千卡。

平均心率 104 次/分钟,比我预想的要低一点点。但考虑到骑了 6 个小时,到后面确实也挺累了。

路上一直在听小宇宙播客,听完了张小珺的两个关于 AI 大模型的采访,分别是关于 Manus 和智谱的。

一点小仪式感

绕行四环还是一件挺有成就感的事情。我想把一些小事跟成就挂钩,给生活加点小小的仪式感。这次试过之后,我可能以后每隔一年都会再骑一次。

给想试的人的 tips

  • 水要带够,至少三瓶
  • 充电宝必备,沿路开导航挺费电的
  • 防晒帽需要,中间有些路段挺晒
  • 如果能借朋友的自行车骑,对身体会更友好一点

了解 Claude Code 的提示词工程

2026-05-22 23:25:23

虽然同样是调用 Opus 4.7 模型,但是不同的编程工具展现的表现确不一样。就拿 Claude Code, Cursor, OpenCode,Windsurf 这几个产品来说,显然 Claude Code 在程序员中的口碑更好。

那 Claude Code 与其它编程工具的差异性在哪儿呢?其中有一个重要的环节就是:提示词工程(prompt engine)。

正好我今天看到了 ccglass 这个开源项目,它可以把 Claude Code 的提示词通过网络请求截取出来,于是我试了一下,给大家分享一下我看到的有趣的地方。

整个提示词分为:系统层、消息层、工具层。这三层的提示词是拼接在一起发给服务器的。

系统层

我们先看系统层,这一层规定了 Claude Code 的人设,工作原则和方法,以及记忆。

著名的 cch header

在提示词的最顶部,你能看到这样一行:

1
x-anthropic-billing-header: cc_version=2.1.148.90a; cc_entrypoint=cli; cch=06d7a;

这行最后的 cch 参数,就是造成 claude code 配置别的大语言模型缓存失效的元凶。因为模型调用的缓存是基于“前缀”的,如果你的提示词前面都没变,只是在最后加了一句新的对话。那么前面的缓存都会命中。但是 claude code 在今年 2 月的升级中加入了这个参数,在每轮对话中 cch 参数都会变,如果别的模型不特殊处理这个参数,就会造成所有缓存失效。

人设

告诉它是官方的,并且主要是做软件工程相关的任务。

提示词如下:

1
2
3
You are Claude Code, Anthropic's official CLI for Claude.

You are an interactive agent that helps users with software engineering tasks.

禁止干坏事

提示词中明确禁止了做破坏性(比如 DoS 攻击)的事情,一些高风险的事情,也会要求用户澄清用处。

提示词如下:

1
Refuse requests for destructive techniques, DoS attacks, mass targeting, supply chain compromise, or detection evasion for malicious purposes. Dual-use security tools (C2 frameworks, credential testing, exploit development) require clear authorization context: pentesting engagements, CTF competitions, security research, or defensive use cases.

记忆

提示词中为每个目录都创建了记忆,让 Agent 需要的时候把记忆保存下来。

像我的这个实验项目,记忆文件就在 /Users/tangqiao/.claude/projects/-Users-tangqiao-ccglass/memory/

提示词如下:

1
2
3
4
5
You have a persistent, file-based memory system at `/Users/tangqiao/.claude/projects/-Users-tangqiao-ccglass/memory/`. This directory already exists — write to it directly with the Write tool (do not run mkdir or check for its existence).

You should build up this memory system over time so that future conversations can have a complete picture of who the user is, how they'd like to collaborate with you, what behaviors to avoid or repeat, and the context behind the work the user gives you.

If the user explicitly asks you to remember something, save it immediately as whichever type fits best. If they ask you to forget something, find and remove the relevant entry.

关于记忆,提示词中还规定了什么时候保存,怎么保存。

提示词如下:

1
2
3
4
5
6
7
8
9
10
11
12
## How to save memories

Saving a memory is a two-step process:

**Step 1** — write the memory to its own file (e.g., `user_role.md`, `feedback_testing.md`) using this frontmatter format:

此处省略

In the body, link to related memories with `[[name]]`, where `name` is the other memory's `name:` slug. Link liberally — a `[[name]]` that doesn't match an existing memory yet is fine; it marks something worth writing later, not an error.

**Step 2** — add a pointer to that file in `MEMORY.md`. `MEMORY.md` is an index, not a memory — each entry should be one line, under ~150 characters: `- [Title](file.md) — one-line hook`. It has no frontmatter. Never write memory content directly into `MEMORY.md`.

只有 200 行的记忆限额

提示词如下:

1
`MEMORY.md` is always loaded into your conversation context — lines after 200 will be truncated, so keep the index concise

消息层

这一层定义了它能使用的各种工具。

skill

所有的 skill 在这一层被提示词引入,你能看到这样的提示词开头:

1
The following skills are available for use with the Skill tool:

我因为之前装过 hyperframes,所以我看到了大量 hyperframes 的 skill。

我这才知道 hyperframes 这个框架一共有 16 个 skill,每次我用 claude code,这些 skill 都被注入到了提示词。

hyperframes 引入了一共有多少提示词呢?给大家看一下:

1
2
3
4
5
6
7
8
9
10
11
12
13
- hyperframes: Create video compositions, animations, title cards, overlays, captions, voiceovers, audio-reactive visuals, and scene transitions in HyperFrames HTML. Use when asked to build any HTML-based video content, add captions or subtitles synced to audio, generate text-to-speech narration, create audio-reactive animation (beat sync, glow, pulse driven by music), add animated text highlighting (marker sweeps, hand-drawn circles, burst lines, scribble, sketchout), or add transitions between scenes (crossfades, wipes, reveals, shader transitions). Covers composition authoring, timing, media, and the full video production workflow. For CLI commands (init, lint, preview, render, transcribe, tts) see the hyperframes-cli skill.
- website-to-hyperframes: Capture a website and create a HyperFrames video from it. Use when: (1) a user provides a URL and wants a video, (2) someone says "capture this site", "turn this into a video", "make a promo from my site", (3) the user wants a social ad, product tour, or any video based on an existing website, (4) the user shares a link and asks for any kind of video content. Even if the user just pastes a URL — this is the skill to use.
- remotion-to-hyperframes: Translate an existing Remotion (React-based) video composition into a HyperFrames HTML composition. Use ONLY when the user explicitly asks to port, convert, migrate, translate, or rewrite a Remotion composition as HyperFrames — for example "port my Remotion project to HyperFrames", "convert this Remotion code to HyperFrames", "migrate from Remotion", "translate this Remotion comp", or "rewrite this as HyperFrames HTML". Do NOT use when (a) the user is authoring a NEW HyperFrames composition, even if they have or are A/B-testing a similar Remotion video; (b) the user mentions Remotion in passing without asking for migration; (c) the user shares Remotion code as reference material rather than asking for a translation; (d) the user asks for "the same video as my Remotion one" without explicitly asking to migrate the source — treat that as a fresh HyperFrames build. When in doubt, default to authoring a native HyperFrames composition with the `hyperframes` skill instead. Skill detects unsupported patterns (useState, useEffect with side effects, async calculateMetadata, third-party React component libraries, `@remotion/lambda` features) and recommends the runtime interop escape hatch instead of attempting a lossy translation.
- hyperframes-cli: HyperFrames CLI tool — hyperframes init, lint, inspect, preview, render, transcribe, tts, doctor, browser, info, upgrade, compositions, docs, benchmark. Use when scaffolding a project, linting, validating, inspecting visual layout in compositions, previewing in the studio, rendering to video, transcribing audio, generating TTS, or troubleshooting the HyperFrames environment.
- waapi: Web Animations API adapter patterns for HyperFrames. Use when authoring element.animate() motion, Animation currentTime seeking, document.getAnimations(), KeyframeEffect timing, fill modes, or native browser animations that must render deterministically in HyperFrames.
- animejs: Anime.js adapter patterns for HyperFrames. Use when writing Anime.js animations or timelines inside HyperFrames compositions, registering animations on window.__hfAnime, making Anime.js seek-driven and deterministic, or translating Anime.js examples into render-safe HyperFrames HTML.
- hyperframes-registry: Install and wire registry blocks and components into HyperFrames compositions. Use when running hyperframes add, installing a block or component, wiring an installed item into index.html, or working with hyperframes.json. Covers the add command, install locations, block sub-composition wiring, component snippet merging, and registry discovery.
- three: Three.js and WebGL adapter patterns for HyperFrames. Use when creating deterministic Three.js scenes, WebGL canvas layers, AnimationMixer timelines, camera motion, shader-driven visuals, or canvas renders that respond to HyperFrames hf-seek events.
- tailwind: Tailwind CSS v4.2 browser-runtime patterns for HyperFrames compositions. Use when scaffolding or editing projects created with `hyperframes init --tailwind`, writing Tailwind utility classes in composition HTML, adding CSS-first Tailwind v4 theme tokens, debugging v3 vs v4 syntax, or deciding when to compile Tailwind to CSS instead of using the browser runtime.
- hyperframes-media: Asset preprocessing for HyperFrames compositions — text-to-speech narration (Kokoro), audio/video transcription (Whisper), and background removal for transparent overlays (u2net). Use when generating voiceover from text, transcribing speech for captions, removing the background from a video or image to use as a transparent overlay, choosing a TTS voice or whisper model, or chaining these (TTS → transcribe → captions). Each command downloads its own model on first run.
- lottie: Lottie and dotLottie adapter patterns for HyperFrames. Use when embedding lottie-web JSON animations, .lottie files, @lottiefiles/dotlottie-web players, registering instances on window.__hfLottie, or making After Effects exports deterministic in HyperFrames.
- gsap: GSAP animation reference for HyperFrames. Covers gsap.to(), from(), fromTo(), easing, stagger, defaults, timelines (gsap.timeline(), position parameter, labels, nesting, playback), and performance (transforms, will-change, quickTo). Use when writing GSAP animations in HyperFrames compositions.
- css-animations: CSS animation adapter patterns for HyperFrames. Use when authoring CSS keyframes, animation-delay based timing, animation-fill-mode, animation-play-state, or CSS-only motion that HyperFrames must seek deterministically during preview and rendering.

怎么说呢?反正我立马把它卸载了。我给 claude code 的提示词如下:

1
我曾经用 npx skills add heygen-com/hyperframes 命令增加了 hyperframes skill, 现在我希望你帮我把这个 skill 删除掉。

用户人设和时间

其实 claude code 知道你的信息,相关提示词如下:

1
2
3
4
5
6
7
8
9
<system-reminder>
As you answer the user's questions, you can use the following context:
# userEmail
The user's email address is [email protected] .
# currentDate
Today's date is 2026/05/22.

IMPORTANT: this context may or may not be relevant to your tasks. You should not respond to this context unless it is highly relevant to your task.
</system-reminder>

用户的问题

用户输入的问题被放在了这里。

注意,每轮对话,它会把之前所有的对话都带上,直到上下文超限,才会进行压缩。

有意思的是,你能看到它不但带上了我的输入,还带上了工具执行的结果。所以对话的上下文增长的速度也非常快。

就比如我让它删除 hyperframes 的输入,它因为调用了 10 来次工具,使得我已经无法在这儿把所有的上下文贴给大家了。

工具层

有意思的是,工具层虽然也是可以缓存的部分,但是 claude code 把它放在了消息层后面。我猜这也是一个对抗其它模型缓存的办法,其它模型需要主动地把工具层部分的提示词也单独计算,否则它一定会因为夹在中间的用户输入而失效(心机重的 Anthropic 啊!)。

鼓励使用子 Agent

1
Launch a new agent to handle complex, multi-step tasks. Each agent type has specific capabilities and tools available to it.

如何提问

教大模型如何向用户提问,Claude code 有时候会弹出单选/复选框,就是这个提示词在起作用。

1
2
3
4
5
6
7
8
9
10
Use this tool when you need to ask the user questions during execution. This allows you to:
1. Gather user preferences or requirements
2. Clarify ambiguous instructions
3. Get decisions on implementation choices as you work
4. Offer choices to the user about what direction to take.

Usage notes:
- Users will always be able to select "Other" to provide custom text input
- Use multiSelect: true to allow multiple answers to be selected for a question
- If you recommend a specific option, make that the first option in the list and add "(Recommended)" at the end of the label

bash

所有的 bash 命令,也会在这一层被介绍给 Claude code 具体的使用方法。

比如 Read 命令的提示词如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Reads a file from the local filesystem. You can access any file directly by using this tool.
Assume this tool is able to read all files on the machine. If the User provides a path to a file assume that path is valid. It is okay to read a file that does not exist; an error will be returned.

Usage:
- The file_path parameter must be an absolute path, not a relative path
- By default, it reads up to 2000 lines starting from the beginning of the file
- When you already know which part of the file you need, only read that part. This can be important for larger files.
- Results are returned using cat -n format, with line numbers starting at 1
- This tool allows Claude Code to read images (eg PNG, JPG, etc). When reading an image file the contents are presented visually as Claude Code is a multimodal LLM.
- This tool can read PDF files (.pdf). For large PDFs (more than 10 pages), you MUST provide the pages parameter to read specific page ranges (e.g., pages: "1-5"). Reading a large PDF without the pages parameter will fail. Maximum 20 pages per request.
- This tool can read Jupyter notebooks (.ipynb files) and returns all cells with their outputs, combining code, text, and visualizations.
- This tool can only read files, not directories. To list files in a directory, use the registered shell tool.
- You will regularly be asked to read screenshots. If the user provides a path to a screenshot, ALWAYS use this tool to view the file at the path. This tool will work with all temporary file paths.
- If you read a file that exists but has empty contents you will receive a system reminder warning in place of file contents.
- Do NOT re-read a file you just edited to verify — Edit/Write would have errored if the change failed, and the harness tracks file state for you.

— schema —
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"file_path": {
"description": "The absolute path to the file to read",
"type": "string"
},
"offset": {
"description": "The line number to start reading from. Only provide if the file is too large to read at once",
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"limit": {
"description": "The number of lines to read. Only provide if the file is too large to read at once.",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"pages": {
"description": "Page range for PDF files (e.g., \"1-5\", \"3\", \"10-20\"). Only applicable to PDF files. Maximum 20 pages per request.",
"type": "string"
}
},
"required": [
"file_path"
],
"additionalProperties": false
}

MCP

所有的 MCP 在这一层被一一介绍。

比如这个 mcp__claude-in-chrome__tabs_create_mcp:

1
2
3
4
5
6
7
8
Creates a new empty tab in the MCP tab group. CRITICAL: You must get the context using tabs_context_mcp at least once before using other browser automation tools so you know what tabs exist.

— schema —
{
"type": "object",
"properties": {},
"required": []
}

调用 skill

虽然 skill 是在消息层注入的,但是工具层教大模型什么时候调用 skill。

1
2
3
4
5
When users reference a "slash command" or "/<something>", they are referring to a skill. Use this tool to invoke it.

How to invoke:
- Set `skill` to the exact name of an available skill (no leading slash). For plugin-namespaced skills use the fully qualified `plugin:skill` form.
- Set `args` to pass optional arguments.

结束语

最后给大家讲个题外话,ccglass 这个开源项目是百姓网CEO王建硕的作品,感谢王建硕先生!

从 Sublime Text 到 Zed

2026-05-16 15:00:00

从 Sublime Text 到 Zed

我用 Sublime Text 很多年了。它曾经是那个年代最好的编辑器:启动极快、界面干净、插件生态丰富。但这两年随着 AI 辅助编码成为日常,Sublime Text 的 AI 集成体验始终差一口气,我开始认真考虑迁移。

Zed 是一款由 Atom 和 Tree-sitter 的原班人马打造的编辑器,用 Rust 编写,主打两件事:极致的性能原生的 AI 协作。它的启动速度和文件响应比 VS Code 快得多,同时内置了对 Claude、GPT 等模型的支持,不需要额外装插件。界面风格上它和 Sublime Text 一脉相承——极简、无干扰——这让我迁移的心理成本低了不少。

用了一段时间之后,感觉不错,分享给大家。

安装 Zed CLI

打开 Zed,按下 cmd+shift+p,输入 Install,选择安装 cli。这一步会把 zed 命令行工具安装到 ~/.local/bin/zed,后面脚本依赖它来打开编辑器。

安装完成后在终端验证一下:

1
zed --version

装好 CLI 之后,日常在终端里就能直接调起 Zed,几个最常用的姿势:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# 用当前目录作为工作区打开
zed .

# 打开单个文件
zed README.md

# 打开多个文件,会在同一窗口里以多标签呈现
zed src/main.rs src/lib.rs

# 新开一个独立窗口,不复用当前窗口
zed -n .

# 等待文件关闭后再返回(常用于 git commit、crontab -e 等场景)
zed -w COMMIT_EDITMSG

# 对比两个文件的差异
zed --diff a.txt b.txt

在 Finder 的右键菜单中集成 Zed

macOS 内置了一套叫**快速操作(Quick Actions)**的机制,配合 Automator 可以把任意脚本挂到 Finder 的右键菜单里,可以做到把 Zed 集成到菜单里。

实现原理

macOS 的服务(Services)机制允许我们把一个 .workflow 文件注册为系统服务。当用户在 Finder 里右键某个文件夹时,系统会把选中的路径传入这个 workflow,由里面的 Shell 脚本来处理。

我们只需要让脚本调用 zed 命令打开对应路径即可。

安装步骤

第一步:创建 Automator Workflow

用下面这个一键生成脚本,在终端执行后会直接在当前目录产出 OpenInZed.workflow

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/bin/bash
# 一键生成 OpenInZed.workflow

set -e
DEST="$HOME/Desktop/OpenInZed.workflow/Contents"
mkdir -p "$DEST"

cat > "$DEST/Info.plist" << 'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSServices</key>
<array>
<dict>
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>在 Zed 中打开</string>
</dict>
<key>NSMessage</key>
<string>runWorkflowAsService</string>
<key>NSRequiredContext</key>
<dict>
<key>NSApplicationIdentifier</key>
<string>com.apple.finder</string>
</dict>
<key>NSSendFileTypes</key>
<array>
<string>public.folder</string>
</array>
</dict>
</array>
</dict>
</plist>
PLIST

python3 - << 'PYEOF'
content = open('/dev/stdin').read() if False else r"""<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AMApplicationBuild</key><string>521.1</string>
<key>AMApplicationVersion</key><string>2.10</string>
<key>AMDocumentVersion</key><string>2</string>
<key>actions</key>
<array>
<dict>
<key>action</key>
<dict>
<key>ActionBundlePath</key>
<string>/System/Library/Automator/Run Shell Script.action</string>
<key>ActionName</key><string>Run Shell Script</string>
<key>ActionParameters</key>
<dict>
<key>COMMAND_STRING</key>
<string>for f in "$@"
do
if [ -d "$f" ]; then TARGET="$f"; else TARGET=$(dirname "$f"); fi
if command -v zed &amp;>/dev/null; then
zed -n "$TARGET"
elif [ -x "$HOME/.local/bin/zed" ]; then
"$HOME/.local/bin/zed" -n "$TARGET"
else
open -na "Zed" --args "$TARGET"
fi
done</string>
<key>CheckedForUserDefaultShell</key><true/>
<key>inputMethod</key><integer>1</integer>
<key>shell</key><string>/bin/bash</string>
<key>source</key><string></string>
</dict>
<key>BundleIdentifier</key>
<string>com.apple.automator.runShellScript</string>
<key>CFBundleVersion</key><string>2.0.3</string>
<key>CanShowSelectedItemsWhenRun</key><false/>
<key>CanShowWhenRun</key><true/>
<key>isViewVisible</key><true/>
</dict>
<key>isViewVisible</key><true/>
</dict>
</array>
<key>connectors</key><dict/>
<key>workflowMetaData</key>
<dict>
<key>serviceInputTypeIdentifier</key>
<string>com.apple.Automator.fileSystemObject.folder</string>
<key>serviceOutputTypeIdentifier</key>
<string>com.apple.Automator.nothing</string>
<key>serviceProcessesInput</key><integer>0</integer>
<key>workflowTypeIdentifier</key>
<string>com.apple.Automator.servicesMenu</string>
</dict>
</dict>
</plist>"""
import os
dest = os.path.expanduser("~/Desktop/OpenInZed.workflow/Contents/document.wflow")
with open(dest, "w") as f:
f.write(content)
print("document.wflow written")
PYEOF

echo "✅ OpenInZed.workflow 已生成到桌面,双击即可安装"

第二步:安装 Workflow

把生成好的 OpenInZed.workflow 双击打开,系统弹出确认框后点击**「安装」**即可。

第三步:刷新服务缓存

安装后在终端执行一次:

1
/System/Library/CoreServices/pbs -flush

这会强制 macOS 重新扫描已安装的服务,避免右键菜单没有立刻出现新选项。

第四步:在系统设置中确认启用

打开 系统设置 → 键盘 → 键盘快捷键 → 服务 → 文件和文件夹,找到「在 Zed 中打开」并勾选。

使用效果

配置完成后,在 Finder 中右键任意文件夹,选择 快速操作 → 在 Zed 中打开,Zed 会直接以该目录为工作区启动。

如果右键的是普通文件而非文件夹,脚本会自动取其父目录打开,不会报错。

几点说明

为什么不用 Finder 扩展(FinderSync)? FinderSync 需要开发一个完整的 Xcode 项目并签名,成本远高于 Automator workflow,对于这个简单需求来说完全没必要。

为什么脚本里要三重兜底? Zed 的 CLI 路径在不同安装方式下不一样。通过 Zed → Install CLI 安装的会在 ~/.local/bin/zed,手动加到 PATH 的会被 command -v zed 找到,而 open -a "Zed" 则是最后的保险,只要 Zed.app 在 /Applications 里就一定能用。

为什么脚本里都加了 -n Zed CLI 的默认行为是把新打开的目录加到当前已聚焦窗口的侧边栏,而不是新开一个窗口。从 Finder 触发时这种”复用”会让人误以为上一个工作区被覆盖、甚至”实例被隐藏”了。加上 -n--new)就能强制开一个独立窗口,原工作区保持原样。

如何卸载? 删除 ~/Library/Services/OpenInZed.workflow 这个文件夹即可,不会留下任何残余。

HyperFrames 实战:用 HTML 写一支 41 秒的产品介绍视频

2026-05-06 23:03:37

介绍

HyperFrames 把视频当成 HTML 来写。 一个 index.html 就是一支视频:

  • data-* 属性控制时间
  • GSAP(一个老牌的 JavaScript 动画库)控制动画
  • CSS 控制外观
  • 借助 FFmpeg 生成 MP4

它由 HeyGen 开源,配套 CLI、Skills、Studio 预览器和 13 个相关 skill 包,安装命令:

1
npx skills add heygen-com/hyperframes

为什么值得试

做产品介绍视频,常见的三类工具各有痛点:

路径 优势 痛点
Premiere / After Effects 视觉上限高 工程文件不可版本控制、模板化扩展难
Remotion 程序化 + React 需要搭工程、依赖链长
文生视频模型 上手快 数据准确性不保证、定制化弱

HyperFrames 的吸引点是:保留”代码即源”的可维护性,但把心智模型压缩到只有 HTML / CSS / GSAP 三件事 —— 适合不需要太复杂动效,偏内容呈现类的视频生成。

实战尝试

我用它做了一支介绍斑马思维机发展历程的视频。

claude code 的提示词如下:

帮我使用 npx skills add heygen-com/hyperframes 来安装 hyperframes 这个 skill,然后读取网上关于的斑马思维机的介绍,帮我做一个 30s-45s 的介绍斑马思维机发展历程的视频,里面要涵盖机器和题卡上升的时间线。

视频要有配音,可以找一些开放版权的背景音乐。

它做出来是横版的,我又让它生成了一个竖版的,提示词如下:

帮我另外再生成一个适合在手机上呈现的竖版的版本

效果视频

这是横版生成的效果:

参考链接