Add image generation and HTML artifact templates (Tools 8–10)#3
Open
klausagnoletti wants to merge 6 commits intoArcanum-Sec:mainfrom
Open
Add image generation and HTML artifact templates (Tools 8–10)#3klausagnoletti wants to merge 6 commits intoArcanum-Sec:mainfrom
klausagnoletti wants to merge 6 commits intoArcanum-Sec:mainfrom
Conversation
Converts the TabletopExercise skill into an MCP server so AI coding agents can enrich M&M scenario cards in a schema-validated, additive-only way. New files: - generators/schema.ts — Zod v3 schemas as single source of truth for types, MCP validation, and the tabletop://schema resource - generators/mcp-server.ts — MCP server (StdioServerTransport) with 6 tools and 3 resources - generators/test-mcp.ts — integration tests via InMemoryTransport (39/39 passing) - CLAUDE.md — project coding standards (security, TypeScript, MCP tool design, code quality) - .gitignore — excludes node_modules and generated test HTML Modified files: - generators/generate-pdf.ts — exports generateTabletopHTML(data, mode) wrapper; existing generatePDF and CLI entry point untouched - generators/package.json — adds @modelcontextprotocol/sdk, zod, zod-to-json-schema; adds mcp and test scripts Tools: check_scenario_completeness, validate_exercise_data, generate_exercise, merge_exercise_data, validate_m_and_m_formatting, list_scenario_cards Resources: tabletop://schema, tabletop://atomics, tabletop://template Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…and-monsters) Implements native Quarto markdown output for the M&M handbook: - generate-qmd.ts: formatting helpers, guards (safeQmd, validateTestNetIPs, validateContemporaryReadAloud), variation block wrapping, section renderers for Inject Sequence / NPC Dialogue / Red Herrings / Gap Analysis, handout renderer with verified CSS block - mcp-server.ts: registers generate_exercise_qmd as Tool 6; populates MALMON_FAMILIES with all 13 canonical names from M&M scenario-cards - schema.ts: extends all sub-schemas with QMD-specific fields (trigger, read_aloud, artifact_inline, hint_if_stuck, NPCDialogueLinesQMD union, RedHerringSchema, handout artifact fields, etc.) - test-mcp.ts: adds 6 new integration tests (Tests 13-18) covering basic generation, handout output, em dash guard, contemporary read_aloud violation, TEST-NET IP validation, path traversal; 63/63 pass Verified: quarto render on lockbit/hospital-emergency fixture produces clean HTML with no warnings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…stral Vibe Documents setup for all four CLIs with correct config formats: - Claude Code: claude mcp add CLI command - Gemini CLI: ~/.gemini/settings.json (JSON mcpServers block) - OpenAI Codex CLI: codex mcp add command + config.toml format - Mistral Vibe: ~/.vibe/config.toml TOML format Also adds v3.0 version entry and updated file structure. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three new MCP tools for visual artifact rendering: - generate_attack_vector_images: phishing emails, ransomware notes, invoices, USB photos - generate_evidence_images: SIEM/Wireshark captures, dark web listings, SCADA HMI - generate_atmosphere_images: cover art, NPC portraits, location illustrations Routing strategy — UI subtypes use CSS/HTML templates (no API key needed, text always legible); physical subtypes use AI image providers: - HTML templates: phishing_email, ransomware_note, fraudulent_invoice, network_capture, dark_web_listing, scada_interface - AI providers: usb_device, network_diagram, portrait, location_illustration, cover_art, period_photograph AI provider chain: IMAGE_PROVIDER accepts comma-separated fallback list (openai,replicate). Providers: OpenAI DALL-E 3, Gemini Imagen 4, Stability AI, Replicate Flux Schnell, Ollama (self-hosted). API keys from .env or shell. Schema: adds ImageSubtypeSchema (12 subtypes), VisualStyleSchema, image_data, html_data, and cover_image_data fields. PDF/HTML output: generate_exercise renders html_data as inline <div> embed and image_data as <img>; generate_exercise_qmd writes [slug].png for handouts. Tests expanded from 63 to 83 assertions (Tests 19–26 cover image paths). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
New tools
generate_attack_vector_imagesgenerate_evidence_imagesgenerate_atmosphere_imagesArtifact routing
phishing_email,ransomware_note,fraudulent_invoice,network_capture,dark_web_listing,scada_interfaceusb_device,network_diagram,period_photograph,portrait,location_illustration,cover_artNew files
generators/generate-images.ts— multi-provider AI image generationgenerators/generate-html-artifacts.ts— six self-contained HTML/CSS templatesTest plan
bun run test-mcp.ts— all 83 assertions pass (including Tests 25–26 for HTML template path)generate_attack_vector_imageswithtype: 'email'artifact — verifyhtml_datais set,image_datais undefinedgenerate_evidence_imageswithtype: 'log'artifact — verify Wireshark-style table renders with correct row countOPENAI_API_KEYand call withimage_subtype: 'usb_device'— verify AI provider is called andimage_database64 is returnedgenerate_attack_vector_images→generate_exercise→ openfacilitator.html— verify email template renders with readable text🤖 Generated with Claude Code