Docs creator

From y-miyazaki/terraform-aws-base · View interactive version

Docs creator is an AI agent skill from the GitHub repository y-miyazaki/terraform-aws-base. Create or improve documentation files with Diataxis-aware placement and consistent naming. Use when the user wants to create any new documentation, improve existing docs, write a README, or restructure documentation. Also use when asked to "write docs", "improve this doc", "add a tutorial", "update

How to use this skill

Skill file

UTILITY SKILL — creates and improves documentation content.

Input

Output Specification

Return structured report per references/common-output-format.md.

Execution Scope

USE FOR:

DO NOT USE FOR:

Reference Files Guide

Workflow

  1. Determine intent: new document or improvement to existing one? If neither can be inferred, stop with Status: blocked.
  1. Detect the existing docs layout: list the repository's documentation directories and any docs/index.md, mkdocs.yml, or README docs-index markers.
  1. Resolve filename: kebab-case, lowercase, .md. No version numbers. If target_file is provided and exists, use it as-is. If the same filename already exists in a different docs directory, stop and ask the user.
  1. Gather context: read the sources for the document type before writing. The document should be self-sufficient — a reader understands the system without reading source code. Remove sections that cannot be populated rather than leaving filler.

| Document type | Read first |

| ------------------ | ------------------------------------------------------------------------------------------- |

| README | Entry points, build/run/test commands in manifests or task files, top-level config, license |

| Tutorial / How-to | The commands, scripts, and config the steps use; existing tests that exercise the same path |

| Reference | Public interfaces: CLI flags, config schemas, API signatures, environment variables |

| Explanation / spec | Module structure, design records or ADRs, and the code paths that implement the topic |

| Improving a doc | The existing file in full, plus the sources above for its type, to correct stale content |

  1. Write or update:
  1. Update docs/index.md only when it already exists and follows the template in common-checklist.md, or when the user asks for it. Otherwise leave it unchanged and note it in the report.
  1. Update mkdocs.yml nav if the file exists. Place the entry in the section matching the file's directory.
  1. Update README markers (<!-- docs-index-start/end -->) if present.
  1. Self-check every created or updated file against QV-01..QV-05 in common-checklist.md. Fix failures before reporting; list any that remain in ## Notes with the ItemID.
  1. Return the report.

Error Handling

| Condition | Severity | Action |

| --------------------------------------------------- | ----------- | ------------------------------------------------------------ |

| No docs directory exists | Recoverable | Create the Diataxis fallback directory needed, continue |

| Ambiguous intent | Blocking | Ask user; report Status: blocked |

| Request matches DO NOT USE FOR | Blocking | Do not edit; report Status: blocked; explain in ## Notes |

| target_file given but does not exist | Recoverable | Treat as a new file at that path; note it in the report |

| Same filename exists in a different docs directory | Blocking | Stop and ask user; report Status: blocked with both paths |

| Topic fits no quadrant and no existing directory | Blocking | Ask user for an explicit target_file |

| docs/index.md exists but does not follow template | Recoverable | Leave unchanged; note in report |

| mkdocs.yml missing | Recoverable | Skip nav update |

| README markers malformed | Recoverable | Skip, note in report |

| QV check still fails after one fix attempt | Recoverable | Keep the file; list the QV ItemID and cause in ## Notes |

Examples

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.