create-playbook

create-playbook is a command for Claude Code from basher83/lunar-claude. It costs 15 tokens per session (665 once invoked), scanned A, original, MIT.

A command that creates an Ansible playbook for managing a resource in either a present or absent state. Ansible is a tool for describing and applying system configuration.

In plain words
What is it for?
Use it to scaffold playbooks that install, configure, or remove resources on selected hosts.
Why use it?
It gives create and remove operations one consistent configuration instead of requiring separate playbooks.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: model in frontmatter; positional $N argument.

Part of the ansible-workflows plugin — 8 skills, 3 commands, 5 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/basher83/lunar-claude/create-playbook
Clone the repo
git clone --depth 1 https://github.com/basher83/lunar-claude

Made for: Claude Code.

Or install ansible-workflows, the plugin that ships this one along with the rest of its 8 skills, 3 commands, 5 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for create-playbook

README.md
[![agentmods](https://agentmods.dev/badge/commands/basher83/lunar-claude/create-playbook.svg)](https://agentmods.dev/commands/basher83/lunar-claude/create-playbook)
Your own site
<a href="https://agentmods.dev/commands/basher83/lunar-claude/create-playbook"><img src="https://agentmods.dev/badge/commands/basher83/lunar-claude/create-playbook.svg" alt="Measured on agentmods" height="20"></a>
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 665 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00015 $0.00665
Opus 5 $0.00008 $0.00332
Sonnet 5 $0.00003 $0.00133
Haiku 4.5 $0.00002 $0.00067

Measured 2d ago against content hash 44181f72556f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

create-playbook scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/infrastructure/ansible-workflows/commands/create-playbook.md · 104 lines

What it actually says

Create a state-based Ansible playbook named $1.

Load the ansible-playbook-design and ansible-fundamentals skills first.

If no playbook name provided, ask for one.

Playbook location: ansible/playbooks/$1.yml (add .yml if missing)

Target hosts: Use $2 if provided with --hosts, otherwise default to all

Create state-based playbook supporting present/absent:

---
# Usage:
#   Create: uv run ansible-playbook playbooks/$1.yml
#   Remove: uv run ansible-playbook playbooks/$1.yml -e "resource_state=absent"

- name: [Descriptive play name]
  hosts: [target]
  become: true
  gather_facts: true

  vars:
    resource_state: present

  tasks:
    - name: Validate state variable
      ansible.builtin.assert:
        that:
          - resource_state in ['present', 'absent']
        fail_msg: "resource_state must be 'present' or 'absent'"

    # Main tasks here

After scaffolding, initialize the pipeline:

  1. Create the .claude/ directory if it doesn't exist:

    mkdir -p "$CLAUDE_PROJECT_DIR/.claude"
    
  2. Ensure .gitignore contains ansible-workflows patterns (append if missing):

# Ansible Workflows plugin state (auto-added)
.claude/ansible-workflows.local.md
.claude/ansible-workflows.*.bundle.md
  1. Write state file $CLAUDE_PROJECT_DIR/.claude/ansible-workflows.local.md:
---
active: true
pipeline_phase: generating
target_path: ansible/playbooks/$1.yml
current_agent: ansible-generator
started_at: "[ISO timestamp]"
validation_attempts: 0
last_validation_passed: true
---

# Ansible Workflows Pipeline

Target: ansible/playbooks/$1.yml
Type: playbook
  1. Write scaffolding bundle $CLAUDE_PROJECT_DIR/.claude/ansible-workflows.scaffolding.bundle.md:
---
source_agent: create-playbook
target_agent: ansible-generator
timestamp: "[ISO timestamp]"
target_path: ansible/playbooks/$1.yml
target_type: playbook
---

# Scaffolding Bundle

## Target Path
ansible/playbooks/$1.yml

## User Requirements
[Capture any user-specified requirements, hosts, or context]

## Files Created
- ansible/playbooks/$1.yml (scaffolded)

## Next Steps
Implement the playbook tasks based on user requirements.
  1. Hand off to ansible-generator agent with the playbook path

Report: playbook path, state pattern implemented, pipeline initialized.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 104 lines · 15 tokens per session scan A 44181f72556f

Subscribe to this mod's changes

create-playbook is a command published in the GitHub repository basher83/lunar-claude (22 stars, last pushed today), licensed MIT. It adds 15 tokens to every session and 665 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.