superdoc-dev/agent-skills/superdoc-core

Claude Code and agent skill by superdoc-dev/agent-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Core SuperDoc usage guidelines for document editing applications. Use when integrating SuperDoc with vanilla JavaScript, Vue, Svelte, or other frameworks. Triggers on tasks involving DOCX editing, document rendering, or SuperDoc configuration.

Install

npx vskill@latest install superdoc-dev/agent-skills/superdoc-core

SKILL.md

SuperDoc Core

SuperDoc is a document editing and rendering library for the web. It provides full DOCX support with real-time collaboration capabilities.

When to Apply

Reference these guidelines when:

  • Adding document editing to a vanilla JS application
  • Integrating SuperDoc with Vue, Svelte, or Angular
  • Configuring SuperDoc options
  • Understanding the core API
  • Setting up collaboration or AI features

Installation

bash
npm install superdoc

Quick Start

javascript
import { SuperDoc } from 'superdoc';
import 'superdoc/style.css';
const superdoc = new SuperDoc({
selector: '#editor',
document: file, // File, Blob, URL, or config object
documentMode: 'editing',
onReady: ({ superdoc }) => {
console.log('Editor ready!');
}
});

Configuration

Required Options
OptionTypeDescription
selector`string \HTMLElement`Container element
document`File \Blob \string \object`Document to load
Mode & Role
OptionTypeDefaultDescription
documentMode`'editing' \'viewing' \'suggesting'`'editing'Editing mode
role`'editor' \'viewer' \'suggester'`'editor'User permissions
User Options
OptionTypeDescription
user{ name, email?, image? }Current user info
usersArray<{ name, email, image? }>All users (for @-mentions)
UI Options
OptionTypeDefaultDescription
toolbar`string \HTMLElement \false`autoToolbar container
rulersbooleantrueShow rulers
paginationbooleantrueEnable pagination
Event Callbacks
OptionTypeDescription
onReady({ superdoc }) => voidInstance initialized
onEditorCreate({ editor }) => voidProseMirror editor created
onEditorDestroy() => voidEditor destroyed
onEditorUpdate({ editor }) => voidContent changed
onContentError(event) => voidDocument parsing error
onException({ error }) => voidRuntime error

Instance Methods

Document Mode
javascript
// Change editing mode
superdoc.setDocumentMode('viewing');
superdoc.setDocumentMode('editing');
superdoc.setDocumentMode('suggesting');
Export
javascript
// Export as DOCX blob
const blob = await superdoc.export({ triggerDownload: false });
// Export and trigger download
await superdoc.export({ triggerDownload: true });
// Export as HTML
const htmlArray = superdoc.getHTML();
Editor Control
javascript
// Focus the editor
superdoc.focus();
// Lock/unlock editing
superdoc.setLocked(true);
superdoc.setLocked(false);
// Toggle rulers
superdoc.toggleRuler();
// High contrast mode
superdoc.setHighContrastMode(true);
Search
javascript
// Search for text
const results = superdoc.search('keyword');
const regexResults = superdoc.search(/pattern/gi);
// Navigate to result
superdoc.goToSearchResult(results[0]);
Track Changes
javascript
// Set track changes preferences
superdoc.setTrackedChangesPreferences({
mode: 'review', // 'review' | 'original' | 'final'
enabled: true
});
Cleanup
javascript
// Destroy instance
superdoc.destroy();

Document Modes

ModeDescriptionUse Case
editingFull editing capabilitiesDefault editing
viewingRead-only presentationDocument preview
suggestingTrack changes modeCollaborative review

User Roles

RoleCan EditCan SuggestCan View
editorYesYesYes
suggesterNoYesYes
viewerNoNoYes

Framework Integration

Vue 3
vue
<script setup>
import { ref, onMounted, onUnmounted } from 'vue';
import { SuperDoc } from 'superdoc';
import 'superdoc/style.css';
const containerRef = ref(null);
let superdoc = null;
const props = defineProps({
document: { type: [File, String, Object], required: true }
});
onMounted(async () => {
superdoc = new SuperDoc({
selector: containerRef.value,
document: props.document,
documentMode: 'editing'
});
});
onUnmounted(() => {
superdoc?.destroy();
});
</script>
<template>
<div ref="containerRef" style="height: 700px" />
</template>
Svelte
svelte
<script>
import { onMount, onDestroy } from 'svelte';
import { SuperDoc } from 'superdoc';
import 'superdoc/style.css';
export let document;
let container;
let superdoc;
onMount(() => {
superdoc = new SuperDoc({
selector: container,
document,
documentMode: 'editing'
});
});
onDestroy(() => {
superdoc?.destroy();
});
</script>
<div bind:this={container} style="height: 700px" />
Vanilla JavaScript (Dynamic Import)
javascript
async function initEditor(container, document) {
const { SuperDoc } = await import('superdoc');
return new SuperDoc({
selector: container,
document,
documentMode: 'editing',
onReady: ({ superdoc }) => {
console.log('Ready!');
}
});
}

Collaboration Setup

javascript
import * as Y from 'yjs';
import { WebsocketProvider } from 'y-websocket';
import { SuperDoc } from 'superdoc';
const ydoc = new Y.Doc();
const provider = new WebsocketProvider(
'wss://your-server.com',
'document-id',
ydoc
);
const superdoc = new SuperDoc({
selector: '#editor',
document: file,
modules: {
collaboration: {
ydoc,
provider
}
}
});

AI Integration

javascript
const superdoc = new SuperDoc({
selector: '#editor',
document: file,
modules: {
ai: {
apiKey: 'your-api-key',
endpoint: 'https://api.example.com/ai'
}
}
});

Comments Module

javascript
const superdoc = new SuperDoc({
selector: '#editor',
document: file,
user: { name: 'John', email: 'john@example.com' },
users: [
{ name: 'Jane', email: 'jane@example.com' },
{ name: 'Bob', email: 'bob@example.com' }
],
modules: {
comments: {
enabled: true
}
}
});

Error Handling

javascript
const superdoc = new SuperDoc({
selector: '#editor',
document: file,
onContentError: (event) => {
console.error('Failed to parse document:', event);
},
onException: ({ error }) => {
console.error('Runtime error:', error);
}
});

Architecture Notes

SuperDoc has two rendering systems:

ModeSystemDescription
Editingsuper-editorProseMirror-based rich text editing
Viewinglayout-engineVirtualized DOM rendering for presentation

Both systems work together to provide seamless editing and viewing experiences.

Requirements

RequirementVersion
Node.js16+
Modern browserES2020 support

Examples

ExampleDescription
React + TypeScriptReact wrapper usage
Next.js SSRNext.js App Router
For React/Next.js projects, prefer @superdoc-dev/react wrapper over core package.

Links

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Refreshed 17 Mar 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/superdoc-dev/agent-skills/superdoc-core/badge)](https://verified-skill.com/skills/superdoc-dev/agent-skills/superdoc-core)

Something wrong with this skill or its page? Tell us.