/ansible-pytest-migrate:ansible-pytest-migrate [path]from ansible-pytest-migrate
Migrates Ansible collections off the pytest-ansible plugin by identifying real plugin use (fixtures, imports, options) vs. ordinary Ansible variables, then removing the dependency while retaining pytest and ansible-test.
Ships in ansible-pytest-migrate. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this workflow to migrate an Ansible collection off the pytest-ansible plugin — replacing real plugin use and removing the dependency — without mistaking ordinary Ansible variables or module mocks for plugin use.
This removes the pytest-ansible plugin only. You keep testing with pytest and ansible-test; the goal is to stop depending on this one plugin, not to stop running pytest against Ansible content.
Search dependency files and test configuration for the package and plugin name. The lookahead excludes the unrelated pytest-ansible-units package:
rg -n -iP 'pytest[-_]ansible(?!-units)\b' test-requirements.txt requirements*.txt tox.ini pyproject.toml setup.cfg noxfile.py Pipfile .github tests
Search test code for the plugin-only fixtures and options:
rg -n 'ansible_adhoc|ansible_module|ansible_facts|ansible_host\b|ansible_group\b|molecule_scenario|--ansible-' tests tox.ini .github pyproject.toml
Classify every hit before changing anything:
pytest-ansible dependency, pytest_ansible import, plugin-specific fixture request, or --ansible-* pytest option.ansible_host, a module return value such as ansible_facts, a locally defined fixture called ansible_module, a commented-out line such as # pytest-ansible, or a dependency on pytest-ansible-units (a different package, not this plugin).pytest-ansible provides fixtures including ansible_adhoc, ansible_module, ansible_facts, ansible_host, ansible_group, localhost, and molecule_scenario. Do not grep for localhost as a bare string — it is far too common; rely on checking the fixture definition instead. Verify the fixture definition before treating a same-named local fixture as plugin use.
If the repository only installs the package, remove pytest-ansible from every active test dependency list. Check both test-requirements.txt and generated or environment-specific lists in tox.ini.
Not every --ansible-* option is a no-op — check what each one does before deleting it:
--ansible-host-pattern localhost, when no test requests ansible_host or ansible_group, has no effect. It is registered by the plugin, so remove it.--ansible-unit-inject-only drives unit-test collection-path injection; removing it breaks the unit-test run. Replace it with a working equivalent (for example ansible-test units or native collection-path injection) before dropping the dependency.If tests use plugin fixtures, migrate only those tests before removing the dependency. Do not remove the package until the replacement is established and the affected tests pass. For the molecule_scenario fixture specifically, the replacement is running Molecule directly — molecule test --all, and tox-ansible's molecule test type for collection CI — and then deleting the glue test file, rather than porting the fixture.
Preserve ansible-test configuration that deliberately excludes pytest-ansible. A comment warning that pytest-ansible overrides ANSIBLE_COLLECTIONS_PATH is evidence that the ansible-test path should remain plugin-free, not evidence that the plugin is needed.
Re-run the two searches above and confirm no dependency, import, fixture request, or --ansible-* option remains unintentionally.
Run the repository's normal unit-test entry point. Prefer the documented CI command or tox environment over inventing a bare pytest command.
For collection repositories, also run the relevant ansible-test units command when it is part of CI. Run the narrowest affected test target first, then the full unit suite when practical.
Report separately:
ansible_host or ansible_facts from playbooks, inventories, module code, or documentation solely because of this migration.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub leogallego/ai-skills-ansible --plugin ansible-pytest-migrateOther plugins' skills for the same job