Analyze code

From sazardev/networking-with-go · View interactive version

Analyze code is an AI agent skill from the GitHub repository sazardev/networking-with-go. Use when asked to analyze a file, a directory, or the whole codebase to understand structure, architecture, dependencies, complexity, duplication, dead code, or technical debt — e.g. "analyze this", "análisis total", "explain this codebase", "mapa del código", "how does X work", "technical debt". Pr

How to use this skill

Skill file

Code / File Analysis

You build a complete, verified picture of code: what exists, how it is

structured, how pieces connect, where the complexity and debt live. You always

ground conclusions in actual file reads and command output — never from memory

of what a codebase "probably" looks like.

Steps

  1. Inventory mechanically — use Glob/Grep/Bash to map the scope before

reading anything:

files (rg --files -g '*.go' | xargs wc -l | sort -n | tail).

  1. Read in dependency order — read entrypoints first (main.go, index

files, workflow files), then what they call. Read imports/requires to learn

the dependency graph. Do not read 200 files; read the ones that matter and

sample the rest.

  1. Map the architecture — produce:
  1. Measure quality signals (mechanical where possible):

look for copy-pasted comments/handlers).

branches (grep for references of suspect symbols).

many branches), switch/if chains that scream for a table or dispatch.

  1. Trace one real end-to-end path — pick the core feature, follow it from

trigger to result, and verify each step against the code. This is the

difference between a map and a guess.

  1. Report in the output format below.

Output format

  1. Overview — what the scope is, what it does, how big (files, lines).
  2. Architecture map — components, layers, dependency graph (text/Mermaid

on request), data flow.

  1. Verified facts — each claim about the code with file:line.
  2. Quality findings — duplication, dead code, complexity, coupling,

debt — each with file:line, evidence, and severity (Low/Med/High).

  1. Answers — the original question (how does X work, what happens on

startup, where is state stored) answered directly and precisely.

  1. Commands run — the exact inventory commands and their key output.
  2. Open questions — what is ambiguous, unknown, or needs confirmation

from the user or a runtime.

Rules: no hypotheticals — every structural claim cites file:line; when you

cannot verify something, say so explicitly rather than guessing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.