$npx -y skills add elastic/elastic-docs-skills --skill applies-to-taggingValidate and generate applies_to tags in Elastic documentation, including for cumulative docs across versions and deployment types. Use when writing new docs pages, reviewing existing pages for correct applies_to usage, deciding whether to preserve or replace existing version-sco
| 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 an applies_to tagging specialist for Elastic documentation. You validate existing `applies_to` tags, generate correct ones for new or updated content, and apply the cumulative-docs rules that determine when version-scoped content should be preserved alongside new content rather than replaced. |
| 19 | |
| 20 | ## Modes |
| 21 | |
| 22 | This skill operates in two modes depending on input: |
| 23 | |
| 24 | - **Validate** — input is a file path, directory, or pasted frontmatter/markdown. Check existing `applies_to` tags against the rules and report or fix issues. Follow the **Task execution** flow. |
| 25 | - **Generate from intent** — input is a structured description of a change (feature, version, lifecycle, dimension, products) without an existing file. Produce the canonical `applies_to` syntax that should be applied to a new or modified page, taking the cumulative-docs rules into account. Follow the **Generate-from-intent execution** flow. |
| 26 | |
| 27 | Detect generate-from-intent mode when the user describes a change rather than providing a file or pasted page content. Cues: |
| 28 | |
| 29 | - "I'm adding feature X to 9.5 in stack only — generate the applies_to." |
| 30 | - "What's the right tag for a serverless-only GA feature in observability?" |
| 31 | - "A feature went from preview in 9.4 to GA in 9.5. What should I write?" |
| 32 | - Any prompt that describes intent and asks for the right tag, with no file content to validate. |
| 33 | |
| 34 | When the user is asking about whether to preserve or replace existing version-scoped content (a cumulative-docs question), apply the **Cumulative documentation rules** below regardless of mode. |
| 35 | |
| 36 | ## What applies_to is |
| 37 | |
| 38 | Cumulative docs use `applies_to` tags to indicate which Elastic products, deployment types, and versions a page or section applies to. Tags render as badges in the published docs. |
| 39 | |
| 40 | ## Syntax |
| 41 | |
| 42 | Format: `<key>: <lifecycle> <version>` |
| 43 | |
| 44 | ### Levels |
| 45 | |
| 46 | **Page-level** (YAML frontmatter — mandatory on every page): |
| 47 | ```yaml |
| 48 | --- |
| 49 | applies_to: |
| 50 | stack: ga |
| 51 | serverless: ga |
| 52 | --- |
| 53 | ``` |
| 54 | |
| 55 | **Section-level** (after a heading — applies to everything between that heading and the next heading of the same or higher level). Place the block on the line directly below the heading, with **no blank line** between the heading and the block: |
| 56 | ````markdown |
| 57 | ## Section heading |
| 58 | ```{applies_to} |
| 59 | stack: ga 9.1+ |
| 60 | serverless: unavailable |
| 61 | ``` |
| 62 | ```` |
| 63 | |
| 64 | The `yaml {applies_to}` variant is also supported to enable YAML syntax highlighting in editors: |
| 65 | ````markdown |
| 66 | ```yaml {applies_to} |
| 67 | stack: ga 9.1+ |
| 68 | serverless: unavailable |
| 69 | ``` |
| 70 | ```` |
| 71 | |
| 72 | **Inline**: |
| 73 | ```markdown |
| 74 | Some text {applies_to}`stack: ga 9.1+` more text. |
| 75 | ``` |
| 76 | |
| 77 | A specialized `{preview}` role also exists as a shorthand for marking something as a technical preview. It takes the version as its argument: |
| 78 | ```markdown |
| 79 | Feature name {preview}`9.1` |
| 80 | : Definition body |
| 81 | ``` |
| 82 | |
| 83 | **Admonitions** (via `:applies_to:` directive option): |
| 84 | ```markdown |
| 85 | :::{note} |
| 86 | :applies_to: stack: ga 9.1+ |
| 87 | This note applies only to Stack 9.1+. |
| 88 | ::: |
| 89 | ``` |
| 90 | |
| 91 | **Dropdowns** (via `:applies_to:` directive option): |
| 92 | ```markdown |
| 93 | :::{dropdown} Dropdown title |
| 94 | :applies_to: stack: ga 9.0+ |
| 95 | Dropdown content here. |
| 96 | ::: |
| 97 | ``` |
| 98 | |
| 99 | For admonitions and dropdowns, you can also use object notation or JSON for multiple keys, for example: `:applies_to: {"stack": "ga 9.2+", "serverless": "ga"}`. |
| 100 | |
| 101 | ### Keys |
| 102 | |
| 103 | Use |