Skip to content

Add pytest-perf-analysis agent skill - #667

Draft
ehelms wants to merge 1 commit into
theforeman:masterfrom
ehelms:add-pytest-perf-analysis-skill
Draft

Add pytest-perf-analysis agent skill#667
ehelms wants to merge 1 commit into
theforeman:masterfrom
ehelms:add-pytest-perf-analysis-skill

Conversation

@ehelms

@ehelms ehelms commented Jul 15, 2026

Copy link
Copy Markdown
Member

Why are you introducing these changes? (Problem description, related links)

The .agents/skills/ directory exists but has been empty. This adds a first
skill 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?

  • Add .agents/skills/pytest-perf-analysis/SKILL.md — skill definition with
    trigger 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
  • Add .agents/skills/pytest-perf-analysis/references/fixture-antipatterns.md
    — reference file documenting all four pytest timing output format variants
    (--fixture-durations table, --durations, combined report, JUnit XML) and
    five 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:

  • Run the foremanctl test suite with timing flags and paste the output to
    Claude with this skill active — it should produce a structured root-cause
    analysis and ranked recommendations without manual prompting

Checklist

  • Tests added/updated (if applicable)
  • Documentation updated (if applicable)

Co-Authored-By: Claude <noreply@anthropic.com>
@ehelms

ehelms commented Jul 15, 2026

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant