Official agent skill

Docs Restructure

by langchain-ai in langchain-ai/docs

Restructure documentation that spans several pages. An agent skill from langchain-ai/docs.

OfficialMITAuto-check passedAI & LLM Engineering

Install Docs Restructure

skills CLI
$ npx skills add langchain-ai/docs --skill docs-restructure -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install langchain-ai/docs docs-restructure --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/langchain-ai/docs.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/docs-restructure .claude/skills/docs-restructure && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
docs-restructure
GitHub stars
424
Token cost
~1.7k tokens
SKILL.md length
934 words
Files
1
Skills in repo
17
Repo updated
First seen
Licence
MIT

At a glance

Restructure documentation that spans several pages. An agent skill from langchain-ai/docs.

  • Works in 7 steps: Establish the page family → Build a duplication map before writing… → Assign one home per topic → …
  • Asked to streamline
  • SKILL.md covers Step 1. Establish the page…, Step 2. Build a duplication…, Step 3. Assign one home per… and Step 4. Cut, do not relocate, plus 5 more sections
  • Calls make and python3

What it does

Docs Restructure is an agent skill from langchain-ai/docs, published by the product's own GitHub organization. Restructure documentation that spans several pages. Covers splitting a page that has grown too long, moving sections between pages, retiring a page, and fixing a topic documented in two places at once. Use when asked to streamline, simplify, consolidate, or reorganize docs, or when a page review keeps producing edits without the page getting shorter.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in AI & LLM Engineering. The repository describes itself as: Unified LangChain documentation. The licence is MIT.

When your agent uses it

  • Asked to streamline
  • Reorganize docs
  • A page review keeps producing edits without the page getting shorter

Example prompts

  • “/docs-restructure”

Requirements

  • Python 3

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Establish the page family
  2. Build a duplication map before writing anything
  3. Assign one home per topic
  4. Cut, do not relocate
  5. Mechanics
  6. Verify
  7. Report what moved

What it can do on your machine

Read from SKILL.md and the folder at commit 85713b3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • make
    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Docs Restructure loads about 1.7k tokens when it runs. Until then it costs about 92 tokens; SKILL.md has 934 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~92
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from langchain-ai/docs at commit 85713b3, republished under its MIT licence (© langchain-ai). 934 words, ~1,744 tokens.

