/rh-sre:playbook-generatorfrom rh-sre
**CRITICAL**: This skill ONLY GENERATES playbooks. It does NOT EXECUTE them. For execution, use /playbook-executor skill. Generate production-ready Ansible remediation playbooks for CVE vulnerabilities with Red Hat best practices, error handling, and Kubernetes safety patterns. Use when: - "Generate a remediation playbook for CVE-X" - "Create playbook for these CVEs" - "Get remediation playbook from Lightspeed" This skill calls the MCP tool (remediations__create_vuln_playbook) and returns the playbook **AS IS**. Do NOT modify, enhance, or add to the generated playbook. Any change requires explicit user validation first. **IMPORTANT**: - ALWAYS use this skill instead of calling create_vulnerability_playbook directly - NEVER execute playbooks using ansible-playbook CLI - ALWAYS delegate execution to /playbook-executor skill
Ships in rh-sre. 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.
This skill generates Ansible remediation playbooks for CVE vulnerabilities, applying Red Hat best practices, RHEL-specific patterns, and Kubernetes safety considerations.
Integration with Remediation Skill: The /remediation skill orchestrates this skill as part of its Step 4 (Generate Playbook) workflow. For standalone playbook generation, you can invoke this skill directly.
🚨 CRITICAL SCOPE LIMITATION: This skill ONLY GENERATES playbooks. It does NOT EXECUTE them.
Use this skill directly when you need:
Do NOT use this skill when you need:
/remediation skill (orchestrates this skill + playbook-executor)/remediation skill/playbook-executor skill instead/playbook-executor skill via AAP MCP/playbook-executor skill insteadUse the /remediation skill when you need:
How they work together:
/remediation skill orchestrates this skill after gathering system context/playbook-executor for execution via AAP MCP/remediation-verifier confirms success🚨 Tool Failure Rule: If create_vulnerability_playbook (or create_vuln_playbook) fails, STOP. Present options (retry / generate from knowledge with user confirmation / exit). Never auto-generate from your knowledge.
MCP Tool: create_vulnerability_playbook or remediations__create_vulnerability_playbook (from lightspeed-mcp)
Parameters (tool may use cve_ids/cves and system_ids/uuids—check tool schema):
cves or cve_ids: Array of CVE identifiers
["CVE-2024-1234"]uuids or system_ids: Array of system UUIDs from Red Hat Lightspeed inventory
["uuid-1", "uuid-2"]playbook_name: Name for the playbook (if required by tool)Expected Output: Ansible playbook YAML from Red Hat Lightspeed.
CRITICAL — Return AS IS: You MUST return the playbook exactly as the MCP tool provides it. Do NOT add pre-flight checks, backups, service restarts, audit logging, or any other modifications. The MCP tool description states: "Don't process the playbook. You MUST return the YAML as is." Any enhancement requires explicit user approval—offer modifications only after user requests them.
🚨 CRITICAL: When create_vulnerability_playbook (or remediations__create_vulnerability_playbook) returns an error, you MUST NOT generate a playbook from your own knowledge. Stop and present options to the user.
If the tool returns error (e.g., "Unhandled error", timeout, 500, connection failure):
❌ Red Hat Lightspeed playbook generation failed: [error message]
**Next steps** (choose one):
(A) **Retry** - Try the MCP tool again (may succeed if transient)
(B) **Generate from knowledge** - Create a playbook using documentation templates (⚠️ NOT from Red Hat Lightspeed; requires your explicit approval)
(C) **Exit** - Stop playbook generation; user can retry later or use manual remediation
❓ Reply with A, B, or C:
NEVER auto-generate a playbook from your knowledge when the tool fails without explicit user confirmation for option B.
CRITICAL: Return the playbook exactly as the MCP tool provides it. Do NOT add, remove, or modify any content.
Do NOT:
If the user requests enhancements (e.g. "add pre-flight checks", "add backup step"):
Before returning, verify only:
Do NOT validate for "best practices" or add missing elements—return AS IS.
lightspeed-mcp - Red Hat Lightspeed platform accessremediations__create_vuln_playbook (from lightspeed-mcp) - Generate remediation playbook from Red Hat Lightspeed
cve-impact - Provides CVE severity and risk assessment to inform playbook complexitysystem-context - Provides system inventory and deployment context for playbook targetingremediation-verifier - Verifies playbook execution success after deploymentplaybook-executor - Executes generated playbooks and tracks job statusThis skill generates code that will execute on production systems. Explicit user confirmation is REQUIRED before returning the playbook.
When MCP Tool Fails (REQUIRED):
Before Playbook Return (REQUIRED):
❓ Review the playbook above. This playbook will:
- Update packages on N systems
- Require reboot: [Yes/No]
- Affect Kubernetes pods: [Yes/No]
Should I provide this playbook for execution?
Options:
- "yes" or "proceed" - Provide playbook for execution
- "modify" - Request changes to playbook
- "abort" - Cancel playbook generation
Please respond with your choice.
Never assume approval - always wait for explicit user confirmation before providing executable playbooks.
🚨 CRITICAL: This skill ONLY GENERATES playbooks. It does NOT EXECUTE them.
ONLY after receiving explicit user confirmation, return the production-ready playbook with metadata:
# Playbook metadata to return:
playbook:
file: remediation-CVE-YYYY-NNNNN.yml
path: playbooks/remediation/remediation-CVE-YYYY-NNNNN.yml # Full path for playbook-executor template matching
content: |
[Complete YAML playbook]
metadata:
cve_ids: ["CVE-YYYY-NNNNN"]
target_systems: ["uuid-1", "uuid-2"]
rhel_versions_supported: ["7", "8", "9"]
requires_reboot: true/false
kubernetes_safe: true/false
estimated_duration_minutes: 15
risk_level: "medium" # based on reboot requirement
execution_notes:
- "Test in staging environment first"
- "Schedule maintenance window if reboot required"
- "Ensure kubectl access if Kubernetes systems"
- "Back up critical data before execution"
🚨 THIS SKILL DOES NOT EXECUTE PLAYBOOKS
After generating the playbook, if the user requests execution:
❌ WRONG - Do NOT use ansible-playbook CLI:
ansible-playbook remediation.yml --check # ❌ This skill cannot do this
✅ CORRECT - Delegate to the /playbook-executor skill:
I've generated the remediation playbook. To execute it in dry-run mode, I'll invoke the playbook-executor skill:
[Invoke /playbook-executor skill with the playbook content]
When user asks to execute:
/playbook-executor skill with instruction:
"Execute this playbook for CVE-XXXX-YYYY in dry-run mode using AAP job template [ID]. Monitor job status and report results."
Never attempt to:
ansible-playbook command directlyAlways delegate execution to /playbook-executor skill.
When completing playbook generation, provide output in this format:
# Remediation Playbook Generated
## CVE Information
**CVE ID**: CVE-YYYY-NNNNN
**Target Systems**: N systems
**RHEL Versions**: 7, 8, 9
**Requires Reboot**: Yes/No
**Kubernetes Safe**: Yes/No
## Playbook Features
✓ Generated by Red Hat Lightspeed (returned AS IS, no modifications)
## Playbook File: remediation-CVE-YYYY-NNNNN.yml
```yaml
[Complete playbook YAML]
🔴 IMPORTANT: Do NOT execute this playbook using ansible-playbook CLI.
✅ To execute this playbook, invoke the /playbook-executor skill:
Ready to execute? The playbook-executor skill will:
1. Add this playbook to your AAP Git project
2. Create/use an AAP job template
3. Execute in dry-run mode first (if requested)
4. Launch actual execution (with your approval)
5. Monitor job status and report results
Would you like me to invoke the playbook-executor skill now?
Options:
- "yes" or "execute" - Invoke playbook-executor skill
- "dry-run first" - Execute in check mode first
- "save only" - Just save the playbook file for later
Execution Flow:
Safety Notes:
## Examples
### Example 1: Simple CVE
**User Request**: "Generate playbook for CVE-2024-1234 on 5 RHEL 8 systems"
**Skill Response**:
1. Call `remediations__create_vuln_playbook` with cves, uuids, playbook_name
2. Return the playbook **exactly as received**—no modifications
3. Ask for user confirmation before handoff to playbook-executor
### Example 2: Batch CVEs
**User Request**: "Generate playbook for CVE-2024-1234, CVE-2024-5678 on 20 systems"
**Skill Response**:
1. Call `remediations__create_vuln_playbook` with multiple CVE IDs and system UUIDs
2. Return the playbook **exactly as received**—no modifications
3. Ask for user confirmation before handoff to playbook-executor
## Error Handling
**CVE has no automated remediation**:
CVE-YYYY-NNNNN does not have an automated remediation playbook available in Red Hat Lightspeed.
Manual remediation required:
Would you like me to create a manual playbook template based on Red Hat best practices?
**Unsupported RHEL version**:
Target systems include RHEL 6, which is not supported by this skill.
Supported RHEL versions: 7, 8, 9
Please filter target systems to supported versions or consult Red Hat documentation for RHEL 6 remediation guidance.
**Kubernetes context missing**:
Target systems appear to be Kubernetes nodes but kubectl access is not configured.
To generate Kubernetes-safe playbooks, ensure:
Proceeding with standard playbook (without pod eviction). Add pod eviction manually if needed.
## Best Practices
1. **🚨 NEVER EXECUTE PLAYBOOKS** - This skill generates only. Always delegate execution to `/playbook-executor` skill
2. **🚨 RETURN AS IS** - Do NOT modify the MCP-generated playbook. No enhancements without explicit user request and approval
3. **🚨 NEVER auto-generate on tool failure** - When the MCP tool fails, present options (retry / generate from knowledge with user confirmation / exit). Do NOT silently generate from your own knowledge
4. **Require user approval** - ALWAYS get explicit confirmation before providing playbooks for execution
5. **Clear handoff** - After generation, explicitly tell user to invoke `/playbook-executor` for execution
## Tools Reference
This skill uses:
- `remediations__create_vuln_playbook` (from lightspeed-mcp) - Generate playbook from Red Hat Lightspeed. Returns YAML **as is**—do not modify.
All MCP tools are provided by the lightspeed-mcp server configured in `mcps.json`.
## Integration with Other Skills
- **cve-impact**: Provides CVE severity and risk assessment to inform playbook complexity
- **system-context**: Provides system inventory and deployment context for playbook targeting
- **remediation-verifier**: Verifies playbook execution success after deployment
**Orchestration Example** (from `/remediation` skill):
1. Agent invokes cve-impact skill → Gets risk assessment
2. Agent gathers context → Determines deployment requirements
3. Agent invokes playbook-generator skill → Generates production-ready playbook
4. Agent provides execution guidance → User deploys playbook
5. Agent invokes remediation-verifier skill → Confirms success
references/ansible/README.md (opens in a new tab)references/ansible/aap-integration.md (opens in a new tab)references/ansible/cve-remediation-templates.md (opens in a new tab)references/ansible/error-handling.md (opens in a new tab)references/ansible/idempotency.md (opens in a new tab)references/compliance-frameworks.md (opens in a new tab)references/cvss-scoring.md (opens in a new tab)references/insights/vulnerability-logic.md (opens in a new tab)references/rhel/README.md (opens in a new tab)references/rhel/package-management.md (opens in a new tab)references/rhel/selinux-context.md (opens in a new tab)references/rhel/systemd-services.md (opens in a new tab)references/rhel/version-compatibility.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
inheritOther plugins' skills for the same job
npx claudepluginhub rhecosystemappeng/agentic-catalog --plugin rh-sre13 skills in this plugin
/cve-impact**CRITICAL**: Use for ALL CVE discovery and listing. DO NOT call get_cves directly.
Use when: "show critical CVEs", "CVEs on hostname X", "remediatable vulnerabilities", "impact of CVE-X", risk assessment.
NOT for remediation (use `/remediation`).
System-level: FIRST reply = pagination prompt (Step -1). Parsing: scripts/01-cve-response-parser.py.
/cve-validation**CRITICAL**: This skill must be used for CVE validation queries. DO NOT use raw MCP tools like get_cve directly.
Validate CVE identifiers and check remediation availability in Red Hat Lightspeed.
Use when:
- "Is CVE-2024-1234 valid and remediable?"
- "Check if CVE-X has automated remediation available"
- "Verify these CVEs before creating a playbook"
- "Validate CVE list for batch remediation"
**DO NOT use this skill when** user requests full remediation - use `/remediation` skill instead:
- "Create a remediation playbook for CVE-X" → `/remediation` skill
- "Create playbook and execute it" → `/remediation` skill
- "Remediate CVE-X" / "Patch CVE-X" → `/remediation` skill
This skill orchestrates MCP tools (get_cve) for CVE validation. The `/remediation` skill invokes this skill as Step 2 of its workflow.
/execution-summaryGenerates a concise report of agents, skills, tools, and documentation accessed during a workflow for audit and learning purposes.
Use when:
- "Generate execution summary"
- "Create execution report"
- "Summarize what was used"
- "Show execution summary"
- "What agents/skills/tools were used?"
/fleet-inventoryQuery and display Red Hat Lightspeed managed system inventory. This skill focuses on discovery and listing only - for remediation actions, transition to the `/remediation` skill.
Use when:
- "Show the managed fleet"
- "List all systems registered in Lightspeed"
- "What systems are affected by CVE-X?"
- "How many RHEL 8 systems do we have?"
- "Show me production systems"
**When NOT to use this skill** (use `/remediation` skill instead):
- "Remediate CVE-X on these systems"
- "Create a playbook for..."
- "Patch system Y"
This skill orchestrates MCP tools from lightspeed-mcp for fleet visibility and system inventory management.
/job-template-creatorCreate AAP (Ansible Automation Platform) job templates for executing playbooks. Use when users request:
- "Create a job template for this playbook"
- "Set up a template to run remediation playbooks"
- "Configure AAP to execute this playbook"
- "Add a new job template for CVE remediation"
This skill guides through adding playbooks to Git projects and creating job templates via AAP Web UI.
/job-template-remediation-validatorVerify an AAP job template meets requirements for executing CVE remediation playbooks.
Use when:
- "Does this job template support remediation playbooks?"
- "Validate job template X for CVE remediation"
- "Check if template is ready for playbook-executor"
- Before playbook-executor selects a template
NOT for: AAP MCP connectivity (use `/mcp-aap-validator`), creating templates (use `/job-template-creator`).