Agent Skills: == blog/publish.ts ==

>

UncategorizedID: rstacruz/agentic-toolkit/explain-code

Install this agent skill to your local

pnpm dlx add-skill https://github.com/rstacruz/agentic-toolkit/tree/HEAD/skill/atk-extras/explain-code

Skill Files

Browse the full folder contents for explain-code.

Download Skill

Loading file tree…

skill/atk-extras/explain-code/SKILL.md

Skill Metadata

Name
"explain-code"
Description
>

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

<guidelines>

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]
```
</guidelines>