dtyq/magic/ai-card-generator

Claude Code and agent skill by dtyq/magic

Trust tier 2
  • community
  • ext:[{"type":"template","description":"Custom templates for code generation"}]
LLM review pending
Source check pending

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

Generate AI Cards — HTML visual pages (single-file or folder-based multi-file) for scheduled automated reports. Use when: user wants to create a recurring visual card, hotspot tracker, daily digest, analytics panel, inspiration page, or any HTML-based automated visualization that updates on schedule. Trigger signals: AI card, inspiration card, generated card, visual report, hotspot tracker, daily digest, dashboard card, scheduled visualization, and equivalent requests in any user language. Skip…

Install

npx vskill@latest install dtyq/magic/ai-card-generator

Semi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard

SKILL.md

The same SKILL.md was published earlier as dtyq/magic/ai-card-generator.

AI Card Generator

Automatically generate and update HTML visual cards via scheduled tasks. Cards can be single-file or folder-based multi-file, and are generated from user prompts + templates with fresh data.

Output Language Contract

The skill documentation, built-in templates, and prompt snippets are written in English. Generated card content must adapt to the user's language.

  1. Infer the user's preferred output language from the current request first, then from existing card content, template language, project context, and explicit user instructions. Ask one concise clarification only when language choice materially changes the final card.
  2. Write all user-facing generated text in the inferred language: card titles, descriptions, summaries, labels, badges, source notes, chart labels, AI follow-up prompts, status messages, placeholders, and schedule-created card metadata.
  3. Keep machine contracts stable: magic.project.js keys, enum-like status values, paths, filenames, CSS class names, DOM ids, JS function names, Magic API calls, and template marker comments stay in their documented form.
  4. Set HTML lang attributes to the inferred language for generated cards. Built-in English templates may use lang="en", but cards generated for users should update it.
  5. Do not translate brand names, product names, code identifiers, URLs, source quotes, or fixed schema values. Translate surrounding explanation and presentation text.

Core Capabilities

  • Create AI visual cards with scheduled updates
  • Support user-customizable HTML templates (users can edit templates anytime)
  • Each execution generates updated content based on template structure + latest data
  • Automatic history version snapshot management
  • Support multiple card types (hotspot tracker, daily digest, analytics panel, etc.)
  • Design scenario-specific interactive templates instead of only filling the preset skeletons
  • Preserve source links from fetched data and expose them through source lists, new-tab links, or safe iframe previews

Related Skill Usage

When a card needs interactivity, web-page previews, file I/O, agent/model selectors, or AI deep-analysis actions, read and apply these skills first:

  • html-app-architect: decompose the user's request, decide interaction/data/Agent boundaries, and choose Simple/Medium/Complex architecture for ordinary HTML projects.
  • html-api-sdk: verify exact window.Magic.* API signatures, message formats, error handling, and fallback behavior.

Do not treat an AI Card as a static screenshot. It is an updateable HTML micro-page: the template owns the interaction and visual structure, while the scheduled Agent workflow owns data fetching, source tracking, and content replacement.

Directory Structure Convention

Card directory name is user-defined, no fixed path required. The core requirement is the directory must contain magic.project.js with type set to ai-card.

Preferred mode is folder-based multi-file for maintainability. Single-file mode is still supported for backward compatibility.

{card-directory}/
├── magic.project.js # REQUIRED — type="ai-card"
├── template/ # Preferred template folder
│ ├── index.html
│ ├── styles.css # Optional
│ ├── scripts.js # Optional
│ ├── data/ # Optional seed schemas
│ │ ├── card-data.json
│ │ └── sources.json
│ └── prompts/ # Optional analysis prompt snippets
│ └── deep-analysis.txt
├── latest/ # Preferred output folder
│ ├── index.html
│ ├── styles.css # Optional
│ ├── scripts.js # Optional
│ └── data/ # Optional generated structured data
│ ├── card-data.json
│ └── sources.json
└── history/
├── 2026-05-23_09-00/
│ ├── index.html
│ ├── styles.css # Optional
│ ├── scripts.js # Optional
│ └── data/ # Optional snapshot data
│ ├── card-data.json
│ └── sources.json
└── 2026-05-22_09-00/
├── index.html
├── styles.css # Optional
└── scripts.js # Optional
Backward compatible (legacy):
{card-directory}/
├── magic.project.js
├── template.html
├── latest.html
└── history/
└── YYYY-MM-DD_HH-mm.html

Creation Workflow

Step 0: Requirement Decomposition and Template Design

Before creating or modifying a card, decompose the user's request into: information type, data sources, update cadence, expected interactions, source-link display mode, and whether Agent deep analysis is needed.

Design the template for the scenario instead of mechanically applying the three presets:

  • Hotspot / public-opinion cards: ranking, trend lines, platform distribution, sentiment/risk, lifecycle, source preview.
  • Daily / weekly digest cards: executive summary, metric groups, event timeline, action list, citations, expandable source text.
  • Analytics dashboards: KPIs, funnels, cohorts, anomaly alerts, range switching, follow-up insight prompts.
  • Research / intelligence cards: claim cards, evidence matrix, source reliability, iframe source preview, comparison view.
  • Decision / planning cards: option comparison, risk/reward, milestones, owners, next actions.

Prefer interactions that help judgment and action: filters, tabs, sorting, expand/collapse, chart hover, time-range switches, source drawers, iframe previews, and AI follow-up buttons. Avoid decorative-only interactions.

Self-Media Operations Boundary

