complexity-reduction SKILL.md skillA

complexity-reduction from rustyrazorblade/skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add rustyrazorblade/skills/complexity-reduction@git:20260903.4ff0cc0

Pins git:20260903.4ff0cc0 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
rustyrazorblade/skills
Path
plugins/dev-skills/skills/complexity-reduction/SKILL.md
Versions recorded
1
Latest version
git:20260903.4ff0cc0, committed Sep 3, 2026
Size
8,378 bytes
Repository stars
44
License
Apache-2.0

Measure cognitive complexity and duplicate code with PMD (Java) or rust-code-analysis-cli (Rust), then reduce both by pure-move extraction, re-measuring after every step. Runs over a subsystem or over a PR diff. Use this when the user asks to simplify, refactor, clean up, or reduce the complexity of a subsystem, asks "how complex is X", asks to find duplicate code, asks to make code "beautiful", or asks for a complexity check on a diff or PR. It measures before it edits and re-measures after…

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# Complexity reduction, measured

Reduce cognitive complexity and duplication in a **subsystem** or in a **diff**.  Every claim is a
number from a tool.  Every edit is a pure move: behaviour identical, only the shape changes.

Cognitive complexity **at or above 15** for one function marks a potential problem, in every
language below.  It is a threshold to report, not a rule to enforce.

## 1. Tools

Pick the tool by language.  Never report a number you did not measure.

### Java: `pmd`

`pmd` (Homebrew: `brew install pmd`).  Two of its commands matter.

```bash
pmd check -R <skill dir>/pmd-complexity.xml --file-list <list> -f csv -r <out>.csv --no-progress
pmd cpd --minimum-tokens 45 --language java --file-list <list> --format csv
```

`pmd-complexity.xml` beside this file enables CognitiveComplexity (report level 15),
CyclomaticComplexity and NPathComplexity, and nothing else.

### Rust: `rust-code-analysis-cli`

Install it with cargo.  **`--locked` is required**: without it, v0.0.25 fails to compile, because
the dependency graph resolves two different `tree-sitter` versions (0.20 expected, 0.27 found).

```bash
cargo install --locked rust-code-analysis-cli
```
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add rustyrazorblade/skills/complexity-reduction@sha256:4a367229c980dd58

The line at the top of this page pins the label git:20260903.4ff0cc0, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_4tdwnt2u6z22ka2h.svg)](https://markdownregistry.com/a/art_4tdwnt2u6z22ka2h)

5 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 1 version of this file, committed on Sep 3, 2026.

versioncommittedcommitsizeaudit
git:20260903.4ff0cc0 latest2026-09-03 4ff0cc0 8,378 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (8378 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

rustyrazorblade/skills · 44 stars · license Apache-2.0 · pushed 2026-10-31 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_4tdwnt2u6z22ka2h
GET https://markdownregistry.com/api/v1/resolve?ref=rustyrazorblade/skills/complexity-reduction
GET https://markdownregistry.com/api/v1/blob/4a367229c980dd582a3fa1dd00d0254cc17ddd801e992cf0f1e3fe3b2ccd237f

Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from rustyrazorblade/skills

openspec-apply-change SKILL.md skill
rustyrazorblade/skills · .claude/skills/openspec-apply-change/SKILL.md · Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or…
v1.0 · audit A · 44 stars
openspec-archive-change SKILL.md skill
rustyrazorblade/skills · .claude/skills/openspec-archive-change/SKILL.md · Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after…
v1.0 · audit A · 44 stars
openspec-bulk-archive-change SKILL.md skill
rustyrazorblade/skills · .claude/skills/openspec-bulk-archive-change/SKILL.md · Archive multiple completed changes at once. Use when archiving several parallel changes.
v1.0 · audit A · 44 stars
openspec-explore SKILL.md skill
rustyrazorblade/skills · .claude/skills/openspec-explore/SKILL.md · Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use…
v1.0 · audit A · 44 stars
openspec-onboard SKILL.md skill
rustyrazorblade/skills · .claude/skills/openspec-onboard/SKILL.md · Guided onboarding for OpenSpec - walk through a complete workflow cycle with narration and real codebase work.
v1.0 · audit A · 44 stars
openspec-propose SKILL.md skill
rustyrazorblade/skills · .claude/skills/openspec-propose/SKILL.md · Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they…
v1.0 · audit A · 44 stars
openspec-sync-specs SKILL.md skill
rustyrazorblade/skills · .claude/skills/openspec-sync-specs/SKILL.md · Sync delta specs from a change to main specs. Use when the user wants to update main specs with changes from a delta…
v1.0 · audit A · 44 stars
openspec-verify-change SKILL.md skill
rustyrazorblade/skills · .claude/skills/openspec-verify-change/SKILL.md · Verify implementation matches change artifacts. Use when the user wants to validate that implementation is complete…
v1.0 · audit A · 44 stars
CLAUDE.md CLAUDE.md file
rustyrazorblade/skills · CLAUDE.md
git:20260907.450260a · audit A · 44 stars
data-model SKILL.md skill
rustyrazorblade/skills · plugins/cassandra-expert/skills/data-model/SKILL.md · Data modeling and schema design for Apache Cassandra. Use when designing tables, choosing partition keys, modeling…
git:20261031.8909b5e · audit A · 44 stars
diagnose SKILL.md skill
rustyrazorblade/skills · plugins/cassandra-expert/skills/diagnose/SKILL.md · Systematic troubleshooting for Apache Cassandra clusters. Use when diagnosing performance issues, latency problems…
git:20261031.8909b5e · audit A · 44 stars
optimize SKILL.md skill
rustyrazorblade/skills · plugins/cassandra-expert/skills/optimize/SKILL.md · Performance optimization for Apache Cassandra clusters. Use when tuning configuration, improving throughput, reducing…
git:20261031.8909b5e · audit A · 44 stars

Every file in rustyrazorblade/skills

Browse by kind, by grade A, or by owner.