ansible-designer
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseansible-designer
ansible-designer
AI-assisted Ansible authoring toolkit. Scaffolds, reviews, and updates Ansible projects with production-quality output following official ansible-core 2.15+ conventions.
AI辅助Ansible创作工具包,遵循ansible-core 2.15+官方规范生成生产级质量的内容,支持为Ansible项目生成脚手架、审查以及更新操作。
Available Commands
可用命令
Playbook Commands
Playbook命令
| Command | Description |
|---|---|
| Create a new playbook (site, component, or AWX-ready) |
| Review an existing playbook — severity report, no file modification |
| Update a playbook — shows diff, requires confirmation |
| 命令 | 说明 |
|---|---|
| 创建新的playbook(支持站点、组件或者AWX就绪类型) |
| 审查现有playbook — 生成严重程度报告,不修改文件 |
| 更新playbook — 展示差异,需用户确认后执行 |
Role Commands
Role命令
| Command | Description |
|---|---|
| Scaffold a complete role — asks about multi-OS support |
| Review a role — severity report, no file modification |
| Update a role — shows diff, requires confirmation |
| 命令 | 说明 |
|---|---|
| 生成完整的role脚手架 — 可配置多操作系统支持 |
| 审查role — 生成严重程度报告,不修改文件 |
| 更新role — 展示差异,需用户确认后执行 |
Collection Commands
Collection命令
| Command | Description |
|---|---|
| Scaffold a new collection with galaxy.yml, plugins, roles structure |
| Review a collection — severity report, no file modification |
| Update a collection — shows diff, requires confirmation |
| 命令 | 说明 |
|---|---|
| 生成新的collection脚手架,包含galaxy.yml、插件、roles目录结构 |
| 审查collection — 生成严重程度报告,不修改文件 |
| 更新collection — 展示差异,需用户确认后执行 |
ansible.cfg Commands
ansible.cfg命令
| Command | Description |
|---|---|
| Generate an annotated ansible.cfg for dev, CI, or AWX |
| Review an ansible.cfg — severity report, no file modification |
| Update ansible.cfg — shows diff, requires confirmation |
| 命令 | 说明 |
|---|---|
| 生成带注释的ansible.cfg文件,适配开发、CI或者AWX环境 |
| 审查ansible.cfg — 生成严重程度报告,不修改文件 |
| 更新ansible.cfg — 展示差异,需用户确认后执行 |
Global Rules
全局规则
Every sub-command enforces these rules without exception:
-
Discovery first — At command start, read in order:→
CLAUDE.md→ansible.cfg→ filesystem scan. Build internal context (roles, collections, paths, namespace). Skip if user already provided all required parameters inline. SeeREADME.md.references/discovery.md -
Never overwrite silently — Before writing any file, show a summary (new files) or unified diff (modifications). Wait for explicit user confirmation (/
yes). Only write after confirmation.y -
FQCN mandatory — Every module reference uses the Fully Qualified Collection Name., never
ansible.builtin.copy.copy, neveransible.builtin.service. Seeservicefor the complete mapping table.references/best_practices.md -
no_log: true on secrets — Every task handling passwords, tokens, API keys, vault variables, or credentials must include.
no_log: true -
Tags on every task — Minimum: component name + action category (,
install,configure,service,validate,security). No task may be untagged.cleanup -
review never modifies —commands produce a structured severity report (CRITICAL / WARNING / INFO) only. They never write, modify, or suggest
review-*commands. Report only.sed -
update always diffs —commands read the existing file, compute the change, show a unified diff, and wait for explicit confirmation before writing a single byte.
update-* -
Show file tree after writes — After any write operation, runand display the resulting file tree.
find <path> -type f | sort -
Suggest next step — End every command with a concrete suggestion: which command to run next, or what to validate.
所有子命令都严格遵守以下规则:
-
优先执行资源发现 — 命令启动时,按顺序读取:→
CLAUDE.md→ansible.cfg→ 扫描文件系统,构建内部上下文(包含roles、collections、路径、命名空间)。如果用户已经在行内提供了所有必需参数则跳过该步骤,详见README.md。references/discovery.md -
禁止静默覆盖 — 写入任何文件前,展示新增文件摘要或者修改内容的统一diff,等待用户明确确认(/
yes),确认后才执行写入操作。y -
强制使用FQCN — 所有模块引用都必须使用完全限定集合名,例如必须写,不能写
ansible.builtin.copy;必须写copy,不能写ansible.builtin.service。完整映射表详见service。references/best_practices.md -
敏感任务必须添加— 所有处理密码、令牌、API密钥、vault变量或者凭证的任务都必须配置
no_log: true。no_log: true -
所有任务必须配置标签 — 最少需要配置:组件名称 + 操作分类(、
install、configure、service、validate、security),不允许存在无标签的任务。cleanup -
审查命令永不修改文件 —类命令仅生成结构化的严重程度报告(严重/警告/信息),不会写入、修改文件,也不会建议
review-*类修改命令,仅输出报告。sed -
更新命令必须先展示diff —类命令会先读取现有文件,计算变更内容,展示统一diff,等待用户明确确认后才会执行任何写入操作。
update-* -
写入后展示文件树 — 任何写入操作完成后,执行命令并展示生成的文件树。
find <path> -type f | sort -
建议下一步操作 — 每个命令执行结束时都会给出具体的下一步操作建议,比如接下来要运行的命令,或者需要验证的内容。
Standard Operational Flow
标准操作流程
Every command follows this exact sequence:
所有命令都严格遵循以下执行顺序:
Step 1 — Discovery
步骤1 — 资源发现
Read: CLAUDE.md → ansible.cfg → README.md → filesystem scan
Build: internal context (roles_path, collections_path, existing roles, collections, inventory)
Report: "Discovery complete: [summary of what was found]"Skip Step 1 only if the user provided all required parameters inline.
Read: CLAUDE.md → ansible.cfg → README.md → filesystem scan
Build: internal context (roles_path, collections_path, existing roles, collections, inventory)
Report: "Discovery complete: [summary of what was found]"仅当用户在行内提供了所有必需参数时才跳过步骤1。
Step 2 — Parameter Collection
步骤2 — 参数收集
- If the user already provided all required parameters: proceed to Step 3.
- Otherwise: ask one question at a time, using discovery context for smart defaults.
- Never ask for something that can be inferred from discovery (e.g., don't ask for namespace if a collection already exists).
- 如果用户已经提供了所有必需参数:直接进入步骤3。
- 否则:一次只提一个问题,结合资源发现的上下文给出智能默认值。
- 不要询问可以通过资源发现推断的内容(例如如果已经存在collection则不要询问命名空间)。
Step 3 — Pre-Write Confirmation
步骤3 — 写入前确认
- For new files: show a summary of what will be created (paths + brief description).
- For update commands: show a unified diff (,
--- original).+++ proposed - Wait for explicit user confirmation (,
yes, or equivalent) before proceeding.y - If user says no: ask what to change and loop back to Step 2.
- 对于新增文件:展示将要创建的内容摘要(路径 + 简要说明)。
- 对于更新命令:展示统一diff(,
--- 原文件)。+++ 建议修改内容 - 继续操作前必须等待用户明确确认(、
yes或者等效内容)。y - 如果用户拒绝修改:询问需要调整的内容,回到步骤2循环执行。
Step 4 — Execution
步骤4 — 执行
- Write or modify files using bash commands.
- Follow all global rules: FQCN, tags, no_log.
- Use templates from the appropriate file as the base.
references/
- 使用bash命令写入或者修改文件。
- 遵守所有全局规则:FQCN、标签、no_log配置。
- 基于目录下对应的模板文件生成内容。
references/
Step 5 — Final Output
步骤5 — 最终输出
Show file tree of all created/modified files.
Suggest: "Next step: [specific actionable suggestion]"Show file tree of all created/modified files.
Suggest: "Next step: [specific actionable suggestion]"Reference Files
参考文件
| File | Used by |
|---|---|
| All commands — Step 1 |
| All commands — FQCN, tags, no_log, idempotency |
| new-playbook, review-playbook, update-playbook |
| new-role, review-role, update-role |
| new-collection, review-collection, update-collection |
| new-conf, review-conf, update-conf |
| All commands — inventory context |
| 文件 | 使用场景 |
|---|---|
| 所有命令 — 步骤1 |
| 所有命令 — FQCN、标签、no_log、幂等性配置 |
| new-playbook、review-playbook、update-playbook |
| new-role、review-role、update-role |
| new-collection、review-collection、update-collection |
| new-conf、review-conf、update-conf |
| 所有命令 — 清单上下文 |
Installation
安装
bash
npx skills add 3A2DEV/ansible-designer -a claude-codeRequires Claude Code with enabled.
bash_toolbash
npx skills add 3A2DEV/ansible-designer -a claude-code需要已启用的Claude Code环境。
bash_tool