Agent skill

Openlark Validation Style

by foxzool in foxzool/openlark

OpenLark Rust SDK 的 validate() 写法规范(必填校验 / 空白字符串处理)。当需要统一或评审 feature crate 中 validate(&self) - SDKResult<() 的实现、确定何时用 validaterequired!

Apache-2.0Auto-check passedProductivity & Automation

Install Openlark Validation Style

skills CLI
$ npx skills add foxzool/openlark --skill openlark-validation-style -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install foxzool/openlark openlark-validation-style --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/foxzool/openlark.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/openlark-validation-style .claude/skills/openlark-validation-style && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
openlark-validation-style
GitHub stars
106
Token cost
~1.3k tokens
SKILL.md length
200 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
Apache-2.0

At a glance

OpenLark Rust SDK 的 validate() 写法规范(必填校验 / 空白字符串处理)。当需要统一或评审 feature crate 中 validate(&self) - SDKResult<() 的实现、确定何时用 validaterequired!

  • Works in 4 steps: 字符串字段默认用 validate_required! 宏——字符串已自动… → 列表字段用 validate_required_list! 同时校验非空 +… → 多条校验:连续写多个宏(遇首个失败即 return),或用… → …
  • Tasks that involve Messaging and chat bots
  • SKILL.md covers 🧭 技能路由指南, 目标, 规则 and 速查
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Openlark Validation Style is an agent skill from foxzool/openlark. OpenLark Rust SDK 的 validate() 写法规范(必填校验 / 空白字符串处理)。当需要统一或评审 feature crate 中 validate(&self) - SDKResult<() 的实现、确定何时用 validaterequired! 宏、空白字符串是否视为空、列表字段同时校验非空与限长等问题时使用。

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Productivity & Automation, covering Messaging and chat bots. It works with Rust and Feishu (Lark). The repository describes itself as: 飞书开放平台的非官方 Rust SDK,支持自定义机器人、长连接机器人、云文档、飞书卡片、消息、群组等 API 调用。 The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Messaging and chat bots

Example prompts

  • “/openlark-validation-style”

Requirements

  • Pre-approved tools (allowed-tools): Read, Grep

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. 字符串字段默认用 validate_required! 宏——字符串已自动 trim,传 self.field 即可
  2. 列表字段用 validate_required_list! 同时校验非空 + 最大长度
  3. 多条校验:连续写多个宏(遇首个失败即 return),或用 DefaultValidateBuilder 聚合
  4. 禁止在 feature crate 内重复定义 validate_required! / validate_required_list!(或同语义宏)

What it can do on your machine

Read from SKILL.md and the folder at commit 6128d6d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are rust).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Openlark Validation Style loads about 1.3k tokens when it runs. Until then it costs about 50 tokens; SKILL.md has 200 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~50
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from foxzool/openlark at commit 6128d6d, republished under its Apache-2.0 licence (© foxzool). 200 words, ~1,302 tokens.

Download SKILL.mdSave it as .claude/skills/openlark-validation-style/SKILL.md (or your agent's skills folder).
name
openlark-validation-style
description
OpenLark Rust SDK 的 validate() 写法规范(必填校验 / 空白字符串处理)。当需要统一或评审 feature crate 中 validate(&self) -> SDKResult<()> 的实现、确定何时用 validate_required! 宏、空白字符串是否视为空、列表字段同时校验非空与限长等问题时使用。
allowed-tools
Read, Grep
argument-hint
[crate-name|path|request-file]

权威源: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_trimmed(crates/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(...)(快速失败)。

rust
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),同样直接传字段即可:

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

若列表字段还需要“最大长度”限制,应改用下面的 validate_required_list!,不要在 validate_required! 之外再手写长度判断。

2) 列表字段用 validate_required_list! 同时校验非空 + 最大长度

validate_required_list!(field, max_len, msg) 一次完成两项检查:先判空、再判是否超过 max_len,任一失败即快速返回(crates/openlark-core/src/lib.rs:72-82)。msg 用于两种失败场景,建议写明两条约束。

rust
fn validate(&self) -> openlark_core::SDKResult<()> {
    openlark_core::validate_required_list!(self.user_ids, 50, "user_ids 不能为空且不能超过 50 个");
    Ok(())
}

广泛使用于 hr/docs/ai/workflow/mail/communication/user 等,例如 crates/openlark-ai/src/ai/translation/v1/text/translate.rs:32 validate_required_list!(self.texts, 50, "texts 不能为空且不能超过 50 个");, crates/openlark-docs/src/base/bitable/v1/app/table/record/batch_update.rs:114 validate_required_list!(self.records, 1000, "records 不能为空且单次最多 1000 条");。

3) 多条校验:连续写多个宏(遇首个失败即 return),或用 DefaultValidateBuilder 聚合

项目没有统一的“聚合多错误”宏。两种推荐写法:

a) 连续宏——快速失败(绝大多数场景首选)

宏在失败时直接 return Err(...),因此按字段顺序连续书写即可;首个失败字段处返回。

