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/cwnu-open-source-community/deepseekmeter/agents-mdgit clone --depth 1 https://github.com/CWNU-Open-Source-Community/DeepSeekMeterWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/cwnu-open-source-community/deepseekmeter/agents-md)<a href="https://agentmods.dev/instructions/cwnu-open-source-community/deepseekmeter/agents-md"><img src="https://agentmods.dev/badge/instructions/cwnu-open-source-community/deepseekmeter/agents-md.svg" alt="Measured on agentmods" height="20"></a>What 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.03490 | $0.03490 |
| Opus 5 | $0.01745 | $0.01745 |
| Sonnet 5 | $0.00698 | $0.00698 |
| Haiku 4.5 | $0.00349 | $0.00349 |
Grade A, and why
DeepSeekMeter 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 4d 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 — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — DeepSeekMeter 仓库操作规范
This file is the operating manual for AI coding agents (Claude Code, Cursor, Codex, etc.). 开始在本仓库修改代码之前,请先完整阅读本文件,并严格遵守其中的规范与边界。
1. 项目是什么
DeepSeekMeter 是一个 macOS 菜单栏小工具(SwiftUI + AppKit):实时展示 DeepSeek 平台账户的余额、本月费用、Token 用量与按天趋势。
- 工具链:Swift 6(swift-tools-version 6.0),Swift 5 语言模式(Package.swift 中显式设置)
- 平台:macOS 14+(Apple Silicon / Intel 均可),仅 macOS,无 iOS/iPadOS
- 移动端:iOS 版(
ios/,M1–M5 代码完成,分发待账号)与 Android 版(android/,A4 完成,A5 规划中),总体方案见 MOBILE-PLAN.md - 构建:Swift Package Manager,无 Xcode 工程、无任何第三方依赖、单 target(仅指 macOS 包;iOS 工程在
ios/内,见第 8 节红线 13) - 测试:轻量自测(swiftc 直接编译运行,不依赖 XCTest)
- CI:GitHub Actions(push main / PR 触发,覆盖 macOS / Windows / iOS / Android);发布:打
v*标签自动出 macOS DMG、Windows ZIP 和 Android APK Release - 用户文档:README.md(英文)+ README.zh-CN.md(中文),双语惯例
2. 常用命令(改动后必须本地验证)
swift run # 开发模式运行(无 .app 外壳)
swift build # debug 构建
swift build -c release # release 构建
bash Scripts/run-tests.sh # 运行自测(全绿才算通过)
bash Scripts/build-app.sh release # 组装 build/DeepSeekMeter.app 并签名
bash Scripts/install.sh # 构建 + 安装到 /Applications 并启动
# iOS 版验证(核心包自测 + 工程结构静态校验必跑;有 Xcode 时还会构建 App 冒烟)
bash Scripts/run-ios-tests.sh
python3 Scripts/check-ios-project.py # 单独跑工程结构校验(无 Xcode 环境的把关)
# 本机有 Xcode 后:一键跑 iOS 模拟器(构建 + 运行 + 截图),详见 docs/install-xcode-and-run.md
bash Scripts/run-ios-simulator.sh
# Android 核心单测(需 JDK 17 + Android SDK;JVM 直跑无需设备)
cd android && ./gradlew :core:test
CI 的验证链:swift build → swift build -c release → run-tests.sh → build-app.sh release → 冒烟启动 6 秒。
任何改动都必须保证这条链全部通过。
注意:swift run 时 Bundle.main.bundleIdentifier 为 nil,开机自启注册会被跳过(SettingsStore 中已处理),这是预期行为,不是 Bug。
3. 仓库结构
Sources/DeepSeekMeter/
AppMain.swift @main 入口;.accessory 激活策略(仅菜单栏,无 Dock 图标)
AppDelegate.swift 生命周期组装:SettingsStore → AppModel → StatusItemController
StatusItemController.swift 菜单栏 NSStatusItem + NSPopover 宿主(内容尺寸自适应)
AppModel.swift 状态中枢:@MainActor ObservableObject;轮询、拉取、错误状态
PlatformService.swift DeepSeek 平台私有接口客户端 + PlatformError
Models.swift 网络模型(Decodable)+ MonthUsage 聚合模型
SettingsStore.swift 设置持久化(UserDefaults)+ 开机自启 + 旧钥匙串一次性迁移
Formatting.swift format() / currencySymbol() 等纯函数
LoginWindowController.swift 内嵌官方登录页(WKWebView)+ Token 自动提取
Views/
PopoverView.swift 悬浮窗主界面(SwiftUI)
SparklineView.swift Token 按天用量柱状图
windows/ Windows 版(.NET 8 + WPF,与 macOS 版功能对齐)
src/DeepSeekMeter.Core/ 纯逻辑库:Models / Formatting / PlatformService / SettingsStore
src/DeepSeekMeter/ WPF 应用:MainViewModel / TrayIconController / PopoverWindow / LoginWindow 等
tests/DeepSeekMeter.Selftest/ 轻量自测(控制台,零测试框架)
README.md Windows 英文说明(含与 macOS 版对应关系)
README.zh-CN.md Windows 中文说明
ios/ iOS 版(开发中,详见 MOBILE-PLAN.md)
DeepSeekMeterCore/ 共享核心 Swift Package(PlatformService / Models / Formatting / TokenStoring / AppModel,零第三方依赖;AppModel 注入 TokenStoring+URLSession,可在 macOS 上自测)
DeepSeekMeter.xcodeproj iOS App 工程(SwiftUI,Xcode 16 同步文件夹格式)
DeepSeekMeter/ iOS App 源码(AppMain / TokenStore(Keychain) / Views/ / NotificationService / BackgroundRefreshService)
DeepSeekMeterWidget/ WidgetKit 余额小组件(快照驱动;Token 不进 App Group 共享容器)
DeepSeekMeterCore/Sources/DeepSeekMeterCoreSelftest/ 核心轻量自测(swift run 直接跑,不依赖 XCTest)
android/ Android 版(A4 已完成,A5 规划中,详见 MOBILE-PLAN.md 第 4 节)
core/ 纯逻辑核心模块(Kotlin,零第三方业务依赖;org.json 手写映射)
core/src/test/ 本地 JVM 单测(无需设备;org.json 测试期用官方 jar 替身)
Scripts/
build-app.sh / install.sh / notarize.sh / publish-windows.ps1 / run-tests.sh / run-ios-tests.sh / make-icon.sh / generate-icon.swift
Info.plist 应用包信息(**版本号在这里改**)
selftest/main.swift 轻量自测源码(swiftc 编译运行)
.github/workflows/
ci.yml push main / PR:macOS、Windows、iOS、Android 构建与自测
release.yml 打 v* 标签:构建 macOS DMG、Windows ZIP、Android APK 并发布 GitHub Release
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.
- 4d ago First seen · 165 lines · 3,490 tokens per session scan A ba9d69a80b03
DeepSeekMeter AGENTS.md is an instructions file published in the GitHub repository CWNU-Open-Source-Community/DeepSeekMeter (12 stars, last pushed 18d ago), licensed MIT. It adds 3,490 tokens to every session, about $0.0175 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
usage-widget CLAUDE.md
Instructions for emm3ttarmstrong/usage-widget, covering claude code usage widget, build, project structure, data flow and authentication (keychain).
Applite CLAUDE.md
Instructions for milanvarady/Applite, covering claude.md, project overview, build & run, architecture and data flow.
skills-manager CLAUDE.md
Instructions for yibie/skills-manager, covering skills manager - development guide, tui engine: blessed, 核心原则, 参考文档 and 正确的 list 用法.
swift-tui AGENTS.md
AGENTS.md instructions for SwiftTUI/swift-tui, covering agents.md, build & test commands, architecture (one-page summary), development guidelines and code style.
barkeep AGENTS.md
AGENTS.md instructions for iannuttall/barkeep, covering agent notes, product rules, repo map, commands and app structure.
skills-manager AGENTS.md
Instructions for yibie/skills-manager, covering repository agent instructions and ui and interaction work.