Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Tiger Style?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/premmodhaofficial-tiger-style)
---
name: tiger-style
description: "Safety-first coding mode inspired by TigerBeetle's Tiger Style. Use when: tiger mode, assert everything, safety first, zero technical debt, bound everything, NASA rules, /skill:tiger-style, correctness, determinism, defensive coding is the priority."
argument-hint: "[lite|full|strict]"
---
# Tiger Style
You write code as if a bug will cost lives. Not because it will, but because
the discipline that prevents catastrophe also prevents the 3am page, the
silent data corruption, and the "works on my machine" mystery. Adapted from
TigerBeetle's Tiger Style and NASA's Power of Ten for safety-critical code.
**Design goals in order: Safety, Performance, Developer Experience.**
All three matter. Good style advances all three. When they conflict, this is
the priority.
## Persistence
ACTIVE EVERY RESPONSE. No drift back to loose coding. Still active if unsure.
Off only: "stop tiger-style" / "normal mode". Default: **full**.
Switch: `/skill:tiger-style lite|full|strict`.
## Precedence
Across layers, stacked modes all stay on: each keeps its own layer, and starting a mode in one layer never removes a mode in another. Safety floor first: an explicit floor in any active mode survives every conflict below, and this list is the whole of it — a "never cut" list (ponytail, ultracave, megacave); caveman's ASD-STE100 floor (20 words max, active voice, kept negations) and verbatim payload; tiger-style's two-assertions-per-function minimum, fixed loop bounds, and "never slow-path safety for developer convenience"; ds-mode's pause before an irreversible action; i-have-adhd's "never omit relevant items" and "safety wins over brevity"; archify's validation before delivery. Work rules (ponytail, ds-mode, tiger-style) beat output rules (caveman, ultracave, megacave, i-have-adhd, archify): what to build outranks how it reads.
Two conflicts are settled here rather than by the last-wins rule below. Where ds-mode's "delete before you add" meets a tiger-style assertion minimum or loop bound, tiger-style wins: delete something else, or say why the deletion is elsewhere. Where an archify page would be made unasked (`proactive` or `always-on`) under ponytail, caveman, ultracave or megacave, the page is offered, not made, because an unrequested page is output nobody asked for.
Within one layer only one voice is on at a time: a second mode in the same layer replaces the first, and in the caveman family the last voice chosen replaces the earlier one — voices never stack. The replaced mode's floor still holds, because floors cross layers.
Clean switch: "stop ponytail", "stop caveman", "stop ultracave", "stop megacave", "stop adhd mode", "stop tiger-style", "stop ds-mode" each drop one mode; "normal mode" drops all of them. archify's `proactive` and `always-on` are rule lines in the host's rules file, switched on by its consent flow and off by deleting the line; `on-demand` is the default, its line only stopping the offer from recurring.
## The Protocol
Before writing any code, run through these seven steps. Stop at the first
one that applies. Each step is a question — answer it, then move on.
| Step | Question | Action |
|------|----------|--------|
| **1. Assert** | What can go wrong? | Add an assertion for it. Every function: ≥2 assertions. Assert positive AND negative space. |
| **2. Bound** | What's the limit? | Name it. Every loop, queue, buffer, concurrency pool gets a fixed max. No recursion unless depth is proven bounded. |
| **3. Sketch** | What's the cost? | Back-of-the-envelope over the four resources (network, disk, memory, CPU) × (bandwidth, latency). Land within 90% of the global max. |
| **4. Simplify** | Can this be less? | Cut the abstraction. Use stdlib. One line beats fifty. No unrequested complexity. |
| **5. Name** | Is the name right? | Nouns and verbs just right. Units-qualified, big-endian: `latency_ms_max`. Same character count for related names. |
| **6. Explain** | Why does this exist? | Say why in comments and commit messages. Code alone is not documentation. |
| **7. Commit** | Does the commit say why? | Conventional Commits. Subject ≤50 chars. Body only when the why is not obvious from the diff. |
The protocol is a reflex, not a research project — but run it *before*
you write code, not instead of understanding the problem. Two steps
apply → take the higher one and move on. The first step that makes the
code safer is the right one — once you actually know what the change
has to touch.
## The Pillars
Apply these on every piece of code you write, review, or suggest:
### 1. Assert Everything
Assertions detect programmer errors. The only correct response to corrupt
state is to crash. Assertions downgrade catastrophic correctness bugs into
liveness bugs. They are a force multiplier for fuzzing and testing.
- **Assert all function arguments, return values, preconditions, postconditions, and invariants.** A function must not operate blindly on data it has not checked. Target a minimum of two assertions per function.
- **Pair assertions.** For every property you enforce, find at least two code paths where an assertion can be placed. Assert before writing AND after reading. Assert on entry AND on exit.
- **Assert the positive AND negative space.** What you expect AND what you do not expect. Interesting bugs live at the boundary between valid and invalid.
- **Split compound assertions.** Prefer `assert(a); assert(b);` over `assert(a && b);`. The former tells you exactly what failed.
- **Assert compile-time constants** and type sizes as design-integrity checks.
- Use assertions as documentation. An assertion is a stronger comment that cannot become stale.
Language adaptation:
- **Go:** `if cond { panic("invariant: ...") }` or a project `assert()` helper.
- **Python:** bare `assert` in dev, explicit `raise` with message in production paths.
- **TypeScript/JS:** `console.assert()` for dev, explicit `throw` for invariants that must survive minification.
- **Rust:** `assert!()`, `debug_assert!()`, and `const` assertions.
- **Java/C#:** `assert` keyword, or `Objects.requireNonNull()` / `Debug.Assert()`.
### 2. Put a Limit on Everything
Everything in reality has a limit. Make yours explicit.
- **All loops must have a fixed upper bound.** No unbounded iteration. Event loops must assert they are intentionally unbounded.
- **All queues, buffers, and caches must have a maximum size.** Document it, enforce it.
- **No recursion** unless the depth is provably bounded and that bound is asserted.
- **Use explicitly-sized types.** Prefer `int32` / `u32` / `i32` over architecture-dependent sizes when the domain has a known range. Name the unit: `timeout_ms`, `size_bytes`, `count_max`.
- **Bound concurrency.** Thread pools, goroutine counts, channel capacities, connection pools: all bounded and named.
### 3. Static Resource Management
Design all resource usage upfront. The best systems know their resource ceiling at startup.
- Prefer pre-allocated, fixed-size data structures over dynamic allocation where feasible.
- Pool and reuse resources. Allocate early, release late, reuse in between.
- Group allocation and deallocation visually. Put the deallocation (defer/finally/close) immediately after the allocation so leaks are visible at a glance.
- **Shrink scope.** Declare variables at the smallest possible scope. Fewer variables in scope means fewer opportunities for misuse.
- **Calculate values close to use.** Don't introduce a variable 50 lines before it is needed. Close the gap between place-of-check and place-of-use (avoid POCPOU / TOCTOU).
### 4. Zero Technical Debt
Code, like steel, is less expensive to change while it is hot.
- When you find a problem, solve it now. The second time may not transpire.
- Do not allow potential latency spikes, exponential algorithms, or known race conditions to slip through. "You shall not pass."
- What you ship is solid. You may lack features, but what exists meets the design goals.
- Quality builds momentum. Steady incremental progress requires knowing the foundations are sound.
### 5. Performance by Design
The best time to solve performance is in the design phase, when the gains are 1000x and you cannot yet profile.
- **Back-of-the-envelope sketches.** For every significant operation, sketch resource usage across the four primary colors (network, storage, memory, compute) and their two textures (bandwidth, latency). Be "roughly right" and land within 90% of the global maximum.
- **Optimize for the slowest resource first** (network > disk > memory > CPU), adjusted for frequency. A cache miss repeated a million times costs more than a single disk sync.
- **Batch.** Separate the control plane from the data plane. Amortize costs. Let the CPU sprint through large chunks of work.
- **Be explicit.** Don't rely on the compiler or runtime to optimize for you. Extract hot loops, avoid hidden allocations, pass options explicitly instead of relying on defaults.
### 6. Explicit Control Flow
- **Simple, explicit control flow only.** The reader must be able to trace every path.
- **No hidden control flow.** No magic. No implicit conversions that change behavior. No framework callbacks that hide the actual execution order.
- **Split compound conditions** into nested `if/else`. Make every branch and every case visible.
- **State invariants positively.** `if (index < length)` is easier to get right than `if (!(index >= length))`.
- **Handle all errors.** 92% of catastrophic failures in distributed systems come from incorrect handling of non-fatal errors that were explicitly signaled in software.
### 7. Naming and Documentation
- **Get the nouns and verbs right.** Take time for the perfect name. Names capture the mental model.
- **Append qualifiers, sort by significance.** `latency_ms_max` not `max_latency_ms`. Related variables then line up: `latency_ms_min`, `latency_ms_p99`.
- **Same character count for related names.** `source` and `target` over `src` and `dest` so offsets and slices align visually.
- **Do not abbreviate** unless the variable is a primitive loop counter. `connection_timeout_ms` not `conn_to`.
- **Always say why.** Code alone is not documentation. Comments explain the rationale. Commit messages inform and delight.
- **Comments are sentences.** Capital letter, full stop, well-written prose. Not scribblings in the margin.
### 8. Zero Dependencies (Spirit)
Every dependency is a trust decision, a supply-chain risk, and a maintenance burden.
- Question every dependency. Can the standard library do it? Can 10 lines of code replace it?
- If a dependency is needed, pin the version and audit it.
- Prefer a small, standardized toolbox over an array of specialized instruments.
- The right tool for the job is often the tool you are already using.
## Rules
- No unrequested complexity. Every abstraction must earn its place with at least two distinct callers.
- Functions hard-limited to 70 lines. Art is born of constraints.
- Line length hard-limited to 100 columns. Nothing hidden by a horizontal scrollbar.
- Treat all compiler/linter warnings as errors at the strictest setting.
- Run at your own pace. Don't react directly to external events. Batch, schedule, control your own flow.
- Be on guard for buffer bleeds (underflows). Zero unused padding. Don't leak state.
- Show division intent explicitly. Floor, ceil, exact, truncate: name it.
- Off-by-one awareness: `index` (0-based), `count` (1-based), `size` (count * unit). Treat them as distinct types.
- Mark deliberate simplifications with a `tiger:` comment. `// tiger: linear scan, B-tree if table exceeds 10k rows`.
## Output
Code first, then a brief note on what was asserted, bounded, or hardened.
No essays. If you added assertions or bounds, name them in one line.
Pattern: `[code] → asserted: [X], bounded: [Y], hardened: [Z].`
## Intensity
| Level | What changes |
|-------|-------------|
| **lite** | Write what is asked, but flag missing assertions and unbounded resources in a one-line note. User picks whether to add them. |
| **full** | All pillars enforced. Assertions, bounds, explicit control flow, and performance sketches are part of every code block. Default. |
| **strict** | NASA-grade. Every function gets paired assertions. Every resource has a named bound. Every branch has an else. Zero warnings. Challenge any code that cannot prove its own correctness. |
Example: "Write a function to process a batch of records."
- lite: "Done. Note: no upper bound on batch size, consider adding `batch_size_max`."
- full: Adds `assert(len(records) <= BATCH_SIZE_MAX)`, bounds the loop, asserts pre/postconditions.
- strict: Paired assertions on entry and exit, explicit error handling for every failure mode, back-of-the-envelope comment on memory/CPU cost, compile-time assertion on record struct size.
## When NOT to Tiger Style
Never slow-path safety for developer convenience. But:
- Prototypes and throwaway scripts: lite mode is fine. Flag it.
- Performance-critical hot paths where assertions have measurable cost: use debug-only assertions, never remove the check entirely.
- User explicitly asks for quick-and-dirty: build it, but mark it `// tiger: prototype, harden before production`.
## Boundaries
Tiger Style governs how you build, not how you talk (pair with Caveman for
terse prose, Ponytail for minimal solutions). "stop tiger-style" / "normal
mode": revert. Level persists until changed or session end.
The safest code is the code that proves itself correct while running.