Agent Skills › dtyq/magic › html-design-style

html-design-style

GitHub

将指定的视觉设计系统应用于现有HTML文件,在保持内容、行为和交互完整性的前提下,更新颜色、排版、布局等样式。

backend/super-magic/agents/skills/html-design-style/SKILL.md dtyq/magic

Trigger Scenarios

用户要求更改现有HTML文件的视觉风格 用户提供style_code并要求应用设计系统

Install

npx skills add dtyq/magic --skill html-design-style -g -y
More Options

Non-standard path

npx skills add https://github.com/dtyq/magic/tree/master/backend/super-magic/agents/skills/html-design-style -g -y

Use without installing

npx skills use dtyq/magic@html-design-style

指定 Agent (Claude Code)

npx skills add dtyq/magic --skill html-design-style -a claude-code -g -y

安装 repo 全部 skill

npx skills add dtyq/magic --all -g -y

预览 repo 内 skill

npx skills add dtyq/magic --list

SKILL.md

Frontmatter
{
    "name": "html-design-style",
    "description": "Apply a bundled DESIGN.md visual system to an existing HTML file while preserving its content and behavior."
}

HTML Design Style

Use this skill when the user asks to change the visual style of an existing HTML file and provides a bundled style_code.

Workflow

  1. Validate the requested style_code format.
  2. Fetch the matching DESIGN.md from Magic Service.
  3. Inspect the current HTML structure, content, data flow, event handlers, forms, and responsive behavior.
  4. Apply the design system to the current file.
  5. Validate that content, data requests, permissions, event handling, and existing interactions remain available.
  6. Save and report the validated result.

Input

The request contains:

  • target_file: the current HTML file mention and path.
  • style_code: the identifier of the requested design system.
  • user_intent: the user's requested visual direction, when provided.

Fetching the design document

Design documents are owned by Magic Service. Do not expect a local copy under this skill directory.

Fetch the raw DESIGN.md with the get_html_design_style_source tool. It is a Code Mode tool, so call it through sdk.tool.call in a run_sdk_snippet code snippet. Do not start a separate python process for this.

from sdk.tool import tool

result = tool.call("get_html_design_style_source", {"style_code": "apple"})
print(result.content)

On success result.content holds the complete DESIGN.md text after a one-line header with the style_code and sha256. Read the whole document before editing; do not print only a prefix.

Rules:

  • Resolve style_code only as a single identifier: lowercase ASCII letters, digits, dots, and hyphens, beginning with a letter or digit.
  • Reject empty values, path separators, .., absolute paths, and any other malformed value before calling the tool.
  • Use only the returned content as the design source of truth.
  • Do not reconstruct the design system from a catalog, preview metadata, or prior knowledge.
  • If result.ok is false, report the failure from result.content and leave the target file unchanged. Do not guess a fallback style.

Modification rules

  • Change only the visual style. Preserve the current page content and information hierarchy unless the user explicitly requests content changes.
  • Preserve data loading, API calls, event handlers, forms, permissions, and navigation behavior.
  • Apply the design system to colors, typography, spacing, layout, shapes, elevation, component states, and responsive behavior.
  • Reuse existing local assets when possible. Do not replace working assets with remote resources without an explicit request.
  • Keep the HTML file self-contained and compatible with the existing preview environment.
  • Do not change MagicAgentApi, iframe bridge protocols, or unrelated project files.
  • Treat the user's short prompt as a dispatch request. Apply every preservation and validation rule in this skill even when the prompt does not repeat them.
  • Update the referenced HTML file through the standard workspace file flow so the change creates a new file version and keeps the previous version available for restore. Update the original file in place. Do not create a sibling copy or remove previous file versions.

Failure behavior

If the style code is invalid, the design document cannot be fetched, the target file cannot be read, or the requested change cannot be validated, do not overwrite the target file. Explain the exact failure and leave the original file unchanged.

Output

