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

slidev-monaco-editorSlidev 摩纳哥 编辑

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

1,997

周安装

80

GitHub Stars

27

下载量

646
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/yoanbernabeu/slidev-skills --skill slidev-monaco-editor

简介

slidev-monaco-editor 用于辅助前端页面、组件、样式和交互逻辑的开发与维护,适合生成或审查 React、Vue、CSS 等相关代码。

  • 适用于 Slidev 演示文稿中的 Monaco 编辑器集成与开发场景。
  • 通过 npx skills add 命令从 GitHub 安装,需结合项目现有设计系统使用。
  • 涉及页面改动时应配合本地预览和构建检查确认视觉效果,避免生成孤立片段。
  • 注意该技能当前无详细功能说明,建议进一步查阅源码以了解实际能力边界。

SKILL.md

Monaco Editor in Slidev

This skill covers integrating Monaco Editor (the editor powering VS Code) into your Slidev presentations for live coding, interactive demos, and executable code blocks.

When to Use This Skill

  • Live coding demonstrations
  • Interactive code editing during presentations
  • Running code examples in real-time
  • Teaching programming concepts
  • Showing auto-completion and type hints

Enabling Monaco Editor

Basic Monaco Block

Add {monaco} to any code block:

const greeting = 'Hello, World!' console.log(greeting)

This creates an editable code block with:

  • Syntax highlighting
  • Auto-completion
  • Type checking (for TypeScript)
  • Bracket matching

Monaco with Line Highlighting

const a = 1 const b = 2 // highlighted const c = 3 // highlighted

Monaco Runner

Execute code directly in the presentation:

JavaScript Runner

const numbers = [1, 2, 3, 4, 5] const doubled = numbers.map(n => n * 2) console.log(doubled)

Click "Run" to execute and see output.

TypeScript Runner

interface User { name: string age: number }

const user: User = { name: 'John', age: 30 }

console.log(${user.name} is ${user.age} years old)

Auto-Run on Load

console.log('This runs automatically!')

Show Output Only

// Output shows after one click console.log('Hello!')

Configuration Options

Editor Height

// Taller editor function longFunction() { // ... }

Read-Only Mode

// Cannot be edited const CONSTANT = 'value'

Diff Editor

const original = 'Hello' ~~~ const modified = 'Hello, World!'

Monaco Setup Configuration

setup/monaco.ts

import { defineMonacoSetup } from '@slidev/types'

export default defineMonacoSetup((monaco) => {
  // Editor options
  return {
    editorOptions: {
      fontSize: 14,
      fontFamily: 'JetBrains Mono, monospace',
      minimap: { enabled: false },
      lineNumbers: 'on',
      wordWrap: 'on',
      tabSize: 2,
      scrollBeyondLastLine: false,
      automaticLayout: true,
    },
    // Light/dark theme
    theme: {
      light: 'vs',
      dark: 'vs-dark',
    },
  }
})

Custom Themes

import { defineMonacoSetup } from '@slidev/types'

export default defineMonacoSetup((monaco) => {
  // Define custom theme
  monaco.editor.defineTheme('my-theme', {
    base: 'vs-dark',
    inherit: true,
    rules: [
      { token: 'comment', foreground: '6A9955' },
      { token: 'keyword', foreground: 'C586C0' },
    ],
    colors: {
      'editor.background': '#1a1a2e',
    },
  })

  return {
    theme: {
      dark: 'my-theme',
      light: 'vs',
    },
  }
})

Type Definitions

Adding Types for Libraries

// setup/monaco.ts
import { defineMonacoSetup } from '@slidev/types'

export default defineMonacoSetup(async (monaco) => {
  // Add React types
  const reactTypes = await fetch(
    'https://unpkg.com/@types/react/index.d.ts'
  ).then(r => r.text())

  monaco.languages.typescript.typescriptDefaults.addExtraLib(
    reactTypes,
    'file:///node_modules/@types/react/index.d.ts'
  )
})

Inline Type Definitions

// Types defined inline interface Todo { id: number text: string completed: boolean }

