Logo M2ui

M2ui

Cộng đồng
martysama0134
m2ui

Use when creating, modifying, auditing, or debugging Metin2 client UI code (uiscript dicts, root ui*.py classes, locale entries) — user says "/m2ui", "create UI", "make a window", "add button to", provides a UI screenshot to replicate, asks to "check UI for bugs" / "diagnose", or reports a visibly broken window ("doesn't open", "click does nothing", "leaks").

Tổng quan

Nhà phát hànhmartysama0134
Kho mãm2ui-skill
Tên kỹ năngm2ui
Sao
28
Bản fork
9
Tệp đi kèm
40
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 40 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được martysama0134 công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI M2ui trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/martysama0134/m2ui-skill/tree/main/plugins/m2ui/skills/m2ui
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/martysama0134/m2ui-skill.git /tmp/m2ui-skill
mkdir -p .claude/skills
cp -r /tmp/m2ui-skill/plugins/m2ui/skills/m2ui .claude/skills/m2ui
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật M2ui trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp M2ui ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng M2ui với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

/m2ui — Metin2 UI Generator

Mode Detection

Priority order:

  1. Explicit keyword: args start with screenshot, talk, script, or diagnose → that mode
  2. Image attached → screenshot mode
  3. Diagnose request: args say "check", "audit", "review", "diagnose", "find bugs in" → diagnose mode
  4. Symptom report: args contain a visible-bug phrase ("doesn't appear", "doesn't open", "doesn't work", "click does nothing", "X is broken", "looks broken", "leak", "crashes after", "stuck", "flickers") — even when a .py file is also referenced → load reference/failure-atlas.md FIRST, diagnose via the matching symptom entry, THEN script mode (if a code fix is needed) or talk mode
  5. File reference: args name a .py file in uiscript/ or root/ → script mode
  6. Text description: any other text → talk mode
  7. No args: ask — "(a) Create from screenshot, (b) Describe a new UI, (c) Modify an existing file, (d) Diagnose for bugs" — then dispatch

Read the matching mode file from modes/ adjacent to this SKILL.md (screenshot.md, talk.md, script.md, diagnose.md) and follow it.

Before Generating Any Code

Mandatory floor (always load):

  1. reference/mental-model.md — ymir engine concepts; deprograms web/React assumptions
  2. reference/event-binding.md — callback wrapping matrix

Conditional load (only what the task needs):

TaskLoad
New window from scratchreference/anchors/README.md → walk its 2-step tree (see Anchor selection)
Modifying an existing windowSkip anchors; load the existing files
Widget you haven't used recentlyreference/widgets.md — that widget's section
Locale-heavy work (many new strings)reference/locale.md
C++ Python API (net.X, player.X, ...) not already in contextreference/bindings.md — grep for the function
Patterns reminder (Initialize/Destroy, scrollbar wiring, ListBoxEx, integration template, lazy-load sub-windows, inner helper classes, 2D grids)reference/patterns.md — relevant section
User reports a visible symptomreference/failure-atlas.md — matching symptom entry FIRST, before any anchor
Visual style/sizing matters for a new windowreference/visual-conventions.md — pick archetype + chrome + palette before coding
Wiring a window into the main interfacereference/integration.md (always — after every emission)
Window has an OnUpdate body (animation / polling / fade / daily-event timing / movement queues / effect chains)reference/timer-patterns.md

