Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

mapcn-docs地图中文文档

Agent Skill

用于辅助文档、README、Markdown、说明文和内容稿件的整理与改写。它适合让 Agent 提炼结构、补齐章节、统一术语、检查链接或把零散材料整理成可读文档。使用时应保留项目已有事实、命令和路径,不要把未确认的信息写成确定结论;涉及对外文案时,还需要控制语气,避免过度营销或夸大能力。

总安装

212

周安装

9

GitHub Stars

公开资料未说明

下载量

74
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mapcn-docs(地图中文文档)
来源仓库:https://github.com/lucking7/mapcn-skills
仓库路径:skills/mapcn-docs
安装命令:
npx skills add https://github.com/lucking7/mapcn-skills --skill mapcn-docs
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lucking7/mapcn-skills --skill mapcn-docs

简介

用于辅助文档、README 和 Markdown 内容的整理与改写。

  • 支持结构提炼、术语统一和链接检查。
  • 通过 npx skills add 命令从 GitHub 仓库安装使用。
  • 应保留项目已有事实,避免将未确认信息写成确定结论。
  • mapcn-docs 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

mapcn-docs

Build beautiful, interactive documentation sites with live component previews and copy-paste code examples.

Overview

This skill implements a documentation system featuring:

  • Live previews with tabbed preview/code views
  • Syntax-highlighted code using Shiki with light/dark theme support
  • Copy-to-clipboard functionality for all code examples
  • Responsive sidebar navigation with mobile support
  • Scroll-tracking TOC (Table of Contents)
  • Accessible design using shadcn/ui components

When to Use

Use this skill when:

  • Building a docs site for a component library or design system
  • Creating API reference pages with interactive examples
  • Need tabbed preview/code views like shadcn/ui docs
  • Want copy-paste ready code examples with syntax highlighting

Do NOT use when:

  • Simple static documentation (use MDX or plain markdown)
  • No need for live component previews
  • Not using Next.js App Router or React

Prerequisites:

  • Next.js 13+ with App Router (app/ directory)
  • Tailwind CSS configured
  • shadcn/ui initialized (npx shadcn@latest init)

Quick Start

1. Directory Structure

src/app/docs/
├── layout.tsx                    # Root docs layout
├── page.tsx                      # Introduction page
├── _components/
│   ├── docs.tsx                  # Core UI components
│   ├── docs-sidebar.tsx          # Navigation sidebar
│   ├── docs-toc.tsx              # Table of contents
│   ├── component-preview.tsx     # Server-side preview wrapper
│   ├── component-preview-client.tsx  # Client-side preview tabs
│   ├── code-block.tsx            # Code display
│   ├── copy-button.tsx           # Clipboard utility
│   └── examples/                 # Live example components
└── [route]/page.tsx              # Documentation pages

2. Install Dependencies

npm install shiki
npx shadcn@latest add sidebar table card tabs

3. Create Core Components

See references/COMPONENTS.md for complete component implementations.

Page Structure Pattern

Every documentation page follows this structure:

import { Metadata } from "next";
import { DocsLayout, DocsSection, DocsPropTable } from "../_components/docs";
import { ComponentPreview } from "../_components/component-preview";
import { getExampleSource } from "@/lib/get-example-source";
import { MyExample } from "../_components/examples/my-example";

export const metadata: Metadata = { title: "Page Title" };

export default function PageName() {
  const exampleSource = getExampleSource("my-example.tsx");

  return (
    <DocsLayout
      title="Page Title"
      description="Brief description of this page"
      prev={{ title: "Previous", href: "/docs/previous" }}
      next={{ title: "Next", href: "/docs/next" }}
      toc={[
        { title: "Overview", slug: "overview" },
        { title: "Usage", slug: "usage" },
        { title: "API Reference", slug: "api-reference" },
      ]}
    >
      <DocsSection>
        <p>Introduction paragraph.</p>
      </DocsSection>

      <DocsSection title="Overview">
        <p>Section content here.</p>
      </DocsSection>

      <DocsSection title="Usage">
        <ComponentPreview code={exampleSource}>
          <MyExample />
        </ComponentPreview>
      </DocsSection>

      <DocsSection title="API Reference">
        <DocsPropTable
          props={[
            {
              name: "propName",
              type: "string",
              default: "undefined",
              description: "Description of the prop",
            },
          ]}
        />
      </DocsSection>
    </DocsLayout>
  );
}

Example Component Pattern

Create example components in _components/examples/:

// Client-side example (with state)
"use client";

import { useState } from "react";
import { MyComponent } from "@/registry/my-component";

