cosmos-design-struct

cosmos-design-struct is a skill for Claude Code from Azure/azure-sdk-for-rust. It costs 83 tokens per session (5,267 once invoked), scanned A, original, MIT.

A set of rules for designing public Rust structs in the Azure Cosmos SDK, including field visibility and supported construction patterns.

In plain words
What is it for?
Reviewing or validating changed Cosmos SDK structs, checking privacy and nonexhaustive usage, and enforcing constructors, setters, or builders.
Why use it?
It catches inconsistent public APIs and construction methods that could make SDK types harder to use or change safely.

Skill for Claude Code ✓ vendor

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: mentions AGENTS.md.

Good fit Reviewing or validating changed Cosmos SDK structs, checking privacy and nonexhaustive usage, and enforcing constructors, setters, or builders.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/azure/azure-sdk-for-rust/cosmos-design-struct
About the project

Azure SDK for Rust is a collection of Rust libraries, organized as separate crates, for interacting with Azure services. Rust developers use the crates and examples to build applications that work with Azure. The catalogue entries provide coding-agent skills, instructions, agents, and MCP integrations for working with the SDK.

Azure/azure-sdk-for-rust · 884 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Azure/azure-sdk-for-rust --skill cosmos-design-struct
Clone the repo
git clone --depth 1 https://github.com/Azure/azure-sdk-for-rust

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 cosmos-design-struct

README.md
[![agentmods](https://agentmods.dev/badge/skills/azure/azure-sdk-for-rust/cosmos-design-struct/github.svg)](https://agentmods.dev/skills/azure/azure-sdk-for-rust/cosmos-design-struct)
Your own site
<a href="https://agentmods.dev/skills/azure/azure-sdk-for-rust/cosmos-design-struct"><img src="https://agentmods.dev/badge/skills/azure/azure-sdk-for-rust/cosmos-design-struct/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 cosmos-design-struct

Your own site · 80×15
<a href="https://agentmods.dev/skills/azure/azure-sdk-for-rust/cosmos-design-struct"><img src="https://agentmods.dev/badge/skills/azure/azure-sdk-for-rust/cosmos-design-struct.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,267 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00083 $0.05267
Opus 5 $0.00042 $0.02634
Sonnet 5 $0.00017 $0.01053
Haiku 4.5 $0.00008 $0.00527

Measured 9d ago against content hash 740b739157ef, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

cosmos-design-struct 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 9d 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.

sdk/cosmos/.github/skills/cosmos-design-struct/SKILL.md · 362 lines

How it starts

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

Cosmos SDK Struct Design Rules

When to use this skill

Use this skill when:

  • Reviewing or validating struct design in the Cosmos SDK
  • Generating new structs or modifying existing ones under sdk/cosmos/**
  • Preparing a PR that introduces or changes public types
  • Refactoring struct visibility or field access patterns
  • Auditing the public surface area for breaking changes

Behavior

Follow these steps strictly:

Step 1 — Determine target path

  • If the scope argument is specified and is not equal (case-insensitive) to all or *, set the target path to sdk/cosmos/<scope> (for example, if scope is azure_data_cosmos, use sdk/cosmos/azure_data_cosmos as the target path).
  • Otherwise, set the target path to sdk/cosmos.
  • Always include per-crate tests/ directories in the validation scope (e.g., sdk/cosmos/azure_data_cosmos/tests/).

Step 2 — Determine file scope

  • If changed-only is true (the default), restrict scanning to .rs files that differ between the current local branch and main. Use git diff --name-only main -- <target path> (and include per-crate tests/ directories) to obtain the list. Only .rs files in the result set are scanned; all other files are skipped.
  • If changed-only is false, scan all .rs files under the target path(s).
  • In both modes, skip files in generated/ subdirectories — these are produced by external tools and must never be modified.

Step 3 — Scan struct declarations

  • Find all struct declarations in the .rs files identified in Step 2.

Step 4 — Classify each struct

Classify every struct into exactly one of these categories:

  1. Truly public — The struct is pub and all ancestor modules up to the crate root are also pub (the struct is reachable from outside the crate). These structs get the full set of rules: getter coverage for externally-readable fields, explicit field-visibility decisions based on invariants/validation needs, and a construction pattern that matches the required/optional field mix:
  • It must expose Default when there are no logically required fields.
  • It must expose new(required...) when the struct has both required and optional fields.
  • For required-only structs, neither Default nor new(required...) is required by this skill.
  • It must expose fluent with_* methods only for optional fields so callers can conveniently adjust a small subset of options.
  • If a struct has exactly one field, do not force with_* methods.
  • If a struct has only required fields (no optional overrides), do not force with_* methods.
  • A separate builder type (builder()/build() + with_*) is optional, but if not used, the target struct itself must provide fluent with_* methods for optional fields when they exist.

Read the full file on GitHub · 362 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. 9d ago First seen · 362 lines · 83 tokens per session scan A 740b739157ef

Subscribe to this mod's changes

cosmos-design-struct is a skill published in the GitHub repository Azure/azure-sdk-for-rust (884 stars, last pushed yesterday), licensed MIT. It adds 83 tokens to every session and 5,267 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.