Agent skill

explain-code

Gives guidelines on how to explain code with call graphs and pseudocode. Invoke this when creating code explanations. Common user requests: - "Explain {feature or function}" - "Show me how {feature} works" - "Create pseudocode for {feature}" - "Generate call graph for {feature}" - "Show logic for {function}"

Stars 8
Forks 1

Install this agent skill to your Project

npx add-skill https://github.com/rstacruz/agentic-toolkit/tree/main/skill/atk-extras/explain-code

SKILL.md

WHen explain routines or changes with pseudocode, consult the guidelines below.

Call graph

A call graph may be necessary to explain multiple inter-connected functions, modules and systems.

  • use Mermaid graphs with `graph LR`.
  • highlight the new ones in green, updated ones in yellow, removed references in red.
  • also include any references removed.
  • if possible, search the repo to find references to what uses new/updated components, even if they are not part of the PR.
  • Add reference letters like [A] and [B] to correlate them to the pseudocode examples below.

Example format:

## Call graph

\`\`\`mermaid
graph LR
  subgraph "file.ts"
    A["item1"]
    B["[A] item2"]:::new
  end
  subgraph "file2.ts"
    C["item3"]:::updated
    D["item4"]
  end
  A -->|"uses"| B
  B -->|"configured with"| C
  B -->|"renders via"| D

  classDef updated fill:#ff9,stroke:#333
  classDef new fill:#9f9,stroke:#333
  classDef removed fill:#f99,stroke:#333
\`\`\`

Pseudocode breakdown

Break down the core logic related to the plan into pseudocode to illustrate the flow and key components.

  • Add reference letters like [A] and [B] to make it easier to find connections
  • When talking about changes (eg, PR analyses), mark [🟢 NEW] or [🟡 UPDATED] or [🔴 REMOVED] where necessary
  • Use "sh" for syntax highlighting language, even if the syntax is not shell
  • If any specific function/file is not updated/removed, leave it out

Example format:

**publishBlogPost:** publishes a blog post

```sh
# == blog/publish.ts ==

publishBlogPost(post) # [🟢 NEW]
  → validatePostContent(post) # [🟢 NEW: checks for required fields]
  → saveDraftToDB(post) # [🟡 UPDATED: now supports tags]
  → generateSlug(post.title) # [🟢 NEW]
  → scheduleForPublication(post, date) # [🟢 NEW: supports future dates]
  → notifySubscribers(post) # [🟢 NEW]
```

`[A]` **saveDraftToDB:** saves or updates a blog post draft

```sh
# == blog/db.ts ==

saveDraftToDB(post)
  if post.id exists:
    → update existing draft
  else:
    → create new draft
  → update tags # [🟡 UPDATED: now supports multiple tags]
```

Expand your agent's capabilities with these related and highly-rated skills.

rstacruz/agentic-toolkit

refine-implementation

Use after implementation to simplify and review code. Provide: git range (eg, main...HEAD). Runs simplify + peer review loop until change set is clean.

8 1
Explore
rstacruz/agentic-toolkit

implement-spec

Implements a spec on a ticket-by-ticket basis.

8 1
Explore
rstacruz/agentic-toolkit

spec-product-requirements

Gives important guidelines to define product requirements sections (functional requirements, technical requirements, constraints, design considerations, diagrams). Companion to $spec-mode.

8 1
Explore
rstacruz/agentic-toolkit

coding-practices

Contains important guidelines for software engineering, coding, programming. Includes (but not limited to): - CP1: Functional core, imperative shell - CP2: Operational vs unexpected errors - CP3: Result-oriented interface pattern - CP4: Presentational vs container components - CP5: Log context builder pattern Use this when writing, editing, debugging, planning, or otherwise working with: - Any programming work - UI components in React, Vue, or similar - JavaScript, TypeScript, Rust, or any programming language

8 1
Explore
rstacruz/agentic-toolkit

spec-tech-design

Gives important guidelines to define technical design sections (call graphs, data models, pseudocode, files, CSS classes, testing strategy). Companion to $spec-mode skill.

8 1
Explore
rstacruz/agentic-toolkit

review-changes

Use when reviewing code changes against a plan. Provide: plan/spec doc; git range or changed files (eg, branch...HEAD). Returns P1/P2/P3 on alignment, quality, bugs, security.

8 1
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results