lightspeed-agentic-operator: Skill for Claude Code

.cursor/skills/find-complexity/SKILL.md

find-complexity is a skill for Claude Code, Cursor from openshift/lightspeed-agentic-operator. It costs 46 tokens per session (851 once invoked), scanned A, original, Apache-2.0.

A Go code-analysis guide that finds functions with difficult control flow, excessive length, or too many parameters.

In plain words
What is it for?
Use it to scan changed files or a whole codebase, rank complexity hotspots, and report refactoring candidates. It reports findings but does not change the code.
Why use it?
It identifies code that is hard to review, test, and maintain before someone decides how to improve it.

Skill for Claude CodeCursor

Written for Claude Code and Cursor: disable-model-invocation in frontmatter, but also installed under .cursor/. Also seen: positional $N argument.

This is openshift/lightspeed-agentic-operator's own configuration. It tells Claude Code and Cursor how to work on lightspeed-agentic-operator itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything lightspeed-agentic-operator configures →

Reuse

Borrowing it

Nothing to install: this file belongs to openshift/lightspeed-agentic-operator. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/openshift/lightspeed-agentic-operator/main/.cursor/skills/find-complexity/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/openshift/lightspeed-agentic-operator

Made for: Claude Code, 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 find-complexity

README.md
[![agentmods](https://agentmods.dev/badge/skills/openshift/lightspeed-agentic-operator/find-complexity/github.svg)](https://agentmods.dev/skills/openshift/lightspeed-agentic-operator/find-complexity)
Your own site
<a href="https://agentmods.dev/skills/openshift/lightspeed-agentic-operator/find-complexity"><img src="https://agentmods.dev/badge/skills/openshift/lightspeed-agentic-operator/find-complexity/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for find-complexity

Your own site · 80×15
<a href="https://agentmods.dev/skills/openshift/lightspeed-agentic-operator/find-complexity"><img src="https://agentmods.dev/badge/skills/openshift/lightspeed-agentic-operator/find-complexity.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 46 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 851 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00046 $0.00851
Opus 5.5 $0.00018 $0.00340
Sonnet 5.5 $0.00009 $0.00170
Haiku 4.5 $0.00005 $0.00085

Measured 1mo ago against content hash 6cdfab92c690, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

find-complexity 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 1mo ago.

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/skills/find-complexity/SKILL.md · 115 lines

How it starts

The opening of the file, as written. The whole thing — 115 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Find Complexity Hotspots

Identify Go functions that are hard to review, test, and maintain.

Rules

  • Report findings, do not refactor. Refactoring is a separate task.
  • Focus on production code (controller/, api/, cmd/, cli/). Skip tests unless explicitly asked.
  • Rank by severity: highest complexity first.

Step 1: Determine Scope

Ask the user:

  • Branch mode: only files changed in the current branch vs main.
  • Full mode: scan the entire codebase.

For branch mode:

git diff --name-only upstream/main -- 'controller/' 'api/' 'cmd/' 'cli/' | grep '\.go$' | grep -v '_test\.go$'

Step 2: Install Prerequisites

Install gocyclo and gocognit if not available:

go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
go install github.com/uudashr/gocognit/cmd/gocognit@latest

Step 3: Cyclomatic Complexity

gocyclo -over 10 <target>

This shows functions with cyclomatic complexity over 10.

Thresholds: 1-10 (simple), 11-20 (moderate), 21-50 (complex), 51+ (untestable).

Step 4: Cognitive Complexity

Cognitive complexity weights nesting depth — a 5-deep if scores much higher than 5 sequential ifs.

gocognit -over 15 <target>

This shows functions with cognitive complexity over 15.

Step 5: Function Length

Find long functions (50+ lines of code, excluding comments and blank lines):

for file in $(find <target> -name '*.go' -not -name '*_test.go'); do
    awk '/^func / {start=NR; func=$0} 
         /^}/ && start {
           len=NR-start; 
           if(len>50) print FILENAME":"start": "func" ("len" lines)"
         }' "$file"
done

Step 6: Parameter Count

Find functions with too many parameters (6+):

rg "^func.*\([^)]{60,}\)" <target> -A 0

Functions with 6+ parameters are candidates for parameter objects or config structs.

Step 7: File Size

Find large files (500+ lines):

wc -l $(find <target> -name '*.go' -not -name '*_test.go') | sort -rn | head -20

Read the full file on GitHub · 115 lines

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. 1mo ago First seen · 115 lines · 46 tokens per session scan A 6cdfab92c690

Subscribe to this mod's changes

find-complexity is a skill published in the GitHub repository openshift/lightspeed-agentic-operator (15 stars, last pushed today), licensed Apache-2.0. It adds 46 tokens to every session and 851 once invoked, about $0.0002 per session on Opus 5.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-08-31.

Related

Other skills, from other repositories

go-linters

Add and validate custom Go analysis linters in gh-aw.

github/gh-aw · 17 tokens

stack-trace-go-probe

Internal helper for meta-stack-trace-investigator. Use when a Go panic or stack trace needs Go-specific nil/error checks, go test reproducer guidance, and patch targets.

opensquilla/opensquilla · 42 tokens

golang-troubleshooting

Troubleshoot Golang programs systematically - find and fix the root cause. Use when encountering bugs, crashes, deadlocks, races, or unexpected behavior in Go code. Covers debugging methodology, common Go pitfalls, test-driven debugging, pprof setup and capture, Delve, race detection, GODEBUG tracing, and production…

samber/cc-skills-golang · 175 tokens

golang-error-handling

Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log…

samber/cc-skills-golang · 144 tokens

tree-sitter-language-pack-extracting-code-structure

Use when the user wants structured code metadata from a source file — functions, classes, imports, exports, symbols, docstrings, comments, or syntax diagnostics. Covers ts-pack process feature flags, the JSON result shape, and the default feature set.

xberg-io/tree-sitter-language-pack · 52 tokens

tree-sitter-language-pack-parsing-source

Use when the user wants a tree-sitter syntax tree for a source file — an s-expression dump or JSON tree. Covers ts-pack parse, language auto-detection vs --language, stdin input, and reading haserrors.

xberg-io/tree-sitter-language-pack · 48 tokens