Agent skill

PR Plots

by RussellSB in RussellSB/pytrendy

A skill your agent uses when preparing a fix or feature PR for review and adding before/after plot evidence to the PR body.

MITAuto-check passedAgent Workflows

Install PR Plots

skills CLI
$ npx skills add RussellSB/pytrendy --skill pr-plots -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install RussellSB/pytrendy pr-plots --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/RussellSB/pytrendy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.opencode/skills/pr-plots .claude/skills/pr-plots && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
pr-plots
GitHub stars
106
Token cost
~1.2k tokens
SKILL.md length
572 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when preparing a fix or feature PR for review and adding before/after plot evidence to the PR body.

  • Works in 6 steps: Find the PR's first commit: gh pr view… → Find its parent: git fetch origin && git… → Checkout parent commit (detached HEAD):… → …
  • Preparing a fix
  • SKILL.md covers When to generate, Generating "before" plots…, Generating "after" plots… and Updating PR body, plus 3 more sections
  • Calls git, gh and python

What it does

PR Plots is an agent skill from RussellSB/pytrendy. Use when preparing a fix or feature PR for review and adding before/after plot evidence to the PR body. Covers generating pre-fix and post-fix plots via detecttrends(plot=True), updating the PR body with image placeholders via gh CLI, the human-in-the-loop image upload to user-attachments, and cleanup. Never commits plot files or temp scripts.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering Pull requests and Human-in-the-loop approvals. It works with Git. The repository describes itself as: Trend Detection in Python. Applicable for real-world industry use cases in time series. The licence is MIT.

When your agent uses it

  • Preparing a fix
  • Feature PR for review and adding before/after plot evidence to the PR body

Example prompts

  • “/pr-plots”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Find the PR's first commit: gh pr view --json commits -q '.commits[0].oid' or GitHub MCP get_commits.
  2. Find its parent: git fetch origin && git rev-parse ^.
  3. Checkout parent commit (detached HEAD): git checkout .
  4. If test fixture data doesn't exist at that commit, extract from the target branch: git show origin/develop:path/to/fixture.csv >…
  5. Write a temp Python script that
  6. Run the script: python _gen_before_plots.py.

What it can do on your machine

Read from SKILL.md and the folder at commit 0d6d5bb. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh
    • python

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

PR Plots loads about 1.2k tokens when it runs. Until then it costs about 89 tokens; SKILL.md has 572 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~89
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from RussellSB/pytrendy at commit 0d6d5bb, republished under its MIT licence (© RussellSB). 572 words, ~1,235 tokens.

