跳到主要内容

技巧与提示

这页是日常使用 Anyy 的快速清单。每条建议都会链接到负责完整行为的页面,所以这里保持实践导向,不重复写成参数参考。

让结果更稳定

先说明完成标准

告诉 Anyy 什么算做完。一个有用的 prompt 通常会说明目标、约束、相关文件或系统,以及希望如何验证结果。

Review the provider fallback docs against the current config code. Fix inaccurate
claims, keep the wording concise, then build the docs site.

把上下文放到 Anyy 能看到的位置

Resident session 不会自动把项目里的所有文件都扫进每一轮上下文。如果这一轮需要某个文件、目录或项目说明,显式引用它:

Use @file:AGENTS.md and @folder:docs-site/docs/guides to review these pages.

Role identity 来自当前 Anyy home 下的 SOUL.mdAGENTS.mdCLAUDE.md.cursorrules 这类项目说明,在当前版本里不是 resident runtime 的身份文件。详见 Context FilesContext References

让 runtime 自己使用工具

需要检查和验证的工作,最好说明结果和约束,而不是手把手列每个底层步骤。Anyy 可以搜索文件、调用工具、运行经批准的命令,并报告验证了什么。只有当执行顺序本身很重要时,才写很细的步骤。

Session 与忙碌中的对话

长工作保持在一个 Session 里

Session 会保存 transcript、tool results、approvals、artifacts 和 metadata。同一个主题还在继续时,恢复同一个 session:

anyy --resume SESSION_ID
anyy chat --session SESSION_ID "Continue from the last docs review."

主题已经变了,用 /new。想尝试另一条路径,用 /branch。长 session 还要继续但上下文太大,用 /compress。详见 Sessions

明确选择 busy 行为

在 TUI 中:

/busy queue
/busy steer
/busy interrupt

在消息平台里,用 /queue 把消息排到当前 turn 后面,用 /btw 给正在运行的 turn 补充指导;/steer 是别名。如果要先结束当前 turn 再改方向,用 /stop。详见 Slash Commands

Profiles、Roles、Memory 与 Skills

用 Profiles 做真正隔离

当数据不能混在一起时,用不同 profile:个人和工作、不同 channel accounts、不同 provider credentials、不同 memory。一个 profile 拥有自己的 config、state database、sessions、memory、skills、channels、secrets、cron jobs、logs 和 backups。

如果只是想在同一个 profile 内改变 persona 或工作风格,用 role。Roles 共享 profile 的 memory、skills、channels、providers 和 gateway state。详见 ProfilesRoles

事实进 Memory,流程进 Skills

Memory 适合稳定事实和偏好:

Remember that this repository keeps user-facing docs under docs-site/.

Skills 适合可复用流程:

Create a skill for the release checklist we just ran.

不要把任务进度、临时 TODO、原始链接或完整 transcript 存进 memory。过去的工作用 session history/search 找,可复用的“怎么做”知识写成 skill。详见 Persistent MemorySkills System

Toolsets 与 Approvals

保持 Toolsets 收窄

Toolsets 只决定哪些工具对模型可见,不代表工具就是可信的。可见工具仍然可能需要 approval、audit、confirmation 或 ChangePlan。

普通 session 里,只有当你希望新 session 默认使用新工具集时,才编辑 toolsets.default。已有 session 会保留创建时记录的 toolset metadata。MCP 推荐用 anyy mcp add ... --activate-toolsetanyy mcp configure ... --activate-toolset,显式激活对应的 mcp-<server> toolset。详见 Toolsets

Approval 前先看 ChangePlan

Anyy 提议高风险操作时,先读要运行的命令或 ChangePlan。Approvals 会持久化并写入 audit,获批执行前还会校验 plan hash。计划过宽、缺少回滚或缺少验证步骤时,用 deny。详见 Approvals & ChangePlans

长时间运行的工作

有限的长任务用 Background Work

长时间 agentic 工作可以用 background child agent:

/background inspect the failing docs build and summarize the likely cause
/agents

长时间 shell 工作可以由 Anyy 作为 managed background process 运行,再通过 /jobs/job <id>process 工具检查。Managed jobs 是 session-scoped,不是通用 host process list。详见 Background Jobs

Cron Prompt 要自包含

Scheduled work 不是你当前的前台聊天。把指令、数据来源、投递要求和安静情况的行为都写进 cron prompt:

Check the build status. If it is healthy, reply with one short status line. If
it is failing, summarize the failing step and the next action.

Job 不符合预期时,用 anyy cron list --include-disabledautomation_history 查看状态与历史。详见 用 Cron 自动化

消息平台与运维

把 Channels 当成 Resident Runtime 功能

Channels 通过 resident gateway 工作,不通过一次性的 CLI 调用工作。修改 channel config 后,reload gateway channel manager:

anyy channels reload
anyy channels doctor telegram

把 bot 邀进大范围群组前,先使用 allowlists 或 pairing。Channel policy 控制谁能接触 Anyy;它不会绕过 approvals、ChangePlans 或 audit。详见 设置消息平台

保持小型运维检查循环

感觉不对时,先检查这几个固定入口:

anyy status
anyy doctor
anyy config

迁移 profile、高风险配置变更或手动改 state 前,先备份:

anyy backup create
anyy backup list

Backups 默认排除 profile secrets。只有准备把 archive 当作敏感 credential material 处理时,才使用 --include-secrets。详见 备份与恢复