Pytest
mathiasertl/django-ca
Instructions for running, writing, and maintaining tests in this project
Maintains existing pytest and Django test suites without weakening correctness.
$ npx skills add PostHog/posthog-foss --skill maintaining-python-tests -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install PostHog/posthog-foss maintaining-python-tests --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/maintaining-python-tests .claude/skills/maintaining-python-tests && rm -rf skills-srcUse ~/.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/
Install the "maintaining-python-tests" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/maintaining-python-tests into .claude/skills/maintaining-python-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "maintaining-python-tests", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/maintaining-python-testsType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add PostHog/posthog-foss --skill maintaining-python-tests -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install PostHog/posthog-foss maintaining-python-tests --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/maintaining-python-tests .agents/skills/maintaining-python-tests && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "maintaining-python-tests" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/maintaining-python-tests into .agents/skills/maintaining-python-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "maintaining-python-tests", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add PostHog/posthog-foss --skill maintaining-python-tests -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install PostHog/posthog-foss maintaining-python-tests --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/maintaining-python-tests .cursor/skills/maintaining-python-tests && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "maintaining-python-tests" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/maintaining-python-tests into .cursor/skills/maintaining-python-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "maintaining-python-tests", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/PostHog/posthog-foss.git --path .agents/skills/maintaining-python-tests--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add PostHog/posthog-foss --skill maintaining-python-tests -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install PostHog/posthog-foss maintaining-python-tests --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/maintaining-python-tests .gemini/skills/maintaining-python-tests && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "maintaining-python-tests" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/maintaining-python-tests into .gemini/skills/maintaining-python-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "maintaining-python-tests", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install PostHog/posthog-foss maintaining-python-testsInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add PostHog/posthog-foss --skill maintaining-python-tests -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/maintaining-python-tests .github/skills/maintaining-python-tests && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "maintaining-python-tests" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/maintaining-python-tests into .github/skills/maintaining-python-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "maintaining-python-tests", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add PostHog/posthog-foss --skill maintaining-python-tests -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install PostHog/posthog-foss maintaining-python-tests --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/maintaining-python-tests .opencode/skills/maintaining-python-tests && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "maintaining-python-tests" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/maintaining-python-tests into .opencode/skills/maintaining-python-tests/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "maintaining-python-tests", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
maintaining-python-testsMaintains existing pytest and Django test suites without weakening correctness.
Maintaining Python Tests is an agent skill from PostHog/posthog-foss, published by the product's own GitHub organization. Maintains existing pytest and Django test suites without weakening correctness. Use when asked to reduce Python test runtime or CI work, investigate slow pytest families, remove stale migration tests, consolidate repeated setup, improve Python test ownership, or measure whether a test optimization worked after merge. Ranks work by measured cost, applies the writing-tests value gate to existing coverage, preserves distinct behavior cases, validates isolation after shared-fixture changes, and separates testcase…
Its SKILL.md is about 2.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/measurement.md` and `references/optimization-patterns.md`).
It sits in Testing & QA, covering Failing and flaky tests, Unit testing and Test generation. It works with Python, pytest, PostHog and Django. The repository describes itself as: PostHog FOSS is a read-only mirror of PostHog, with all proprietary code removed. NOTE: This repo is synced automatically from the main PostHog repo. Please raise any issues and… The licence is MIT.
10 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 2c48221. It shows what the files ask for, not the result of running them.
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.
No scripts in the folder and no shell commands in SKILL.md.
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Maintaining Python Tests loads about 2.5k tokens when it runs, and up to ~6.6k if it reads all its reference files. Until then it costs about 159 tokens; SKILL.md has 1,314 words of instructions outside code blocks.
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.
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.
The full file from PostHog/posthog-foss at commit 2c48221, republished under its MIT licence (© PostHog). 1,314 words, ~2,514 tokens.
.claude/skills/maintaining-python-tests/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.Before you propose a change to how the suite runs in CI, check things already tried. It records measured verdicts on test parallelism, sharding, and coverage-based selection, so a rejected approach is not rebuilt.
Use this skill for an existing Python test suite. Use /writing-tests before adding or substantially changing coverage. Use /fixing-flaky-tests when intermittent failure is the main problem.
The goal is not a smaller test count. The goal is a suite that catches the same realistic regressions with less compute, less waiting, and less maintenance.
Read measurement.md before you query timing data or report an improvement. Read optimization-patterns.md when you select a fix.
Write down the user problem before choosing a test:
These results need different measurements. Do not claim faster CI when only summed test call time decreased.
Use recent PostHog test spans from master when available. Start with a complete window after the latest relevant merge.
Rank at least three views:
Use p50 to find steady cost. Use p95 to find contention or tail behavior. Use sampled observed hours to find repeated medium-cost tests. Use root-span testcase totals for complete pytest work.
Do not select a target from an old ranking after several fixes merge. Rebuild the ranking first.
Do not rank from .test_durations. It holds flat default values (0.01, 18.0, and 60.0) for tests that pytest-split could not time. These values are not measurements.
Apply the /writing-tests gate to every target:
What realistic regression does this test catch that no existing test already catches?
Then classify each case:
Do not infer redundancy from similar names. Read the setup, execution path, assertions, and production entry point.
Run the exact target with the same command that you will use after the change. Record:
Run the surrounding class or file when fixtures can change the result. A single test can hide repeated setup that only appears across the family.
Do not compare full pytest wall time with summed call time. They measure different work.
Profile before rewriting. Attribute time to one of these groups:
Use a wall-clock profile for subprocesses and I/O. Use a CPU profile for Python or JavaScript work. A CPU profile can miss time spent in services or child processes.
Prefer these options in order:
Do not add timing assertions. CI timing is too noisy for a correctness test.
A shared fixture must not create an ordering dependency.
Before sharing setup, identify all state it owns:
Give each case unique mutable state. Reset shared clients when their local cache or offset can affect the next case.
Run cases alone, together, and in a different order when the framework permits it. Run the family more than once when shared setup has process-level state.
Use this validation ladder:
Keep exact result, response, persisted-state, or emitted-message assertions. Do not replace them with weaker row counts or truthiness checks to gain speed.
Use TDD when the change affects a helper or the contract of a test framework. Make the intended behavior fail first. For a pure runtime change, use a measured baseline instead of an unreliable timing test.
Use this format:
Target: <test, family, or shard>
Regression: <what behavior remains protected>
Cost center: <measured source of time>
Change: <smallest fix>
Before: <metric, command, cases, cold/warm state>
After: <same metric and conditions>
Correctness: <focused and surrounding tests>
Isolation: <how shared state stays separate>
Follow-up: <post-merge query or none>Do not report a percentage from two different measurement types.
Wait for fresh master runs that contain the merge commit. Compare equivalent windows and cohorts.
Check all relevant outcomes:
If summed testcase time falls but suite wall time does not change, report both facts. Select the next target from the current slowest shard.
If the expected metric does not change, do not declare success from local data. Check whether the cost moved into fixture setup, teardown, or another test.
Get explicit user approval before you delete tests. Then confirm all of these conditions:
Delete expired tests. Do not leave them skipped. A skip keeps unused code and can still add collection or service cost.
master runs./writing-tests: decide whether new or changed coverage earns its cost./fixing-flaky-tests: reproduce and fix intermittent failures./debugging-ci-failures: classify a failing CI run before changing a test./django-migrations: change or remove migration-related code safely./establishing-code-ownership: add or correct ownership rules./querying-posthog-data: verify the trace schema and HogQL before reading CI timing data.© PostHog, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files (references) in .agents/skills/maintaining-python-tests of PostHog/posthog-foss.
Open the folder on GitHubat commit 2c48221
Maintaining Python Tests 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Maintaining Python Tests this skillPostHog/posthog-foss | 721 | — | ~2.5k | Automated safety check: Pass | MIT | |
| Pytestmathiasertl/django-ca | 158 | — | ~924 | Automated safety check: Pass | GPL-3.0 | |
| Pytestbobmatnyc/claude-mpm | 155 | — | ~8.2k | Automated safety check: Pass | MIT | |
| Run And Verifyaropan/clist | 439 | — | ~461 | Automated safety check: Pass | Apache-2.0 | |
| Python Devdoccker/cc-use-exp | 1.1k | — | ~790 | Automated safety check: Pass | Custom licence | |
| Django Test Profilinghashgraph-online/awesome-codex-plugins | 1.2k | — | ~892 | Automated safety check: Pass | MIT |
mathiasertl/django-ca
Instructions for running, writing, and maintaining tests in this project
bobmatnyc/claude-mpm
pytest - Python's most powerful testing framework with fixtures, parametrization, plugins, and framework integration for FastAPI, Django, Flask
aropan/clist
Choose and run focused checks after changing CLIST Python code: Django tests, standalone pytest tests, offline parser fixtures, Ruff, or a relevant management-command check.
doccker/cc-use-exp
Python 开发规范。当用户操作 .py、pyproject.toml、requirements.txt、setup.py 文件, 或涉及 FastAPI、Django、Flask、pytest、asyncio 开发时触发。
hashgraph-online/awesome-codex-plugins
Profile and measure slow Django test suites with Django's runner, pytest-django, shell timing, py-spy, cProfile, pytest durations, and profiler visualizations.
softspark/ai-toolkit
Python coding rules: style, patterns, security, testing. An agent skill from softspark/ai-toolkit.
PostHog/posthog-foss
Author useful, low-noise log alerts on services in a PostHog project.
PostHog/posthog-foss
Operating procedure for the conflict-autoresolver agent: sweep open PostHog/posthog PRs that conflict with master, resolve the trivial conflicts (generated artifacts deterministically, source…
PostHog/posthog-foss
Help users debug PostHog Error Tracking stack-trace symbolication for any supported platform — JavaScript/TypeScript web, React Native (Hermes), Android (Proguard / R8), or iOS / macOS (dSYM).
PostHog/posthog-foss
Investigates distributed application performance using PostHog APM (OpenTelemetry span) data via MCP.
PostHog/posthog-foss
Debug and inspect LLM/AI agent traces using PostHog's MCP tools.
PostHog/posthog-foss
Diagnose why a product metric changed (dropped, spiked, or plateaued) by orchestrating breakdowns, actors, paths, lifecycle, retention, and annotations queries.
Categories
Maintains existing pytest and Django test suites without weakening correctness. Maintaining Python Tests is an agent skill from PostHog/posthog-foss, published by the product's own GitHub organization. Maintains existing pytest and Django test suites without weakening correctness.
Maintaining Python Tests fits situations like: asked to reduce Python test runtime; investigate slow pytest families; remove stale migration tests; consolidate repeated setup.
Run `npx skills add PostHog/posthog-foss --skill maintaining-python-tests -a claude-code`. Or copy the skill folder (.agents/skills/maintaining-python-tests in PostHog/posthog-foss) into .claude/skills/maintaining-python-tests in your project. Claude Code loads it when a task matches its description.
Run `npx skills add PostHog/posthog-foss --skill maintaining-python-tests -a codex`. Or copy the skill folder (.agents/skills/maintaining-python-tests in PostHog/posthog-foss) into .agents/skills/maintaining-python-tests in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PostHog/posthog-foss --skill maintaining-python-tests -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/maintaining-python-tests, .gemini/skills/maintaining-python-tests, .github/skills/maintaining-python-tests and .opencode/skills/maintaining-python-tests in your project.
SKILL.md names no scripts, command-line tools or credentials: Maintaining Python Tests is instructions for the agent only. Our summary lists: Python 3.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
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.
Maintaining Python Tests is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.5k tokens (SKILL.md is roughly 10k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4.1k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Maintaining Python Tests: Pytest (mathiasertl/django-ca, 158 stars), Pytest (bobmatnyc/claude-mpm, 155 stars), Run And Verify (aropan/clist, 439 stars) and Python Dev (doccker/cc-use-exp, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
PostHog (a GitHub organization, an official publisher) maintains it in PostHog/posthog-foss, which has 721 GitHub stars. The repository holds 213 skills in this directory. The repository was last updated on October 7, 2026.
Source: PostHog/posthog-foss on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.