Skip to content
Back to skills

Guide Complexity

ASecurity

Use when code is written or changed that branches heavily, in any language: if/else or switch chains, type-check cascades, kind fields compared to strings, flag parameters, deep nesting. Produces the branching shaped before it lands, and the bar it must meet at merge. Not for auditing or reworking existing code (complexity-rework).

  • 14 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
ai-agentsapi

Works with

  • api

Security analysis

A100/100

Scanned November 11, 2026

npx -y skills add Ovich/swarmstorm --skill guide-complexity --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Guide Complexity?

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

Security grade badge for Guide Complexity
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ovich-guide-complexity/badge)](https://www.skillsdirectory.com/skills/ovich-guide-complexity)

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
---
name: guide-complexity
description: "Use when code is written or changed that branches heavily, in any language: if/else or switch chains, type-check cascades, kind fields compared to strings, flag parameters, deep nesting. Produces the branching shaped before it lands, and the bar it must meet at merge. Not for auditing or reworking existing code (complexity-rework)."
---

# Guide: complexity

**Applies** to any code that adds or grows branching: a chain of conditions, a dispatch on a kind, a flag that changes what a function does, nesting past two levels.

## Shaping step

1. Before writing the branch, name what varies: the kinds, the cases.
2. Put each case behind one shape: a table, a map of handlers, a type per kind, one function per flag value.
3. Keep each function one level of decision; extract the rest.
4. The branching already exists and is to be reworked: run the `complexity-rework` skill.

## Ok at merge

- No new chain of more than three conditions on the same value.
- No kind compared to strings in more than one place; no boolean flag parameter.
- Nesting at most two levels in the changed code.

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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