create-rule

Generate ComplianceAsCode security rule scaffolds with rule.yml, tests, and references.

2.8k|817|Updated Apr 29, 2014
One-click install
npx skills add https://github.com/ComplianceAsCode/content --skill create-rule-complianceascode
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-rule
Source: https://github.com/ComplianceAsCode/content/tree/main/.claude/skills/create-rule
Command: npx skills add https://github.com/ComplianceAsCode/content --skill create-rule-complianceascode

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides a guided, repeatable process to generate a complete security rule scaffold for ComplianceAsCode, including rule metadata, rule structure, tests, and references.

Core Features & Use Cases

  • Automates creation of rule directory with rule.yml, OVAL, Bash, Ansible, and tests skeletons, and ensures components are linked.
  • Validates rule ID format, detects existing rules, and determines proper location within the guide hierarchy.
  • Supports both templated and non-templated rule creation, with fallback generation if templates are unavailable.
  • Updates component mappings and profile references as part of the generation workflow, ensuring integration into the repository.

Quick Start

Start by running the create-rule skill and follow the guided prompts to generate a complete rule scaffold.

Frequently Asked Questions about create-rule

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a security compliance rule scaffold with rule.yml and tests?

To create a security compliance rule scaffold, use a guided process that generates rule.yml, OVAL, Bash, Ansible, and tests skeletons. This enforces ID formats, validates locations, and links components within the guide hierarchy.

What is the process for adding a new security rule to ComplianceAsCode?

Adding a new security rule involves determining its proper location in the guide hierarchy, validating the rule ID format, and updating component mappings and profile references to ensure full integration into the repository.

Can I use templates to generate security rules and what happens if they are unavailable?

You can use templates to generate security rules, with fallback non-templated generation available if templates are missing. Both approaches create complete rule structures, including necessary metadata and tests.

Does the rule creation workflow validate rule ID formats and existing rules?

The rule creation workflow enforces strict ID formats and detects existing rules to prevent duplication. It validates metadata and determines the proper directory location within the guide hierarchy.

How do I update profiles and components after generating a security rule?

Updating profiles and components happens automatically as part of the rule generation workflow. The process updates component mappings and profile references to ensure the new security rule integrates properly into the repository.