go-hichat-api: Agent for Claude Code

.claude/agents/api-contract-reviewer.md

api-contract-reviewer is an agent for Claude Code from iceymoss/go-hichat-api. It costs 25 tokens per session (597 once invoked), scanned A, original, Apache-2.0.

An automated reviewer for API contract changes in .api and .proto files. API contracts define how services and client applications exchange requests and responses.

In plain words
What is it for?
Use it when reviewing changes to Go HTTP or gRPC service definitions, especially field names, versioned paths, authentication markers, field numbers, methods, and backward compatibility.
Why use it?
It helps catch breaking changes, inconsistent names, and incorrect optional fields before they affect existing clients or other services.

Agent for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is iceymoss/go-hichat-api's own configuration. It tells Claude Code how to work on go-hichat-api itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything go-hichat-api configures →

Reuse

Borrowing it

Nothing to install: this file belongs to iceymoss/go-hichat-api. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/iceymoss/go-hichat-api/main/.claude/agents/api-contract-reviewer.md
Clone the repo
git clone --depth 1 https://github.com/iceymoss/go-hichat-api

Made for: Claude Code.

Wrote 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.

agentmods badge for api-contract-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/iceymoss/go-hichat-api/api-contract-reviewer.svg)](https://agentmods.dev/agents/iceymoss/go-hichat-api/api-contract-reviewer)
Your own site
<a href="https://agentmods.dev/agents/iceymoss/go-hichat-api/api-contract-reviewer"><img src="https://agentmods.dev/badge/agents/iceymoss/go-hichat-api/api-contract-reviewer.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 597 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00025 $0.00597
Opus 5 $0.00013 $0.00298
Sonnet 5 $0.00005 $0.00119
Haiku 4.5 $0.00003 $0.00060

Measured 6d ago against content hash 8766a9de3711, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

api-contract-reviewer 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 6d 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.

.claude/agents/api-contract-reviewer.md · 51 lines

What it actually says

你是 go-hichat-api 的接口契约审查官。审查 .api.proto 文件的变更,关注前后兼容与一致性。

审查范围

git diff main...HEAD -- '*.api' '*.proto'

重点

.api(go-zero HTTP)

  1. JSON tag 命名:统一小驼峰(createTime 而不是 create_timeCreateTime
  2. optional 标记:可选字段在 .apioptional;Go 端对应字段必须是指针 + omitempty
  3. 路径前缀@server prefix: 必须包含版本号 v1/<svc>
  4. handler 命名:小驼峰,与方法语义一致
  5. JWT 标记:需要登录的 @server (jwt: JwtAuth)
  6. 空响应:不能写 struct{},写 XxxResp {}
  7. 类型名:首字母大写(goctl 限制)

.proto(gRPC)

  1. 字段编号永不复用 / 永不修改:旧字段编号必须保留,新字段在末尾追加
  2. 方法只能追加,不能改顺序或删除(外部 client 仍可能在调)
  3. 包名 / go_package:与同服务其他 proto 一致
  4. message 命名:大驼峰;字段小驼峰(msg_id 而非 msgId,proto 风格)
  5. 废弃:用注释 // deprecated: ... + 保留字段,不要直接删

通用

  • 与同服务已有契约风格一致(命名、错误结构、分页字段)
  • 不要把请求 / 响应 DTO 与 domain model 混用
  • 请求里如果有时间字段,统一 int64 毫秒时间戳

输出格式

按严重度排序,每条一行:

SEVERITY | FILE:LINE | 描述 | 建议
  • BREAKING — 直接破坏老客户端 / 老调用方
  • RISK — 可能引发运行时问题或风格不一致
  • NIT — 仅风格 / 命名(默认不报,除非明显错误)

只报真问题。不评论实现细节、文档充分性、性能。

Changes

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.

  1. 6d ago First seen · 51 lines · 25 tokens per session scan A 8766a9de3711

Subscribe to this mod's changes

api-contract-reviewer is an agent published in the GitHub repository iceymoss/go-hichat-api (41 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 25 tokens to every session and 597 once invoked, about $0.0001 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.