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/caidaoli/kiro2api/claude-mdgit clone --depth 1 https://github.com/caidaoli/kiro2apiWrote 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/caidaoli/kiro2api/claude-md)<a href="https://agentmods.dev/instructions/caidaoli/kiro2api/claude-md"><img src="https://agentmods.dev/badge/instructions/caidaoli/kiro2api/claude-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.01249 | $0.01249 |
| Opus 5 | $0.00624 | $0.00624 |
| Sonnet 5 | $0.00250 | $0.00250 |
| Haiku 4.5 | $0.00125 | $0.00125 |
Grade A, and why
kiro2api CLAUDE.md scanned grade A with 1 finding 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 5d 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.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
curl -X POST http://localhost:8080/v1/messages \ How it starts
The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
项目概述
高性能 AI API 代理服务器,桥接 Anthropic/OpenAI API 与 AWS CodeWhisperer。支持流式响应、工具调用、多账号池管理。
代码探索规范
⚠️ 强制要求:优先使用 Serena MCP 工具进行代码探索和编辑
- 代码探索: 使用
mcp__serena__get_symbols_overview获取文件概览,然后使用mcp__serena__find_symbol精确读取符号 - 代码搜索: 使用
mcp__serena__search_for_pattern进行模式搜索 - 代码编辑: 使用
mcp__serena__replace_symbol_body、insert_after_symbol、insert_before_symbol进行符号级编辑 - 依赖分析: 使用
mcp__serena__find_referencing_symbols查找引用关系
禁止: 直接使用 Read 工具读取整个 Go 源代码文件,除非是配置文件(.json、.yaml、.env)或文档文件(.md)。
开发命令
# 编译和运行
go build -o kiro2api main.go
./kiro2api
# 测试
go test ./... # 运行所有测试
go test ./parser -v # 单包测试(详细输出)
go test ./... -bench=. -benchmem # 基准测试
# 代码质量
go vet ./... # 静态检查
go fmt ./... # 格式化
golangci-lint run # Linter
# 运行模式
GIN_MODE=debug LOG_LEVEL=debug ./kiro2api # 开发模式
GIN_MODE=release ./kiro2api # 生产模式
# 生产构建
go build -ldflags="-s -w" -o kiro2api main.go
技术栈
- Go: 1.24.0
- Web: gin-gonic/gin v1.11.0
- JSON: bytedance/sonic v1.14.1
核心架构
请求流程:认证 → 请求分析 → 格式转换 → 流处理 → 响应转换
包职责:
server/- HTTP 服务器、路由、处理器、中间件converter/- API 格式转换(Anthropic ↔ OpenAI ↔ CodeWhisperer)parser/- EventStream 解析、工具调用处理、会话管理auth/- Token 管理(顺序选择策略、并发控制、使用限制监控)utils/- 请求分析、Token 估算、HTTP 工具types/- 数据结构定义logger/- 结构化日志config/- 配置常量和模型映射
关键实现:
- Token 管理:顺序选择策略,支持 Social/IdC 双认证
- 流式优化:零延迟传输,直接内存分配(已移除对象池)
- 智能超时:根据 MaxTokens、内容长度、工具使用动态调整
- EventStream 解析:
CompliantEventStreamParser(BigEndian 格式)
开发原则
内存管理:
- 已移除
sync.Pool对象池(KISS + YAGNI) - 直接使用
bytes.NewBuffer(nil)、strings.Builder、make([]byte, size) - 信任 Go 1.24 GC 和逃逸分析
- 仅在 QPS > 1000 且对象 > 10KB 时考虑对象池
代码质量:
- 遵循 KISS、YAGNI、DRY、SOLID 原则
- 避免过度抽象和预先优化
- 定期清理死代码和未使用功能
- 所有包测试通过率 100%
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.
- 5d ago First seen · 120 lines · 1,249 tokens per session scan A de47660854a7
kiro2api CLAUDE.md is an instructions file published in the GitHub repository caidaoli/kiro2api (635 stars, last pushed 2mo ago), licensed MIT. It adds 1,249 tokens to every session, about $0.0062 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other instructions, from other repositories
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.
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.
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
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).