Skip to main content

A skill generation framework that converts Ansible modules into portable AI agent skills.

Project description

AnsibleClaw

A skill generation framework that converts Ansible modules into portable AI agent skill packages.

Overview

AnsibleClaw bridges Ansible's 3000+ modules to AI agents (Cursor, Claude Code, etc.) by generating full skill packages from ansible-doc documentation. Each package includes a SKILL.md, wrapper scripts, prerequisite checks, and a ready-to-use playbook. Generated skills only depend on ansible-core at runtime -- no custom package needed.

Build-time -- Run ansibleclaw to scrape Ansible module docs and generate skill packages. Runtime -- Generated skills teach AI agents standard ansible CLI commands. Only ansible-core required.

Installation

# Install from PyPI
pip install ansible-claw

# Install with web dashboard
pip install "ansible-claw[ui]"

# Or install from source for development
pip install -e ".[ui,dev]"

Quick Start

# Search for modules
ansibleclaw search "redis"
ansibleclaw search "container" --namespace community.docker

# Generate a skill package
ansibleclaw generate "ansible.builtin.apt"

# Generate and create a distributable ZIP
ansibleclaw generate "ansible.builtin.apt" --zip

# Generate and install directly into Cursor
ansibleclaw generate "community.general.redis" --install cursor

# Generate and install directly into Claude Code
ansibleclaw generate "community.docker.docker_container" --install claude

# Launch the web dashboard
ansibleclaw ui

How It Works

  1. Search -- Find the right Ansible module with ansibleclaw search or the ansible_search skill
  2. Generate -- Convert a module into a full skill package with ansibleclaw generate
  3. Use -- The AI agent reads the SKILL.md and runs standard ansible CLI commands
  4. Distribute -- Download as ZIP from the web dashboard or use --zip on the CLI

Generated skills are portable: copy them into ~/.cursor/skills/, ~/.claude/skills/, or any agent's skill directory. ZIP packages can be uploaded directly to Claude.ai or shared via agentskill.sh. They work anywhere ansible-core is installed.

Generated Skill Package

Each generated skill is a complete Agent Skills package:

ansible_apt/
├── SKILL.md              # Main instructions for the AI agent
├── scripts/
│   ├── run.sh            # Wrapper script (dry-run by default, --apply to execute)
│   └── check.sh          # Prerequisite validator (ansible installed? module available?)
└── assets/
    └── playbook.yml      # Ready-to-use Ansible playbook
File Purpose Dependency
SKILL.md Agent reads this to learn module parameters, usage, and safety rules None
scripts/run.sh Wraps ansible CLI with sane defaults and safe dry-run mode ansible-core
scripts/check.sh Validates that ansible and the module/collection are available ansible-core
assets/playbook.yml Ansible playbook with example tasks for the module ansible-core

CLI Reference

ansibleclaw generate

Generate a full skill package for any Ansible module.

ansibleclaw generate <module> [--install PLATFORM] [--output DIR] [--zip]
Option Description
module Fully-qualified module name (e.g., ansible.builtin.apt)
--install Install directly to cursor or claude
--output Write to a custom directory
--zip Also create a .zip archive for distribution
# Default: writes full package to skills/ansible_apt/
ansibleclaw generate "ansible.builtin.apt"

# Generate + create distributable ZIP
ansibleclaw generate "ansible.builtin.apt" --zip

# Install to Cursor: writes to ~/.cursor/skills/ansible_redis/
ansibleclaw generate "community.general.redis" --install cursor

# Custom path
ansibleclaw generate "ansible.builtin.user" --output /tmp/my-skills/

# Batch generate with ZIP
for module in ansible.builtin.apt ansible.builtin.systemd community.docker.docker_container; do
    ansibleclaw generate "$module" --install cursor --zip
done

ansibleclaw search

Search for Ansible modules by keyword.

ansibleclaw search [keyword] [--namespace NS] [--detail MODULE]
Option Description
keyword Search term to match against module names and descriptions
--namespace, -n Filter to a namespace (e.g., community.docker)
--detail Show full JSON documentation for a module
ansibleclaw search "redis"
ansibleclaw search "container" -n community.docker
ansibleclaw search --namespace ansible.builtin
ansibleclaw search --detail "community.general.redis"

