Viewer
Viewer (apps/viewer/) is the project’s HyperSkills reader. It decodes compressed ?hs= URLs, displays widgets in a reading interface, and lets you create, edit, and export skills. It’s the consultation and sharing tool: when someone sends you a HyperSkill link, the Viewer is what displays it.
What you see when you open the app
Section titled “What you see when you open the app”When you open the Viewer without a ?hs= parameter, you’ll see an empty screen with a grayed-out hexagon and the message “No ?hs= parameter in the URL”. A “Paste URI” bar at the top invites you to paste a HyperSkill link, with a “New” button to create a blank skill.
When a skill is loaded (via URL or paste), the interface transforms:
- Header: the skill’s title, description, and action buttons — “DAG” to view the version tree, “Test in Recipes” to launch a live test, “Edit” to open the skill in Flex
- Paste bar: always visible for loading another skill, plus an “Export URL” button to copy the link to the clipboard
- Meta card: title, description, source MCP server, SHA hash, version
- Widgets: each block is rendered via
WidgetRendererin a container with a hover toolbar (edit JSON, delete) - “Add widget” button: at the bottom, a dashed button lets you manually add a
textwidget - DAG panel: when enabled, displays a horizontal version timeline with clickable nodes connected by SVG arrows
Architecture
Section titled “Architecture”graph TD subgraph Frontend Page["+page.svelte<br/>URL decoding + rendering"] end
subgraph Packages SDK["@webmcp-auto-ui/sdk<br/>decodeHyperSkill,<br/>encodeHyperSkill,<br/>getHsParam"] UI["@webmcp-auto-ui/ui<br/>WidgetRenderer,<br/>Button, Input"] end
Page -->|decode ?hs=| SDK Page -->|render widgets| UI Page -->|export URL| SDKTech stack
Section titled “Tech stack”| Component | Detail |
|---|---|
| Framework | SvelteKit + Svelte 5 |
| Styles | TailwindCSS 3.4 |
| Icons | lucide-svelte (ExternalLink, Pencil, Plus, Trash2, FlaskConical, GitBranch, Github) |
| Adapter | @sveltejs/adapter-node |
Packages used:
@webmcp-auto-ui/sdk:decodeHyperSkill,encodeHyperSkill,getHsParam@webmcp-auto-ui/ui:WidgetRenderer,Button,Input
Getting started
Section titled “Getting started”| Environment | Port | Command |
|---|---|---|
| Dev | 3008 | npm -w apps/viewer run dev |
| Production | 3008 | node build/index.js (via systemd) |
npm -w apps/viewer run dev# Available at http://localhost:3008Features
Section titled “Features”HyperSkill URL decoding
Section titled “HyperSkill URL decoding”The Viewer automatically decodes the ?hs= parameter on load. The parameter contains a base64 gzip-encoded skill with metadata (title, description, hash, version) and content (list of type + data blocks).
Paste URI
Section titled “Paste URI”Paste any HyperSkill URL (or just the raw hs parameter value) in the input bar. The Viewer decodes it and updates the browser URL via history.pushState.
Widget CRUD
Section titled “Widget CRUD”Each widget is editable:
- Edit: opens an inline JSON editor to modify the widget’s
data - Delete: removes the widget from the list
- Add: creates a new
textwidget with default content - Change type: in the editor, the type field is editable
Version DAG
Section titled “Version DAG”The version graph displays the SHA hash chain. Each skill can reference a previousHash, forming a directed acyclic graph (DAG). Nodes are displayed as clickable buttons connected by SVG arrows.
Cross-app navigation
Section titled “Cross-app navigation”Two buttons enable navigation:
- “Edit”: opens the skill in Flex for editing with the AI agent
- “Test in Recipes”: opens the skill in the recipe explorer
URL export
Section titled “URL export”The “Export URL” button re-encodes the skill (with all modifications) as a HyperSkill URL and copies it to the clipboard.
Configuration
Section titled “Configuration”The Viewer has no environment variables. It works entirely client-side.
Code walkthrough
Section titled “Code walkthrough”+page.svelte
Section titled “+page.svelte”Single file for the app. It handles:
- URL decoding via
getHsParam+decodeHyperSkillononMount - Block extraction from the decoded HyperSkill structure
- Version DAG construction from
hash/previousHashmetadata - Inline JSON editing with validation (the “Save” button is blocked on invalid JSON)
- Export via
encodeHyperSkillwith clipboard copy
Example URL
Section titled “Example URL”http://localhost:3008/?hs=eyJtZXRhIjp7InRpdGxlIjoiV2VhdGhlciJ9LCJjb250ZW50IjpbeyJ0eXBlIjoic3RhdCIsImRhdGEiOnsibGFiZWwiOiJUZW1wIiwidmFsdWUiOiIxNEMifX1dfQ==Customization
Section titled “Customization”To extend the Viewer:
- Add block types: widgets are rendered by
WidgetRenderer, which supports all types from the UI package - Extend the DAG: extend the
buildDag()logic to display a full tree with navigation - Add collaboration: integrate a backend to store skills and share URLs
Deployment
Section titled “Deployment”| Server path | /opt/webmcp-demos/viewer/build/ (subdirectory) |
|---|---|
| systemd service | webmcp-viewer |
| ExecStart | node build/index.js |
./scripts/deploy.sh viewer- Live demo
- SDK package —
decodeHyperSkill,encodeHyperSkill - Flex — for editing with the AI agent
- Recipes — for testing recipes