Download SKILL.mdSave it as .claude/skills/docs-restructure/SKILL.md (or your agent's skills folder).
name
docs-restructure
description
Restructure documentation that spans several pages. Covers splitting a page that has grown too long, moving sections between pages, retiring a page, and fixing a topic documented in two places at once. Use when asked to streamline, simplify, consolidate, or reorganize docs, or when a page review keeps producing edits without the page getting shorter.

Restructure docs across pages

The failure this skill prevents: an agent asked to "streamline this page" reorders its sections, collapses them into accordions, retitles them, and tabulates them, thirty times over, while the page gets longer. The page was never the problem. Three of its sections already existed on sibling pages.

Single-page skills cannot see that. add-docs-page owns one page's lifecycle and docs-edit owns one page's diff. This skill owns the question they cannot ask: is this content on the right page at all?

AGENTS.md holds the navigation map, the style guide, and the frontmatter rules. This skill covers the procedure around them and does not repeat them.

Step 1. Establish the page family

A page almost never lives alone. Find its siblings before reading it closely:

bash
ls src/langsmith/llm-gateway*.mdx          # a flat-file family
ls src/oss/deepagents/                     # a directory family
grep -n '"langsmith/llm-gateway' src/docs.json   # what the nav groups together

The nav grouping is the better signal when the two disagree: pages a reader moves between are the pages whose content can be confused.

Then list every heading in the family, so you are working from the whole shape rather than one file:

bash
grep -n '^## ' src/langsmith/llm-gateway*.mdx

Step 2. Build a duplication map before writing anything

This is the step that does the work. For each H2 in the page you were asked to fix, search the rest of the family for the same content:

bash
grep -rn 'LANGSMITH_GATEWAY' src/langsmith/ --include=*.mdx
grep -rn 'Use a regional gateway' src/ --include=*.mdx

Search for the distinctive noun, env var, or endpoint in the section, not for its heading. Duplicated content is usually retitled, which is why heading searches miss it.

Record for each section: does this topic already live somewhere else, and where? Two copies that have drifted apart are the strongest finding available. It means no page owns the topic, so both copies are edited independently and readers get contradictions. In one real case the quickstart claimed TypeScript support for three providers while the sibling page said "Python only."

Report the map before editing anything. "Three of these six sections duplicate llm-gateway-api-formats" is the finding. The restructure is downstream of it.

Step 3. Assign one home per topic

For each topic in the map, pick the single page that should own it:

  • Prefer a page that already exists. A new page is warranted when the topic has no home and does not fit an existing one, not when it merely needs somewhere to go.

  • Prefer the page a reader would search for, not the page the content happens to sit on.

  • Keep the most-linked URL. Check before choosing, because inbound links decide which file survives a merge of two pages:

    bash
    grep -rn '(/langsmith/llm-gateway)' src/ --include=*.mdx | wc -l

    Folding content into the well-linked page and retiring the other one is usually cheaper than the reverse.

Step 4. Cut, do not relocate

A section that duplicates a sibling gets deleted and replaced with one sentence pointing at the owner. It does not get moved, collapsed into an accordion, or shortened in place. An accordion still costs the reader the decision of whether to open it.

Content that has no home yet moves. Content that has one is already written.

When you delete a section whose facts differ from the sibling's, the difference is a bug in one of them. Resolve it against the source before deleting, or you silently pick a winner. See docs-edit for the verification procedure.

Show full SKILL.md (408 more words)Show less

Step 5. Mechanics

Retiring, renaming, or creating a page means navigation entries, redirects, and inbound links. add-docs-page covers all of it, including the anchor-stability and snippet traps. Follow it rather than improvising here.

Two additional things a restructure breaks that a single-page edit does not:

  • Section anchors other pages link to. Moving a section moves its anchor. Grep for #the-anchor across src/ before the move and repoint every hit. A <Step> or <Accordion> can carry an explicit id to preserve a landing spot that is no longer a heading.
  • Cross-page pointers that now point at the wrong page. After moving a topic, the sibling pages that used to reference its old location need repointing, not just the page you edited.

Step 6. Verify

bash
make lint_prose FILES="<changed files>"
make build
make broken-links-with-anchors
python3 scripts/check_removed_pages_redirects.py --base-ref origin/main src/docs.json

Read broken-links-with-anchors by skipping to the ⎿ lines; those are the only real failures. Compare the count against the same command on origin/main so a pre-existing baseline is not read as a regression.

Then review the prose with the docs-review skill, scoped to the files this pass changed.

Step 7. Report what moved

State, per page, what was deleted, what moved, and what was added, with before and after line counts. A restructure that cannot show a page getting shorter has not restructured anything, and the line counts are what show the reviewer whether it did.

Name what you deleted rather than only what you wrote. A reviewer who asked for a shorter page needs to see the cuts to agree with them.

Scope

Stay inside the page family named in the request. A restructure surfaces adjacent problems: stale model IDs, legacy version numbers, and the same duplication one directory over. Report them, and ask before widening the sweep. Fixing sixteen instances across a page family is a reasonable follow-on inside one pull request. Fixing six hundred across the corpus is a separate pull request and probably a tracked issue, because some instances are deliberate and some live in generated files.

Checklist

  • Page family established from src/docs.json, not guessed from filenames.
  • Duplication map built and reported before any edit.
  • One owner chosen per topic; most-linked URL identified before merging pages.
  • Duplicated sections deleted and replaced with a pointer, not relocated.
  • Conflicting facts between copies resolved against source, not by picking one.
  • Redirects, nav entries, inbound links, and section anchors all updated.
  • Verification commands run, ⎿ count compared against origin/main.
  • Report gives per-page before and after line counts.
  • Anything outside the page family reported, not swept, unless asked.

© langchain-ai, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/docs-restructure of langchain-ai/docs.

Open the folder on GitHubat commit 85713b3

Compare with similar skills

Docs Restructure next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Docs Restructure compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Docs Restructure this skilllangchain-ai/docs424—~1.7kAutomated safety check: PassMIT
Agent BuildershareAI-lab/learn-claude-code78k6 repos~1.2kAutomated safety check: PassMIT
Add Uint Supportpytorch/pytorch104k2 repos~2.3kAutomated safety check: PassCustom licence
Peft Fine TuningOrchestra-Research/AI-Research-SKILLs13k9 repos~3.1kAutomated safety check: PassMIT
Segment Anything Model GuideOrchestra-Research/AI-Research-SKILLs13k9 repos~3.3kAutomated safety check: PassMIT
1passwordtrpc-group/trpc-agent-go1.8k13 repos~656Automated safety check: PassApache-2.0

Similar skills

  • Agent Builder

    shareAI-lab/learn-claude-code

    Design and build AI agents for any domain. An agent skill from shareAI-lab/learn-claude-code.

    78k GitHub starsUsed in 6 repos~1.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Add Uint Support

    pytorch/pytorch

    Add unsigned integer (uint) type support to PyTorch operators by updating ATDISPATCH macros.

    104k GitHub starsUsed in 2 repos~2.3k tokens
    AI & LLM EngineeringAuto-check passed
  • Peft Fine Tuning

    Orchestra-Research/AI-Research-SKILLs

    Parameter-efficient fine-tuning for LLMs using LoRA, QLoRA, and 25+ methods.

    13k GitHub starsUsed in 9 repos~3.1k tokens
    AI & LLM EngineeringAuto-check passed
  • Segment Anything Model Guide

    Orchestra-Research/AI-Research-SKILLs

    Guide to using Meta's Segment Anything Model for zero-shot image segmentation with point, box or mask prompts, or automatic mask generation.

    13k GitHub starsUsed in 9 repos~3.3k tokens
    AI & LLM EngineeringAuto-check passed
  • 1password

    trpc-group/trpc-agent-go

    Set up and use 1Password CLI (op). An agent skill from trpc-group/trpc-agent-go.

    1.8k GitHub starsUsed in 13 repos~656 tokens
    AI & LLM EngineeringAuto-check passed
  • Chroma Vector Database

    Orchestra-Research/AI-Research-SKILLs

    Shows how to store documents and embeddings in Chroma, query them by similarity with metadata filters, and persist them to disk for RAG and semantic search projects.

    13k GitHub starsUsed in 8 repos~2.3k tokens
    AI & LLM EngineeringAuto-check passed

More from langchain-ai/docs

All 17 skills in this repo
  • Add Docs Page

    langchain-ai/docs

    Official

    Add, move, rename, or delete a page on the LangChain docs site.

    424 GitHub stars~2k tokensUpdated today
    Auto-check passed
  • Deep Agents

    langchain-ai/docs

    Official

    Build batteries-included agents with planning, context management, subagent delegation, and sandboxed execution.

    424 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Docs Code Samples

    langchain-ai/docs

    Official

    A skill your agent uses when migrating inline code samples from LangChain docs (MDX files) into external, testable code files that are extracted by this repo’s snippet scripts and used as Mintlify…

    424 GitHub stars~4.6k tokensUpdated today
    Auto-check passed
  • Docs Edit

    langchain-ai/docs

    Official

    Edit a docs page that already has an open pull request, or revise a page in place.

    424 GitHub stars~1.9k tokensUpdated today
    Auto-check passed
  • Docs Team Voice

    langchain-ai/docs

    Official

    Write or revise documentation prose so it reads like the rest of this site, in the docs team's shared voice.

    424 GitHub stars~1.5k tokensUpdated today
    Auto-check passed
  • Langchain

    langchain-ai/docs

    Official

    Build agents with a prebuilt architecture and integrations for any model or tool.

    424 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Questions about Docs Restructure

What does Docs Restructure do?

Restructure documentation that spans several pages. An agent skill from langchain-ai/docs. Docs Restructure is an agent skill from langchain-ai/docs, published by the product's own GitHub organization. Restructure documentation that spans several pages.

When should I use Docs Restructure?

Docs Restructure fits situations like: asked to streamline; reorganize docs; A page review keeps producing edits without the page getting shorter.

How do I install Docs Restructure in Claude Code?

Run `npx skills add langchain-ai/docs --skill docs-restructure -a claude-code`. Or copy the skill folder (.agents/skills/docs-restructure in langchain-ai/docs) into .claude/skills/docs-restructure in your project. Claude Code loads it when a task matches its description.

How do I install Docs Restructure in Codex?

Run `npx skills add langchain-ai/docs --skill docs-restructure -a codex`. Or copy the skill folder (.agents/skills/docs-restructure in langchain-ai/docs) into .agents/skills/docs-restructure in your project. Codex loads it when a task matches its description.

Can I use Docs Restructure in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add langchain-ai/docs --skill docs-restructure -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/docs-restructure, .gemini/skills/docs-restructure, .github/skills/docs-restructure and .opencode/skills/docs-restructure in your project.

What does Docs Restructure need to run?

Going by SKILL.md and its folder, Docs Restructure needs the command-line tools its instructions call (make and python3). Our summary lists: Python 3.

Does Docs Restructure access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Docs Restructure safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Docs Restructure use?

Docs Restructure is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Docs Restructure use?

About 1.7k tokens (SKILL.md is roughly 7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Docs Restructure?

Skills that share tags, products or a category with Docs Restructure: Agent Builder (shareAI-lab/learn-claude-code, 78k stars), Add Uint Support (pytorch/pytorch, 104k stars), Peft Fine Tuning (Orchestra-Research/AI-Research-SKILLs, 13k stars) and Segment Anything Model Guide (Orchestra-Research/AI-Research-SKILLs, 13k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Docs Restructure?

langchain-ai (a GitHub organization, an official publisher) maintains it in langchain-ai/docs, which has 424 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

Source: langchain-ai/docs on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.