Report:

  • the applied style_code;
  • the modified file paths;
  • the preserved behaviors that were checked;
  • the validation result;
  • any remaining visual or responsive risk.

Version History

  • 0f1432c Current 2026-11-03 04:32

Same Skill Collection

backend/super-magic/agents/skills/agent-info/SKILL.md
backend/super-magic/agents/skills/canvas-designer/SKILL.md
backend/super-magic/agents/skills/chat-history/SKILL.md
backend/super-magic/agents/skills/cli-manager/SKILL.md
backend/super-magic/agents/skills/compact-chat-history/SKILL.md
backend/super-magic/agents/skills/creating-slides/SKILL.md
backend/super-magic/agents/skills/develop-data-analysis-dashboard/SKILL.md
backend/super-magic/agents/skills/document-converter/SKILL.md
backend/super-magic/agents/skills/download/SKILL.md
backend/super-magic/agents/skills/env-manager/SKILL.md
backend/super-magic/agents/skills/file-bundle/SKILL.md
backend/super-magic/agents/skills/im-channels/SKILL.md
backend/super-magic/agents/skills/magic-calendar/SKILL.md
backend/super-magic/agents/skills/magicbase/SKILL.md
backend/super-magic/agents/skills/micro-app-architect/SKILL.md
backend/super-magic/agents/skills/persona-research/SKILL.md
backend/super-magic/agents/skills/sandbox-manager/SKILL.md
backend/super-magic/agents/skills/self-media-pre-publish-analyzer/SKILL.md
backend/super-magic/agents/skills/share/SKILL.md
backend/super-magic/agents/skills/skill-vetter/SKILL.md
backend/super-magic/agents/skills/slide-template-maker/SKILL.md
backend/super-magic/agents/skills/slide-template-replacement/SKILL.md
backend/super-magic/agents/skills/startup-manager/SKILL.md
backend/super-magic/agents/skills/subagents/SKILL.md
backend/super-magic/agents/skills/super-magic/SKILL.md
backend/super-magic/agents/skills/teamshare-cli/SKILL.md
backend/super-magic/agents/skills/use-magicbase/SKILL.md
backend/super-magic/agents/skills/user-info/SKILL.md
backend/super-magic/agents/skills/using-cron/SKILL.md
backend/super-magic/agents/skills/using-llm/SKILL.md
backend/super-magic/agents/skills/using-mcp/SKILL.md
frontend/magic-web/.agents/skills/antd-style-to-tailwind/SKILL.md
frontend/magic-web/.agents/skills/code-review-expert/SKILL.md
frontend/magic-web/.agents/skills/dual-edition-module-migration/SKILL.md
frontend/magic-web/.agents/skills/frontend-storage-requirements/SKILL.md
frontend/magic-web/.agents/skills/magic-web-error-logging/SKILL.md
frontend/magic-web/.agents/skills/sw-best-practices/SKILL.md
frontend/magic-web/.agents/skills/ui-data-testid/SKILL.md
frontend/magic-web/.agents/skills/vercel-composition-patterns/SKILL.md
frontend/magic-web/.agents/skills/vercel-react-best-practices/SKILL.md
backend/super-magic/agents/skills/ai-card-generator/SKILL.md
backend/super-magic/agents/skills/canvas-manager/SKILL.md
backend/super-magic/agents/skills/crew-creator/SKILL.md
backend/super-magic/agents/skills/deep-research/SKILL.md
backend/super-magic/agents/skills/dingtalk-cli/SKILL.md
backend/super-magic/agents/skills/html-api-sdk/SKILL.md
backend/super-magic/agents/skills/html-app-architect/SKILL.md
backend/super-magic/agents/skills/lark-cli/SKILL.md
backend/super-magic/agents/skills/memory/SKILL.md

Metadata

Files
0
Version
0f1432c
Hash
31da82d1
Indexed
2026-11-03 04:32

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-11-03 19:20
浙ICP备14020137号-1