Lib

Lib is a cursor rule for Cursor from StratoKit/strato-db. It costs 324 tokens per session, scanned A, original, MIT.

A collection of small utility functions, including helpers for handling several asynchronous results, creating URL-friendly text, and showing deprecation warnings.

In plain words
What is it for?
Use it for batch operations that should record both successes and failures, generating slugs for URLs or filenames, and warning about outdated APIs.
Why use it?
It gathers common low-level tasks in one library so other code does not need to reimplement them.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

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.

agentmods
npx agentmods add rules/stratokit/strato-db/lib
Clone the repo
git clone --depth 1 https://github.com/StratoKit/strato-db

Made for: Cursor.

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 Lib

README.md
[![agentmods](https://agentmods.dev/badge/rules/stratokit/strato-db/lib.svg)](https://agentmods.dev/rules/stratokit/strato-db/lib)
Your own site
<a href="https://agentmods.dev/rules/stratokit/strato-db/lib"><img src="https://agentmods.dev/badge/rules/stratokit/strato-db/lib.svg" alt="Measured on agentmods" height="20"></a>
Per session 324 This file is loaded in full into every session.
When invoked 324 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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.00324 $0.00324
Opus 5 $0.00162 $0.00162
Sonnet 5 $0.00065 $0.00065
Haiku 4.5 $0.00032 $0.00032

Measured yesterday against content hash 4ef618644237, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

Lib 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 yesterday.

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.

.cursor/rules/Lib.mdc · 40 lines

What it actually says

Lib Module (src/lib)

This directory contains miscellaneous utility functions used across the codebase.

Core Components

settleAll.js

  • Purpose: Provides a function likely analogous to Promise.allSettled, allowing multiple promises to be awaited, capturing both fulfilled values and rejection reasons without short-circuiting on the first rejection.
  • Usage: Useful when you need to process a batch of independent asynchronous operations and handle their individual outcomes.

slugify.js

  • Purpose: Converts a string into a URL-friendly "slug" format.
  • Key Features: Likely removes special characters, converts to lowercase, and replaces spaces with hyphens.
  • Usage: Generating clean identifiers for URLs or filenames.

warning.js

  • Purpose: Handles the display of warnings or deprecation notices, potentially only in development environments.
  • Key Features: Exports DEV (boolean indicating development mode) and deprecated (function to log deprecation warnings).
  • Usage: Providing feedback to developers about outdated APIs or potential issues without cluttering production logs.

_test-helpers.js

  • Purpose: Contains helper functions specifically designed for use within the project's test suite (*.test.js files).
  • Usage: Reducing boilerplate and simplifying common testing patterns.

Structure

src/
└── lib/
    ├── settleAll.js
    ├── slugify.js
    ├── slugify.test.js
    ├── warning.js
    └── _test-helpers.js
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. yesterday First seen · 40 lines · 324 tokens per session scan A 4ef618644237

Subscribe to this mod's changes

Lib is a cursor rule published in the GitHub repository StratoKit/strato-db (14 stars, last pushed 6mo ago), licensed MIT. It adds 324 tokens to every session, about $0.0016 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-09-04.