openlark: Skill for Claude Code

.agents/skills/openlark-validation-style/SKILL.md

openlark-validation-style is a skill for Claude Code from foxzool/openlark. It costs 80 tokens per session (2,034 once invoked), scanned A, original, Apache-2.0.

A Rust SDK guide for writing consistent validate methods, which check whether request data is acceptable before sending it. It covers required fields, blank strings, list limits, and how multiple errors are handled.

In plain words
What is it for?
Use it when adding or reviewing a request or builder's validate method, especially for required strings, required lists, trimming whitespace, length limits, and validation macros.
Why use it?
It removes uncertainty and keeps validation behavior consistent across different feature crates, avoiding repeated debate over empty values and error messages.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: installed under .agents/ (shared by several agents); mentions AGENTS.md.

This is foxzool/openlark's own configuration. It tells Claude Code how to work on openlark 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 openlark configures →

Reuse

Borrowing it

Nothing to install: this file belongs to foxzool/openlark. 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/foxzool/openlark/main/.agents/skills/openlark-validation-style/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/foxzool/openlark

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 openlark-validation-style

README.md
[![agentmods](https://agentmods.dev/badge/skills/foxzool/openlark/openlark-validation-style.svg)](https://agentmods.dev/skills/foxzool/openlark/openlark-validation-style)
Your own site
<a href="https://agentmods.dev/skills/foxzool/openlark/openlark-validation-style"><img src="https://agentmods.dev/badge/skills/foxzool/openlark/openlark-validation-style.svg" alt="Measured on agentmods" height="20"></a>
Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,034 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00080 $0.02034
Opus 5 $0.00040 $0.01017
Sonnet 5 $0.00016 $0.00407
Haiku 4.5 $0.00008 $0.00203

Measured 7d ago against content hash ad9bde06bbe0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

openlark-validation-style 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.

.agents/skills/openlark-validation-style/SKILL.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.

权威源:crates/openlark-core/AGENTS.md,本文件与之冲突时以它为准。

OpenLark Validation Style

🧭 技能路由指南

本技能适用场景:

  • 需要统一/评审 validate() 方法写法
  • 不确定字符串字段是否要 .trim()、空白字符串算不算空
  • 列表字段需要同时校验“非空 + 最大长度”
  • 多条校验如何组织(连续宏快速失败 / 用构建器聚合)

其他技能:

  • 项目级代码规范检查(架构/API/导出/校验一体)→ Skill(openlark-code-standards)
  • 添加/重构 API → Skill(openlark-api)
  • 审查整体设计规范 → Skill(openlark-design-review)

关键词触发映射

  • validate、必填校验、validate_required、validate_required_list、空白字符串、校验聚合 → openlark-validation-style
  • 代码规范、规范检查、风格一致性、体检 → openlark-code-standards
  • 架构设计、public API、收敛方案、feature gating、兼容策略 → openlark-design-review
  • 新增 API、重构 API、Builder、Request/Response、mod.rs 导出 → openlark-api
  • 覆盖率、缺失 API、实现数量、CSV 对比 → openlark-api-validation

双向跳转规则

  • 若校验问题已扩展到命名/导出/端点体系,转 openlark-code-standards
  • 若校验争议本质是架构范式冲突(例如 Request/Service 边界),转 openlark-design-review

目标

在各 feature crate 的请求/Builder validate(&self) -> SDKResult<()> 中统一:

  • 必填字段校验写法(减少样板代码)
  • 空白字符串是否视为缺失(避免不同 crate 行为漂移)
  • 失败时返回的错误类型与消息风格

规则

1) 字符串字段默认用 validate_required! 宏——字符串已自动 trim,传 self.field 即可

validate_required! 宏内部调用 Validatable::is_empty_trimmedcrates/openlark-core/src/lib.rs:53-59)。 对 &str / String 的实现是 self.trim().is_empty()crates/openlark-core/src/validation/validatable.rs:7-17,提交 6fe4a6ca6)。

也就是说:字符串字段会自动 trim,纯空白字符串视为空。直接传 self.field,不要再额外 .trim()

适用场景:必填校验失败就应该立即返回 Err(...)(快速失败)。

fn validate(&self) -> openlark_core::SDKResult<()> {
    // 字符串字段:自动 trim,空白算空,直接传字段本身
    openlark_core::validate_required!(self.app_token, "app_token 不能为空");
    openlark_core::validate_required!(self.table_id, "table_id 不能为空");
    Ok(())
}

现码惯例一致,例如 crates/openlark-ai/src/ai/document_ai/v1/bank_card/recognize.rs:30 validate_required!(self.file, "file 不能为空"); —— 字符串字段未手动 .trim()

非字符串容器(如 Vec<T> / &[T])的 is_empty_trimmed 退化为“长度是否为 0”(validatable.rs:25-35),同样直接传字段即可:

fn validate(&self) -> openlark_core::SDKResult<()> {
    openlark_core::validate_required!(self.items, "items 不能为空");
    Ok(())
}

Read the full file on GitHub · 150 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. 7d ago First seen · 150 lines · 80 tokens per session scan A ad9bde06bbe0

Subscribe to this mod's changes

openlark-validation-style is a skill published in the GitHub repository foxzool/openlark (105 stars, last pushed 4d ago), licensed Apache-2.0. It adds 80 tokens to every session and 2,034 once invoked, about $0.0004 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.