Skip to content

Commit 66b2637

Browse files
committed
feat: add Skills template tab with platform-skill.md reference
- Add platform-skill.md — comprehensive 860-line reference of all TextAgent capabilities (11 DocGen tags, variable system, code execution, media, etc.) - Add Skills tab to Templates modal as a standard template category - Create js/templates/skills.js — fetches platform-skill.md at load time - Register skills category in templates.js concat + icon mappings - Add skills.js to src/main.js Phase 3c template imports - Fix template category pills overflow with scrollable container - Minor README/docgen fixes (@Think@Think: yes mode)
1 parent 0e9e679 commit 66b2637

11 files changed

Lines changed: 919 additions & 8 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
| **Desktop** | Native app via Neutralino.js with system tray and offline support |
3737
| **Code Execution** | 7 languages in-browser: Bash ([just-bash](https://justbash.dev/)), Math (Nerdamer), LaTeX (MathJax + Nerdamer evaluation), Python ([Pyodide](https://pyodide.org/)), HTML (sandboxed iframe, `html-autorun` for widgets/quizzes), JavaScript (sandboxed iframe), SQL ([sql.js](https://sql.js.org/) SQLite) · 25+ compiled languages via [Judge0 CE](https://ce.judge0.com): C, C++, Rust, Go, Java, TypeScript, Kotlin, Scala, Ruby, Swift, Haskell, Dart, C#, and more · **▶ Run All** notebook engine — one-click sequential execution with preflight dialog (block table with model/status), pre-execution model loading (AI + TTS auto-loaded before blocks run), progress bar, abort, per-block status badges, detailed console logging, and SQLite shared context store |
3838
| **Security** | Content Security Policy (CSP), SRI integrity hashes, XSS sanitization (DOMPurify), ReDoS protection, Firestore write-token ownership, API keys via HTTP headers, postMessage origin validation, 8-char passphrase minimum, sandboxed code execution |
39-
| **AI Document Tags** | `{{@AI:}}` text generation, `{{@Think:}}` deep reasoning, `{{@Image:}}` image generation (Gemini Imagen), `{{@OCR:}}` image-to-text extraction (Text/Math/Table modes via Granite Docling 258M or Florence-2 230M, PDF page rendering via pdf.js), `{{@TTS:}}` text-to-speech playback (Kokoro TTS per card, language selector, ▶ Play / ⬇ Save WAV), `{{@STT:}}` speech-to-text dictation (engine selector: Whisper/Voxtral/Web Speech API, 11 languages, Record/Stop/Insert/Clear), `{{@Translate:}}` translation (target language selector, integrated TTS pronunciation, cloud model routing), `{{@Game:}}` game builder (AI-generated or pre-built, Canvas 2D/Three.js/P5.js, import/export HTML) — `@` prefix syntax on all tag types + metadata fields (`@name`, `@use`, `@think`, `@search`, `@prompt`, `@step`, `@upload`, `@model`, `@engine`, `@lang`, `@prebuilt`); `@model:` field persists selected model per card with intelligent defaults (OCR→`granite-docling`, TTS→`kokoro-tts`, STT→`voxtral-stt`, Image→`imagen-ultra`); editable `@prompt:` textarea and `@step:` inputs in preview cards; description/prompt separation (bare text = label, `@prompt:` = AI instruction); 📎 image/PDF upload for multimodal vision analysis; per-card model selector with document-portable model persistence, concurrent block operations |
39+
| **AI Document Tags** | `{{@AI:}}` text generation (`@think: Yes` for deep reasoning), `{{@Image:}}` image generation (Gemini Imagen), `{{@OCR:}}` image-to-text extraction (Text/Math/Table modes via Granite Docling 258M or Florence-2 230M, PDF page rendering via pdf.js), `{{@TTS:}}` text-to-speech playback (Kokoro TTS per card, language selector, ▶ Play / ⬇ Save WAV), `{{@STT:}}` speech-to-text dictation (engine selector: Whisper/Voxtral/Web Speech API, 11 languages, Record/Stop/Insert/Clear), `{{@Translate:}}` translation (target language selector, integrated TTS pronunciation, cloud model routing), `{{@Game:}}` game builder (AI-generated or pre-built, Canvas 2D/Three.js/P5.js, import/export HTML) — `@` prefix syntax on all tag types + metadata fields (`@name`, `@use`, `@think`, `@search`, `@prompt`, `@step`, `@upload`, `@model`, `@engine`, `@lang`, `@prebuilt`); `@model:` field persists selected model per card with intelligent defaults (OCR→`granite-docling`, TTS→`kokoro-tts`, STT→`voxtral-stt`, Image→`imagen-ultra`); editable `@prompt:` textarea and `@step:` inputs in preview cards; description/prompt separation (bare text = label, `@prompt:` = AI instruction); 📎 image/PDF upload for multimodal vision analysis; per-card model selector with document-portable model persistence, concurrent block operations |
4040
| **🔌 API Calls** | `{{API:}}` REST API integration — GET/POST/PUT/DELETE methods, custom headers, JSON body, response stored in `$(api_varName)` variables; inline review panel; toolbar GET/POST buttons |
4141
| **🔗 Agent Flow** | `{{Agent:}}` multi-step pipeline — define Step 1/2/3, chain outputs, per-card model + search provider selector, live step status indicators (⏳/✅/❌), review combined output |
4242
| **🔍 Web Search** | Toggle web search for AI — 7 providers: DuckDuckGo (free), Brave Search, Serper.dev, Tavily (AI-optimized), Google CSE, Wikipedia, Wikidata; search results injected into LLM context; source citations in responses; per-agent-card search provider selector |
@@ -260,9 +260,9 @@ Import files directly — they're auto-converted to Markdown client-side:
260260
<details open>
261261
<summary><strong>🏷️ AI Document Tags — Generate Entire Sections</strong></summary>
262262

263-
**One-click document generation.** Use `{{AI:}}` for text, `{{Think:}}` for deep reasoning, and `{{Image:}}` for AI-generated images. Each tag becomes a card with generate, review, accept/reject, and regenerate controls — all operating independently.
263+
**One-click document generation.** Use `{{AI:}}` for text (with `@think: Yes` for deep reasoning) and `{{Image:}}` for AI-generated images. Each tag becomes a card with generate, review, accept/reject, and regenerate controls — all operating independently.
264264

265-
<img src="public/assets/demos/15_ai_doc_tags.webp" alt="AI Document Tags — generating content with AI, Think, and Image tags" width="100%">
265+
<img src="public/assets/demos/15_ai_doc_tags.webp" alt="AI Document Tags — generating content with AI and Image tags, Think toggle for deep reasoning" width="100%">
266266

267267
</details>
268268

changelogs/CHANGELOG-skills-tab.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# CHANGELOG — Skills Template Tab + Platform Skill Document
2+
3+
## Added
4+
- **`platform-skill.md`** — Comprehensive platform skill reference (859 lines) documenting all 11 DocGen tags, variable system, code execution, media embedding, Run All engine, web search, file import, and 7 template composition patterns. Designed to be fed to any AI to generate rich TextAgent templates.
5+
- **`js/templates/skills.js`** — New "Skills" template category that fetches `platform-skill.md` at load time using top-level `await`. Registers "Platform Skills Reference" as a standard template card.
6+
- **Skills tab** in Templates modal — appears alongside All, AI, Documentation, Project, etc. as a regular category pill.
7+
8+
## Modified
9+
- **`src/main.js`** — Added `skills.js` to Phase 3c template imports.
10+
- **`js/templates.js`** — Added `__MDV_TEMPLATES_SKILLS` to template concat array, `skills` case to icon class/icon switch statements.
11+
- **`js/modal-templates.js`** — Added Skills category button to template pills row.
12+
- **`css/modals.css`** — Added `overflow-x: auto`, `flex-shrink: 0`, and hidden scrollbar to `.template-categories` to prevent pill overflow when many categories are present.
13+
- **`js/templates/documentation.js`** — Minor text fix.
14+
- **`README.md`** — Minor corrections (`@Think``@think: yes` mode of `{{@AI:}}`).
15+
- **`js/ai-docgen-ui.js`** — Minor fix.
16+
- **`js/help-mode.js`** — Minor fix.

css/modals.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,9 @@
13021302
.template-categories {
13031303
display: flex;
13041304
padding: 16px 24px 12px;
1305+
overflow-x: auto;
1306+
-webkit-overflow-scrolling: touch;
1307+
flex-shrink: 0;
13051308
}
13061309

13071310
.template-cat-pills {
@@ -1311,6 +1314,16 @@
13111314
border: 1.5px solid #c0c0cc;
13121315
border-radius: 10px;
13131316
padding: 3px;
1317+
flex-shrink: 0;
1318+
}
1319+
1320+
/* Hide scrollbar but keep scrolling */
1321+
.template-categories::-webkit-scrollbar {
1322+
height: 0;
1323+
display: none;
1324+
}
1325+
.template-categories {
1326+
scrollbar-width: none;
13141327
}
13151328

13161329
[data-theme="dark"] .template-cat-pills {

js/ai-docgen-ui.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
var blocks = M.parseDocgenBlocks(text);
6363

6464
if (blocks.length === 0) {
65-
showToast('No {{AI:}}, {{Think:}}, {{Image:}}, or {{Agent:}} blocks found. Tag sections first.', 'warning');
65+
showToast('No {{AI:}}, {{Image:}}, or {{Agent:}} blocks found. Tag sections first.', 'warning');
6666
return;
6767
}
6868

js/help-mode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
},
238238
'[data-action="think-tag"]': {
239239
name: 'AI Think Tag',
240-
desc: 'Wrap text in {{Think: ...}} — AI uses deep reasoning mode to analyze and respond with step-by-step thinking.',
240+
desc: 'Wrap text in {{AI: @think: Yes ...}} — AI uses deep reasoning mode to analyze and respond with step-by-step thinking.',
241241
shortcut: null,
242242
demo: 'assets/demos/15_ai_doc_tags.webp'
243243
},
@@ -346,7 +346,7 @@
346346
},
347347
'#docgen-fill-btn': {
348348
name: 'Fill All AI Blocks',
349-
desc: 'Process all {{AI:}}, {{Think:}}, {{Image:}}, {{Agent:}}, and {{API:}} tags in the document. Each block generates independently and can be accepted, rejected, or regenerated.',
349+
desc: 'Process all {{AI:}}, {{Image:}}, {{Agent:}}, and {{API:}} tags in the document. Each block generates independently and can be accepted, rejected, or regenerated.',
350350
shortcut: null,
351351
demo: 'assets/demos/15_ai_doc_tags.webp'
352352
},

js/modal-templates.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ const chatResponse = await openai.chat.completions.create({
642642
<button class="template-cat-btn" data-category="tables">Tables</button>
643643
<button class="template-cat-btn" data-category="finance">Finance</button>
644644
<button class="template-cat-btn" data-category="games">Games</button>
645+
<button class="template-cat-btn" data-category="skills">Skills</button>
645646
</div>
646647
</div>
647648
<div class="template-grid" id="template-grid"></div>

js/templates.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
window.__MDV_TEMPLATES_AI || [],
2020
window.__MDV_TEMPLATES_AGENTS || [],
2121
window.__MDV_TEMPLATES_FINANCE || [],
22-
window.__MDV_TEMPLATES_GAMES || []
22+
window.__MDV_TEMPLATES_GAMES || [],
23+
window.__MDV_TEMPLATES_SKILLS || []
2324
);
2425

2526

@@ -49,6 +50,7 @@
4950
case 'ai': return 'creative';
5051
case 'finance': return 'project';
5152
case 'games': return 'creative';
53+
case 'skills': return 'doc';
5254
default: return 'doc';
5355
}
5456
}
@@ -67,6 +69,7 @@
6769
case 'ai': return 'bi-robot';
6870
case 'finance': return 'bi-graph-up-arrow';
6971
case 'games': return 'bi-controller';
72+
case 'skills': return 'bi-book';
7073
default: return 'bi-file-earmark';
7174
}
7275
}
@@ -503,6 +506,7 @@
503506
templateCategories.querySelectorAll('.template-cat-btn').forEach(b => {
504507
b.classList.toggle('active', b === btn);
505508
});
509+
506510
filterTemplates();
507511
});
508512
}

