openlark: Skill for Claude Code

.agents/skills/openlark-formal-token-provider/SKILL.md

openlark-formal-token-provider is a skill for Claude Code, Codex from foxzool/openlark. It costs 71 tokens per session (1,673 once invoked), scanned A, original, Apache-2.0.

A formal verification check for token fetching and caching in Rust authentication code. Formal verification uses a model or set of rules to check that concurrent code keeps specified promises.

In plain words
What is it for?
Use it when changing the token provider, token cache, refresh logic, related concurrent callers, or the verification model.
Why use it?
It helps detect cases where failed token requests pollute the cache or simultaneous requests fail to share one fetch. These bugs can cause bad credentials or inconsistent recovery.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is foxzool/openlark's own configuration. It tells Claude Code and Codex 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 →

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is ./formal/token_provider/run_tlc.sh.

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-formal-token-provider/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/foxzool/openlark

Made for: Claude Code, Codex.

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-formal-token-provider

README.md
[![agentmods](https://agentmods.dev/badge/skills/foxzool/openlark/openlark-formal-token-provider/github.svg)](https://agentmods.dev/skills/foxzool/openlark/openlark-formal-token-provider)
Your own site
<a href="https://agentmods.dev/skills/foxzool/openlark/openlark-formal-token-provider"><img src="https://agentmods.dev/badge/skills/foxzool/openlark/openlark-formal-token-provider/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.

agentmods 80×15 button for openlark-formal-token-provider

Your own site · 80×15
<a href="https://agentmods.dev/skills/foxzool/openlark/openlark-formal-token-provider"><img src="https://agentmods.dev/badge/skills/foxzool/openlark/openlark-formal-token-provider.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 71 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,673 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.00071 $0.01673
Opus 5.5 $0.00028 $0.00669
Sonnet 5.5 $0.00014 $0.00335
Haiku 4.5 $0.00007 $0.00167

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

Security

Grade A, and why

openlark-formal-token-provider 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 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.

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-formal-token-provider/SKILL.md · 117 lines

How it starts

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

Formal verification: AuthTokenProvider get_or_fetch

Read this cold mid-change. You do not need to know TLA+. Run the script, read the plain-language result, and only open the .tla file when the covered Rust steps changed.

When to use

Use this skill if your change touches any of:

Path Why
crates/openlark-auth/src/token_provider.rs get_or_fetch, get_cached, set_cached, CachedToken
crates/openlark-auth/src/token_provider/tests.rs only if it documents a new concurrency contract
crates/openlark-core/src/auth/token_provider.rs TokenProvider trait / request shape that drives cache keys
crates/openlark-core/src/auth/acquisition.rs callers that share one Arc<dyn TokenProvider> across tasks
formal/token_provider/** the model or runner itself

If none of those change, skip this skill.

Property (plain language)

Promise A — failed fetch does not write: If fetch().await returns Err, that call must not insert into the token HashMap. Harm if broken: a failed refresh poisons the cache with a bogus token (or blocks recovery until skew expiry).

Promise B — single-flight (intended, currently broken): For one cache_key, at most one in-flight Feishu token HTTP fetch at a time. Harm if broken: concurrent cold/expired callers stampede the token endpoint → 429 / outages; overlapping writes last-writer-wins.

Tool and why

TLA+ / TLC (model checker), not a Rust prover: the risk is bad interleaving of get_cached → unlocked fetch → set_cached, which unit tests almost never enumerate. There is no production-ready code-level model checker for async + tokio::sync::RwLock here. The model mirrors the Rust steps; TLC explores every order up to the bound.

Pinned tool: tla2tools v1.8.0 (tla2tools.jar from the tlaplus GitHub release). Requires Java 17+ on PATH.

One command

From the repo root:

./formal/token_provider/run_tlc.sh

Success (exit 0) means:

Read the full file on GitHub · 117 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 Changed · +1 lines e26d4c4a0a9f
  2. 7d ago First seen · 116 lines · 71 tokens per session scan A 5f4b6dba02ec

Subscribe to this mod's changes

openlark-formal-token-provider is a skill published in the GitHub repository foxzool/openlark (108 stars, last pushed 3d ago), licensed Apache-2.0. It adds 71 tokens to every session and 1,673 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-10-22.