Code Explainer

Explain code at a high level and surface gotchas. Use when the user wants to understand what code does, its flow, dependencies, risks, or edge cases.

devclarityai 80a1f1d 1.3 KB Updated

File contents

Use this template to explain code at a high level and surface gotchas.

INPUTS

  • PROJECT_CONTEXT
  • CODE
  • (optional) FILE_PATH

INSTRUCTIONS

  1. Read code in the context of PROJECT_CONTEXT.
  2. Describe what it does in clear, concise terms. Prefer bullets.
  3. Summarize data flow, side effects, external calls, and I/O.
  4. Note domain concepts relevant to the business/application context.
  5. Call out risks, edge cases, and TODOs you would add.
  6. Keep it actionable and brief. Avoid restating the code line-by-line.
  7. When helpful, include a small sequence diagram or pseudo-code.
  8. Keep lines ≤80 chars.

OUTPUT FORMAT

What this code does

  • ...

How it works (flow)

  • Inputs:
  • Processing:
  • Outputs:
  • Side effects:

Dependencies & contracts

  • Frameworks/libraries used:
  • Service/API calls:
  • Databases/tables/queues touched:

Assumptions

  • ...

Gotchas & risks

  • Concurrency:
  • Error handling:
  • Performance:
  • Security/compliance:
  • Observability:

TODOs / improvements

  • Quick wins:
  • Follow-ups:

Example trace (pseudo)

...

devclarityai/environment-setup/tree/main/cursor/.cursor/skills/code-explainer commit 80a1f1d238

Frequently asked questions

npx skillmds@latest add devclarityai/code-explainer-2