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/jianzhoujz/input-indicator/agents-mdgit clone --depth 1 https://github.com/jianzhoujz/input-indicatorWrote 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/jianzhoujz/input-indicator/agents-md)<a href="https://agentmods.dev/instructions/jianzhoujz/input-indicator/agents-md"><img src="https://agentmods.dev/badge/instructions/jianzhoujz/input-indicator/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.07192 | $0.07192 |
| Opus 5 | $0.03596 | $0.03596 |
| Sonnet 5 | $0.01438 | $0.01438 |
| Haiku 4.5 | $0.00719 | $0.00719 |
Grade A, and why
input-indicator 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 — 439 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — 给 AI 协作 Agent 的项目指南
本文件是项目唯一的「面向 AI 阅读」的入口文档。任何 AI Agent(Claude Code / Cursor / Codex / Gemini Code Assist / Cline 等)在开始工作前 都应先读完本文,再去翻代码。本文回答四个问题:
- 这是什么项目? —— 一句话定位 + 用户视角
- 代码长什么样? —— 单文件 Swift 应用的结构地图
- 状态推断怎么做?为什么这么做? —— 核心算法与设计原则
- 开发与发布流程? —— 构建、安装、调试、提交规范
1. 项目一句话定位
豆包输入法 / 微信输入法的 macOS 菜单栏中英文状态指示器。单文件
Swift 应用(Sources/DoubaoInputIndicator.swift,约 1700
行),通过编译期 -D WETYPE flag 切出两个产品(豆包版 / 微信版)。
用户视角
菜单栏出现一个 emoji 图标,指示当前 IME 的中英文子状态:
| 图标 | 含义 |
|---|---|
🇨🇳 |
中文模式 |
🇺🇸 |
英文模式 |
🫥 |
状态未知,需要校准或等待自动校准 |
🤐 |
当前不是目标输入法(豆包/微信),不显示状态 |
🥶 |
输入监控权限未开启 |
LSUIElement accessory 应用——无 Dock 图标、无主窗口,常驻菜单栏。
为什么需要这个东西
豆包、微信输入法的「中文 / 英文」子状态保存在它们自己的进程内存里, 没有任何官方 API 能从外部读到(详见 §3.4 的调研结论)。系统输入 法菜单只能显示「当前选中了哪个输入法」,无法显示该输入法内部的中英 状态。因此本项目用多种间接信号(Shift 键、候选词窗、AX 模式指示框) 推断状态。
2. 代码结构地图
仓库布局
input-indicator/
├── AGENTS.md ← 本文件,AI 入口
├── README.md ← 用户视角的安装与使用文档
├── DEVELOPMENT_CONTEXT.md ← 仅本地,作者私人开发笔记(.gitignore)
├── Sources/
│ └── DoubaoInputIndicator.swift ← 全部业务代码,单文件
├── Resources/
│ └── AppIcon.icns ← 应用图标
├── tools/
│ └── make_app_icon.swift ← 从 emoji 生成 iconset 的脚本
├── packaging/
│ └── dmg/ ← DMG 打包用的 .DS_Store / 背景图
├── scripts/
│ └── package-release.sh ← 同时打两个 DMG 给 Homebrew tap 用
├── docs/
│ └── images/ ← README 用图
├── build.sh ← swiftc + lipo + codesign,输出 build/<App>.app
├── install.sh ← 构建 + 装到 /Applications + LaunchAgent
├── uninstall.sh ← 反向操作
└── package-dmg.sh ← 从 build/<App>.app 打 dmg 到 dist/
单文件源码结构(Sources/DoubaoInputIndicator.swift)
按出现顺序:
| 行号 | 符号 | 职责 |
|---|---|---|
| L7-L38 | enum DisplayMode |
状态枚举(chinese / english / unknown / nonTarget) + 显示用的 emoji 标题 |
| L40-L47 | struct AppConfig |
变体配置:app 名、目标 IME bundle ID、UserDefaults key、日志文件名 |
| L49-L82 | GitHub release 工具 | VersionNumber 比较 + 检查更新所需的 URL 常量 |
| L84-L102 | #if WETYPE 分支 |
唯一编译期分歧:豆包 vs 微信的 appConfig 实例 |
| L104-L131 | class InputSourceReader |
TISCopyCurrentKeyboardInputSource 的封装,返回当前输入源标识 |
| L133-L347 | class CandidateWindowMonitor |
候选窗 / 模式指示器小窗口的扫描与 AX 文本读取(核心算法在这里) |
| L349-L1694 | class AppDelegate |
状态机、事件监听、菜单构建、权限管理、日志、自启、更新检查 |
| L1696-L1699 | 入口 | NSApplication.shared.run() |
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 · 439 lines · 7,192 tokens per session scan A 5445e6900c01
input-indicator AGENTS.md is an instructions file published in the GitHub repository jianzhoujz/input-indicator (22 stars, last pushed 3mo ago), licensed MIT. It adds 7,192 tokens to every session, about $0.0360 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
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
next.js AGENTS.md
Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.