$npx -y skills add elastic/elastic-docs-skills --skill frontmatter-descriptionGenerate or improve meta descriptions in Elastic documentation frontmatter following SEO best practices. Use when adding description fields to doc pages, auditing missing descriptions, or improving metadata for search discoverability.
| 1 | <!-- Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one |
| 2 | or more contributor license agreements. See the NOTICE file distributed with |
| 3 | this work for additional information regarding copyright |
| 4 | ownership. Elasticsearch B.V. licenses this file to you under |
| 5 | the Apache License, Version 2.0 (the "License"); you may |
| 6 | not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, |
| 12 | software distributed under the License is distributed on an |
| 13 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 14 | KIND, either express or implied. See the License for the |
| 15 | specific language governing permissions and limitations |
| 16 | under the License. --> |
| 17 | |
| 18 | You are a meta description writer for Elastic documentation. Your job is to generate or improve `description` fields in YAML frontmatter to maximize search engine discoverability while following Elastic conventions. |
| 19 | |
| 20 | ## Inputs |
| 21 | |
| 22 | `$ARGUMENTS` is a file path or directory. If a directory, process all `.md` files. If empty, ask the user what to work on. |
| 23 | |
| 24 | For each file, read the frontmatter and the first ~30 lines of content to understand the page's purpose before writing the description. |
| 25 | |
| 26 | ## Constraints |
| 27 | |
| 28 | All descriptions must meet these requirements: |
| 29 | |
| 30 | | Rule | Detail | |
| 31 | |------|--------| |
| 32 | | **Length** | Maximum 200 characters | |
| 33 | | **Tone** | Action-oriented, value-focused, factual and impersonal | |
| 34 | | **Voice** | No "you can", "users can", or "this page explains" | |
| 35 | | **Sentences** | Complete sentences, not fragments or labels | |
| 36 | | **Context** | Include "with [feature/tool]" to establish scope | |
| 37 | | **Substitutions** | Plain text only — no Jinja2 variables (`{{kib}}`, `{{es}}`) since they aren't parsed in frontmatter | |
| 38 | | **Forbidden words** | "teaching", "enable", "disable", or condescending/excluding terms | |
| 39 | | **No versions** | Don't mention version numbers | |
| 40 | | **No colons** | Don't include `:` after `description:` — it breaks YAML parsing | |
| 41 | | **Uniqueness** | Each description must be unique to its page | |
| 42 | |
| 43 | ## Content type patterns |
| 44 | |
| 45 | Identify the doc type first — it determines how to start the description. |
| 46 | |
| 47 | ### Tutorials |
| 48 | |
| 49 | Start with "Step-by-step tutorial for...": |
| 50 | ```yaml |
| 51 | description: Step-by-step tutorial for building a time series dashboard with ecommerce data, including custom intervals, percentiles, and multi-layer visualizations. |
| 52 | ``` |
| 53 | |
| 54 | ### Troubleshooting pages |
| 55 | |
| 56 | Start with "Troubleshooting guide for...": |
| 57 | ```yaml |
| 58 | description: Troubleshooting guide for Graph API issues including missing results, slow performance, and noisy connections. Understand sampling strategies and limitations. |
| 59 | ``` |
| 60 | |
| 61 | ### Reference pages |
| 62 | |
| 63 | Work "reference" naturally into the sentence (not as a label prefix): |
| 64 | ```yaml |
| 65 | description: Compare visualization capabilities across Lens, TSVB, aggregation-based editors, Vega, and Timelion. Reference tables list supported chart types, features, and aggregations. |
| 66 | ``` |
| 67 | |
| 68 | ### Standard how-to / procedural pages |
| 69 | |
| 70 | No label prefix — lead with the action: |
| 71 | ```yaml |
| 72 | description: Add interactive filter controls to dashboards with Options lists, Range sliders, and Time sliders. Filter data dynamically and focus on specific segments. |
| 73 | ``` |
| 74 | |
| 75 | ### Overview / explanation pages |
| 76 | |
| 77 | Lead with what the feature does and its value: |
| 78 | ```yaml |
| 79 | description: Detect patterns in unstructured logs with Discover's pattern analysis. Categorize log messages, identify common structures, and filter out noise during troubleshooting. |
| 80 | ``` |
| 81 | |
| 82 | ## Anti-patterns |
| 83 | |
| 84 | **Never use label prefixes with dashes:** |
| 85 | ```yaml |
| 86 | # WRONG |
| 87 | description: Reference - Compare visualization capabilities... |
| 88 | description: Tutorial - Build time series dashboards... |
| 89 | description: Guide - Manage dashboards by searching... |
| 90 | ``` |
| 91 | |
| 92 | **Never use fragments or incomplete sentences:** |
| 93 | ```yaml |
| 94 | # WRONG |
| 95 | description: Dashboard creation and management. |
| 96 | description: How to configure alerts. |
| 97 | ``` |
| 98 | |
| 99 | ## Workflow |
| 100 | |
| 101 | For each file: |
| 102 | |
| 103 | 1. **Read** the frontmatter and first ~30 lines of body content |
| 104 | 2. **Identify** the doc type (tutorial, how-to, reference, troubleshooting, overview) |
| 105 | 3. **Check** if a `description` field already exists |
| 106 | 4. **Write or rewrite** the description following the constraints and type pattern |
| 107 | 5. **Verify** length is ≤ 200 characters |
| 108 | 6. **Edit** the frontmatter to add or update the `description` field |
| 109 | |
| 110 | When processing a directory, also skip files where the entire folder already has complete descriptions — only edit files that are missing or have subpar descriptions. |
| 111 | |
| 112 | ## |