‹ 首页

update-component-reference

@nikiforovall · 收录于 昨天 · 上游提交 3 周前

This skill should be used when the user wants to add components (commands, agents, skills, hooks, or MCP servers) to the Component Reference section of the website.

适合你,如果你需要维护网站上的组件目录

/ 通过 npx 安装 校验哈希
npx oh-my-skill add nikiforovall/claude-code-rules/update-component-reference
/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- nikiforovall/claude-code-rules/update-component-reference
/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify nikiforovall/claude-code-rules/update-component-reference
安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
133GitHub stars
~1.7K上下文体积 · 单文件
索引托管

怎么用

商店整理自技能原文 · 版本 642e21e · 表述以原文为准
它做什么

当用户要求为Claude Code组件(命令、代理、技能、钩子、MCP服务器)添加文档时,Claude会检查组件是否存在,然后在网站Component Reference部分创建对应的MDX文件,并填入规范、配置等信息。

什么时候触发

用户要求将新的命令、代理、技能、钩子或MCP服务器添加到网站的Component Reference文档时。

装好后可以这样说
Claude会创建skill-creator.mdx文件。
技能原文 SKILL.md作者撰写 · Apache-2.0 · 642e21e

Update Component Reference Skill

Add documentation for Claude Code components (commands, agents, skills, hooks, MCP servers) to the website's Component Reference section.

When to Use

Use this skill when the user requests to:

  • Add a new component to the Component Reference documentation
  • Document a newly created command, agent, skill, hook, or MCP server
  • Update component documentation in the reference section
Prerequisites Checklist

Before documenting a component, ensure:

  1. Component exists in the appropriate plugin directory:
  2. Commands: plugins/handbook/commands/{name}.md
  3. Agents: plugins/handbook/agents/{name}.md
  4. Skills: plugins/handbook/skills/{name}/SKILL.md
  5. Hooks: plugins/{plugin-name}/hooks/hooks.json and hook scripts
  6. MCP Servers: plugins/{plugin-name}/.mcp.json
  1. For skills only: Component is registered in plugin.json: ```json { "skills": [ "./skills/skill-creator", "./skills/{new-skill-name}" ] } ```
  1. Verify plugin name: Check .claude-plugin/plugin.json for the badge (e.g., "handbook", "handbook-dotnet")
Implementation Process
Step 1: Determine Target Directory

Component documentation goes in: website/docs/component-reference/{type}/

  • Commands → website/docs/component-reference/commands/
  • Agents → website/docs/component-reference/agents/
  • Skills → website/docs/component-reference/skills/
  • Hooks → website/docs/component-reference/hooks/
  • MCP Servers → website/docs/component-reference/mcp-servers/

All category directories and _category_.json files already exist for these types.

Step 2: Determine sidebar_position

Read existing .mdx files in the target directory to find the highest sidebar_position and add 1.

Example:

