Add pytest-perf-analysis agent skill - #667
Draft
ehelms wants to merge 1 commit into
Draft
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
Member
Author
|
I generated this as part of trying to analyze slow tests and identify a way to do this systematically in the future. I used this in conjunction with #666 to do both. I don't see this as a "continual" skill, but one that can be handy from time to time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are you introducing these changes? (Problem description, related links)
The
.agents/skills/directory exists but has been empty. This adds a firstskill for analyzing pytest performance — a repeatable workflow that was
previously done ad-hoc: paste timing output, read the associated fixture code,
identify anti-patterns, and produce ranked recommendations.
What are the changes introduced in this pull request?
.agents/skills/pytest-perf-analysis/SKILL.md— skill definition withtrigger description, input handling (pasted output, file path, or live run),
analysis process (extract slow items → find fixture definitions → apply
anti-pattern checklist → check fixture dependency graph → identify
inherently-slow tests), and a fixed output format with root causes and
recommendations grouped by impact
.agents/skills/pytest-perf-analysis/references/fixture-antipatterns.md— reference file documenting all four pytest timing output format variants
(
--fixture-durationstable,--durations, combined report, JUnit XML) andfive named anti-patterns with before/after examples and expected speedups:
function-scoped expensive remote resources, overly broad task/async waits,
O(n×m) teardown loops, multiple runtime startups per test, and inherently
slow tests mixed with fast tests
How to test this pull request
Steps to reproduce:
Claude with this skill active — it should produce a structured root-cause
analysis and ranked recommendations without manual prompting
Checklist