name: api-shaping
description: Use this when designing or refactoring public APIs across workspace crates. Keeps APIs small, explicit, and stable while allowing fast internals.
API shaping (lightweight)
Aim
Small public surface
Clear data ownership (views vs owned)
Fast internals without leaking complexity
Prefer
Detector structs that own scratch buffers → avoid allocations per call.
Config structs with safe defaults, but don’t hide “magic” thresholds.
ImageView<T> / ImageViewMut<T> in APIs; keep crates buffer-agnostic.
Separate “core algorithm” from “pipeline convenience wrapper”.
Output types that can be iterated cheaply (Vec<Edgel>, Vec<LaserSample>)
Optional features for parallelism/SIMD later, not in baseline.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: vitalyvorobyev-ringgrid-api-shaping3description: ---4---5---6name: api-shaping7description: Use this when designing or refactoring public APIs across workspace crates. Keeps APIs small, explicit, and stable while allowing fast internals.8---------------------------------------------------------------------------------------------------------------------------------------------------------910# API shaping (lightweight)1112## Aim1314* Small public surface15* Clear data ownership (views vs owned)16* Fast internals without leaking complexity1718## Prefer1920* `Detector` structs that own scratch buffers → avoid allocations per call.21* `Config` structs with safe defaults, but don’t hide “magic” thresholds.22* `ImageView<T>` / `ImageViewMut<T>` in APIs; keep crates buffer-agnostic.23* Separate “core algorithm” from “pipeline convenience wrapper”.2425## Avoid2627* Generic abstractions that obscure hot loops.28* Exposing internal scratch buffers in public API.29* “One mega function” that does everything.3031## Patterns that work here3233* `detect_*(&mut self, img: &ImageView<_>, cfg: &Config) -> Output`34* `Output` types that can be iterated cheaply (`Vec<Edgel>`, `Vec<LaserSample>`)35* Optional features for parallelism/SIMD later, not in baseline.3637---38> Converted and distributed by [TomeVault](https://tomevault.io/claim/vitalyvorobyev) — claim your Tome and manage your conversions.39<!-- tomevault:4.0:skill_md:2026-04-14 -->
Run npx skillmds@latest add tomevault-io/vitalyvorobyev-ringgrid-api-shaping in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
--- It is listed under Integrations & APIs on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.