Borrowing it
Nothing to install: this file belongs to 4t145/lark-acp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/4t145/lark-acp/main/CLAUDE.mdgit clone --depth 1 https://github.com/4t145/lark-acpWrote 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/4t145/lark-acp/claude-md)<a href="https://agentmods.dev/instructions/4t145/lark-acp/claude-md"><img src="https://agentmods.dev/badge/instructions/4t145/lark-acp/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.1 | $0.02801 | $0.02801 |
| Opus 5 | $0.01401 | $0.01401 |
| Sonnet 5 | $0.00560 | $0.00560 |
| Haiku 4.5 | $0.00280 | $0.00280 |
Grade A, and why
lark-acp CLAUDE.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 7d 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 — 213 lines — stays where its author put it; the contents beside it link to each section on GitHub.
LARK API
本项目是把飞书作为ACP的客户端的桥接库,虽然有API SDK调用,但是也不免会涉及到参考飞书官方API文档,必要时候需要参看:https://open.larksuite.com/document/server-docs/getting-started/getting-started
ACP
ACP(Agent Communication Protocol)参考文档 https://agentcommunicationprotocol.dev/core-concepts/architecture
TypeScript 工程准则(TypeScript 5.x / Strict Mode)
适用于本仓库所有 TypeScript 代码。AI 助手与人类贡献者都应遵守。
1. 避免魔法值
除显而易见的平凡值(0、1、一天 24 小时)外,禁止硬编码未加说明的数字或字符串字面量。
- 使用
const常量,配合as const收窄字面量类型;或定义字面量 union。 - 优先使用所引入库已暴露的常量;库中确无定义时再自行声明。
- 常量应放在与其语义最贴近的模块中,不要堆到一个全局
constants.ts。
2. 错误处理:默认抛异常 + 文档化
TS / Node 生态以异常为主,默认采用抛异常 + JSDoc @throws 文档化的风格,与标准库、绝大多数第三方库保持一致。
- 任何可能抛出(含
Promisereject)的函数,必须在 JSDoc 中通过@throws描述失败原因与错误类型。 - 错误类型用自定义
Error子类区分语义,并带上有用的上下文字段;不要把多种语义不同的错误合并成同一个原始Error。 - 仅在以下特定边界才考虑 Result / Either 风格的返回类型(明确"失败是预期分支而非异常"):
- schema 校验 / 反序列化(如
zod的safeParse) - 用户输入 / 表单校验
- 解析器 / 协议握手等"成功失败都是常规结果"的场景
- schema 校验 / 反序列化(如
- 不要为了一致性把整个工程改成 Result 风格——会和生态摩擦严重。
3. 优先使用原生异步模式
- 使用
async/await与原生Promise。 - 不要无理由引入 RxJS、Effect-TS 等重型抽象。
- 并发原语优先
Promise.all/Promise.allSettled与AbortController/AbortSignal,而不是再造一套调度层。 - 需要节流 / 限流时使用
p-limit、p-queue、p-retry等成熟库。
4. 类型系统的纪律
不安全的类型断言和 any 会让 strict mode 形同虚设。
- 禁止
any:需要"任意类型"的位置一律用unknown加类型守卫。 - 禁止不安全的
as——即"绕过类型检查的强转"。以下用法是允许甚至推荐的:as const:字面量收窄satisfies之后的隐式收窄(优先satisfies而不是as)- 经过类型守卫 / schema 校验后的合法收窄
- DOM API 中已知具体子类型时的向下转型(写一行注释说明)
- 禁止
!非空断言:通过 early return / 类型守卫 /??/?.处理;确实必须断言时写一行注释说明理由(与 Rustexpect("...")同义)。 - 解析外部数据(HTTP / 文件 / 用户输入 / IPC)一律走 schema 校验(推荐
zod),不允许直接as SomeType。
5. 保持代码可维护性
- 长函数拆分为聚焦的辅助函数。
- 函数 / 变量使用有意义的名称,不要
data、info、tmp。 - 每个函数只做一件事。
- 默认写 pure function,副作用收敛到模块边界(IO / 网络 / 全局状态)。
- 仅为非显而易见的逻辑添加简洁注释;不要写"这段代码做什么",要写"为什么这么做"。
6. 扁平化控制流
- early return / guard clause 让主路径保持在外层作用域。
- 类型收窄替代多层
if:if (!user) return; user.xxx优于嵌套if (user) { ... }。 - 错误分支优先
throw或return,避免用else包裹主逻辑。 - discriminated union +
switch+never穷尽性检查,代替散落的if / else if链:
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.
- 7d ago First seen · 213 lines · 2,801 tokens per session scan A e2eab45ce543
lark-acp CLAUDE.md is an instructions file published in the GitHub repository 4t145/lark-acp (12 stars, last pushed 3mo ago), licensed MIT. It adds 2,801 tokens to every session, about $0.0140 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
CopilotTraining typescript.instructions.md
Instructions for MSBart2/CopilotTraining, covering typescript development standards, type definitions, type safety, generics and union types.
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.
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).
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).
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.