grep -h "sidebar_position:" website/docs/component-reference/skills/*.mdx | sort -n
Step 3: Create Component Documentation File

Filename convention: Use kebab-case matching the component name

  • Command /commitcommit.mdx
  • Agent @backend-architectbackend-architect.mdx
  • Skill skill-creatorskill-creator.mdx
  • Hook csharp-formattercsharp-formatter.mdx
  • MCP Server context7context7.mdx
Step 4: Write MDX Content

Use the appropriate template based on component type:

Commands Template
---
title: "/command-name"
sidebar_position: N
---

import CommandNameSource from '!!raw-loader!../../../../plugins/handbook/commands/command-name.md'
import CodeBlock from '@theme/CodeBlock';

# Use `/command-name`

<span className="badge badge--handbook">handbook</span>

Brief description of what this command does (1-2 sentences).

More detailed explanation of the command's purpose and benefits.

## Command Specification

<CodeBlock language="markdown">
{CommandNameSource}
</CodeBlock>

## Additional sections as needed
- Example usage
- Tips and tricks
- Related commands
Agents Template
---
title: "@agent-name"
sidebar_position: N
---

import AgentNameSource from '!!raw-loader!../../../../plugins/handbook/agents/agent-name.md'
import CodeBlock from '@theme/CodeBlock';

# Use `@agent-name` agent

<span className="badge badge--handbook">handbook</span>

Brief description of what this agent specializes in (1-2 sentences).

More detailed explanation of the agent's capabilities and when to use it.

## Agent Specification

<CodeBlock language="markdown">
{AgentNameSource}
</CodeBlock>

## Additional sections as needed
- Key strengths
- Example use cases
- Related agents
Skills Template
---
title: "skill-name"
sidebar_position: N
---

import SkillNameSource from '!!raw-loader!../../../../plugins/handbook/skills/skill-name/SKILL.md'
import CodeBlock from '@theme/CodeBlock';

# Use `skill-name` skill

<span className="badge badge--handbook">handbook</span>

Brief description of what this skill provides (1-2 sentences).

More detailed explanation of the skill's purpose and capabilities.

## When to Use This Skill

Use the `skill-name` skill when you want to:

- Primary use case
- Secondary use case
- Additional scenarios

## Skill Specification

<CodeBlock language="markdown">
{SkillNameSource}
</CodeBlock>

## Additional sections as needed
- Key concepts
- Example workflows
- Related skills
Hooks Template
---
title: "Hook Name"
sidebar_position: N
---

# Hook Name

<span className="badge badge--{plugin-name}">{plugin-name}</span>

Brief description (1-2 sentences).

## Configuration

{ hook config from hooks.json }

## Use Cases

- Bullet points

## Installation

Setup notes.

## Related

- Links
MCP Servers Template
---
title: "server-name"
sidebar_position: N
---

# Server Name MCP Server

<span className="badge badge--{plugin-name}">{plugin-name}</span>

Brief description (1-2 sentences).

## Configuration

{ config from .mcp.json }

## Coverage

- Bullet list

## Example Usage

"Example query"

## Installation

Setup notes.

## Related

- Links
Step 5: Verify Import Paths (Commands, Agents, Skills Only)

Note: Hooks and MCP Servers show configuration directly (no raw-loader imports needed).

For commands, agents, and skills, double-check the raw-loader import path:

  • Commands: '!!raw-loader!../../../../plugins/handbook/commands/{name}.md'
  • Agents: '!!raw-loader!../../../../plugins/handbook/agents/{name}.md'
  • Skills: '!!raw-loader!../../../../plugins/handbook/skills/{name}/SKILL.md' ⚠️ Note the /SKILL.md suffix

The path goes up 4 directories (../../../../) from the .mdx file to reach the repo root.

Common Pitfalls
  1. Forgetting plugin.json registration for skills
  2. Skills MUST be in plugin.json or they won't be available
  3. Commands, agents, hooks, and MCP servers are auto-discovered
  1. Incorrect import paths
  2. Skills use /SKILL.md suffix: skills/{name}/SKILL.md
  3. Commands and agents use .md directly: commands/{name}.md
  4. Hooks and MCP servers don't use raw-loader (show config directly)
  1. Wrong relative path depth (commands, agents, skills only)
  2. Always use 4 levels up: ../../../../
  3. Path starts from the .mdx file location
  1. Inconsistent naming
  2. File names should match component names exactly (kebab-case)
  3. Title in frontmatter should include prefix (/ for commands, @ for agents)
  1. Wrong plugin badge
  2. Badge class follows pattern: badge--{plugin-name}
  3. Badge text is the plugin name (e.g., "handbook", "handbook-dotnet")
Quick Reference
Import Variable Naming Convention (Commands, Agents, Skills)

Match the component name in PascalCase + "Source":

  • commit.mdCommitCommandSource
  • backend-architect.mdBackendArchitectAgentSource
  • skill-creator/SKILL.mdSkillCreatorSource

Note: Hooks and MCP servers don't use imports.

Badge

Badge format: <span className="badge badge--{plugin-name}">{plugin-name}</span>

Examples:

  • handbook: <span className="badge badge--handbook">handbook</span>
  • handbook-dotnet: <span className="badge badge--handbook-dotnet">handbook-dotnet</span>
Adding a New Plugin

When documenting components from a new plugin, also update:

  1. Badge CSS: Add style to website/src/css/custom.css (pick unique color)
  2. Plugin index: Add entry to website/docs/plugins.md (both main list and Direct Installation section)
Example Workflow

User: "Add the new @pair-programmer agent to the documentation"

  1. Verify component exists: plugins/handbook/agents/pair-programmer.md
  2. Check it's an agent (auto-discovered, no plugin.json needed) ✓
  3. Find next sidebar_position in website/docs/component-reference/agents/
  4. Create website/docs/component-reference/agents/pair-programmer.mdx
  5. Write content using agent template
  6. Import using: '!!raw-loader!../../../../plugins/handbook/agents/pair-programmer.md'
  7. Verify documentation renders correctly
按 Apache-2.0 许可原样转载,未经改动 · 在 GitHub 查看 →

评论

登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。