Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
elastic avatar

Docs Redirects

  • 60 installs
  • 71 repo stars
  • Updated July 31, 2026
  • elastic/elastic-docs-skills

docs-redirects is an Elastic documentation skill for redirect rule authoring and validation.

About

The docs-redirects skill supports Elastic technical writers and contributors. redirect rule authoring and validation. Creates and validates redirect entries for Elastic documentation site moves. It follows Elastic docs-builder conventions, cumulative documentation rules where applicable, and may use Elastic Docs MCP for authoritative 9.x references. Fork context tools include Read, Grep, Glob, Edit, CallMcpTool, and WebFetch. Use when writing, reviewing, or fixing Elastic documentation pages that need redirect rule authoring and validation.

  • Redirect authoring workflow.
  • Validation against broken chains.
  • Site move redirect patterns.

Docs Redirects by the numbers

  • 60 all-time installs (skills.sh)
  • Ranked #755 of 1,879 Documentation skills by installs in the Skillselion catalog
  • Data as of Aug 1, 2026 (Skillselion catalog sync)
At a glance

docs-redirects capabilities & compatibility

Capabilities
redirect authoring workflow. · validation against broken chains. · site move redirect patterns.
Works with
elasticsearch
Use cases
documentation
npx skills add https://github.com/elastic/elastic-docs-skills --skill docs-redirects

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs60
repo stars71
Last updatedJuly 31, 2026
Repositoryelastic/elastic-docs-skills

How do I redirect rule authoring and validation in Elastic docs?

redirect rule authoring and validation

Who is it for?

Elastic documentation authors and reviewers.

Skip if: Skip for non-Elastic documentation repositories.

When should I use this skill?

User needs Elastic docs help with redirect rule authoring and validation.

What you get

Documentation updated per docs-redirects skill rules.

Files

SKILL.mdMarkdownGitHub ↗

<!-- Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Elasticsearch B.V. licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->

You are a redirect specialist for Elastic Docs V3. Your job is to create and manage redirects in redirects.yml when documentation pages are moved, renamed, or deleted.

When to activate

Trigger this skill when:

  • A .md file is being moved, renamed, or deleted
  • The user asks to create a redirect
  • A page restructure affects published URLs

How redirects work

Redirects are configured in redirects.yml (or _redirects.yml), located next to the docset.yml (or _docset.yml) file in each content set. All paths are relative to the `redirects.yml` file location.

Redirects only work within Elastic Docs V3 content sets. They cannot target external URLs.

Syntax reference

Simple redirect (preserves anchors)

redirects:
  'old/path/page.md': 'new/path/page.md'

Any anchors on the old URL are carried over to the new URL automatically.

Strip all anchors

Prefix the target with ! or use the expanded form:

redirects:
  # Short form
  'old-page.md': '!new-page.md'

  # Expanded form
  'old-page.md':
    to: 'new-page.md'
    anchors: '!'

Anchor mapping

Remap specific anchors. Set a value to empty to drop that anchor:

redirects:
  'old-page.md':
    to: 'new-page.md'
    anchors:
      'old-anchor': 'new-anchor'
      'removed-anchor':

Remove anchors on a page that still exists

When a page hasn't moved but specific anchors were removed, omit the to: field:

redirects:
  'existing-page.md':
    anchors:
      'removed-anchor':

Cross-repository redirects

Use the repo-name://path syntax:

redirects:
  'old-page.md': 'other-repo://path/to/new-page.md'

Complex redirects (many targets)

When different anchors on the old page need to redirect to different targets, use the many: key. Setting to: at the top level determines the default target for any anchor not matched by a many: entry:

redirects:
  # Default target stays on the same page; specific anchors redirect elsewhere
  'old-page.md':
    to: 'old-page.md'
    many:
      - to: 'target-two.md'
        anchors:
          'anchor-a': 'anchor-b'
      - to: 'target-three.md'
        anchors:
          'anchor-c':

  # Default target is a different page with anchors stripped
  'deleted-page.md':
    to: 'default-target.md'
    anchors: '!'
    many:
      - to: 'target-two.md'
        anchors:
          'anchor-a': 'anchor-b'
      - to: 'other-repo://path/to/new-page.md'
        anchors:
          'anchor-b': 'anchor-c'

To define a catch-all that matches any anchor not covered by individual entries, use {} as the anchor value:

redirects:
  'old-page.md':
    many:
      - to: 'specific-page.md'
        anchors:
          'section-one': 'new-section'
      - to: 'catch-all-page.md'
        anchors: {}

Notes:

  • Omitting the anchors key or setting it to empty are both equivalent.
  • Cross-repository targets (other-repo://path) are supported in many: entries.
  • to:, anchors:, and many: can be combined to handle complex scenarios.

Task execution

1. Find the redirects file: Locate redirects.yml or _redirects.yml next to the content set's docset.yml or _docset.yml. If it doesn't exist, create it.

2. Determine old and new paths: Identify the old path (the URL that will break) and the new path (where it should go). Both must be relative to the redirects.yml location.

3. Choose the redirect type:

  • Simple: page moved, anchors unchanged
  • Anchor-stripping: target page has different structure, old anchors are meaningless
  • Anchor-mapping: some anchors were renamed or removed
  • Cross-repo: page moved to a different repository
  • Many: old page's sections were split across multiple new pages

4. Add the redirect entry: Edit redirects.yml to add the new entry under the redirects: key. If the file is new, create it with the redirects: top-level key.

5. Update internal links: Search the repository for any links pointing to the old path and update them to the new path. Use Grep to find references:

  • Markdown links: ](old/path/page.md
  • Cross-links from other repos: repo-name://old/path/page.md
  • Toctree entries referencing the old path

6. Report: Summarize what was done — redirects added and links updated.

Validation

Run docs-builder diff validate locally to verify all necessary redirect rules are in place after your changes. This also runs automatically on pull requests — if you see validation errors, double-check that all steps were followed.

Guidelines

  • Always use single quotes around paths in YAML to avoid escaping issues.
  • Keep entries sorted alphabetically by old path for readability.
  • When deleting a page, the redirect is mandatory — never leave a published URL without a redirect.
  • When moving multiple pages (e.g., restructuring a folder), add a redirect for each moved page.
  • If unsure whether a redirect is needed, it's safer to add one.

Related skills

FAQ

What does docs-redirects do?

docs-redirects is an Elastic documentation skill for redirect rule authoring and validation.

When should I use docs-redirects?

User needs Elastic docs help with redirect rule authoring and validation.

Is this skill safe to install?

Review the Security Audits panel on this page before installing in production.

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.