import os

base_path = "temp_ui_ux_skill/src/ui-ux-pro-max/templates/base"
with open(os.path.join(base_path, "skill-content.md"), "r", encoding="utf-8") as f:
    content = f.read()

with open(os.path.join(base_path, "quick-reference.md"), "r", encoding="utf-8") as f:
    quick_ref = f.read()

content = content.replace("{{TITLE}}", "UI UX Pro Max")
content = content.replace("{{DESCRIPTION}}", "An AI skill that provides design intelligence for building professional UI/UX across multiple platforms and frameworks.")
content = content.replace("{{QUICK_REFERENCE}}", quick_ref)
content = content.replace("{{SKILL_OR_WORKFLOW}}", "Skill")
content = content.replace("{{SCRIPT_PATH}}", ".trae/skills/ui-ux-pro-max/scripts/search.py")

frontmatter = """---
name: "ui-ux-pro-max"
description: "An AI skill that provides design intelligence for building professional UI/UX across multiple platforms. Invoke when designing UI, choosing colors/fonts, or checking UX."
---

"""

final_content = frontmatter + content

with open(".trae/skills/ui-ux-pro-max/SKILL.md", "w", encoding="utf-8") as f:
    f.write(final_content)
