/ansible-skills:ansible-scaffold-collectionfrom ansible-skills
Scaffolds Ansible collections following Red Hat Communities of Practice structure and standards. Use when the user wants to create or initialize a new Ansible content collection.
Ships in ansible-skills. 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.
Read when SKILL.md points to them.
Scaffold complete Ansible collections following Red Hat Communities of Practice (CoP) standards with proper structure, documentation, and testing setup.
An Ansible Collection is a distribution format for Ansible content that can contain:
Collections enable:
Format: namespace.collection_name
Rules:
company.infrastructure, redhat.rhel_system_roles, community.generalComplete Red Hat CoP compliant collection:
namespace/
└── collection_name/
├── galaxy.yml # Collection metadata (REQUIRED)
├── README.md # Collection documentation (REQUIRED)
├── docs/ # Additional documentation
│ ├── getting_started.md
│ └── guides/
├── meta/
│ └── runtime.yml # Runtime metadata
├── roles/ # Collection roles
│ ├── role_name_1/
│ │ ├── defaults/
│ │ ├── handlers/
│ │ ├── meta/
│ │ │ ├── main.yml
│ │ │ └── argument_specs.yml
│ │ ├── tasks/
│ │ ├── templates/
│ │ ├── vars/
│ │ ├── README.md
│ │ └── molecule/
│ └── role_name_2/
├── plugins/ # Collection plugins
│ ├── modules/ # Custom modules
│ │ └── module_name.py
│ ├── module_utils/ # Shared module utilities
│ ├── filter/ # Jinja2 filters
│ ├── lookup/ # Lookup plugins
│ ├── inventory/ # Inventory plugins
│ ├── callback/ # Callback plugins
│ └── action/ # Action plugins
├── playbooks/ # Example playbooks
│ ├── example_1.yml
│ └── example_2.yml
├── tests/ # Collection-level tests
│ ├── integration/
│ │ └── targets/
│ └── unit/
│ └── plugins/
├── changelogs/ # Changelog management
│ ├── config.yaml
│ └── changelog.yaml
├── .ansible-lint # Linting configuration
├── .yamllint # YAML linting configuration
├── .gitignore
└── LICENSE
Required fields:
---
namespace: company
name: infrastructure
version: 1.0.0
readme: README.md
authors:
- Your Name <[email protected]>
description: >
Infrastructure automation collection for managing servers,
networking, and cloud resources following Red Hat CoP standards.
license:
- MIT
license_file: LICENSE
tags:
- infrastructure
- automation
- cloud
- networking
dependencies: {}
# Other collections this depends on
# ansible.posix: ">=1.0.0"
repository: https://github.com/company/ansible-infrastructure
documentation: https://docs.company.com/ansible-infrastructure
homepage: https://company.com/automation
issues: https://github.com/company/ansible-infrastructure/issues
Optional but recommended:
# Collection build configuration
build_ignore:
- .git
- .gitignore
- .DS_Store
- '*.pyc'
- '*.retry'
- tests/output
- .vscode
- .idea
Defines collection requirements and redirects:
---
requires_ansible: '>=2.11.0'
plugin_routing:
# Redirect old module names to new ones
modules:
old_module_name:
redirect: namespace.collection.new_module_name
deprecation:
removal_version: "2.0.0"
warning_text: Use namespace.collection.new_module_name instead
action_groups:
# Group modules for easier reference
cloud:
- aws_ec2
- azure_vm
- gcp_compute
# Ansible Collection: namespace.collection_name
Description of what this collection provides and its purpose.
## Included Content
### Roles
- **role_name_1** - Description of role 1
- **role_name_2** - Description of role 2
### Modules
- **module_name** - Description of module
### Plugins
- **filter/custom_filter** - Description of filter
## Requirements
- Ansible 2.11 or higher
- Python 3.8 or higher
- Supported platforms: RHEL 8/9, Debian 11/12, Ubuntu 20.04/22.04
## Installation
### From Ansible Galaxy
```bash
ansible-galaxy collection install namespace.collection_name
ansible-galaxy collection install git+https://github.com/company/collection.git
cd path/to/namespace/collection_name
ansible-galaxy collection build
ansible-galaxy collection install namespace-collection_name-1.0.0.tar.gz
---
- name: Example playbook
hosts: servers
become: true
roles:
- role: namespace.collection_name.role_name_1
variable_name: value
---
- name: Example module usage
hosts: localhost
tasks:
- name: Use custom module
namespace.collection_name.module_name:
parameter: value
ansible-galaxy collection build
# Lint
ansible-lint
# Run role tests
cd roles/role_name
molecule test
# Integration tests
ansible-test integration
Contributions welcome! Please:
[License Name]
## Collection Roles
Roles in collections must follow the same Red Hat CoP standards:
**Key Requirements:**
- Variable names prefixed: `rolename_variable`
- Internal variables: `__rolename_internal`
- Idempotency required
- Multi-platform support
- Argument specs defined
- Molecule tests included
- Comprehensive README
**Reference:** Use the `role-developer` skill for creating collection roles.
## Collection Modules
Custom modules for collection-specific functionality.
### Module Structure
```python
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2026, Your Name <[email protected]>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
module: module_name
short_description: Short description of what the module does
description:
- Detailed description of the module
- What it accomplishes
- Use cases
version_added: "1.0.0"
author:
- Your Name (@github_handle)
options:
parameter_name:
description:
- Description of the parameter
type: str
required: true
another_parameter:
description:
- Another parameter description
type: bool
required: false
default: true
'''
EXAMPLES = r'''
- name: Example usage
namespace.collection_name.module_name:
parameter_name: value
another_parameter: true
'''
RETURN = r'''
result:
description: The result of the operation
returned: always
type: dict
sample: {"status": "success"}
'''
from ansible.module_utils.basic import AnsibleModule
def run_module():
module_args = dict(
parameter_name=dict(type='str', required=True),
another_parameter=dict(type='bool', required=False, default=True),
)
result = dict(
changed=False,
result=dict()
)
module = AnsibleModule(
argument_spec=module_args,
supports_check_mode=True
)
if module.check_mode:
module.exit_json(**result)
# Module logic here
result['changed'] = True
result['result'] = {'status': 'success'}
module.exit_json(**result)
def main():
run_module()
if __name__ == '__main__':
main()
# plugins/filter/custom_filters.py
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class FilterModule(object):
"""Custom Jinja2 filters"""
def filters(self):
return {
'custom_transform': self.custom_transform,
}
def custom_transform(self, value):
"""
Transform value in custom way
Args:
value: Input value
Returns:
Transformed value
"""
return value.upper()
---
profile: production # Strictest for collections
exclude_paths:
- .git/
- .github/
- tests/output/
- changelogs/
kinds:
- playbook: "playbooks/*.yml"
- tasks: "roles/*/tasks/*.yml"
- vars: "roles/*/vars/*.yml"
- meta: "roles/*/meta/main.yml"
---
extends: default
rules:
line-length:
max: 160
level: warning
indentation:
spaces: 2
indent-sequences: true
comments:
min-spaces-from-content: 1
# From collection root directory
ansible-galaxy collection build
# Creates: namespace-collection_name-1.0.0.tar.gz
# Publish to Galaxy
ansible-galaxy collection publish namespace-collection_name-1.0.0.tar.gz --token <galaxy-token>
# Install from tarball
ansible-galaxy collection install namespace-collection_name-1.0.0.tar.gz
# Or install in development mode
ansible-galaxy collection install -p ./collections /path/to/namespace/collection_name
Use antsibull-changelog for automated changelog generation:
# Initialize changelog
antsibull-changelog init .
# Add changelog fragment
cat > changelogs/fragments/feature-name.yml <<EOF
---
minor_changes:
- Add new role for database management
bugfixes:
- Fix idempotency issue in web_server role
EOF
# Generate changelog
antsibull-changelog release
# Create collection skeleton
ansible-galaxy collection init namespace.collection_name
# Navigate to collection
cd namespace/collection_name
# Create role within collection
cd roles
ansible-galaxy role init role_name --init-path .
# Or use role-developer skill
# Add role following CoP standards
# Create module
touch plugins/modules/module_name.py
# Create plugin
touch plugins/filter/custom_filters.py
# Lint
ansible-lint
# Test roles
cd roles/role_name
molecule test
# Integration tests
ansible-test integration
# Update README.md
# Add docs/ content
# Update galaxy.yml
# Build collection
ansible-galaxy collection build
# Verify build
tar -tzf namespace-collection_name-1.0.0.tar.gz
# Publish to Galaxy
ansible-galaxy collection publish namespace-collection_name-1.0.0.tar.gz
Recommended patterns:
company.infrastructure, company.securitycompany.network_team, company.platform_opscompany.kubernetes, company.cloud_awsFollow semantic versioning (MAJOR.MINOR.PATCH):
Minimize external dependencies:
Must include:
Wrong:
my-collection # Dashes not allowed
MyCollection # Capital letters not allowed
Right:
my_collection # Underscores OK, lowercase
Collection cannot build without galaxy.yml. Always include:
Wrong:
roles:
- role_name # Missing namespace
Right:
roles:
- namespace.collection_name.role_name
Wrong:
- module_name: # Ambiguous
Right:
- namespace.collection_name.module_name:
When scaffolding a collection, create:
Provide clear next steps for:
When asked to scaffold a collection, analyze requirements, create complete structure following Red Hat CoP standards, and provide comprehensive guidance for development and distribution.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Claude Code refuses to install this plugin
.claude-plugin/plugin.json: skills.0: Invalid string: must start with "./", skills.1: Invalid string: must start with "./", skills.2: Invalid string: must start with "./", skills.3: Invalid string: must start with "./", skills.4: Invalid string: must start with "./", skills.5: Invalid string: must start with "./", skills.6: Invalid string: must start with "./", skills.7: Invalid string: must start with "./", skills.8: Invalid string: must start with "./", skills.9: Invalid string: must start with "./", skills.10: Invalid string: must start with "./"
.claude-plugin/plugin.json: skills.0: Invalid string: must start with "./", skills.1: Invalid string: must start with "./", skills.2: Invalid string: must start with "./", skills.3: Invalid string: must start with "./", skills.4: Invalid string: must start with "./", skills.5: Invalid string: must start with "./", skills.6: Invalid string: must start with "./", skills.7: Invalid string: must start with "./", skills.8: Invalid string: must start with "./", skills.9: Invalid string: must start with "./", skills.10: Invalid string: must start with "./"
Checked against Claude Code 2.1.332's install rules. The listing below is what the repository ships; Claude Code cannot install it as published.
11 skills in this plugin
/aap-config-as-codeConfigure Ansible Automation Platform as code using infra.aap_configuration collection for infrastructure-as-code management of AAP components. Use this skill when the user asks to: "configure AAP as code", "aap configuration management", "configure automation controller", "manage AAP with ansible", "aap infrastructure as code", "configure automation hub", "configure eda controller", or wants to automate AAP platform configuration using the Red Hat CoP collections. Always invoke this skill for AAP configuration-as-code workflows.
/ansible-cop-reviewReview Ansible code against Red Hat Communities of Practice automation good practices. Use this skill when the user asks to: "review ansible code", "check CoP compliance", "validate against Red Hat standards", "cop review", "ansible best practices review", "check ansible code quality", "review playbook", "review role", or wants to validate their Ansible automation against Red Hat CoP standards. Always invoke this skill for code review and validation tasks.
/ansible-eda-rulebookCreate Event-Driven Ansible rulebooks and integrate with event sources for automated infrastructure response. Use this skill when the user asks to: "create eda rulebook", "event-driven ansible", "ansible rulebook", "eda event source", "webhook automation", "event automation", "create rulebook for", "integrate event source", or wants to build event-driven automation with Ansible. Always invoke this skill for EDA rulebook creation and event source integration.
/ansible-interactiveInteractive step-by-step guided Ansible development workflow from environment setup through playbook deployment. Use this skill when the user asks to: "guide me through ansible", "interactive ansible setup", "step by step ansible", "walk me through ansible development", "help me start with ansible", "ansible project setup", or wants hands-on guided assistance with Ansible development. Always invoke this skill for interactive, beginner-friendly Ansible workflows.
/ansible-navigator-configConfigure ansible-navigator for optimal workflow, execution environment integration, and troubleshooting. Use this skill when the user asks to: "configure ansible-navigator", "setup navigator", "navigator config", "ansible-navigator settings", "navigator ee integration", "navigator troubleshooting", "ansible-navigator.yml", "set up ansible navigator", or wants to configure or optimize their ansible-navigator workflow. Always invoke this skill for ansible-navigator configuration and usage guidance.
/ansible-scaffold-eeScaffold Ansible Execution Environments using ansible-builder following Red Hat best practices. Use this skill when the user asks to: "create execution environment", "scaffold ee", "build execution environment", "ansible-builder", "execution environment definition", "containerized ansible", "ansible ee", "create ansible container", or wants to create a containerized Ansible runtime environment. Always invoke this skill for execution environment scaffolding tasks.