Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/binaryfroggy/hopet/agents-mdgit clone --depth 1 https://github.com/BinaryFroggy/HopetWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.03103 | $0.03103 |
| Opus 5 | $0.01551 | $0.01551 |
| Sonnet 5 | $0.00621 | $0.00621 |
| Haiku 4.5 | $0.00310 | $0.00310 |
Grade A, and why
Hopet AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 212 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Hopet · Agent 协作规范
本文件是 Hopet 仓库面向 AI 编码 agent(Claude Code / Codex CLI 等)的唯一权威规范。CLAUDE.md 通过 @AGENTS.md 引用本文件,规则改动只在本文件进行。
0. 项目
macOS 桌面 AI 宠物,将 Claude Code / Codex CLI 的会话生命周期映射到桌面状态。Swift 5.10 / macOS 14+ / SwiftPM。两个 executable target:Hopet(App)与 hopet-emit(hook 投递 CLI)。
1. 文档
- 架构、状态机、优先级、hook 协议的事实之源在
DevDocs/。注释引用使用章节级指引,例如See architecture.md §7.1。 - 注释解释意图与约束,不复述代码。
- README 仅描述已实现能力。未实现项需明确标注。
2. Swift 代码风格
2.1 模块组织
源码位于 Sources/Hopet/,按职责分目录:
| 目录 | 职责 |
|---|---|
App/ |
NSApplication 入口、AppDelegate、菜单栏、SceneRouter |
Core/ |
状态机、聚合器、Session 注册表、日志、路径、计时器(纯逻辑、可单测) |
Models/ |
值类型、enum、Codable 数据结构 |
IPC/ |
Unix Domain Socket、长度前缀帧、hook 同步通道 |
HookKit/ |
Claude / Codex hook settings 的 merge 安装与卸载 |
Pet/ |
桌面宠物 NSPanel、气泡布局与渲染、权限 / AskUser 交互 |
Notch/ |
刘海条三态渲染与降级顶条 |
Panel/ |
偏好面板 Tab 骨架 |
Theme/ |
主题包、color token |
新增文件应归入贴切的现有目录,不另起新层级。Sources/hopet-emit/ 为独立 CLI target,禁止反向依赖主 App 符号。
2.2 命名与可见性
- 公共类型与 API 显式声明
public;模块内部默认internal,省略关键字。 - 工具与算法集合优先使用 caseless
enum作为命名空间,参考HopetLog、SessionStateMachine、HopetPaths。不使用空struct或全局函数。 @MainActor标注于面向 UI 的聚合器与控制器,参考PetAggregator。- 跨模块的异步状态使用 Combine
PassthroughSubject/CurrentValueSubject,避免直接暴露@Published。
2.3 实现取舍
- 不实现做不完整的功能,宁可移除。
- 不为假想的未来需求引入抽象。三段相似代码优于一个早产的 protocol。
- 错误处理仅在系统边界进行(用户输入、socket 解码、外部 settings 文件)。模块内部信任调用方,不写防御性
guard。 - 日志统一走
HopetLog。终端事件流追踪使用HopetLog.trace(tag:_:),结构化日志使用.info / .warn / .error。禁止使用print。
2.4 IPC 与 Hook 协议
- 跨进程消息统一使用长度前缀 JSON 帧,编解码集中在
IPC/。业务代码不得自行拼装字节。 - 新增 hook 字段需先更新
DevDocs/hooks-and-priority.md字段表,再修改hopet-emit的 flag 解析与HookKit的 settings merge。代码与文档同 PR 提交。 - Permission Allow/Deny 与 AskUserQuestion 同步回包是协议级承诺。修改这两条路径需保留跨终端宿主兼容性。
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 212 lines · 3,103 tokens per session scan A 6c387c501f01
Hopet AGENTS.md is an instructions file published in the GitHub repository BinaryFroggy/Hopet (63 stars, last pushed 1mo ago), licensed MIT. It adds 3,103 tokens to every session, about $0.0155 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
cindy AGENTS.md
AGENTS.md instructions for makecindy/cindy, covering cindy 客户端仓:agent 工作入口, 仓库边界, 规则组织, 当前规则索引 and 通用工作流程.
PiDeck AGENTS.md
Instructions for ayuayue/PiDeck, covering agents.md, 项目简介, 代码结构与跨层契约, 架构规则(硬性) and 模块内聚与低耦合(硬性).
Xcode-Build-Optimization-Agent-Skill copilot-instructions.md
Instructions for AvdLee/Xcode-Build-Optimization-Agent-Skill, covering repository mission, agent skill requirements, behavior constraints, build optimization focus areas and common issues to flag.
AppClaw CLAUDE.md
Instructions for appclawhq/AppClaw, covering claude.md, what is appclaw?, build & run commands, architecture and entry point & cli modes (src/index.ts).
mectrics CLAUDE.md
Instructions for farukkamcici/mectrics, covering claude.md, absolute must-knows (see agents.md for detail), fast local loop (no xcode ui), build & run the app and notes.
Aether AGENTS.md
AGENTS.md instructions for Zhou-Shilin/Aether, a project described as: A stunning, localized, general-purpose AI Agent for Android, iOS & Mac. | Aether 扶摇.