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.
curl -O https://raw.githubusercontent.com/foxzool/openlark/main/.agents/skills/openlark-validation-style/SKILL.mdgit clone --depth 1 https://github.com/foxzool/openlarkWrote 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/skills/foxzool/openlark/openlark-validation-style)<a href="https://agentmods.dev/skills/foxzool/openlark/openlark-validation-style"><img src="https://agentmods.dev/badge/skills/foxzool/openlark/openlark-validation-style/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<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="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00080 | $0.02034 |
| Opus 5.5 | $0.00032 | $0.00814 |
| Sonnet 5.5 | $0.00016 | $0.00407 |
| Haiku 4.5 | $0.00008 | $0.00203 |
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 2mo 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 — 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_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(...)(快速失败)。
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:30validate_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(())
}
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.
- 2mo ago First seen · 150 lines · 80 tokens per session scan A ad9bde06bbe0
openlark-validation-style is a skill published in the GitHub repository foxzool/openlark (108 stars, last pushed 3d ago), licensed Apache-2.0. It adds 80 tokens to every session and 2,034 once invoked, about $0.0003 per session on Opus 5.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 skills, from other repositories
fastapi-common
A shared foundation for FastAPI web backends, covering cross-origin access, error handling, request logs, and consistent API responses. FastAPI is a Python framework for building web APIs.
rust-patterns
Idiomatic Rust patterns, ownership, error handling, traits, concurrency, and best practices for building safe, performant applications.
update-v8-version
Update Codex's pinned v8 / rustyv8 versions, validate the release-candidate path, and investigate failed V8 canary or artifact builds. Use when asked to bump V8, update rustyv8 artifacts, prepare or validate a V8 release candidate, check v8-canary, or diagnose why a V8 version update no longer builds.
dd-code-generation
Use pup CLI for immediate Datadog operations or generate code for integration into applications.
omh-rust
This is an OMH rust workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).
metabot-team
Use for the MetaBot Agent Teams CLI: create and inspect durable Teams, spawn teammates, exchange messages, and manage Tasks and Runs across Sessions.