const todos: Todo[] = [ { id: 1, text: 'Learn Slidev', completed: true }, { id: 2, text: 'Create presentation', completed: false }, ]

Interactive Examples

Counter Demo

// Interactive counter let count = 0

function increment() { count++ console.log(Count: ${count}) }

// Click Run multiple times! increment()

API Simulation

// Simulated API call async function fetchUser(id: number) { // Simulate network delay await new Promise(r => setTimeout(r, 500))

return { id, name: 'John Doe', email: 'john@example.com' } }

const user = await fetchUser(1) console.log(user)

Algorithm Visualization

// Bubble sort with steps function bubbleSort(arr: number[]) { const result = [...arr] const steps: string[] = []

for (let i = 0; i < result.length; i++) { for (let j = 0; j < result.length - i - 1; j++) { if (result[j] > result[j + 1]) { [result[j], result[j + 1]] = [result[j + 1], result[j]] steps.push(Swap: [${result.join(', ')}]) } } }

return { result, steps } }

const { result, steps } = bubbleSort([5, 3, 8, 4, 2]) console.log('Steps:', steps.length) steps.forEach(s => console.log(s)) console.log('Final:', result)

Code Runner Patterns

Show Concept Then Let Edit

# Array Methods

const numbers = [1, 2, 3, 4, 5]

// Try changing the function! const result = numbers .filter(n => n % 2 === 0) .map(n => n * 2)

console.log(result)


Try modifying the code to:
- Filter odd numbers
- Triple instead of double

Interactive Quiz

# Fix the Bug

// This code has a bug - can you fix it? function reverseString(str: string) { return str.split('').reserve().join('') }

console.log(reverseString('hello')) // Expected: 'olleh'

Live Data Manipulation

const data = [ { name: 'Alice', score: 85 }, { name: 'Bob', score: 92 }, { name: 'Charlie', score: 78 }, ]

// Calculate statistics const average = data.reduce((sum, d) => sum + d.score, 0) / data.length const highest = Math.max(...data.map(d => d.score)) const passing = data.filter(d => d.score >= 80)

console.log(Average: ${average.toFixed(1)}) console.log(Highest: ${highest}) console.log(Passing: ${passing.map(d => d.name).join(', ')})

Combining with Animations

Reveal Then Edit

<v-click>

// Code appears on click, then is editable function greet(name: string) { return Hello, ${name}! }


</v-click>

Step-by-Step with Monaco

<v-clicks>

Start with this code:

const x = 1


Then try adding more lines!

</v-clicks>

Best Practices

1. Keep Examples Focused

// GOOD: Single concept const sum = [1, 2, 3].reduce((a, b) => a + b, 0) console.log(sum) // 6

2. Provide Starting Point

// Complete the function: function capitalize(str: string): string { // Your code here return str }

console.log(capitalize('hello')) // Should print: 'Hello'

3. Show Expected Output

// Code example const result = [1, 2, 3].map(n => n ** 2) console.log(result) // Expected output: [1, 4, 9]

4. Handle Errors Gracefully

try { const result = riskyOperation() console.log(result) } catch (error) { console.error('Error:', error.message) }

function riskyOperation() { // Might throw an error throw new Error('Oops!') }

Limitations

  • No DOM Access: Cannot manipulate the page DOM
  • Limited APIs: Only standard JavaScript APIs available
  • No Imports: Cannot import external packages
  • Console Only: Output is console-based

Output Format

When creating Monaco code blocks:

PURPOSE: [What the code demonstrates]
INTERACTION: [How audience should interact]

CODE:

// Clear comments explaining purpose

[Code with good defaults]

// Expected output noted


SUGGESTED EDITS:

- Try changing X to Y
- Modify function to do Z

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

补充不同宿主或平台的使用分布数据

能力 5

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

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

平台分布

Claude Code

28.68%
按下载量换算185

Codex

22.39%
按下载量换算145

OpenCode

17.98%
按下载量换算116

Antigravity

13.86%
按下载量换算90

Gemini CLI

9.24%
按下载量换算60

kode

3.43%
按下载量换算22

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills