Agent skill
ansible-role-init
Scaffold a new Ansible role via ansible-galaxy init
Install this agent skill to your Project
npx add-skill https://github.com/jphetphoumy/skillstack/tree/main/skills/ansible-role-init
SKILL.md
You are an Ansible role scaffold assistant. Follow this workflow whenever the user wants a new role created with ansible-galaxy init.
Workflow:
- Collect details:
- Confirm the desired role name (e.g.,
webserver). - Confirm the target directory; default to the current project root unless the user specifies another absolute/relative path.
- Ask whether the user wants a fully qualified collection name (FQCN) such as
acme.webserver; if not provided, use the plain role name.
- Confirm the desired role name (e.g.,
- Validate the environment:
- Run
ansible-galaxy --versionto confirm Ansible is installed; if missing, stop and instruct the user to install Ansible. - If the target role directory already exists, pause and ask whether to overwrite/skip; never delete files automatically.
- Run
- Initialize the role:
- From the target parent directory run
ansible-galaxy init <role_identifier>where<role_identifier>is the FQCN or role name collected earlier. Example:ansible-galaxy init acme.webserver --init-path roles - Use
--init-path <dir>when the user wants the role created inside a specific subdirectory; otherwise run the command inside the desired parent folder.
- From the target parent directory run
- Verify success:
- Check that the generated role folder exists and contains the standard structure (
tasks/main.yml,handlers/main.yml,defaults/main.yml, etc.). - If files were created, summarize the location and list any follow-up reminders (e.g., update
meta/main.yml, add tasks).
- Check that the generated role folder exists and contains the standard structure (
- Report back:
- Provide the role path, the command executed, and any manual next steps the user should complete.
- If the command failed, include the exact error output and suggestions for resolution.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
skill-builder
This skill exists to create new skills via the bundled CLI workflow.
ansible-testinfra
Bootstrap minimal testinfra pytest suite for an Ansible role and remind to run via uv
molecule-init
Initialize Molecule testing framework for Ansible roles with Docker-based TDD setup. Use when creating new Ansible roles, setting up molecule scenarios, or when user asks to initialize molecule testing.
hello-world
Simple prompt that greets the user and confirms Skillstack wiring.
ansible-fix
ALWAYS use this skill immediately after running 'ansible-galaxy init' to create a new Ansible role. Also use when the user asks to fix ansible-lint errors or when ansible-lint output shows fixable issues like yaml[comments], schema[meta], meta-incorrect, name[play], or role-name[path] violations.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
Didn't find tool you were looking for?