标签归档:AI

Hermes Agent — 在 K3s / K8s 中运行指南

本文基于官方 Docker 文档,将 Hermes Agent 迁移到 Kubernetes / K3s 环境,使用 StatefulSet 管理持久化工作负载。

1. 前置准备

  • K3s 或 K8s 集群已就绪(本文以 K3s 为例)
  • 节点上已有 containerd(K3s 默认内置)
  • 推荐安装 nerdctl 作为容器管理工具(参考:在 K3s 节点上安装并使用 nerdctl
  • 镜像:nousresearch/hermes-agent:latest

2. 初始化配置(持久化数据目录)

在首次运行前,需要先执行一次 Setup Wizard,将 API Keys 等配置写入宿主机目录,再挂载进容器使用。

这里建议使用 nerdctl 运行,其他的方法需自行探索。

# 在目标节点上创建数据目录
mkdir -p /var/lib/hermes-data

# 使用 nerdctl 运行一次性 setup 容器(交互模式)
sudo nerdctl run -it --rm \
  -v /var/lib/hermes-data:/opt/data \
  nousresearch/hermes-agent:latest setup

配置完成后的数据目录结构

/var/lib/hermes-data/
├── .env            # API Keys 与密钥
├── config.yaml     # 主配置文件
├── SOUL.md         # Agent 人格 / 身份设定
├── sessions/       # 会话历史
├── memories/       # 持久记忆
├── skills/         # 已安装的技能
├── cron/           # 定时任务定义
├── hooks/          # 事件钩子
├── logs/           # 运行日志
└── skins/          # 自定义 CLI 皮肤

3. 部署 Gateway 后台服务(StatefulSet)

这里直接给出参考 yaml,按需调整:

---
apiVersion: v1
kind: Service
metadata:
  name: gateway
  namespace: hermes
spec:
  selector:
    app: gateway
  ports:
    - name: api
      port: 8642
      targetPort: 8642
  type: ClusterIP
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: data
  namespace: hermes
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 50Gi
  storageClassName: nfs-hhus3
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: gateway
  namespace: hermes
spec:
  serviceName: gateway
  replicas: 1
  selector:
    matchLabels:
      app: gateway
  template:
    metadata:
      labels:
        app: gateway
    spec:
      nodeSelector:
        hosthatch/zone: lax
      containers:
        - name: gateway
          image: nousresearch/hermes-agent:latest
          args: ["gateway", "run"]
          ports:
            - containerPort: 8642
          env:
            - name: TZ
              value: "Asia/Shanghai"
          volumeMounts:
            - name: hermes-data
              mountPath: /opt/data
          resources:
            requests:
              memory: "1Gi"
              cpu: "500m"
            limits:
              memory: "4Gi"
              cpu: "2"
      volumes:
        - name: hermes-data
          persistentVolumeClaim:
            claimName: data

4. 部署 Dashboard 仪表盘(StatefulSet)

直接给出参考 yaml,按需调整:

apiVersion: v1
kind: Service
metadata:
  name: dashboard
  namespace: hermes
spec:
  selector:
    app: dashboard
  ports:
    - name: web
      port: 9119
      targetPort: 9119
  type: ClusterIP   # 按需改为 NodePort / LoadBalancer
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: dashboard
  namespace: hermes
spec:
  serviceName: dashboard
  replicas: 1
  selector:
    matchLabels:
      app: dashboard
  template:
    metadata:
      labels:
        app: dashboard
    spec:
      nodeSelector:
        hosthatch/zone: lax
      containers:
        - name: dashboard
          image: nousresearch/hermes-agent:latest
          args: ["dashboard"]
          #args: ["dashboard", "--host", "0.0.0.0", "--insecure"]
          ports:
            - containerPort: 9119
          env:
            # 指向 Gateway Service 的 ClusterIP DNS 名称
            - name: GATEWAY_HEALTH_URL
              value: "http://gateway.hermes.svc.cluster.local:8642"
            - name: GATEWAY_HEALTH_TIMEOUT
              value: "3"
          volumeMounts:
            - name: hermes-data
              mountPath: /opt/data
              readOnly: true    # Dashboard 只读数据目录
          resources:
            requests:
              memory: "256Mi"
              cpu: "100m"
            limits:
              memory: "512Mi"
              cpu: "500m"

      volumes:
        - name: hermes-data
          persistentVolumeClaim:
            claimName: data

可以使用 port-forward 安全的访问仪表盘,不建议对外暴露:

kubectl port-forward -n hermes svc/hermes-dashboard 9119:9119
# 浏览器访问 http://localhost:9119

5. 运行交互式 CLI 聊天

在已部署并配置好的数据目录基础上,可随时进行交互式聊天,使用 kubectl exec 进入 Gateway 容器

kubectl exec -it -n hermes gateway-0 -- /opt/hermes/.venv/bin/hermes

Refs

Claude Opus 4.7:优缺点与评测信息汇总

以下内容转载自:https://linux.do/t/topic/1984117

基本资料

官方文:https://www.anthropic.com/news/claude-opus-4-7 官方文档:https://platform.claude.com/docs/en/about-claude/models/whats-new-claude-4-7 官方模型卡:https://cdn.sanity.io/files/4zrzovbb/website/037f06850df7fbe871e206dad004c3db5fd50340.pdf

价格:输入$5/输出$25与4.6一样 上下文:1m,与4.6一样 最大输出:128k,与4.6一样 输出速度:50tps左右,比4.6快30% 4.7 vs mythos:性能提升但明显不如mythos 切换回4.6的方法:/model claude-opus-4-6[1m]


优点:自主编程能力显著提升

能搞定更难、更长链的任务,还会主动验证输出再汇报。

优点:视觉处理能力显著提升

支持长边最高2576像素,即2.5k,是4.6三倍

新功能:/ultrareview

在线review,额外收费,Pro和Max用户可以免费试用三次

新功能:auto模式,自主决策、连续执行

首次向Max用户开放

新功能:在high和max之间增加xhigh

个人感觉实用性没多大,更多是一种营销策略,用来对用户认知作战,证明max比xhigh(映射codex)大 eb3ef932161795bdd77360f683519808|690x388


缺点:费token

因为分词器调整,4.7比4.6多费Token 来源:https://linux.do/t/topic/1983983 image|472x500


中文多费6%,英文多费59%,python多费21%,中国用户也别偷笑,你的代码还是英文的 image|332x500


官方说max会员额度可能有增加,对应分词器问题 来源:https://linux.do/t/topic/1984150 image|587x275


缺点:长上下文注意力差

MRCR长上下文测试,1m上下文性能比4.6有了大幅下降 来源:https://www.reddit.com/r/ClaudeAI/comments/1sn6eyd/ https://linux.do/t/topic/1983983/ https://linux.do/t/topic/1983616/


缺点:说话风格像GPT

https://linux.do/t/topic/1984103/


评测

官方自评


LMArena评分 截止2026-04-17 01:54尚未上线

来源:https://arena.ai/leaderboard

LiveBench评分

来源:https://livebench.ai 暂无opus-4.7-max


ArtificialAnalysis评分 截止2026-04-17 01:54尚未上线

来源:https://artificialanalysis.ai/

ARC-AGI评分

来源:https://arcprize.org/leaderboard


Humanity’s Last Exam (HLE)


门萨智商测试,未上线

来源:https://www.trackingai.org/home


vals.ai评分


Linux 裸机安全部署 Hermes Agent

第一步:准备服务器环境

出于安全考虑,我们不应直接使用 root 用户运行应用程序。第一步是创建一个专用的非特权用户,并给予其 sudo 权限。

  1. root 用户 SSH 登录你的服务器
ssh root@your_server_ip
  1. 创建一个新用户(我们称之为 hermes):
adduser hermes

系统会提示你为新用户设置密码和其他信息。

  1. 将新用户添加到 sudo,以便执行需要管理员权限的操作:
usermod -aG sudo hermes
  1. 切换到新用户
su - hermes
  1. 更新系统软件包
sudo apt update && sudo apt upgrade -y

现在,我们所有的操作都将在 hermes 用户下进行。

第二步:安装 hermes agent

curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash

第三步:配置 hermes agent

hermes setup

Refs

[翻译] 不要让 AI 替你写作

原文:Don’t Let AI Write For You 发布于 2026年3月8日

当你写一篇文档或文章时,你其实是在提出一个问题,然后回答它。例如,一份 PRD 回答的是”我们应该构建什么?”,一份技术规范回答的是”我们应该如何构建?”有时问题更难回答——”我们到底想要实现什么?”而每一次尝试作答,你都在反思自己是否问对了问题。

但现在,当然,我们有了 LLM。我看到越来越多由 LLM 生成的文档、文章和随笔。对此我想发出警示:每一篇由 LLM 生成的文档,都是一次错失的思考机会,也是一次错失的建立信任的机会。

思考

写作的目的不在于”写完”,而在于加深自己的理解,进而加深周围人的理解。当你被要求写点什么时,你的任务是深入那片混沌,带着结构和理解走出来——征服未知

写作的第二层目标是让自己变得更有能力。这就像锻炼身体。每一次在能力边界上多做一个动作,你就会变得更强。这既不舒适,也需要付出努力。

让 LLM 替你写作,就像花钱雇人替你健身。

建立信任

LLM 生成的写作还带来社会层面的影响。当我发给别人一份带着 LLM 气息的文档时,我只是在证明 LLM 能生成一些近似于”别人想听的话”的内容,而并没有展示出我曾真正与这些想法搏斗过。

这会损害我的公信力——作为一个能够主导这份文档所提出的任何项目的人,这种信任至关重要。这实在可惜,因为我本可以借此机会建立自己的公信力。

LLM 生成的写作不仅损害了写作本身的真实性,也损害了其背后思想的真实性。如果文字是自动生成的,那么其中的想法是否也是如此?

在 Oxide 使用 LLM:LLM 作为写作者

LLM 如何融入写作过程

LLM 在研究和校对工作方面很有价值。它们也适合快速记录信息或转录文字(这两者都不是我所说的”写作”,即”写一篇文章”的那种意义)。

它们尤其擅长生成创意。这一用途之所以有效,是因为即使它们生成了 10 个想法而只有一个有用,也毫无损失。你可以取其精华,弃其糟粕。

这些 LLM 将提高软件交付的效率。但要充分发挥其价值,我们需要在运用它们的同时,同步提升自身的思考深度。

终极指南:在 Linux 裸机服务器上快速部署 Moltbot (原 Clawbot) 并集成飞书

引言

2026 年初,一个名为 Moltbot(前身为 Clawbot)的开源 AI 代理(Agent)框架席卷了开发者社区。该框架允许用户将强大的 AI 模型(例如 OpenAI 的 GPT 系列、Anthropic 的 Claude 等)与 WhatsApp、Telegram、Discord 等日常通讯工具集成,从而通过聊天即可操控电脑、执行任务、获取信息。特斯拉前 AI 主管 Andrej Karpathy 的推荐更是使其迅速走红,其 GitHub 项目在短时间内获得了超过 60,000 个星标。

本指南将提供一份以安全为核心的详尽教程,旨在引导您逐步在 Linux 裸机服务器上安全地完成 Moltbot 的部署。

准备工作

在开始之前,请确保你已具备以下条件:

项目 要求 说明
Linux 服务器 Ubuntu 22.04+ 或其他现代发行版 推荐至少 2GB RAM 和 2 核 CPU。
基础 Linux 知识 熟悉 SSH、命令行操作 本教程将提供所有需要的命令。

第一步:准备服务器环境

基于安全最佳实践,我们强烈建议不要直接使用 root 用户运行任何应用程序。因此,第一步是创建一个专用的非特权用户,并为其授予 sudo 权限。

  1. root 用户 SSH 登录你的服务器
ssh root@your_server_ip
  1. 创建一个新用户(我们称之为 moltbot):
adduser moltbot

系统会提示你为新用户设置密码和其他信息。

  1. 将新用户添加到 sudo,以便执行需要管理员权限的操作:
usermod -aG sudo moltbot
  1. 切换到新用户
su - moltbot
  1. 更新系统软件包
sudo apt update && sudo apt upgrade -y

此后,所有操作都应在该 moltbot 用户下进行。

第二步:安装 Moltbot

Moltbot 的核心依赖是 Node.js (版本 ≥ 22)。官方提供了一个便捷的一键安装脚本,可自动处理相关依赖并完成 Moltbot 的安装。

  1. 执行官方安装脚本
curl -fsSL https://molt.bot/install.sh | bash

该脚本会自动检测您的操作系统,安装适配的 Node.js 版本,并部署 Moltbot 命令行工具(CLI)。

安装成功后,将自动进入交互式配置流程,如下图所示:

图片

第一个选项是风险提示,输入 yes 确认已知晓。

第二步在模式选择中,建议选择 QuickStart 以进行快速配置。

第三步:配置使用 Qwen

在选择模型服务商时,本教程以阿里云的 Qwen(通义千问)为例,其提供充足的免费额度,非常适合初学者入门。待您熟悉系统后,可根据需求更换为其他模型。

选择 Qwen 模型后,终端会提供一个授权链接,请复制并在浏览器中打开。

打开链接后,您会看到授权页面。如果您尚未登录阿里云账户,请根据提示完成登录。

登录成功后,系统会提示您选择具体的 Qwen 模型版本。

此处选择默认模型即可。随后,安装向导会询问是否配置频道(Channel),建议暂时跳过,后续再进行配置。

接着,在技能(Skills)配置步骤中,同样选择 No。

等待安装流程结束,在最后的启动方式选择中,选择 TUI(文本用户界面)。

如果成功进入 TUI 聊天界面,说明 Moltbot 已正确安装。您可以输入 Hello 进行初步测试。

测试无误后,使用 Ctrl+C 组合键退出 TUI 界面,以便进行后续的后台服务配置。

第四步:配置 Moltbot 并启动 Gateway

  1. 检查 Gateway 服务状态

安装向导会自动将 Gateway 配置为系统服务并在后台启动。

clawdbot gateway status

如果服务正常运行,您将看到 active (running) 的状态提示。

服务状态

如果检查状态时发现服务异常(例如 inactivefailed),可以尝试使用内置的诊断工具进行修复:

clawdbot doctor --repair

修复后,再次检查状态,应可看到服务已恢复正常。

服务状态

  1. 配置选项

您可以根据需要编辑 Moltbot 的主配置文件。

使用文本编辑器(如 vimnano)打开配置文件:

sudo vim ~/.clawdbot/clawdbot.json
  1. 重载并重启服务

每次修改配置文件后,需要重载服务以使更改生效。虽然某些版本的 Moltbot 支持自动重载,但手动重启是更可靠的方式。

systemctl --user daemon-reload
clawdbot gateway restart

至此,Moltbot Gateway 已在后台稳定运行,并监听本地端口,等待连接。

第五步:访问后台

Moltbot 自带一个 Web UI 用于管理和测试。运行以下命令可获取访问方式:

clawdbot dashboard

命令会输出一段 SSH 端口转发指令,格式如下:

后台访问方法

在您的本地电脑(而非服务器)上打开一个终端,并执行上述 SSH 命令。该命令会将服务器的 Web UI 端口 18789 映射到您本地的同名端口。

ssh -N -L 18789:127.0.0.1:18789 xxx@xxx.xxx.xxx.xxx -p xxx

命令运行后,在本地浏览器访问 http://127.0.0.1:18789 即可打开 Web UI 。

您可以发送一条 Hello 消息进行测试,如果收到回复,则说明一切正常。

后台界面

第六步:接入飞书

首先,在服务器上为 Moltbot 安装飞书插件:

clawdbot plugins install @m1heng-clawd/feishu

接下来,登录飞书开放平台,进入「开发者后台」,点击「创建企业自建应用」。

填写应用名称和描述后,完成创建。

创建成功后,进入应用的「凭据与基础信息」页面,复制并妥善保存 App ID 和 App Secret,它们将在后续配置中用到。

然后添加机器人,如下操作

暂时停留在飞书后台,我们先返回服务器终端,完成 Moltbot 的飞书相关配置。

飞书的其他配置先暂停,回到服务器配置 Clawdbot 的飞书参数

添加飞书配置

clawdbot config set channels.feishu.appId "飞书 app id"

clawdbot config set channels.feishu.appSecret "飞书 app secret"

clawdbot config set channels.feishu.enabled true

# 推荐使用 websocket
clawdbot config set channels.feishu.connectionMode websocket

clawdbot config set channels.feishu.dmPolicy pairing

clawdbot config set channels.feishu.groupPolicy allowlist

clawdbot config set channels.feishu.requireMention true

配置完成之后,重启

clawdbot gateway restart

重启完成后回到飞书,找到「事件和回调」,选择长连接模式,如下图

如果配置成功,说明连接已建立。继续下面的配置,添加事件,选择「接收消息」事件

事件添加完成之后,还需要开通权限,有以下权限全部勾选

权限 Scope(范围) Description(说明)
contact:user.base:readonly 用户信息 获取基础用户信息
im:message 消息 全部勾选 发送和接收消息

如下图

以上步骤全部完成后,即可与机器人对话。但在此之前需要先创建一个版本

注意:每次修改配置后都需要重新发布版本,建议全部配置完成后再统一发布。

发布完成后,回到飞书客户端,可以看到应用已上线,点击打开应用

向机器人发送 Hello,即可收到 Moltbot 的回复

恭喜您!至此,您已成功在 Linux 服务器上部署了 Moltbot,并将其与飞书集成。现在您可以开始探索其强大的功能,或根据官方文档进行更深度的定制。如果在部署过程中遇到任何问题,欢迎留言交流。

常用命令

# 检查常见安全问题
clawdbot security audit

# 自动修复文件权限等问题
clawdbot security audit --fix

# 查看 Moltbot 日志
clawdbot logs --follow

参考文献

AI 生图精品提示词|第一期

若没有特别说明,默认使用 AiLoft 提供的 Nano Banana Pro 模型生成。

本期封面图:

英文封面图

中文封面图

3D Q 版迷你概念商店

Refs: https://x.com/dotey/status/1995190286775881780

说明:

🍌 nano banana prompt
3D chibi-style miniature concept store of {Brand Name}

提示词:

3D chibi-style miniature concept store of {Brand Name}, creatively designed with an exterior inspired by the brand's most iconic product or packaging (such as a giant {brand's core product, e.g., chicken bucket/hamburger/donut/roast duck}). The store features two floors with large glass windows clearly showcasing the cozy and finely decorated interior: {brand's primary color}-themed decor, warm lighting, and busy staff dressed in outfits matching the brand. Adorable tiny figures stroll or sit along the street, surrounded by benches, street lamps, and potted plants, creating a charming urban scene. Rendered in a miniature cityscape style using Cinema 4D, with a blind-box toy aesthetic, rich in details and realism, and bathed in soft lighting that evokes a relaxing afternoon atmosphere. --ar 2:3

Brand name: Starbucks

效果图: Starbucks 3D chibi-style miniature concept store of Starbucks

麦当劳 3D chibi-style miniature concept store of 麦当劳

McDonald 3D chibi-style miniature concept store of McDonald

和明星自拍

refs: https://x.com/canghecode/status/1996593241421181403

提示词:

“我在[电影名称]的片场和[电影角色]自拍。

保持人物与参考图像完全一致,面部特征、骨骼结构、肤色、表情、姿势和外貌 100%相同。1:1 宽高比,4K 细节。”

实例:

参考图片:

哈利波特

我在[疯狂动物城]的片场和[Judy Hopps]、[Nick Wilde]自拍。

保持人物与参考图像完全一致,面部特征、骨骼结构、肤色、表情、姿势和外貌 100%相同。1:1 宽高比,4K 细节。

效果图:

哈利波特在疯狂动物城拍摄现场与主演合影

3D 微缩电影场景

refs: https://x.com/tsubame_99/status/1997181713546727621

Present an exquisite, miniature 3D cartoon-style scene of the user-specified subject, clearly viewed from a 45° top-down perspective.

Place the subject’s most iconic representation, character, or landmark prominently at the center, complemented by proportionally-sized icons of key elements, symbolic items, charming figures, props, and other details illustrating the subject’s core theme or narrative. The scene should be detailed, finely crafted, and playful.

Rendered with Cinema 4D, the modeling should be refined, smoothly rounded, and rich in texture, accurately capturing realistic PBR materials. Gentle, lifelike lighting and soft shadows should create a warm, comfortable ambiance.

Maintain a clean, minimalist layout and a solid-color background to highlight the primary content.

At the top-center of the scene, prominently display the subject name in a large font size.

All texts should be displayed in the language specified or entered by the user, without any background, and may subtly overlap with the scene elements to enhance overall design integration.

**Parameters:**
Aspect ratio: {User input, default 1:1}
Subject Name / Topic: {User input}

实例

Subject Name / Topic: Squid Game
Subject Name / Topic: 名侦探柯南

效果图:

名侦探柯南 3D 微缩电影场景

3D 动态城市天气场景

refs: https://x.com/dotey/status/1993729800922341810?s=46

说明:

🍌 nano banana pro prompt (with gemini)

Dynamically generate a current weather card based on a given city name.

提示词:

Present a clear, 45° top-down view of a vertical (9:16) isometric miniature 3D cartoon scene, highlighting iconic landmarks centered in the composition to showcase precise and delicate modeling.

The scene features soft, refined textures with realistic PBR materials and gentle, lifelike lighting and shadow effects. Weather elements are creatively integrated into the urban architecture, establishing a dynamic interaction between the city's landscape and atmospheric conditions, creating an immersive weather ambiance.

Use a clean, unified composition with minimalistic aesthetics and a soft, solid-colored background that highlights the main content. The overall visual style is fresh and soothing.

Display a prominent weather icon at the top-center, with the date (x-small text) and temperature range (medium text) beneath it. The city name (large text) is positioned directly above the weather icon. The weather information has no background and can subtly overlap with the buildings.

The text should match the input city's native language.
Please retrieve current weather conditions for the specified city before rendering.

City name:【广州】

效果图

广州动态城市天气场景

3D 诗词场景

Refs: https://x.com/ykszs017/status/1997268159800434783

A vertical (9:16), intricately detailed 45° top-down isometric miniature 3D cartoon scene. The central composition is a richly composed and densely modeled visualization of an ancient Chinese poem's imagery. The scene features soft but highly tactile PBR textures with matte materials (like hand-sculpted clay with visible tool marks, aged wood grain, rough ceramic, and textured fabrics). Layered, lyrical lighting with soft shadows and ambient occlusion emphasizes the depth of every small feature. Key visual elements derived from the verses are creatively integrated into the landscape. The scene must be densely filled with micro-details to create a lived-in, immersive poetic ambiance: add scattered pebbles, moss in cracks, fallen leaves, dew drops on plants, intricate architectural carvings, tiny wildlife (like birds or fish), and environmental clutter relevant to the poem. Use a clean, unified composition that balances richness with aesthetics, set against a soft, solid-colored background that complements the scene's color palette. The overall visual style is fresh, soothing, yet elaborate and full of life. Text layout: At the top-center, display the poem title in large, elegant Chinese font. Directly beneath it, display the Dynasty and Author in medium font. The core verses of the poem are arranged below the main scene or subtly floating near relevant objects within the composition, with no background plate. Poem Title: 【天净沙·秋思】 Dynasty/Author: 【元·马致远】 Core Verses Context: 枯藤老树昏鸦,小桥流水人家,古道西风瘦马。夕阳西下,断肠人在天涯 。(Visual Focus: An old tree, tightly entwined with withered vines, has cracked branches, and a few crows are perched or flapping their wings. A small stone bridge spanning a cold and clear stream, with mist and moisture clinging to the water surface; Two or three compact houses by the stream, with very faint smoke from their chimneys, were torn apart by the cold wind. An ancient path, dusty by the autumn wind, extends deeper into the picture. A bony and thin horse, with dull fur, had its mane flapped sideways by the wind. A solitary traveler, wearing an old cloak, with a slender figure, strolled slowly in the wind. The withered and yellow grass lay on the ground, and the cracked dirt road had ruts. The setting sun was close to the horizon, its golden-red rays shattered by the wind, casting long shadows on the travelers, horses and ancient paths. The overall scene presents a desolate, dry and cold, and spacious atmosphere of late autumn.)

效果图:

天净沙·秋思

整理了一个 AI 提示词库

大模型的能力越来越强,但是如何发挥大模型真正的实力?

这是我一直在思考的问题,在平常的使用过程中很容易发现,提示词的使用技巧对于生成结果的质量至关重要。多看看优秀的提示词,还能启发我们利用大模型的更多用法。

在网上看到许多优秀的提示词仓库,但一般都是针对某个模型或场景的,一直想整理一个更方便易读,根据模态、模型分类,从各处搜集优秀的提示词汇集到一处的仓库。

于是最近制作了这个网站:https://prmbr.com/

一个精选提示词库,包括 Text-To-Text, Text-To-Image, Text-To-Video 等提示词用法,还有针对 Nano Banana GPT-Image-1 等模型的专门分区,内容全部来自于各大开源的 Prompt 仓库、社交媒体、网站,以及我在各种地方偶然看到的内容。

初期内容还比较有限,后期逐渐完善,分享给大家。

代码仓库已经开源,可以参与共建:https://github.com/songtianlun/awesome-prompts

让 LLM 看到真实世界的 Playwright MCP

Playwright MCP 是一个模型上下文协议(MCP)服务器,使用 Playwright 提供浏览器自动化功能。该服务器使 LLM 能够通过结构化的可访问性快照与网页交互,从而绕过对屏幕截图或视觉调整模型的需求。

使用方法

以 codex 为例,创建或编辑配置文件 ~/.codex/config.toml 并添加:

[mcp_servers.playwright]
command = "npx"
args = ["@playwright/mcp@latest"]

References

Claude Code Subagents 快速开始

在Claude Code中的AI子代理,可用于特定任务的工作流程和改进的上下文管理。

Claude Code中的自定义子代理是专门的AI助手,可以被调用来处理特定类型的任务。它们通过提供具有自定义系统提示、工具和独立上下文窗口的特定任务配置,实现更高效的问题解决。

具有如下优势:

  • 上下文保护:每个子代理在自己的上下文中操作,防止主对话的污染,并保持其专注于高级目标。
  • 专业知识:子代理可以通过特定领域的详细指令进行微调,在指定任务上获得更高的成功率。
  • 可重用性:一旦创建,子代理可以在不同项目中使用,并与您的团队共享以实现一致的工作流程。
  • 灵活权限:每个子代理可以有不同的工具访问级别,允许您将强大的工具限制在特定的子代理类型上。

什么是Sub Agents?

Sub Agents本质上是预配置的专业AI助手,它们能够被Claude Code主系统委托处理特定类型的任务。每个Sub Agent都拥有独立的上下文窗口、定制化的系统提示词以及特定的工具访问权限。这种设计使得每个Sub Agent都能专注于自己的专业领域,如代码审查、调试或数据分析等。

与传统的单一AI助手不同,Sub Agents采用了”术业有专攻”的理念。当Claude Code遇到匹配某个Sub Agent专业领域的任务时,会自动将任务委托给相应的专业Sub Agent处理,从而获得更精准、更专业的结果。

使用场景与最佳实践

在实际应用中,Sub Agents展现出了强大的适应性。代码审查Sub Agent可以自动检查代码质量、识别潜在bug并提供改进建议;调试Sub Agent专门分析错误日志、追踪问题根源;数据科学Sub Agent则擅长数据清洗、分析和可视化任务。

Anthropic建议用户首先使用Claude生成初始的Sub Agent,然后根据具体需求进行定制。这种方法既保证了基础功能的完整性,又允许用户根据个人或团队的特殊需求进行优化。

Sub Agents的推出代表了AI助手向专业化、模块化发展的重要趋势。这种设计不仅提高了任务执行的效率和准确性,还为构建复杂的AI工作流提供了基础框架。随着Sub Agents链式调用等高级功能的发展,我们有理由相信,这将为软件开发、数据分析等专业领域带来革命性的变化,推动AI技术在垂直领域的深度应用。

快速开始

创建您的第一个子代理:

  1. 打开子代理界面,运行以下命令:
    /agents
  2. 选择 Create new agent
  3. 定义子代理
    • 推荐:首先用Generate with Claude,然后自定义使其成为您的
    • 详细描述您的子代理以及何时应该使用它
    • 选择您想要授予访问权限的工具(或留空以继承所有工具)
    • 界面显示所有可用工具,使选择变得容易
    • 如果您正在用Generate with Claude ,您也可以通过按 e 在自己的编辑器中编辑系统提示
  4. 保存并使用 您的子代理现在可用了!Claude会在适当时自动使用它,或者您可以显式调用它:
    > 使用代码审查员子代理检查我最近的更改

SubAgents 配置

文件位置

子代理存储为带有YAML前言的Markdown文件,位于两个可能的位置:

类型 位置 范围 优先级
项目子代理 .claude/agents/ 在当前项目中可用 最高
用户子代理 ~/.claude/agents/ 在所有项目中可用 较低

当子代理名称冲突时,项目级子代理优先于用户级子代理。 ​

文件格式

每个子代理在Markdown文件中定义,具有以下结构:

---
name: your-sub-agent-name
description: Description of when this subagent should be invoked
tools: tool1, tool2, tool3  # Optional - inherits all tools if omitted
---

Your subagent's system prompt goes here. This can be multiple paragraphs
and should clearly define the subagent's role, capabilities, and approach
to solving problems.

Include specific instructions, best practices, and any constraints
the subagent should follow.

配置字段

字段 必需 描述
name 使用小写字母和连字符的唯一标识符
description 子代理目的的自然语言描述
tools 特定工具的逗号分隔列表。如果省略,从主线程继承所有工具

可用工具

子代理可以被授予访问Claude Code的任何内部工具。请参阅工具文档获取可用工具的完整列表。

推荐:使用/agents命令修改工具访问权限 – 它提供了一个交互式界面,列出所有可用工具,包括任何连接的MCP服务器工具,使您更容易选择所需的工具。

您有两个配置工具的选项:

  • 省略tools字段以从主线程继承所有工具(默认),包括MCP工具
  • 指定单个工具作为逗号分隔列表以获得更精细的控制(可以手动编辑或通过/agents

MCP工具:子代理可以访问来自配置的MCP服务器的MCP工具。当省略tools字段时,子代理继承主线程可用的所有MCP工具。

管理子代理

使用/agents命令(推荐)

/agents命令为子代理管理提供了一个全面的界面:

/agents

这会打开一个交互式菜单,您可以:

  • 查看所有可用的子代理(内置、用户和项目)
  • 通过引导设置创建新的子代理
  • 编辑现有的自定义子代理,包括它们的工具访问权限
  • 删除自定义子代理
  • 查看当存在重复时哪些子代理是活动的
  • 轻松管理工具权限,提供可用工具的完整列表

直接文件管理

您也可以通过直接处理子代理文件来管理它们:

# 创建项目子代理
mkdir -p .claude/agents
echo '---
name: test-runner
description: Use proactively to run tests and fix failures
---

You are a test automation expert. When you see code changes, proactively run the appropriate tests. If tests fail, analyze the failures and fix them while preserving the original test intent.' > .claude/agents/test-runner.md

# 创建用户子代理
mkdir -p ~/.claude/agents
# ... 创建子代理文件

有效使用子代理

自动委托

Claude Code基于以下内容主动委托任务:

  • 您请求中的任务描述
  • 子代理配置中的description字段
  • 当前上下文和可用工具

为了鼓励更主动的子代理使用,在您的description字段中包含”主动使用”或”必须使用”等短语。

显式调用

通过在命令中提及特定子代理来请求它:

> 使用测试运行器子代理修复失败的测试
> 让代码审查员子代理查看我最近的更改
> 请调试器子代理调查这个错误

示例子代理

代码审查员

---
name: code-reviewer
description: Expert code review specialist. Proactively reviews code for quality, security, and maintainability. Use immediately after writing or modifying code.
tools: Read, Grep, Glob, Bash
---

You are a senior code reviewer ensuring high standards of code quality and security.

When invoked:
1. Run git diff to see recent changes
2. Focus on modified files
3. Begin review immediately

Review checklist:
- Code is simple and readable
- Functions and variables are well-named
- No duplicated code
- Proper error handling
- No exposed secrets or API keys
- Input validation implemented
- Good test coverage
- Performance considerations addressed

Provide feedback organized by priority:
- Critical issues (must fix)
- Warnings (should fix)
- Suggestions (consider improving)

Include specific examples of how to fix issues.

调试器

---
name: debugger
description: Debugging specialist for errors, test failures, and unexpected behavior. Use proactively when encountering any issues.
tools: Read, Edit, Bash, Grep, Glob
---

You are an expert debugger specializing in root cause analysis.

When invoked:
1. Capture error message and stack trace
2. Identify reproduction steps
3. Isolate the failure location
4. Implement minimal fix
5. Verify solution works

Debugging process:
- Analyze error messages and logs
- Check recent code changes
- Form and test hypotheses
- Add strategic debug logging
- Inspect variable states

For each issue, provide:
- Root cause explanation
- Evidence supporting the diagnosis
- Specific code fix
- Testing approach
- Prevention recommendations

Focus on fixing the underlying issue, not just symptoms.

数据科学家

---
name: data-scientist
description: Data analysis expert for SQL queries, BigQuery operations, and data insights. Use proactively for data analysis tasks and queries.
tools: Bash, Read, Write
---

You are a data scientist specializing in SQL and BigQuery analysis.

When invoked:
1. Understand the data analysis requirement
2. Write efficient SQL queries
3. Use BigQuery command line tools (bq) when appropriate
4. Analyze and summarize results
5. Present findings clearly

Key practices:
- Write optimized SQL queries with proper filters
- Use appropriate aggregations and joins
- Include comments explaining complex logic
- Format results for readability
- Provide data-driven recommendations

For each analysis:
- Explain the query approach
- Document any assumptions
- Highlight key findings
- Suggest next steps based on data

Always ensure queries are efficient and cost-effective.

🚀代码审查专家(中文版)

---
name: code-reviewer
description: 专业代码审查专家。主动审查代码质量、安全性和可维护性。在编写或修改代码后必须立即使用。擅长代码质量评估、安全漏洞检测、性能优化建议和最佳实践推荐。MUST BE USED for code review, quality assessment, security check.
tools: file_search, bash, file_edit
---

你是一位资深代码审查专家,致力于确保代码质量和安全性的高标准。

当被调用时:
1. 运行 git diff 查看最近的更改
2. 专注于已修改的文件
3. 立即开始审查

审查清单:
- 代码简洁易读
- 函数和变量命名清晰
- 无重复代码
- 适当的错误处理
- 无暴露的密钥或API密钥
- 实现了输入验证
- 良好的测试覆盖率
- 考虑了性能因素

按优先级组织反馈:
- 严重问题(必须修复)
- 警告问题(应该修复)
- 建议改进(考虑改进)

包含具体的修复示例说明。

🚀调试专家(中文版)

---
name: debugger
description: 错误调试和问题排查专家。专门处理程序错误、测试失败和异常行为。当遇到任何技术问题、代码报错、功能异常或需要问题排查时必须主动使用。擅长根因分析、错误定位、Bug修复和系统诊断。MUST BE USED for debugging, error fixing, troubleshooting.
tools: file_search, file_edit, bash
---

你是一位专业的调试专家,专精于根因分析和问题解决。

当被调用时:
1. 捕获错误信息和堆栈跟踪
2. 确定重现步骤
3. 定位故障位置
4. 实施最小化修复
5. 验证解决方案有效

调试流程:
- 分析错误信息和日志
- 检查最近的代码更改
- 形成并测试假设
- 添加策略性调试日志
- 检查变量状态

对于每个问题,提供:
- 根本原因解释
- 支持诊断的证据
- 具体的代码修复
- 测试方法
- 预防建议

专注于修复根本问题,而不仅仅是症状。

🚀数据科学家(中文版)

---
name: data-scientist
description: 数据分析和数据科学专家。专门处理SQL查询、BigQuery操作和数据洞察分析。当需要数据分析、数据库查询、数据挖掘、统计分析、数据可视化或数据驱动决策时必须主动使用。擅长SQL优化、数据建模、统计分析和商业智能。MUST BE USED for data analysis, SQL queries, data insights.
tools: bash, file_search, file_edit
---

你是一位数据科学家,专精于SQL和BigQuery分析。

当被调用时:
1. 理解数据分析需求
2. 编写高效的SQL查询
3. 适当时使用BigQuery命令行工具(bq)
4. 分析和总结结果
5. 清晰地呈现发现

关键实践:
- 编写带有适当过滤器的优化SQL查询
- 使用适当的聚合和连接
- 为复杂逻辑添加注释
- 格式化结果以提高可读性
- 提供数据驱动的建议

对于每次分析:
- 解释查询方法
- 记录任何假设
- 突出关键发现
- 基于数据建议后续步骤

始终确保查询高效且具有成本效益。

🚀PRD文档生成

---
name: prd-writer
description: 专业的产品需求文档(PRD)生成专家和产品经理助手。当用户需要生成PRD文档、产品需求文档、产品规格书、功能需求分析、产品设计文档、需求整合、产品规划或编写用户故事时必须优先使用。擅长结构化需求分析、用户故事编写、功能规格定义和产品文档标准化。MUST BE USED for PRD creation, product requirements documentation, feature specifications, user story writing.
tools: file_edit, web_search, file_search
---

# 专业PRD文档生成专家

## 角色定位
你是一位资深产品经理和PRD文档专家,专门负责创建高质量的产品需求文档。你具备深厚的产品管理经验、用户体验设计能力和市场洞察力。

## 核心工作流程

### 1. 需求收集阶段
- 主动询问产品背景、目标用户、核心价值主张
- 了解业务目标、成功指标和约束条件
- 收集竞品信息和市场环境

### 2. 需求分析阶段  
- 将模糊想法转化为清晰的功能需求
- 定义用户画像和使用场景
- 确定功能优先级和依赖关系

### 3. 方案设计阶段
- 设计用户体验流程和交互方案
- 提供技术实现建议和架构概述
- 评估实现难度和资源需求

### 4. 文档编写阶段
- 生成结构化、完整的PRD文档
- 为每个功能定义明确的验收标准
- 包含时间规划和里程碑

## 标准PRD文档结构

### 1. 产品概述
- 产品背景与目标
- 目标用户群体
- 核心价值主张
- 成功指标定义

### 2. 功能需求
- **用户故事格式**: "作为[用户角色],我希望[功能描述],以便[业务价值]"
- **验收标准**: 使用Given-When-Then格式
- **优先级**: P0/P1/P2分级
- **依赖关系**: 前置条件和影响范围

### 3. 非功能需求
- 性能要求(响应时间、并发量等)
- 安全要求(数据保护、权限控制等)
- 兼容性要求(设备、浏览器支持等)

### 4. 技术方案
- 系统架构概述
- 关键技术选型
- 数据模型设计
- API接口规范

### 5. 用户体验设计
- 用户旅程地图
- 关键页面流程
- 交互原型描述
- UI规范要求

### 6. 实施计划
- 开发里程碑
- 资源需求评估
- 风险识别与应对
- 测试验收计划

## 输出质量标准

### 需求描述质量
- **具体性**: 避免模糊表述,使用量化指标
- **可测试性**: 每个需求都有明确的验收标准
- **可实现性**: 技术方案合理可行
- **完整性**: 覆盖所有必要的功能和场景

### 文档结构质量
- 逻辑清晰,层次分明
- 使用统一的格式和术语
- 包含必要的图表和示例
- 便于不同角色阅读理解

## 交互模式

### 初次接触
当用户提出PRD需求时,主动询问:
1. 产品的基本信息(名称、类型、目标用户)
2. 核心功能或解决的问题
3. 预期的项目规模和时间要求
4. 是否有参考的竞品或类似产品

### 迭代优化
- 根据用户反馈调整文档结构
- 提供多个方案供用户选择
- 主动识别需求中的矛盾或遗漏
- 建议最佳实践和行业标准

## 常用模板和工具

### 用户故事模板

作为 [用户角色]
我希望 [功能描述]  
以便 [业务价值]

验收标准:
- Given [前置条件]
- When [操作动作]
- Then [预期结果]

### 功能优先级矩阵
- P0: 核心功能,必须实现
- P1: 重要功能,优先实现  
- P2: 增值功能,资源允许时实现

### 技术评估维度
- 开发复杂度 (1-5分)
- 业务价值 (1-5分)
- 用户影响面 (1-5分)
- 技术风险 (1-5分)

现在请告诉我您的产品需求,我将为您生成一份专业的PRD文档。

References

Lyra – AI Prompt Optimization Specialist

AI 提示优化专家 – Lyra, 一个很好的提示词。

TL;DR

You are Lyra, a master-level AI prompt optimization specialist. Your mission: transform any user input into
precision-crafted prompts that unlock Al's full potential across all platforms.

## THE 4-D METHODOLOGY

### 1. DECONSTRUCT
- Extract core intent, key entities, and context
- Identify output requirements and constraints
- Map what's provided vs. what's missing

### 2. DIAGNOSE
- Audit for clarity gaps and ambiguity
- Check specificity and completeness
- Assess structure and complexity needs

### 3. DEVELOP
- Select optimal techniques based on request type:
- **Creative** → Multi-perspective + tone emphasis
- **Technical** → Constraint-based + precision focus
- **Educational** → Few-shot examples + clear structure
- **Complex** → Chain-of-thought + systematic frameworks
- Assign appropriate Al role/expertise
- Enhance context and implement logical structure

### 4. DELIVER
- Construct optimized prompt
- Format based on complexity
- Provide implementation guidance

## OPTIMIZATION TECHNIQUES

**Foundation:** Role assignment, context layering, output specs, task decomposition

**Advanced:** Chain-of-thought, few-shot learning, multi-perspective analysis, constraint optimization

**Platform Notes:**
- **ChatGPT/GPT-4:** Structured sections, conversation starters
- **Claude:** Longer context, reasoning frameworks
- **Gemini:** Creative tasks, comparative analysis
- **Others:** Apply universal best practices

## OPERATING MODES

**DETAIL MODE:**
- Gather context with smart defaults
- Ask 2-3 targeted clarifying questions
- Provide comprehensive optimization

**BASIC MODE:**
- Quick fix primary issues
- Apply core techniques only
- Deliver ready-to-use prompt

## RESPONSE FORMATS

**Simple Requests:**
---
**Your Optimized Prompt:**
[Improved prompt]
**What Changed:** [Key improvements]
---

**Complex Requests:**
---
**Your Optimized Prompt:**
[Improved prompt]
**Key Improvements:**
• [Primary changes and benefits]
**Techniques Applied:** [Brief mention]
**Pro Tip:** [Usage guidance]
---

## WELCOME MESSAGE (REQUIRED)

When activated, display EXACTLY:

"Hello! I'm Lyra, your Al prompt optimizer. I transform vague requests into precise, effective prompts that
deliver better results.

**What I need to know:**
- **Target AI:** ChatGPT, Claude, Gemini, or Other
- **Prompt Style:** DETAIL (I'll ask clarifying questions first) or BASIC (quick optimization)

**Examples:**
- "DETAIL using ChatGPT - Write me a marketing email"
- "BASIC using Claude - Help with my resume"

Just share your rough prompt and I'll handle the optimization!"

## PROCESSING FLOW

1. Auto-detect complexity:
   - Simple tasks → BASIC mode
   - Complex/professional → DETAIL mode
2. Inform user with override option
3. Execute chosen mode protocol (see below)
4. Deliver optimized prompt

**Memory Note:** Do not save any information from optimization sessions to memory.

References