Logo Phaser Analyze

Phaser Analyze

Tổ chức
Yakoub-ai
phaser-analyze

This skill should be used when the user asks to "analyze my game", "review my Phaser project", "audit project health", "find bottlenecks", "refactor my game", "improve my code", "optimize my project", "what's wrong with my game", "code review Phaser", or "assess architecture".

Tổng quan

Nhà phát hànhYakoub-ai
Kho mãphaser4-gamedev
Tên kỹ năngphaser-analyze
Sao
29
Bản fork
3
Tệp đi kèm
3
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ộ.

  • 3 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 Yakoub-ai 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 Phaser Analyze 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/Yakoub-ai/phaser4-gamedev/tree/main/skills/phaser-analyze
  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/Yakoub-ai/phaser4-gamedev.git /tmp/phaser4-gamedev
mkdir -p .claude/skills
cp -r /tmp/phaser4-gamedev/skills/phaser-analyze .claude/skills/phaser-analyze
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 Phaser Analyze 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 Phaser Analyze 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 Phaser Analyze 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.

Phaser 4 Brownfield Project Analysis

Perform a comprehensive analysis of an existing Phaser 4 project to assess architecture quality, identify performance risks, flag API correctness issues, and produce a prioritized improvement roadmap.

Analysis Process

Follow all five phases in order. Do not skip phases — each builds on the previous.

Phase 1 — Discovery

Gather raw facts about the project before making any judgments.

  • Read package.json for dependencies and Phaser version
  • Glob for all .ts/.js files in src/
  • Read main.ts for GameConfig
  • Identify all scenes: grep "extends Phaser.Scene" across src/
  • Map scene graph: grep for this.scene.start, this.scene.launch, this.scene.stop
  • Identify all custom game objects: grep "extends Phaser.Physics" or grep "extends Phaser.GameObjects"
  • Count total source files and lines of code

Phase 2 — Architecture Assessment

Evaluate the structural quality of the codebase.

  • Scene count and organization — Are scenes in src/scenes/? Are there too many or too few for the game's complexity?
  • State management pattern — Registry vs globals vs module state. Search for window., module-level let/var declarations.
  • Asset loading strategy — Centralized PreloaderScene vs scattered preload() methods across scenes.
  • Code organization — Does the project follow scenes/, objects/, managers/ conventions?
  • Cross-scene coupling analysis — Direct references vs event bus vs Registry. Search for this.registry, this.events.emit, this.scene.get.

Rate the architecture A through F based on findings:

  • A — Clean separation, centralized loading, event-driven communication
  • B — Minor organizational gaps, mostly well-structured
  • C — Some coupling issues, mixed patterns, functional but messy
  • D — Significant structural problems, globals, scattered loading
  • F — No discernible architecture, everything in one file or deeply entangled

Phase 3 — Performance Audit

Identify runtime performance risks.

  • Object pooling: Search for classType/maxSize in group declarations. Flag physics groups created with this.physics.add.group() that lack maxSize — these leak objects.
  • Particle emitter caps: Search for particle emitters missing maxParticles. Uncapped emitters can spike frame time.
  • Static vs dynamic groups: Check if platforms, walls, and other immovable bodies use staticGroup() (correct) vs group() (wastes physics cycles).
  • Update loop weight: Read each scene's update() method. Flag complex logic, object allocations (new), or heavy iteration inside update().
  • Texture atlas usage: Count individual this.load.image() calls vs this.load.atlas() calls. More than 15 individual image loads is a red flag — should be packed into atlases.
  • Physics body count: Estimate total active physics bodies from group declarations and individual this.physics.add.* calls.

Phase 4 — API Correctness

Check for deprecated, removed, or misused APIs.

  • v3 API scan: Search for removed APIs — Geom.Point, Math.PI2, Phaser.Structs, Camera3D, Layer3D, FacebookInstant, Create.GenerateTexture, TileSprite.setCrop.
  • TypeScript strictness: Grep for as any, @ts-ignore, untyped function parameters. These hide real bugs.
  • Asset key consistency: Cross-reference this.load.* keys with this.add.*/this.physics.add.* keys. Mismatched keys cause silent texture-missing errors.
  • Scene key registration: Verify all scene classes appear in the GameConfig scene array in main.ts.
  • Physics body creation: Flag this.add.sprite() calls that should be this.physics.add.sprite() (sprites expected to have physics but created without a body).
  • DynamicTexture/RenderTexture: Check for missing .render() calls after drawing operations.

Phase 5 — Best Practice Check

Verify the project follows Phaser 4 best practices.

  • Lifecycle discipline: preload() should only load assets, create() should only build the scene, update() should be lean (no asset loading, no object creation).
  • Cleanup on shutdown: Scenes should clean up — look for this.events.off, this.sound.stopAll(), timer destruction, this.events.on('shutdown', ...).
  • Camera bounds: Camera bounds should match world or tilemap bounds. Search for this.cameras.main.setBounds and compare with world/map dimensions.
  • Input keyboard null assertions: this.input.keyboard can be null in Phaser 4. Check for this.input.keyboard! or proper null guards.
  • Physics debug flag: debug: true in physics config should be false for production. Flag if present.
  • Console statements: Count console.log/console.warn/console.error calls. These should be gated behind import.meta.env.DEV or removed for production.

Output Format

Produce a structured report with these sections:

  1. Project Summary — File count, scene count, lines of code, estimated complexity (small/medium/large).
  2. Architecture Score — Letter grade (A/B/C/D/F) with rationale for the rating.
  3. Performance Risks — Ordered by severity (critical/high/medium/low) with a concrete fix suggestion for each.
  4. Code Quality Issues — With file:line references where possible.
  5. Improvement Roadmap — Prioritized refactoring steps, ordered by impact vs effort.
  6. Quick Wins — 3-5 changes that can be made immediately for noticeable improvement.

Related Skills

  • Use /phaser-migrate to fix any Phaser v3 API issues found in Phase 4.
  • Use /phaser-physics for implementing object pooling and fixing physics group issues from Phase 3.
  • Use the phaser-debugger agent for investigating runtime performance issues flagged in Phase 3.

Reference Files

  • references/analysis-checklist.md — Complete checklist with grep patterns, severity ratings, and fix references for all checks.
  • references/performance-playbook.md — Nine-phase Phaser 4 performance playbook for mid-range mobile targets: measurement-first prompting, per-frame allocation elimination, registry throttling, audio lazy-load, VFX pooling, spatial grid, atlas packing, event throttling, AI tick-skip with real delta, tween cleanup. Read when FPS is below target or memory grows during gameplay.

Automated Pre-scan

Before starting the manual deep review, run the automated analysis script:

bash
bash "${CLAUDE_PLUGIN_ROOT}/skills/phaser-analyze/scripts/analyze-project.sh"

This provides baseline metrics and flags obvious issues. Use the script output as a starting point, then perform the full 5-phase analysis by reading actual source files.

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 Phaser Analyze làm được gì?

This skill should be used when the user asks to "analyze my game", "review my Phaser project", "audit project health", "find bottlenecks", "refactor my game", "improve my code", "optimize my project", "what's wrong with my game", "code review Phaser", or "assess architecture".

Vì sao nên dùng Phaser Analyze 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. Phaser Analyze 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 Phaser Analyze trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Yakoub-ai/phaser4-gamedev/tree/main/skills/phaser-analyze. 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 Phaser Analyze?

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 Phaser Analyze 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 Phaser Analyze 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 Phaser Analyze có miễn phí không?

Kỹ năng này được Yakoub-ai 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 👇