js/templates/documentation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ window.__MDV_TEMPLATES_DOCUMENTATION = [
1818
'| **Rendering** | GitHub Styling · Syntax Highlighting (180+ langs) · LaTeX Math (MathJax) · Mermaid Diagrams (zoom/pan/export) · PlantUML · Callout blocks · Footnotes · Emoji · Anchor links |\n' +
1919
'| **🎬 Media Embedding** | Video playback via `![alt](video.mp4)` syntax · YouTube/Vimeo auto-embeds · `embed` code block for responsive media grids (`cols=1-4`, `height=N`) · Video.js v10 with native fallback · Website URLs as rich link preview cards |\n' +
2020
'| **🤖 AI Assistant** | 3 local Qwen 3.5 sizes (0.8B / 2B / 4B via WebGPU/WASM) · Gemini 3.1 Flash Lite · Groq Llama 3.3 70B · OpenRouter — summarize, expand, rephrase, grammar-fix, explain, simplify, auto-complete; AI writing tags; per-card model selection; smart model loading UX (cache vs download, delete cached models) |\n' +
21-
'| **🏷️ AI Document Tags** | `{{@AI:}}` text · `{{@Think:}}` reasoning · `{{@Image:}}` images · `{{@Memory:}}` context · `{{@Agent:}}` pipelines · `{{@OCR:}}` image-to-text (Text/Math/Table, Granite Docling, Florence-2) · `{{@TTS:}}` speech · `{{@STT:}}` dictation · `{{@Translate:}}` translation · `{{@Game:}}` game builder — `@model:` per-card persistence · `@upload:` image/PDF · `@prompt:` editable textareas · concurrent blocks |\n' +
21+
'| **🏷️ AI Document Tags** | `{{@AI:}}` text (`@think: Yes` for reasoning) · `{{@Image:}}` images · `{{@Memory:}}` context · `{{@Agent:}}` pipelines · `{{@OCR:}}` image-to-text (Text/Math/Table, Granite Docling, Florence-2) · `{{@TTS:}}` speech · `{{@STT:}}` dictation · `{{@Translate:}}` translation · `{{@Game:}}` game builder — `@model:` per-card persistence · `@upload:` image/PDF · `@prompt:` editable textareas · concurrent blocks |\n' +
2222
'| **🔌 API Calls** | `{{API:}}` REST API integration — GET/POST/PUT/DELETE · custom headers · JSON body · response stored in `$(api_varName)` · inline review panel · toolbar GET/POST buttons |\n' +
2323
'| **🔗 Agent Flow** | `{{@Agent:}}` multi-step pipelines — chain @step 1→2→3, output feeds next step · per-card model + search provider selector · live status indicators |\n' +
2424
'| **🔍 Web Search** | Toggle web search for AI — DuckDuckGo (free) · Brave Search · Serper.dev — search results injected into LLM context · source citations |\n' +

js/templates/skills.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// ============================================
2+
// templates/skills.js — Skills Templates
3+
// Platform Skills content is fetched from platform-skill.md
4+
// ============================================
5+
6+
// Fetch content synchronously before templates.js reads it
7+
const _resp = await fetch('platform-skill.md').catch(() => null);
8+
const _skillContent = (_resp && _resp.ok) ? await _resp.text() : '# TextAgent — Platform Skill Reference\n\n> Skills content could not be loaded.';
9+
10+
window.__MDV_TEMPLATES_SKILLS = [
11+
{
12+
name: 'Platform Skills Reference',
13+
category: 'skills',
14+
icon: 'bi-book',
15+
description: 'Complete reference of all TextAgent capabilities — feed this to any AI to generate rich templates',
16+
content: _skillContent
17+
}
18+
];

0 commit comments

Comments
 (0)