code-explain-templates

code-explain-templates is a command for Claude Code from thapaliyabikendra/ai-artifacts. It costs 0 tokens per session (3,477 once invoked), scanned A, original, Apache-2.0.

A set of templates for explaining C#/.NET code, including its structure, complexity, common design patterns, and diagrams.

In plain words
What is it for?
Use it to document C#/.NET classes and methods, review complexity, identify patterns such as dependency injection, and create Mermaid flow or class diagrams.
Why use it?
It gives code explanations a consistent structure and helps readers understand hard-to-read code without starting from scratch each time.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Good fit Use it to document C#/.NET classes and methods, review complexity, identify patterns such as dependency injection, and create Mermaid flow or class diagrams.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/thapaliyabikendra/ai-artifacts/code-explain-templates
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/thapaliyabikendra/ai-artifacts

Made for: Claude Code.

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 code-explain-templates

README.md
[![agentmods](https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/code-explain-templates/github.svg)](https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/code-explain-templates)
Your own site
<a href="https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/code-explain-templates"><img src="https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/code-explain-templates/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 code-explain-templates

Your own site · 80×15
<a href="https://agentmods.dev/commands/thapaliyabikendra/ai-artifacts/code-explain-templates"><img src="https://agentmods.dev/badge/commands/thapaliyabikendra/ai-artifacts/code-explain-templates.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,477 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.
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.00000 $0.03477
Opus 5.5 $0.00000 $0.01391
Sonnet 5.5 $0.00000 $0.00695
Haiku 4.5 $0.00000 $0.00348

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

Security

Grade A, and why

code-explain-templates 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 3mo 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.

.claude/commands/references/code-explain-templates.md · 624 lines

How it starts

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

Code Explanation Templates Reference

Templates and patterns for the /explain:code-explain command. All examples are C#/.NET focused.

Complexity Metrics

Code Analysis Checklist

## Code Complexity Analysis

| Metric | Value | Threshold |
|--------|-------|-----------|
| Lines of Code | {count} | <200 per class |
| Cyclomatic Complexity | {value} | <10 per method |
| Nesting Depth | {depth} | <4 levels |
| Method Count | {count} | <20 per class |
| Dependency Count | {count} | <10 per class |

### Identified Concepts
- [ ] Async/await patterns
- [ ] Dependency injection
- [ ] Repository pattern
- [ ] Unit of Work
- [ ] CQRS pattern

Visual Diagram Templates

Flow Diagram (Mermaid)

flowchart TD
    F0[MethodName]
    F0_params[/param1, param2/]
    F0_return[ReturnType]
    F0_params --> F0
    F0 --> F0_return
    F0 --> F1[CalledMethod]

Class Diagram (Mermaid)

classDiagram
    class ClassName {
        -privateField : Type
        +PublicProperty : Type
        -PrivateMethod() : void
        +PublicMethod(params) : ReturnType
    }
    IInterface <|.. ClassName : implements
    BaseClass <|-- ClassName : extends
    ClassName --> DependencyClass : uses

Sequence Diagram (Mermaid)

sequenceDiagram
    participant Controller
    participant AppService
    participant Repository
    participant Database

    Controller->>AppService: CreateAsync(dto)
    AppService->>Repository: InsertAsync(entity)
    Repository->>Database: INSERT INTO...
    Database-->>Repository: Success
    Repository-->>AppService: Entity
    AppService-->>Controller: DTO

Concept Explanations

Dependency Injection

## Understanding Dependency Injection

Dependency Injection (DI) is a design pattern where objects receive their dependencies from external sources rather than creating them internally.

**Simple Analogy**: Instead of a chef growing their own vegetables (tight coupling), vegetables are delivered to them (loose coupling). The chef doesn't need to know where vegetables come from.

**How it works in .NET**:
```csharp
// ❌ Without DI - tightly coupled
public class PatientService
{
    private readonly PatientRepository _repository = new PatientRepository();
    // Hard to test - can't mock the repository
}

Read the full file on GitHub · 624 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. 3mo ago First seen · 624 lines · 0 tokens per session scan A 5eef1d5be158

Subscribe to this mod's changes

code-explain-templates is a command published in the GitHub repository thapaliyabikendra/ai-artifacts (25 stars, last pushed 8mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 3,477 tokens. 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-30.

Related

code-explain-templates compared with commands from other repositories

code-explain-templates next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
code-explain-templatesthapaliyabikendra/ai-artifactsCommand258mo agoApache-2.0A0Claude Code
scriptsAmaniDawn/DGameCommand18013d agoMITA0Claude Code
abp-background-workersmss123/ABP-ai-skillsCommand71mo agoGPL-3.0A0Claude Code
testpeterblazejewicz/claude-pluginsCommand85mo agoMITA30Claude Code
azure-graph-dotnet:deploy-azureTheLobbi/Claude-mCommand202mo agononeA57Claude Code
csharp-exercise-clearaleksei-perchukov/coding-exercise-generator-ide-pluginCommand56mo agononeA15Claude Code
checklistgithub/spec-kitCommand154ktodayMITA13Claude Code