Skip to content
Back to skills

Pseudocode Logic

ASecurity

This is a per-key token bucket (`src/limits/middleware.ts` + `src/limits/bucket.ts`). ```text rateLimit(req) key = req["x-api-key"] header, else "anonymous" cost = GET → 1, else → 3 allow(key, cost) ? yes → pass request through no → 429 "slow down" allow(key, cost) bucket = buckets[key], or {tokens: 20, updatedAt: now} if new elapsed = now - bucket.updatedAt bucket.tokens = min(20, bucket.tokens + elapsed * 5/sec) # refill bucket.updatedAt = now if bucket.tokens < cost save bucket return ...

  • 17 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 25, 2026
developmentapi

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 25, 2026

npx -y skills add bendrucker/claude --skill pseudocode-logic --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pseudocode Logic?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pseudocode Logic
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bendrucker-pseudocode-logic/badge)](https://www.skillsdirectory.com/skills/bendrucker-pseudocode-logic)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
This is a per-key token bucket (`src/limits/middleware.ts` + `src/limits/bucket.ts`).

```text
rateLimit(req)
  key  = req["x-api-key"] header, else "anonymous"
  cost = GET → 1, else → 3
  allow(key, cost) ?
    yes → pass request through
    no  → 429 "slow down"

allow(key, cost)
  bucket = buckets[key], or {tokens: 20, updatedAt: now} if new
  elapsed = now - bucket.updatedAt
  bucket.tokens = min(20, bucket.tokens + elapsed * 5/sec)   # refill
  bucket.updatedAt = now
  if bucket.tokens < cost
    save bucket
    return false        # denied, tokens unchanged
  bucket.tokens -= cost
  save bucket
  return true            # allowed, tokens spent
```

Key numbers: capacity **20 tokens**, refill **5/sec**, GET costs **1**, everything else costs **3**. Buckets are keyed by `x-api-key` (or the shared `"anonymous"` bucket if absent) and live in an in-memory `Map`, so limits reset on process restart and aren't shared across instances.

Files in this skill

  • sonnet-plain.md1.5 KB
  • sonnet-skill.md955 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.