Anchor selection (new windows): walk the 2-step decision tree in reference/anchors/README.md — pick exactly ONE primary archetype (the window's chrome; no exact match → closest; never skip this step), plus zero or more augmentors (05-feature-gated, 14-drag-and-drop, 15-network-coupled-flow, 16-tabbed-content, 22-compare-tooltip, 23-auto-hide-chrome). Read the primary FIRST; augmentors layer on top and never override the primary's lifecycle/structure. Tie-breaker: match the window's CHROME, not its data — "tabbed inventory" = primary 08-inventory-equipment + augmentor 16-tabbed-content, NOT 16 alone. For widgets.md/locale.md/bindings.md/patterns.md, load only the section you need, not the whole file.

Output Targets

OutputPath
uiscript dictspack/pack/uiscript/uiscript/
root UI classespack/pack/root/
locale stringsauto-detect — see reference/locale.md

Critical Rules

All modes, all generated code. Reference files cite these by number — numbering 1-19 is frozen; new rules append.

  1. @ui.WindowDestroy on every Destroy(self) method
  2. Initialize() or __Initialize() sets all instance vars to None/defaults
  3. Destroy() calls Initialize(); script-backed windows also ClearDictionary()
  4. __del__ calls ui.ScriptWindow.__del__(self)
  5. Open()/Close() — Open calls Show(), Close calls Hide()
  6. OnPressEscapeKey() returns True (always; not False)
  7. OnMouseWheel() returns True/False based on whether it consumed the event
  8. No hardcoded strings — all user text via localeInfo.* or uiScriptLocale.*
  9. constInfo.intWithCommas() for large numbers
  10. "not_pick" flag on decorative elements (lines, separators, background images)
  11. Z-order: create widgets back-to-front (SetParent call order = render order)
  12. Parent bounds clip picking — size parents to contain all interactive children
  13. Python 2.7 target — // for int division, in not has_key(), keep xrange. Full py2/py3 rules: reference/patterns.md Section 8
  14. Asset paths must exist — verify every d:/ymir work/ui/... path under D:\ymir work\ui\ via Glob before referencing it. New asset needed → emit # TBD ASSET: <path> — needs creation; never invent (invented path = red-X/pink-box at runtime, failure-atlas entry 6).
  15. Verified C++ APIs only — every call into net, player, item, chr, app, wndMgr, chat, quest must exist in reference/bindings.md. Absent → ask the user OR stub with # TODO: verify <module>.<func> exists in your fork; never invent (invented binding = AttributeError crash).
  16. ASCII-only in emitted Python — new .py content m2ui writes (code AND comments) is ASCII: no em/en-dash, ellipsis, curly quotes — use -, --, ..., ', ". Pre-existing non-ASCII and verbatim user-supplied content stay untouched; locale data files exempt (see reference/locale.md). Reason: cp1252/cp949 build encodings.

Pre-Emit Self-Review

Silently verify each item against the draft; any failure → revise and re-check. Item numbers are cited by reference files — order is frozen.

  1. Rule 1: @ui.WindowDestroy on every Destroy()
  2. Rule 2: every self.X assignment listed in Initialize()/__Initialize()
  3. Rule 5: every callback wrapped per reference/event-binding.md matrix — no bare bound method, no lambda: self.X()
  4. Rules 7-8: OnPressEscapeKey() returns True; OnMouseWheel() returns True/False
  5. Rule 9: all user-visible strings via localeInfo.*/uiScriptLocale.*
  6. Rule 11: "not_pick" on all decorative elements
  7. Rule 13: parent bounds contain all interactive children
  8. Rule 12: z-order = back-to-front SetParent order
  9. Rule 15: image paths verified via Glob (or # TBD ASSET: ...)
  10. Rule 16: C++ API calls verified in reference/bindings.md (or # TODO: verify ...)
  11. Rule 14: Python 2.7 compatible (//, in, xrange)
  12. uiscript dict filename matches the LoadScriptFile() arg in the root class
  13. Rule 3: Destroy() calls Initialize(); script-backed also ClearDictionary()
  14. Rule 4: __del__ calls ui.ScriptWindow.__del__(self)
  15. Alignment resolved — for every widget with all_align or centered horizontal_align/vertical_align, mentally resolve the FINAL screen position: all_align re-anchors (x, y) as an offset from PARENT CENTER, not absolute coords. Never all_align on a child whose y is meaningful as absolute. (See reference/widgets.md text section.)
  16. Rect within parent — after alignment, child.x + width <= parent.width and child.y + height <= parent.height; children of board_with_titlebar clear the engine titlebar (y >= 32)
  17. Rule 17: pre-existing Destroy bodies intact; owned-widget calls guarded with if self.X: (including inside helper methods the body calls)
  18. Rule 18: all new .py content ASCII-only (carve-outs per rule: pre-existing non-ASCII, verbatim user content, locale files)
  19. Rule 19: every Pattern B / Pattern E site with extra args checked against the actual setter signature in ui.py (augmented or downgraded to Pattern C)

Optional second pass: for high-stakes generations (screenshot mode, multi-file edits, gated windows) or when the silent review feels like cargo-cult, dispatch the m2ui-pre-emit-reviewer subagent before emission — independent audit, cites file:line, proposes no fixes. Distinct from diagnose mode (which audits user-supplied files).

After Code Generation

Always emit an interfacemodule.py integration snippet: import (feature-flag-guarded if applicable), instance creation, tooltip binding if applicable, BindInterface(self) if needed, toggle method, Destroy() in cleanup, Hide() in HideAllWindows. Shape + lazy-init/gated-toggle/tooltip variations: reference/integration.md.

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI M2ui làm được gì?

Use when creating, modifying, auditing, or debugging Metin2 client UI code (uiscript dicts, root ui*.py classes, locale entries) — user says "/m2ui", "create UI", "make a window", "add button to", provides a UI screenshot to replicate, asks to "check UI for bugs" / "diagnose", or reports a visibly broken window ("doesn't open", "click does nothing", "leaks").

Vì sao nên dùng M2ui trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. M2ui là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài M2ui trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/martysama0134/m2ui-skill/tree/main/plugins/m2ui/skills/m2ui. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng M2ui?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng M2ui với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng M2ui với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI M2ui có miễn phí không?

Kỹ năng này được martysama0134 phát hành trên GitHub. Hãy xem điều khoản giấy phép trong kho mã. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