AgentSkillsCN

update-nav

在 docs.json 导航结构中新增页面。根据用户旅程更新导航分组(如“指南”、“API 参考”、“配方”等)。适用于用户请求在导航中添加页面、更新 docs.json、加入导航,或在侧边栏中纳入新页面的场景。

SKILL.md
--- frontmatter
name: update-nav
description: Add new pages to docs.json navigation structure. Updates navigation groups based on user journey (Guides, API Reference, Recipes, etc.). Use when the user asks to add a page to navigation, update docs.json, add to nav, or include a new page in the sidebar.

Update Navigation

Add new documentation pages to the docs.json navigation structure.

Instructions

  1. Identify the page: Determine which page needs to be added to navigation

    • If not specified, ask the user which file/page to add
    • Confirm the file path is correct (relative to docs root)
  2. Determine navigation group: Figure out where in the navigation this belongs

    • Ask which navigation group it should go in if not specified
    • Common groups: "Get Started", "Developer Resources", "Products", "API Reference", "Recipes"
    • Read docs.json to see current navigation structure and group names
  3. Read current docs.json:

    • Understand the existing navigation structure
    • Find the correct group to add to
    • Note the format and patterns used
  4. Update docs.json:

    • Add the new page entry to the appropriate navigation group
    • Maintain consistent formatting
    • Preserve alphabetical or logical ordering within the group if applicable
    • Ensure proper JSON syntax
  5. Show changes:

    • Show the user what was added to docs.json
    • Confirm the placement is correct

Navigation structure notes

  • Pages are organized by user journey, not by file structure
  • The main tabs are: Guides, API Reference, Recipes, Data
  • Navigation group names should match existing patterns
  • Each entry typically includes just the file path

Example

If user says "Add the new webhook-setup.mdx page to the Developer Resources navigation":

  1. Verify file exists at the specified path
  2. Read docs.json to find the "Developer Resources" group
  3. Add "guides/developer-resources/webhook-setup" to the appropriate location in that group
  4. Show the diff for confirmation