export function InteractiveExample() {
  const [value, setValue] = useState("initial");

  return (
    <div className="h-[400px] w-full">
      <MyComponent value={value} onChange={setValue} />
    </div>
  );
}
// Server-side example (no state)
import { MyComponent } from "@/registry/my-component";

export function SimpleExample() {
  return (
    <div className="h-[400px] w-full">
      <MyComponent />
    </div>
  );
}

Key pattern: Always wrap examples in a fixed-height container (h-[400px]) for consistent preview rendering.

Navigation Configuration

Define navigation in docs-navigation.ts:

import { BookOpen, Code, Settings } from "lucide-react";

export const docsNavigation = {
  groups: [
    {
      title: "Getting Started",
      items: [
        { title: "Introduction", href: "/docs", icon: BookOpen },
        { title: "Installation", href: "/docs/installation", icon: Code },
      ],
    },
    {
      title: "Components",
      items: [
        { title: "Button", href: "/docs/button", icon: Settings },
        // Add more components...
      ],
    },
  ],
};

Code Highlighting Setup

Create lib/highlight.ts:

import { codeToHtml } from "shiki";

export async function highlightCode(code: string, lang = "tsx") {
  return codeToHtml(code, {
    lang,
    themes: {
      light: "github-light",
      dark: "github-dark",
    },
  });
}

Create lib/get-example-source.ts:

import fs from "fs";
import path from "path";

export function getExampleSource(filename: string): string {
  const filePath = path.join(
    process.cwd(),
    "src/app/docs/_components/examples",
    filename
  );

  let content = fs.readFileSync(filePath, "utf-8");

  // Transform import paths for user copy-paste
  content = content.replace(
    /@\/registry\//g,
    "@/components/ui/"
  );

  return content;
}

UI Components

The docs system uses these core components:

ComponentPurpose
DocsLayoutPage wrapper with prev/next nav and TOC
DocsSectionContent section with auto-generated slug IDs
DocsHeaderPage title and description
DocsNoteHighlighted callout boxes
DocsCodeInline code styling
DocsLinkStyled links with external support
DocsPropTableAPI reference tables
ComponentPreviewLive preview with code tab
CodeBlockStandalone code display

Preview System Architecture

┌─────────────────────────────────────────────┐
│ ComponentPreview (Server Component)          │
│ - Receives code string                       │
│ - Calls highlightCode() with Shiki           │
│ - Passes highlighted HTML to client          │
└──────────────────┬──────────────────────────┘
                   │
                   ▼
┌─────────────────────────────────────────────┐
│ ComponentPreviewClient (Client Component)    │
│ - Renders tabs: Preview | Code               │
│ - Preview tab: renders children              │
│ - Code tab: shows highlighted code           │
│ - Copy button for code                       │
└─────────────────────────────────────────────┘

Adding a New Documentation Page

  1. Create route directory: src/app/docs/[page-name]/page.tsx
  2. Create example component if needed: _components/examples/[name]-example.tsx
  3. Add to navigation in docs-navigation.ts
  4. Update prev/next links on adjacent pages

Best Practices

  1. Keep examples focused - One concept per example
  2. Use fixed heights - h-[400px] for consistent previews
  3. Transform imports - Change internal paths for user copy-paste
  4. Include API tables - Document all props with types and defaults
  5. Add TOC items - List all major sections for scroll tracking
  6. Mobile-first - Test sidebar collapse and responsive layouts

Common Mistakes

MistakeFix
Calling highlightCode in Client ComponentMove to Server Component - Shiki requires server-side execution
Missing fixed height on examplesAdd h-[400px] wrapper for consistent preview rendering
Using internal import paths in examplesUse getExampleSource() to transform @/registry/ to @/components/ui/
Forgetting to update navigationAlways add new pages to docs-navigation.ts
Not updating prev/next linksCheck adjacent pages when adding/removing docs

Troubleshooting

ProblemSolution
shadcn/ui not installedRun npx shadcn@latest init first, then add components
Shiki SSR errorsEnsure highlightCode is only called in Server Components
Dark mode not workingAdd defaultColor: false to Shiki config and use CSS [data-theme] selectors
Preview height inconsistentAlways use fixed height (h-[400px]) on example wrappers
Copy button not workingEnsure HTTPS or localhost (clipboard API requirement)

Prerequisites Check

Before using this skill, verify:

  1. Next.js 13+ with App Router (app/ directory)
  2. Tailwind CSS configured
  3. cn() utility from shadcn/ui (lib/utils.ts)

If missing shadcn/ui:

npx shadcn@latest init

File Reference

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.96%
按下载量换算27

Claude

28.93%
按下载量换算21

Cursor

20.16%
按下载量换算15

Gemini CLI

8.58%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills