kiro2api CLAUDE.md

kiro2api CLAUDE.md is an instructions file for coding agents from caidaoli/kiro2api. It costs 1,249 tokens per session, scanned A, original, MIT.

Repository instructions for working on kiro2api, an AI API proxy server that connects Anthropic and OpenAI APIs with AWS CodeWhisperer. They cover the project, code exploration, editing rules, build commands, tests, and tools.

In plain words
What is it for?
Use them when building, testing, formatting, checking, or running the kiro2api Go project.
Why use it?
They give an agent the project's expected workflow and commands, including how to explore and edit the Go code safely.

Instructions file

Install

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.

agentmods
npx agentmods add instructions/caidaoli/kiro2api/claude-md
Clone the repo
git clone --depth 1 https://github.com/caidaoli/kiro2api

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 kiro2api CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/caidaoli/kiro2api/claude-md.svg)](https://agentmods.dev/instructions/caidaoli/kiro2api/claude-md)
Your own site
<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>
Per session 1,249 This file is loaded in full into every session.
When invoked 1,249 The same file — it is already loaded in full.
Security scan A 1 finding. 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 $0.01249 $0.01249
Opus 5 $0.00624 $0.00624
Sonnet 5 $0.00250 $0.00250
Haiku 4.5 $0.00125 $0.00125

Measured 5d ago against content hash de47660854a7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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 \
CLAUDE.md · 120 lines

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_bodyinsert_after_symbolinsert_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.Buildermake([]byte, size)
  • 信任 Go 1.24 GC 和逃逸分析
  • 仅在 QPS > 1000 且对象 > 10KB 时考虑对象池

代码质量

  • 遵循 KISS、YAGNI、DRY、SOLID 原则
  • 避免过度抽象和预先优化
  • 定期清理死代码和未使用功能
  • 所有包测试通过率 100%

Read the full file on GitHub · 120 lines

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. 5d ago First seen · 120 lines · 1,249 tokens per session scan A de47660854a7

Subscribe to this mod's changes

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.

Related

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.

openai/codex · 5,182 tokens

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

microsoft/vscode · 6,785 tokens

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.

github/spec-kit · 7,104 tokens

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.

vercel/next.js · 7,296 tokens

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.

langchain-ai/langchain · 4,469 tokens

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

microsoft/vscode · 5,001 tokens