When the prompt is for a self-media article/post review, post-publication retrospective, published-data import, operations review dashboard, article operations dashboard, or localized equivalent, do not generate or update ops/* files in this skill. Route the work to self-media-composer or the self-media/IP-operations data-sync workflow, which owns ops/source.json, ops/metrics.json, ops/comments.json, and ops/review.html.

AI Card may read already-produced self-media operation files only when the user explicitly asks for a separate visual card based on those existing files. It must not create, overwrite, backfill, or pretend to fetch self-media operation data.

Step 1: Create Card Directory Structure

Based on user requirements, create directory and write all required files:

1. Create the directory (name specified by the user or inferred from the content)
2. Write `magic.project.js` (triggers frontend rendering recognition and contains card config plus metadata)
3. Generate the template (recommended `template/index.html`, legacy-compatible `template.html`)
4. Fetch initial data and generate the latest card (recommended `latest/index.html`, legacy-compatible `latest.html`)
5. If scheduled updates are needed, create the scheduled task with using-cron
Step 2: magic.project.js Format

Must follow this format strictly — both frontend and backend depend on it for type recognition:

javascript
window.magicProjectConfig = {
type: "ai-card",
card_id: "stable_id_from_creation_message",
name: "Card name",
description: "Card description",
prompt: "Full user prompt",
card_path_or_link: "https://example.com/global/super/{project_id}/{topic_id}?ai_card=stable_id_from_creation_message",
cards: [{ file: "latest/index.html", label: "Latest" }],
template: "template/index.html",
schedule_id: "", // Will be filled after scheduled task creation
notification: {
channels: [
{
channel: "dingtalk", // dingtalk | wecom | lark
targetDescription: "Send to the Ops Daily group",
},
],
}, // Optional. Omit or leave channels empty when notification delivery is not needed.
last_generated: "", // ISO 8601 timestamp, updated each generation
generation_count: 0, // Incremented each generation
status: "active", // active | paused | error
};
// Legacy compatible example:
// cards: [{ file: "latest.html", label: "Latest" }],
// template: "template.html",

If the creation message includes a card id and card link, copy both values into magic.project.js as card_id and card_path_or_link. The frontend owns URL generation. This skill stores and uses the provided URL; it must not guess the frontend domain or route base.

Creation messages may provide these values as friendly text instead of raw JSON:

text
卡片编号:stable_id_from_creation_message
卡片链接:https://example.com/global/super/{project_id}/{topic_id}?ai_card=stable_id_from_creation_message

Field rules:

  1. 卡片编号 is the stable frontend deep-link identifier for this AI Card. Write it to top-level magic.project.js.card_id.
  2. 卡片链接 is the full frontend URL that opens the topic and targets this card. Write it to top-level magic.project.js.card_path_or_link.
  3. Do not require the creation message to explain why these fields exist or to use JSON. This skill owns the mapping and usage rules.
  4. Use card_path_or_link in notification content when present.

Creation messages intentionally keep execution details concise. Treat sections such as 创建需求, 创建位置, 模板, 更新方式, 定时, and 分析指令 as inputs. Apply this skill's Creation Workflow, Template Specification, Scheduled Update Workflow, and Notification Dispatch rules to decide the actual file structure, template behavior, scheduled task setup, and update process. Do not require the message itself to repeat these execution steps.

Notification Dispatch

AI Cards can optionally deliver a short update notice after a card is created or refreshed. The v1 configuration only stores notification channel and target description. Do not ask the frontend or user to provide platform credentials, webhook secrets, SMTP settings, message templates, target IDs, or channel-specific delivery options in magic.project.js.

Supported shape:

javascript
notification: {
channels: [
{
channel: "dingtalk",
targetDescription: "Send to the Ops Daily group",
},
{
channel: "wecom",
targetDescription: "Send to the WeCom Ops group",
},
{
channel: "lark",
targetDescription: "Send to: <target user>",
},
],
}

Rules:

  1. Treat missing notification, missing channels, or an empty channels array as notification disabled.
  2. Supported channel values are dingtalk, wecom, and lark only. Ignore unknown channels and explain the skipped channel in the current topic.
  3. targetDescription is natural-language user intent. It may describe a person, group, chat, or another platform-specific target. Do not invent a target when it is ambiguous.
  4. Send notifications only after the card output has been written successfully, history has been archived when needed, and magic.project.js has been updated.
  5. For dingtalk, load dingtalk-cli and use its normal routing and authentication flow to resolve and send the message.
  6. For wecom, guide the user to configure a WeCom group bot webhook outside magic.project.js; after the webhook is configured, the next card update can use the configured webhook delivery path.
  7. For lark, load lark-cli and use its normal routing and authentication flow to resolve and send the message.
  8. Do not put channel routing rules, skill names, credentials, or fallback execution details into the scheduled task message. The scheduled task should instruct the agent to update the card; this skill owns notification behavior.
  9. If authentication, webhook configuration, target resolution, or delivery fails, report the concrete missing information in the current topic. Do not claim the notification was sent.

Recommended notification content:

text
AI card updated: {card_name}
Updated at: {generated_at}
Latest card: {magic.project.js.card_path_or_link}
Step 3: Template Specification (template/index.html or template.html)

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

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

Source

Popularity

7-day trend score
0

Not refreshed yet.

Extension points

  • templateCustom templates for code generation

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/dtyq/magic/ai-card-generator/badge)](https://verified-skill.com/skills/dtyq/magic/ai-card-generator)

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