tokless / rules
AGENTS.md75 starsChanged 5 days agoMITView on GitHub
In this repository3 other files it gives its agents.
- AGENTS.mdAGENTS.md
- code-skeletonSkill
- token-auditSkill
The file
We found no rules to list in this file: it reads as prose or reference rather than instructions.
Files
AI 编程省流读取、MCP 瘦身与缓存保护规范 (tokless)
1. 先看代码骨架或按符号切片,再精准读取 (tokless skeleton / tokless slice / repo-skeleton)
- 拒绝无行号盲读与“伪精准”大区间硬读:探索陌生模块或中大型代码文件(约
>200行)前必须先提取语法骨架定位行号,或直接按符号名切片;严禁不抽骨架直接无行号盲读,或用StartLine=1, EndLine=800等泛大跨度区间伪装按行读取来跳过骨架导航(可选启用--with-guard读前护栏后,仅对>800行无行号盲读自动返回全文骨架辅助导航,凡传入显式行号参数一律放行)。 - 两步精准定位与按符号抗漂移切片:
- 探索陌生目录或大文件时,先用
tokless skeleton(兼容repo-skeleton)提取语法签名与[L起-L止]行号(0 模型 Token,比盲读全文省 85%~97% 探索开销):- 全局 CLI(推荐):
tokless skeleton <目录或文件路径> --depth 2 - macOS / Linux:
node "$HOME/.gemini/config/plugins/agy-tokless/tools/repo-skeleton/cli.js" <目录或文件路径> --depth 2 - Windows (PowerShell):
node "$env:USERPROFILE\.gemini\config\plugins\agy-tokless\tools\repo-skeleton\cli.js" <目录或文件路径> --depth 2
- 全局 CLI(推荐):
- 根据骨架中的
[L起-L止]行号,调用read_file(Path, StartLine, EndLine)(或Read(file_path, offset, limit))按需完整读取目标函数或逻辑块(针对骨架已定位的明确目标区间无单次跨度硬限制,可一次读完;未定位前禁止用1-800等满额区间批量扫读多个陌生文件);刚改过文件再查附近函数防偏移、并发编辑同一文件,或只记符号名需跨目录追查定义时,直接用tokless slice <文件或目录>#<符号> -n(或cli.js <路径> --symbol <符号> -n)实时切片,勿脑补推算行号或拉大区间硬读(未命中自动返回候选与目录)。
- 探索陌生目录或大文件时,先用
2. MCP 瘦身与 Antigravity 4x 计费排雷(严禁滥用自定义 Agent)
- 坚持使用默认 Agent(1x 原价):自 Antigravity CLI
>= 1.5.17起,任何自定义 Agent(--agent、.agents/agents/*、插件内置agents/*及派生子智能体)均按custom_agent消耗 4 倍额度(见上游 antigravity-cli#1890)。日常编码与审查一律保持默认 Agent,把约束放在AGENTS.md/GEMINI.md或skills/中,不要再为省 MCP 税而切换到自定义 Agent。 - 1x 原价卸除闲置 MCP 底座税:定期运行
tokless audit project <项目目录>排查高开销或闲置的外部 MCP(同时检查本机 4x 雷区),直接通过agy mcp disable <name>关掉当前任务用不上的 MCP,需要时再agy mcp enable <name>重新开启。
3. 本地账单透视、Prefix Cache 保护与控水位减轮次 (tokless audit / agy-audit)
- 0 Token 账单与底座税体检(支持
list列最近会话、session <ID|latest>查缓存断层/模型切换归因与 Top 5 膨胀步、compare <前ID> <后ID>、project <项目目录>查常驻规则、MCP 底座账单与 4x 雷区):- 全局 CLI(推荐):
tokless audit <list|session|compare|project> <参数> - macOS / Linux:
node "$HOME/.gemini/config/plugins/agy-tokless/tools/agy-audit/cli.js" <list|session|compare|project> <参数> - Windows (PowerShell):
node "$env:USERPROFILE\.gemini\config\plugins\agy-tokless\tools\agy-audit\cli.js" <list|session|compare|project> <参数>
- 全局 CLI(推荐):
- 严控终端输出与保护 Prefix Cache:
run_command必须主动限制长日志输出规模;对话中途保持顶部规则稳定只追加,控制上下文水位与对话轮次以降低累计Cache Read滚雪球并避免触发历史自动压缩(三代模型常见约 256K,四代模型实测跑上 440K 未触发、推测约 512K)。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