rust
fn validate(&self) -> openlark_core::SDKResult<()> {
    openlark_core::validate_required!(self.app_token, "app_token 不能为空");
    openlark_core::validate_required!(self.table_id, "table_id 不能为空");
    openlark_core::validate_required_list!(self.records, 1000, "records 不能为空且单次最多 1000 条");
    Ok(())
}

b) 需要收集多个错误一次性返回——用 DefaultValidateBuilder

openlark_core::validation::DefaultValidateBuilder 实现 ValidateBuilder trait,链式 required / length / custom 累积错误,build() 返回 Result<String, Vec<String>>(crates/openlark-core/src/validation/core.rs:154-266)。

rust
use openlark_core::validation::{DefaultValidateBuilder, ValidateBuilder};

fn validate(&self) -> openlark_core::SDKResult<()> {
    let result = DefaultValidateBuilder::new()
        .required(Some(self.name.clone()), "name")
        .length(self.code.clone(), 1, 32, "code")
        .build();
    match result {
        Ok(_) => Ok(()),
        Err(errs) => Err(openlark_core::CoreError::validation_msg(errs.join("; "))),
    }
}

注意:DefaultValidateBuilder 当前仅在 core 内定义与使用,feature crate 的现码一律采用方式 (a) 的连续宏写法。优先沿用 (a);确有聚合需求时再评估 (b)。

4) 禁止在 feature crate 内重复定义 validate_required! / validate_required_list!(或同语义宏)

统一复用 openlark_core::validate_required! 与 openlark_core::validate_required_list!,避免各 crate 的判空规则/错误类型不一致。

同步约束:openlark_core::validation::validate_required(函数)已删除,不要引用或照抄旧文档里的函数写法,否则编译失败(见 crates/openlark-core/AGENTS.md:91,125 反模式)。

速查

  • 字符串必填 → validate_required!(self.field, "...");自动 trim,空白算空,不要手动 .trim()
  • 列表必填(不限长)→ validate_required!(self.items, "...")
  • 列表必填 + 限长 → validate_required_list!(self.items, max_len, "不能为空且不能超过 N 个")
  • 多条校验按顺序快速失败 → 连续写多个宏(首个失败即 return)
  • 必须一次性返回全部错误 → DefaultValidateBuilder(openlark_core::validation::DefaultValidateBuilder),项目无统一聚合宏

© foxzool, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/openlark-validation-style of foxzool/openlark.

Open the folder on GitHubat commit 6128d6d

Compare with similar skills

Openlark Validation Style next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Openlark Validation Style compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Openlark Validation Style this skillfoxzool/openlark106—~1.3kAutomated safety check: PassApache-2.0
Feishu Docopenclaw/openclaw392k—~516Automated safety check: PassMIT
Claude To Imop7418/Claude-to-IM-skill2.9k—~3.4kAutomated safety check: NotesMIT
Feishu Docraucvr/Group-Goki1123 repos~592Automated safety check: PassMIT
Feishu BridgeAlexAnys/feishu-openclaw3171 repos~615Automated safety check: PassNone
Content CollectorvigorX777/content-collector-skill240—~2kAutomated safety check: PassNone

Similar skills

  • Feishu Doc

    openclaw/openclaw

    Feishu document read/write workflows. An agent skill from openclaw/openclaw.

    392k GitHub stars~516 tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Claude To Im

    op7418/Claude-to-IM-skill

    Bridge THIS Claude Code or Codex session to Telegram, Discord, Feishu/Lark, QQ, or WeChat so the user can chat with Claude from their phone.

    2.9k GitHub stars~3.4k tokensUpdated 6 mo ago
    Productivity & AutomationAuto-check: notes
  • Feishu Doc

    raucvr/Group-Goki

    Feishu document read/write operations. An agent skill from raucvr/Group-Goki.

    112 GitHub starsUsed in 3 repos~592 tokens
    Productivity & AutomationAuto-check passed
  • Feishu Bridge

    AlexAnys/feishu-openclaw

    Connect a Feishu (Lark) bot to Clawdbot via WebSocket long-connection.

    317 GitHub starsUsed in 1 repo~615 tokens
    Productivity & AutomationAuto-check passed
  • Content Collector

    vigorX777/content-collector-skill

    Collect social media content (X/Twitter, WeChat, Jike, Reddit, etc.) into Feishu bitable.

    240 GitHub stars~2k tokensUpdated 6 mo ago
    Productivity & AutomationAuto-check passed
  • Feishu Rich Card Sender

    xjtulyc/MedgeClaw

    Sends interactive Feishu group-chat cards that mix markdown text with uploaded chart or diagram images, for progress updates and analysis results.

    617 GitHub starsUsed in 1 repo~734 tokens
    Productivity & AutomationAuto-check: notes

More from foxzool/openlark

