
dzmm-builder
Comprehensive skill for building, debugging, and optimizing DZMM.AI applications. Use this skill whe
DZMM Builder
Comprehensive Claude Code skill for building AI-driven interactive web applications on the DZMM.AI platform.
๐ฏ Overview
DZMM Builder is a specialized Claude Code skill that provides comprehensive support for creating single-file HTML applications on the DZMM.AI platform. Whether you're building chatbots, visual novels, dating sims, content generators, or interactive games, this skill offers complete examples, reusable code patterns, and expert guidance.
โจ Features
๐๏ธ 5 Architecture Patterns
- Stateless Generator - One-shot content generation (translators, summarizers)
- State Management Game - Interactive games with dynamic variables (dating sims, RPGs)
- Stateful Dialogue System - Multi-turn conversations with history
- Layered Cache Platform - Content communities with two-tier caching
- Visual Novel / Galgame System - Narrative-driven interactive fiction
๐ ๏ธ Core Capabilities
- Complete API Integration - Streaming AI, KV storage, chat API with branching narratives
- Effect System - "Fourth wall breaking" browser control (lights, sounds, particles, visual effects)
- Rich Text Rendering - Placeholder technique for nested structures (dialogue, options, formatting)
- Message Management - Reroll/regenerate, edit, delete with context preservation
- Multi-Opening System - Dynamic scene switching with state management
- Resource Reuse Strategy - URL-based asset loading (100% fidelity vs โค60% CSS simulation)
- Responsive Design - Mobile-first with Tailwind breakpoints
- Migration Guide - Complete React/Vue to DZMM conversion workflow
๐ 19 Best Practices
Including:
- DZMM API initialization (dual detection with timeout)
- Resource reuse strategy (critical for migrations)
- Conversation history management
- Error handling with retry logic
- Advanced prompt engineering (XML structure, emphasis sections)
- KV storage patterns (versioning, chunking, caching)
- Streaming AI response optimization
- Mobile responsive design patterns
๐ Structure
dzmm-builder/
โโโ SKILL.md # Main skill documentation (780+ lines)
โโโ README.md # This file
โโโ .gitignore # Git ignore rules
โโโ assets/
โ โโโ examples/ # 7 complete working applications
โ โโโ ๅฐ็บขไนฆๆๆก.html # Stateless generator (15KB)
โ โโโ ๆ็ฑๆธธๆ.html # State management game (35KB)
โ โโโ horror-story.html # Effect system (29KB)
โ โโโ dungeon-adventure.html # Turn-based game (41KB)
โ โโโ neon-gomoku.html # Board game (24KB)
โ โโโ ่ดดๅง.html # Content platform (26KB)
โ โโโ yoshiwara-chronicles-dzmm.html # Complete visual novel (84KB) โญ
โโโ references/
โโโ developer-guide.md # Complete DZMM platform documentation
โโโ code-snippets.md # Reusable code patterns library
๐ Usage
As a Claude Code Skill
-
Install this skill in your Claude Code environment:
cd ~/.claude/skills/ git clone https://github.com/waylon256yhw/dzmm-builder.git -
Invoke the skill when working with DZMM projects:
- "Build me a DZMM visual novel"
- "How to add message reroll functionality?"
- "Help me migrate my React app to DZMM"
- "How to implement rich text rendering?"
-
Reference examples and code snippets directly from the skill files.
As Documentation Reference
Browse the files directly for:
- SKILL.md - Complete skill guide with all capabilities
- references/developer-guide.md - DZMM platform documentation
- references/code-snippets.md - 17 categories of reusable code
- assets/examples/ - 6 complete working applications
๐ Quick Start Examples
Example 1: Simple Content Generator
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/alpinejs@3"></script>
</head>
<body x-data="app()">
<textarea x-model="input"></textarea>
<button @click="generate()">Generate</button>
<div x-html="output"></div>
<script>
function app() {
return {
input: '',
output: '',
async generate() {
await window.dzmm.completions({
model: 'nalang-turbo-0826',
messages: [{ role: 'user', content: this.input }]
}, (content, done) => {
if (done) this.output = content;
});
}
}
}
</script>
</body>
</html>
Example 2: Complete Visual Novel System
See assets/examples/yoshiwara-chronicles-dzmm.html (84KB) for the most comprehensive implementation including:
- Multi-opening system - Switch between "Night Chapter" and "Day Chapter" scenes
- Rich text rendering - Placeholder technique for nested options, dialogue quotes, italics
- Message management - Reroll/regenerate, edit, delete with full context preservation
- Multi-slot save/load - 3 save slots with character/message count preview
- Modular prompts - XML-structured system (main + character + guidance + emphasis)
- Advanced techniques -
<last_input>emphasis, token optimization, streaming responses - Responsive design - Mobile-optimized navigation, compressed spacing, flex-wrap buttons
- Resource reuse - GitHub Raw URLs for background images (100% visual fidelity)
This is a production-ready visual novel template based on 54 commits of iterative development.
Also see other examples in assets/examples/ for specific patterns:
- ๅฐ็บขไนฆๆๆก.html - Simple content generator
- ๆ็ฑๆธธๆ.html - State management game with progress bars
- horror-story.html - Effect system with lights/sounds/particles
๐ Key Patterns
Rich Text Rendering (Placeholder Technique)
renderRichText(text) {
// 1. Extract complex structures
const optionsMap = [];
let result = text.replace(/<options>([\s\S]*?)<\/options>/g, (match, content) => {
const placeholder = '___OPTIONS_' + optionsMap.length + '___';
optionsMap.push(content);
return placeholder;
});
// 2. Process simple text
result = result
.replace(/\*([^*]+)\*/g, '<em>$1</em>')
.replace(/ใ([^ใ]+)ใ/g, '<span class="dialogue">ใ$1ใ</span>')
.replace(/\n/g, '<br>');
// 3. Restore structures as HTML
optionsMap.forEach((content, i) => {
const buttons = /* generate buttons */;
result = result.replace('___OPTIONS_' + i + '___', buttons);
});
return result;
}
Message Reroll with Context Preservation
async rerollMessage(messageIndex) {
const contextMessages = this.messages.slice(0, messageIndex);
// Clean history and emphasize last input
const cleanedMessages = contextMessages.map(msg => ({
...msg,
content: msg.role === 'assistant'
? msg.content.replace(/<options>[\s\S]*?<\/options>/g, '').trim()
: msg.content
}));
await window.dzmm.completions({
model: this.selectedModel,
messages: [
{ role: 'user', content: systemPrompt },
...cleanedMessages,
{ role: 'user', content: emphasis }
]
}, (content, done) => {
if (done) this.messages[messageIndex].content = content;
});
}
๐ Real-World Application
This skill was developed based on the yoshiwara-chronicles project, a complete visual novel application featuring:
- 2 opening scenes (Night Chapter, Day Chapter)
- Rich text rendering with dialogue quotes and italics
- Message management (reroll, edit, delete)
- 3-slot save system with preview
- Modular prompt system (XML-structured)
- Mobile responsive design
- Resource reuse from original React project (100% visual fidelity)
See the yoshiwara-chronicles repository for the complete implementation.
๐ Model Selection Guide
| Model | Context | Speed | Use Case |
|---|---|---|---|
| nalang-turbo-0826 | 32K | โกโกโก | Simple tasks, quick responses |
| nalang-medium-0826 | 32K | โกโก | Moderate complexity |
| nalang-max-0826 | 32K | โก | Game AI, complex rules, stable output |
| nalang-xl-0826 | 32K | โก | Complex dialogues, long-form content |
| nalang-max-0826-16k | 16K | โกโก | Fast version with shorter context |
| nalang-xl-0826-16k | 16K | โกโก | Fast XL with shorter context |
๐ค Contributing
Contributions are welcome! Please feel free to:
- Report bugs or issues
- Suggest new features or patterns
- Submit pull requests with improvements
- Share your DZMM applications built with this skill
๐ License
MIT License - feel free to use this skill in your projects.
๐ Resources
- DZMM Platform: https://dzmm.ai
- Claude Code: https://claude.com/claude-code
- Reference Project: yoshiwara-chronicles
- Development Guide: See
DZMM_DEVELOPMENT_GUIDE.mdin yoshiwara-chronicles for comprehensive 54-commit development history
๐ฎ Contact
For questions or discussions:
- Open an issue in this repository
- Reference the skill in your Claude Code session
- Check the comprehensive documentation in
SKILL.md
Built with โค๏ธ for the DZMM.AI community
๐ค Generated with Claude Code