add-related-resources

Generates and merges localized RelatedResources cards into TiDB documentation pages.

617|718|Updated Jul 23, 2016
One-click install
npx skills add https://github.com/pingcap/docs --skill add-related-resources
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: add-related-resources
Source: https://github.com/pingcap/docs/tree/main/.agents/skills/add-related-resources
Command: npx skills add https://github.com/pingcap/docs --skill add-related-resources

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Adding related resource cards to TiDB docs requires correct MDX component syntax, localized headings for English, Chinese, and Japanese, and accurate metadata from blogs, YouTube videos, and TiDB Labs, which is error-prone when done manually.

Core Features & Use Cases

  • Metadata Fetching: Runs a Python script that drafts ResourceCard JSON from blog, YouTube, or lab URLs with language-aware URL normalization.
  • Localized Merging: Appends cards to an existing RelatedResources block or creates the correct localized h2 section, including the Japanese {#related-resources} anchor.
  • Format Validation: Validates card attributes, date formats, localized durations, and YouTube link/image ID consistency until the file passes.
  • Use Case: When a user asks to add a YouTube video card to a Japanese TiDB docs page, the skill fetches the video title and duration, builds the card, merges it under 関連リソース {#related-resources}, and validates the result.

Quick Start

Add a related resource card for this YouTube link to the Japanese version of the TiDB quick-start doc page.

Frequently Asked Questions about add-related-resources

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a related resources section to a TiDB docs page?

Add a final h2 heading followed by a RelatedResources block containing one ResourceCard per line. The heading is localized: Related resources for English, 相关资源 for Chinese, and 関連リソース {#related-resources} for Japanese.

How to generate ResourceCard metadata from a YouTube or blog URL?

Run the fetch_resource_metadata.py script with the URL and a --lang flag of en, zh, or ja. It returns a JSON draft with type, title, link, imgSrc, and optional fields, plus warnings you should review before merging.

What attributes does a ResourceCard component require?

Every card requires title, type, link, and imgSrc, with type limited to blog, video, or lab. Optional attributes are author, date in YYYY-MM-DD format, and a localized duration such as 8 mins, 8 分钟, or 8 分.

Does the skill support Japanese TiDB documentation?

Yes, Japanese docs use the heading 関連リソース with a mandatory {#related-resources} anchor and durations formatted like 8 分. Japanese blog URLs use pingcap.co.jp, and missing pages require user confirmation before fallback.

Why does RelatedResources validation fail on my docs file?

Common causes include duplicate container sections, blank lines inside the block, non-ISO dates, wrong duration formats, or mismatched YouTube IDs between link and imgSrc. Run validate_related_resources.py to list exact line-level errors.