|
| 1 | +--- |
| 2 | +name: doc-create |
| 3 | +description: Create new documentation pages for the validatedpatterns.io site. Supports learn pages and pattern page sets. Generates AsciiDoc files with correct frontmatter, structure, and style-compliant content. Use this skill whenever the user wants to write, draft, scaffold, generate, or create new documentation pages — whether for learn content, patterns, tutorials, or guides. Triggers on requests like "create a new page", "write docs for", "scaffold a pattern", "add a learn page", "generate documentation", or any task involving new .adoc/.md content for the site, even if the user does not name this skill explicitly. |
| 4 | +argument-hint: <content-type> <topic-or-name> |
| 5 | +--- |
| 6 | + |
| 7 | +Create new documentation for the validatedpatterns.io Hugo site. Follow the workflow below precisely. |
| 8 | + |
| 9 | +--- |
| 10 | + |
| 11 | +## Step 1: Resolve content type and gather inputs |
| 12 | + |
| 13 | +- If `$ARGUMENTS` is empty, ask the user what content type (`learn` or `pattern`) and topic to create. |
| 14 | +- If `$ARGUMENTS` contains a content type and topic, use them directly. |
| 15 | + |
| 16 | +### Learn pages |
| 17 | + |
| 18 | +Collect: |
| 19 | +- **title** (required): Page title in sentence-style capitalization. |
| 20 | +- **parent menu** (optional): If this is a child page, the parent menu label (e.g. "Patterns quick start"). Leave empty for top-level learn pages. |
| 21 | +- **weight** (required): Sort order (10, 20, 30, ...). |
| 22 | +- **topic summary**: Brief description of what the page covers — used to generate content. |
| 23 | + |
| 24 | +### Pattern page sets |
| 25 | + |
| 26 | +Collect: |
| 27 | +- **pattern name** (required): Lowercase, dash-separated directory name (e.g. `my-new-pattern`). |
| 28 | +- **title** (required): Human-readable pattern title. |
| 29 | +- **date** (required): Publication date in `YYYY-MM-DD` format. |
| 30 | +- **summary** (required): One-sentence pattern description. |
| 31 | +- **tier** (required): `sandbox`, `tested`, or `maintained`. |
| 32 | +- **rh_products** (required): List of Red Hat products used. |
| 33 | +- **industries** (required): List of target industries. |
| 34 | +- **partners** (optional): List of partner organizations. |
| 35 | +- **GitHub repo URL** (required): Used to populate `links.github` and `links.bugs`. |
| 36 | +- **Additional subpages** (optional): Beyond the standard set (getting-started, cluster-sizing, ideas-for-customization, troubleshooting). |
| 37 | + |
| 38 | +## Step 2: Determine format and naming |
| 39 | + |
| 40 | +- **Always use AsciiDoc (`.adoc`)** unless the user explicitly requests Markdown (`.md`). |
| 41 | +- File names: lowercase, dash-separated (e.g. `getting-started.adoc`, `cluster-sizing.adoc`). |
| 42 | +- Pattern directories: `content/patterns/<pattern-name>/` with `_index.adoc` and subpages. |
| 43 | +- Learn pages: `content/learn/<page-name>.adoc`. |
| 44 | + |
| 45 | +## Step 3: Generate files from templates |
| 46 | + |
| 47 | +Read the applicable reference file before generating content: |
| 48 | + |
| 49 | +- **Learn page**: Read [references/learn-page.md](references/learn-page.md) for frontmatter schema, menu hierarchy, and body structure. |
| 50 | +- **Pattern page set**: Read [references/pattern-set.md](references/pattern-set.md) for index frontmatter schema, standard subpages, and body templates. |
| 51 | + |
| 52 | +### Generation rules |
| 53 | + |
| 54 | +1. Create files using the template structure, substituting the gathered metadata. |
| 55 | +2. For patterns, create the full standard page set: |
| 56 | + - `_index.adoc` — pattern overview |
| 57 | + - `getting-started.adoc` (weight 10) — prerequisites and deployment procedure |
| 58 | + - `cluster-sizing.adoc` (weight 20) — resource requirements |
| 59 | + - `ideas-for-customization.adoc` (weight 30) — customization suggestions |
| 60 | + - `troubleshooting.adoc` (weight 40) — common issues and solutions |
| 61 | + - Plus any additional subpages requested by the user. |
| 62 | +3. For AsciiDoc files, always include these attributes at the top of the body: |
| 63 | + ``` |
| 64 | + :toc: |
| 65 | + :imagesdir: /images |
| 66 | + :_content-type: ASSEMBLY |
| 67 | + include::modules/comm-attributes.adoc[] |
| 68 | + ``` |
| 69 | +4. **Write real content** based on the topic — not just placeholder comments. Draft substantive sections that the user can refine. Use shared AsciiDoc attributes from `modules/comm-attributes.adoc` instead of hard-coding product names. |
| 70 | +5. Use `[id="section-id"]` anchors before major AsciiDoc sections. |
| 71 | + |
| 72 | +## Step 4: Style review using doc-review guides |
| 73 | + |
| 74 | +After generating the files, perform a comprehensive style review using the doc-review guide files. Read the relevant guides from `../doc-review/guides/` and check the generated content against them. The two-pass approach from doc-review applies here: scan the generated content first, then load only the guides whose rules are relevant. |
| 75 | + |
| 76 | +**Important**: Because skills cannot invoke other skills directly, perform the review inline by reading the guide files yourself rather than trying to call the doc-review skill. The guides live at `../doc-review/guides/` relative to this skill's directory. |
| 77 | + |
| 78 | +For each generated file: |
| 79 | +1. Scan for likely violations (contractions, passive voice, title case, banned words, etc.). |
| 80 | +2. Read the matching guide files from `../doc-review/guides/`. |
| 81 | +3. Apply must-fix issues automatically. |
| 82 | +4. Present recommended improvements to the user for their decision. |
| 83 | + |
| 84 | +## Step 5: Present results |
| 85 | + |
| 86 | +After generating and validating, present: |
| 87 | +1. A file list with full paths and a one-line description of each file. |
| 88 | +2. Any style fixes that were applied during generation and review. |
| 89 | +3. Suggested next steps (e.g. adding images, creating reusable modules, running `make serve` to preview). |
0 commit comments