ansibleclaw ui

Launch the web management dashboard.

ansibleclaw ui [--port PORT]

Starts at http://localhost:8600 by default. Requires pip install "ansible-claw[ui]".

Web Dashboard

Start with ansibleclaw ui and open http://localhost:8600.

Skills Library (/skills) -- View all skills (built-in + generated), click to read SKILL.md content, download as ZIP, delete generated skills, or install to Cursor/Claude with one click.

Module Search (/search) -- Search Ansible modules by keyword and namespace. View module parameters and examples inline. Jump to the generator from any result.

Skill Generator (/generate) -- Enter a module name, preview the generated SKILL.md in real time, choose a target (project / Cursor / Claude / custom path), and generate a full skill package. Download as ZIP from the success message.

Built-In Skills

These ship inside the ansible-claw package and are always available -- no repo checkout needed.

Skill Purpose Runtime Dependency
ansible_manager Teaches AI to run any Ansible module via ansible CLI ansible-core
ansible_search Teaches AI to discover modules via ansible-doc ansible-core
ansible_skills_factory Teaches AI to generate new skills on-demand ansibleclaw

Dependencies

Context Install command
Core CLI pip install ansible-claw
With web dashboard pip install "ansible-claw[ui]"
With dev tools pip install "ansible-claw[dev]"
Runtime (on target) ansible-core only

Configuration

Environment Variable Default Description
ANSIBLECLAW_SKILLS_DIR ./skills/ (CWD) Where generated skills are written

Project Structure

AnsibleClaw/
├── src/ansibleclaw/           # Python package (pip install ansible-claw)
│   ├── cli.py                 # CLI: generate / search / ui
│   ├── config.py              # Configuration + paths
│   ├── core/
│   │   ├── parser.py          # ansible-doc scraping + extraction
│   │   └── packager.py        # ZIP packaging for skill distribution
│   ├── builtins/              # Built-in skills (shipped in wheel)
│   │   ├── ansible_manager/   # General-purpose Ansible executor
│   │   ├── ansible_search/    # Module discovery via ansible-doc
│   │   └── ansible_skills_factory/  # On-demand skill generation
│   ├── templates/             # Jinja2 skill blueprints (shipped in wheel)
│   │   ├── skill_template.md  # SKILL.md template
│   │   ├── run.sh.j2          # Wrapper script template
│   │   ├── check.sh.j2        # Prerequisite checker template
│   │   └── playbook.yml.j2    # Ansible playbook template
│   └── web/                   # Optional web dashboard (FastAPI + HTMX)
│       ├── app.py             # Routes (including ZIP download)
│       ├── templates/         # Jinja2 HTML templates (Pico CSS)
│       └── static/            # CSS (dark/light themes)
├── skills/                    # Generated skills (user output, CWD-based)
├── tests/                     # Test suite
├── docs/                      # Documentation
│   └── user-guide.md          # Comprehensive user guide
├── pyproject.toml             # Package definition (ansible-claw on PyPI)
└── README.md

Documentation

See docs/user-guide.md for the comprehensive user guide covering CLI usage, web dashboard walkthrough, end-to-end workflows, inventory setup, and troubleshooting.

License

Apache License 2.0 -- see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ansible_claw-0.1.0.tar.gz (4.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ansible_claw-0.1.0-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

Details for the file ansible_claw-0.1.0.tar.gz.

File metadata

  • Download URL: ansible_claw-0.1.0.tar.gz
  • Upload date:
  • Size: 4.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for ansible_claw-0.1.0.tar.gz
Algorithm Hash digest
SHA256 206c1cff213f33a5af4fe4ff02826f23cbbaa32928920ea118eecc77ac591bff
MD5 5ad2e0c636fc10b5601b0bee293a20b4
BLAKE2b-256 9cc36686c78ffbe75e451257247c340e05e3fd3346e7e095434f1e13feebc601

See more details on using hashes here.

File details

Details for the file ansible_claw-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ansible_claw-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 631962b4a887f5ca5e05b8673689834499b14161641e66e7e35fb46c48c410f5
MD5 c7fae0288e10cf85b2fda749d8a31280
BLAKE2b-256 814f6fdda0f31222de43beb09afd7f0a6767fe42db52eced97a4c3f97527cbe1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page