Download SKILL.mdSave it as .claude/skills/pr-plots/SKILL.md (or your agent's skills folder).
name
pr-plots
description
Use when preparing a fix or feature PR for review and adding before/after plot evidence to the PR body. Covers generating pre-fix and post-fix plots via detect_trends(plot=True), updating the PR body with image placeholders via gh CLI, the human-in-the-loop image upload to user-attachments, and cleanup. Never commits plot files or temp scripts.

Before/After plots for PR body

When a fix or feature PR is ready for review, generate visual evidence showing the change's effect and add it to the PR description. This is a human-in-the-loop process: the agent generates plots and writes the PR body with <img> placeholders; the user pastes images into GitHub's editor to get user-attachments/assets/ URLs.

When to generate

PR typePlotsNotes
Fix PRBefore + After for the main bugShow the bug behavior (pre-fix) and the corrected behavior (post-fix)
Feature PRAfter only (usually)If there's a prior behavior to compare, include Before; otherwise just show the new behavior
Guard railAfter onlyWhen a fix introduces a workaround or edge-case suppression, add a complementary plot showing that other scenarios still work correctly
Guard rail plots

When a fix introduces a workaround (e.g. suppressing noise on a zero-baseline leading edge), add a guard rail plot to verify the fix doesn't break another scenario. Use a single "after" plot (not before/after) — the point is confirming no regression. Label the section "Guard rail" and explain in the text why it was added.

Generating "before" plots (pre-fix state)

  1. Find the PR's first commit: gh pr view <N> --json commits -q '.commits[0].oid' or GitHub MCP get_commits.
  2. Find its parent: git fetch origin <sha> && git rev-parse <sha>^.
  3. Checkout parent commit (detached HEAD): git checkout <parent-sha>.
  4. If test fixture data doesn't exist at that commit, extract from the target branch: git show origin/develop:path/to/fixture.csv > /tmp/fixture.csv.
  5. Write a temp Python script that:
    • Sets matplotlib to Agg backend: matplotlib.use('Agg')
    • Loads the fixture data (from /tmp/ if extracted, or from the repo if it exists at that commit)
    • Runs detect_trends(plot=True) with the same params as the test
    • Saves the plot: plt.savefig('before_<scenario>.png', dpi=150, bbox_inches='tight')
    • Closes the figure: plt.close()
  6. Run the script: python _gen_before_plots.py.

Generating "after" plots (post-fix state)

  1. Checkout the working branch (develop or feature branch).
  2. Run the same script with output filenames changed to after_<scenario>.png.
Show full SKILL.md (255 more words)Show less

Updating PR body

  1. Write the PR body markdown to /tmp/pr_body.md with <img> placeholder tags (empty src="").
  2. Update via gh CLI REST API (the GitHub MCP token lacks PR write permission):
    bash
    gh api repos/OWNER/REPO/pulls/N --method PATCH --field body="$(cat /tmp/pr_body.md)"
  3. Never git add, git commit, or git push plot files or temp scripts. Plots stay local only.
  4. User pastes each image into the GitHub PR editor (edit PR → paste image into body) to get user-attachments/assets/ URLs.
  5. User provides URLs → agent updates the PR body with real image URLs (same gh api PATCH call).

PR body structure template

markdown
## Before / After — `test_<name>`

The core fix: <one-line description>

**Before fix** — <description of the bug behavior>:

<img width="1990" height="478" alt="<description>" src="" />

**After fix** — <description of the fixed behavior>:

<img width="1990" height="478" alt="<description>" src="" />

## Guard rail — `test_<name>`

Added to verify the fix doesn't break <scenario>. Confirmed working post-fix:

<img width="1990" height="478" alt="<description>" src="" />

Cleanup

After the user has pasted the images and confirmed the PR body looks good:

  • Delete temp plot files (*.png) from the repo working directory
  • Delete temp Python scripts (_gen_*.py)
  • Delete temp CSV fixtures from /tmp/
  • Delete temp branch if one was created (git branch -D <temp-branch>)
  • Switch back to the original working branch
  • Do NOT leave any untracked files in the repo

Constraints

  • Zero commits: Never git add or git commit plot files, temp scripts, or temp fixtures. These are ephemeral.
  • MCP token limitation: The GitHub MCP token does not have PR write permission. Use gh api (REST) or gh pr edit (if it works) with the user's local PAT instead.
  • Image hosting: GitHub has no API for uploading images to user-attachments/assets/. This is a web-editor-only feature. The human-in-the-loop step is mandatory.
  • matplotlib backend: Always use matplotlib.use('Agg') in temp scripts to avoid interactive display warnings and ensure PNGs save correctly in non-interactive environments.

© RussellSB, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .opencode/skills/pr-plots of RussellSB/pytrendy.

Open the folder on GitHubat commit 0d6d5bb

Compare with similar skills

PR Plots next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

PR Plots compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
PR Plots this skillRussellSB/pytrendy106—~1.2kAutomated safety check: PassMIT
Code ReviewerCaoMeiYouRen/caomei-auth220—~1.5kAutomated safety check: PassMIT
Repo Context Ledgergviiisen/repo-context-ledger105—~2.8kAutomated safety check: PassMIT
PRP Workstream OrchestratorWirasm/prp2.3k—~3.5kAutomated safety check: PassMIT
Walkthroughsmallnest/goal-workflow290—~4.7kAutomated safety check: NotesMIT
Cline Pilotsickn33/agentic-awesome-skills47k1 repos~4.6kAutomated safety check: PassMIT

Similar skills

  • Code Reviewer

    CaoMeiYouRen/caomei-auth

    审查当前 git 变更、PR、提交范围、技能定义文件、架构调整或安全敏感代码时使用。输出结构化 Review Gate 结论(Pass/Reject)、问题分级(blocker/warning/suggest)、最低验证矩阵、证据链与复查基线。覆盖正确性、安全、架构、SOLID、可删除代码、性能、异常处理与测试风险;默认只输出 review,不直接修改代码。用户提到 review、code…

    220 GitHub stars~1.5k tokensUpdated 8 days ago
    DevelopmentAuto-check passed
  • Repo Context Ledger

    gviiisen/repo-context-ledger

    Record every behavior-changing feature addition, fix, and adjustment as durable, evidence-based repository knowledge, then use that ledger to continue accurately across AI windows, tools, Git…

    105 GitHub stars~2.8k tokensUpdated 1 mo ago
    Agent WorkflowsAuto-check passed
  • Coordinates several PRP workstreams in isolated Git worktrees from one session, verifying proof, holding merge gates and sequencing the merges.

    2.3k GitHub stars~3.5k tokensUpdated 7 days ago
    Agent WorkflowsAuto-check passed
  • Walkthrough

    smallnest/goal-workflow

    Generate a Phase-2 Walkthrough artifact (walkthrough.md) once implementation and verification are complete.

    290 GitHub stars~4.7k tokensUpdated 26 days ago
    Testing & QAAuto-check: notes
  • Cline Pilot

    sickn33/agentic-awesome-skills

    Acts as a proxy for the Cline CLI, dispatching coding tasks one at a time, monitoring runs by hard evidence, relaying decisions to you and learning per-project preferences.

    47k GitHub starsUsed in 1 repo~4.6k tokens
    Agent WorkflowsAuto-check passed
  • Gh Issues

    trpc-group/trpc-agent-go

    Fetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments.

    1.9k GitHub starsUsed in 8 repos~8.7k tokens
    Agent WorkflowsAuto-check passed

More from RussellSB/pytrendy

  • Debug

    RussellSB/pytrendy

    A skill your agent uses when debugging a pytrendy bug, reproducing a regression, or inspecting intermediate pipeline stage output.

    106 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Maintenance

    RussellSB/pytrendy

    A skill your agent uses when making ANY code change to pytrendy, creating issues, or opening PRs.

    106 GitHub stars~2.1k tokensUpdated yesterday
    Auto-check passed
  • Pytrendy

    RussellSB/pytrendy

    A skill your agent uses when working on pytrendy code, tests, or data.

    106 GitHub stars~2.5k tokensUpdated yesterday
    Auto-check passed
  • Cicd

    RussellSB/pytrendy

    A skill your agent uses when touching .github/workflows/, release config (.releaserc), mkdocs.yml, docs deploy, or the whats-new generator.

    106 GitHub stars~1.6k tokensUpdated yesterday
    Auto-check passed

Works with

Questions about PR Plots

What does PR Plots do?

A skill your agent uses when preparing a fix or feature PR for review and adding before/after plot evidence to the PR body. PR Plots is an agent skill from RussellSB/pytrendy. Use when preparing a fix or feature PR for review and adding before/after plot evidence to the PR body.

When should I use PR Plots?

PR Plots fits situations like: preparing a fix; feature PR for review and adding before/after plot evidence to the PR body.

How do I install PR Plots in Claude Code?

Run `npx skills add RussellSB/pytrendy --skill pr-plots -a claude-code`. Or copy the skill folder (.opencode/skills/pr-plots in RussellSB/pytrendy) into .claude/skills/pr-plots in your project. Claude Code loads it when a task matches its description.

How do I install PR Plots in Codex?

Run `npx skills add RussellSB/pytrendy --skill pr-plots -a codex`. Or copy the skill folder (.opencode/skills/pr-plots in RussellSB/pytrendy) into .agents/skills/pr-plots in your project. Codex loads it when a task matches its description.

Can I use PR Plots in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add RussellSB/pytrendy --skill pr-plots -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pr-plots, .gemini/skills/pr-plots, .github/skills/pr-plots and .opencode/skills/pr-plots in your project.

What does PR Plots need to run?

Going by SKILL.md and its folder, PR Plots needs the command-line tools its instructions call (git, gh and python). Our summary lists: Python 3.

Does PR Plots access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is PR Plots safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does PR Plots use?

PR Plots is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does PR Plots use?

About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to PR Plots?

Skills that share tags, products or a category with PR Plots: Code Reviewer (CaoMeiYouRen/caomei-auth, 220 stars), Repo Context Ledger (gviiisen/repo-context-ledger, 105 stars), PRP Workstream Orchestrator (Wirasm/prp, 2.3k stars) and Walkthrough (smallnest/goal-workflow, 290 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains PR Plots?

RussellSB (a GitHub user) maintains it in RussellSB/pytrendy, which has 106 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 8, 2026.

Source: RussellSB/pytrendy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.