All 8 skills in this repo
  • Verify Openlark

    foxzool/openlark

    Prove OpenLark (Feishu/Lark Rust SDK) changes the way a maintainer does — cargo build/test, public examples, API coverage and field-verify harnesses.

    106 GitHub stars~1.8k tokensUpdated 6 days ago
    Auto-check passed
  • Openlark API

    foxzool/openlark

    OpenLark 项目 API 接口实现规范(速查)。用于添加/重构飞书开放平台 API:确定落盘路径、实现 Body/Response + Builder(Request)、对齐 endpoints 常量/enum、补齐 mod.rs 导出,并明确"调用服务端 API"的方法签名/RequestOption 传递约定。触发关键词:API 接口、API 文件、飞书 API、添加…

    106 GitHub stars~3k tokensUpdated 6 days ago
    Auto-check: notes
  • OpenLark API 字段核对技能。用于新增/重构飞书 API 后,核对 Rust 实现的请求体/响应体字段是否与飞书官方文档一致。通过 playwright 渲染飞书 SPA 文档页面,提取真实的请求/响应字段定义,对比代码实现找出不符项。触发关键词:字段核对、字段验证、字段不符、文档核对、核对请求字段、核对响应字段、飞书文档字段、推断字段、user 级接口、用户级接口字段

    106 GitHub stars~2.3k tokensUpdated 6 days ago
    Auto-check: notes
  • Openlark Code Standards

    foxzool/openlark

    OpenLark 项目代码规范检查技能。用于快速审查仓库内的架构一致性、API 实现套路、参数校验、命名与导出规范,并输出可执行检查清单与证据路径。Triggers: code review / consistency check / architecture audit / 规范检查 / 风格一致性 / 体检 / 对齐约定。项目锚点见 AGENTS.mdCONVENTIONS 与…

    106 GitHub stars~1.8k tokensUpdated 6 days ago
    Auto-check: notes
  • Openlark Design Review

    foxzool/openlark

    OpenLark Rust SDK 的代码设计/公共 API 规范审查技能(面向 crate/模块)。用于系统化检查入口设计、feature gating、Request/Service/Builder 一致性、端点体系、Config/错误处理、导出与文档同步、测试与告警控制,并输出按优先级排序的整改清单与可落地改造方案。触发关键词:设计审查、crate 设计、API 设计、public…

    106 GitHub stars~2.1k tokensUpdated 6 days ago
    Auto-check: notes
  • Openlark API Validation

    foxzool/openlark

    OpenLark API 覆盖率验证技能。用于验证各 crate 的 API 实现数量与覆盖率,基于 tools/validateapis.py 脚本和 apilistexport.csv 对比实际代码实现。触发关键词:API 验证、API 覆盖率、验证 API 数量、检查 API 实现、API 统计

    106 GitHub stars~2k tokensUpdated 6 days ago
    Auto-check: notes

Questions about Openlark Validation Style

What does Openlark Validation Style do?

OpenLark Rust SDK 的 validate() 写法规范(必填校验 / 空白字符串处理)。当需要统一或评审 feature crate 中 validate(&self) - SDKResult<() 的实现、确定何时用 validaterequired! Openlark Validation Style is an agent skill from foxzool/openlark. OpenLark Rust SDK 的 validate() 写法规范(必填校验 / 空白字符串处理)。当需要统一或评审 feature crate 中 validate(&self) - SDKResult<() 的实现、确定何时用 validaterequired!

When should I use Openlark Validation Style?

Openlark Validation Style fits situations like: tasks that involve Messaging and chat bots.

How do I install Openlark Validation Style in Claude Code?

Run `npx skills add foxzool/openlark --skill openlark-validation-style -a claude-code`. Or copy the skill folder (.agents/skills/openlark-validation-style in foxzool/openlark) into .claude/skills/openlark-validation-style in your project. Claude Code loads it when a task matches its description.

How do I install Openlark Validation Style in Codex?

Run `npx skills add foxzool/openlark --skill openlark-validation-style -a codex`. Or copy the skill folder (.agents/skills/openlark-validation-style in foxzool/openlark) into .agents/skills/openlark-validation-style in your project. Codex loads it when a task matches its description.

Can I use Openlark Validation Style in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add foxzool/openlark --skill openlark-validation-style -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/openlark-validation-style, .gemini/skills/openlark-validation-style, .github/skills/openlark-validation-style and .opencode/skills/openlark-validation-style in your project.

What does Openlark Validation Style need to run?

SKILL.md names no scripts, command-line tools or credentials: Openlark Validation Style is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Grep.

Does Openlark Validation Style access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Openlark Validation Style safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Openlark Validation Style use?

Openlark Validation Style is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Openlark Validation Style use?

About 1.3k tokens (SKILL.md is roughly 5.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Openlark Validation Style?

Skills that share tags, products or a category with Openlark Validation Style: Feishu Doc (openclaw/openclaw, 392k stars), Claude To Im (op7418/Claude-to-IM-skill, 2.9k stars), Feishu Doc (raucvr/Group-Goki, 112 stars) and Feishu Bridge (AlexAnys/feishu-openclaw, 317 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Openlark Validation Style?

foxzool (a GitHub user) maintains it in foxzool/openlark, which has 106 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on October 3, 2026.

Source: foxzool/openlark on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.