Communitygithub.com

ComeOnOliver/skillshub

為《忍者之道》遊戲實作橫向對戰分割畫面 UI(模式 A)。當使用者想要建立水平對戰佈局、角色面板、行動欄、階段標頭、VS 分隔線或模式 A 戰鬥 UI 系統中的任何元件時使用。引導使用者遵循既定架構建立元件。

skillshub 是什麼?

此技能會引導開發者實作《SHINOBI WAY》遊戲的「分割畫面戰鬥 UI(模式 A)」,將垂直的劇場模式轉換為橫向對戰佈局。它提供完整的架構概覽、元件層級結構、檔案結構以及逐步實作工作流程,涵蓋從 CombatLayout(CSS 網格容器)到 PhaseHeader、ConfrontationZone、CharacterPanel、VSDivider、ActionDock 等所有元件的建立。此技能支援 Cursor 和 Claude Code 等 AI 代理平台,透過引用參考檔案(如佈局規範、元件介面、樣式權杖和動畫規格)來生成 TypeScript React 元件,並使用 Tailwind CSS 進行樣式設計。它還包含一個遷移策略,分四個階段從舊的劇場模式程式碼過渡,確保逐步導入且不影響現有功能。最終輸出是可直接整合至專案的完整元件程式碼,並附有正確的 props 對應和 barrel 匯出。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/ComeOnOliver/skillshub/tree/HEAD/skills/aiskillstore/marketplace/cesaraugustusgrob/combat-ui-pattern-a

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

戰鬥 UI 模式 A - 分割畫面實作

此技能引導實作分割畫面戰鬥 UI,將垂直的劇場模式轉換為橫向對戰佈局。

架構概覽

┌───────────────────────────────────────────────────┐
│  回合指示器  │  階段管線  │  修飾符  │  ← PhaseHeader
├──────────────────┴───────┬───────────┴────────────┤
│                          │                        │
│     玩家面板             │     敵方面板           │  ← ConfrontationZone
│     (CharacterPanel)     │     (CharacterPanel)   │
│                          │                        │
├──────────────────────────┴────────────────────────┤
│  快速行動 (側邊/切換)  │   主要行動              │  ← ActionDock
└───────────────────────────────┴───────────────────┘

元件層級結構

Combat.tsx (場景協調器)
├── CombatLayout.tsx (CSS 網格容器)
│   ├── PhaseHeader.tsx (頂部狀態列)
│   │   ├── TurnIndicator
│   │   ├── PhasePipeline
│   │   ├── SideActionCounter
│   │   └── ApproachModifier
│   │
│   ├── ConfrontationZone.tsx (戰鬥區域)
│   │   ├── CharacterPanel.tsx (玩家變體)
│   │   │   ├── CharacterSprite
│   │   │   ├── IdentityBar
│   │   │   ├── ResourceBars (HP/CP)
│   │   │   └── BuffBar
│   │   │
│   │   ├── VSDivider.tsx (中央標誌)
│   │   │
│   │   └── CharacterPanel.tsx (敵方變體)
│   │       ├── CharacterSprite
│   │       ├── IdentityBar (名稱、階級、元素)
│   │       ├── HealthBar
│   │       ├── DefenseStats
│   │       └── BuffBar
│   │
│   └── ActionDock.tsx (技能列)
│       ├── QuickActionsSection
│       │   ├── QuickActionCard (側邊技能)
│       │   └── QuickActionCard (切換技能)
│       ├── MainActionsSection
│       │   └── MainActionCard (主要技能)
│       └── ControlButtons (自動、結束回合)
│
└── FloatingTextLayer (z-50, 不變)

檔案結構

src/components/combat/
├── index.ts                  # Barrel 匯出
├── CombatLayout.tsx          # 網格容器
├── PhaseHeader.tsx           # 頂部狀態列
├── ConfrontationZone.tsx     # 玩家 vs 敵方區域
├── CharacterPanel.tsx        # 可重複使用的角色顯示
├── VSDivider.tsx             # 中央 VS 標誌
├── ActionDock.tsx            # 底部技能列
├── QuickActionCard.tsx       # 精簡側邊/切換卡片
└── MainActionCard.tsx        # 大型主要技能卡片

實作工作流程

步驟 1:識別目標元件

詢問使用者要實作哪個元件:

  1. CombatLayout - 新實作從此開始
  2. PhaseHeader - 頂部狀態列
  3. ConfrontationZone - 包含兩個面板的戰鬥區域
  4. CharacterPanel - 單個角色顯示
  5. VSDivider - 中央標誌和效果
  6. ActionDock - 底部技能列
  7. QuickActionCard - 精簡技能卡片變體
  8. MainActionCard - 大型技能卡片變體

步驟 2:載入元件參考

根據選擇,載入適當的參考:

步驟 3:產生元件程式碼

遵循元件模板模式:

import React from 'react';
import { cn } from '@/lib/utils'; // 如果使用 cn 工具函式

interface ComponentNameProps {
  // 來自 component-interfaces.md 的屬性
}

export const ComponentName: React.FC<ComponentNameProps> = ({
  // 解構屬性
}) => {
  return (
    <div className={cn(
      // 來自 styling-tokens.md 的基礎樣式
      // 條件樣式
    )}>
      {/* 元件內容 */}
    </div>
  );
};

步驟 4:連接到 Combat.tsx

建立元件後:

  1. 從 components/combat/index.ts 匯出
  2. 在 Combat.tsx 中匯入
  3. 取代對應區段
  4. 從現有狀態傳遞必要的屬性

快速實作指令

建立所有檔案(支架)

# 建立目錄
mkdir -p src/components/combat

# 建立所有元件檔案
touch src/components/combat/{index,CombatLayout,PhaseHeader,ConfrontationZone,CharacterPanel,VSDivider,ActionDock,QuickActionCard,MainActionCard}.tsx

Barrel 匯出模板

// src/components/combat/index.ts
export { CombatLayout } from './CombatLayout';
export { PhaseHeader } from './PhaseHeader';
export { ConfrontationZone } from './ConfrontationZone';
export { CharacterPanel } from './CharacterPanel';
export { VSDivider } from './VSDivider';
export { ActionDock } from './ActionDock';
export { QuickActionCard } from './QuickActionCard';
export { MainActionCard } from './MainActionCard';

從現有程式碼對應屬性

從 App.tsx → Combat.tsx(不變)

player: Player
enemy: Enemy
turnState: 'PLAYER' | 'ENEMY_TURN'
turnPhase: TurnPhaseState
combatState: CombatState
onUseSkill: (skill: Skill) => void
onPassTurn: () => void
onToggleAutoCombat: () => void
autoCombatEnabled: boolean

Combat.tsx → 新元件

// PhaseHeader
turnState, turnPhase, combatState.approach

// ConfrontationZone
player, enemy, playerStats, enemyStats

// CharacterPanel (玩家)
character: player, stats: playerStats, variant: 'player'

// CharacterPanel (敵方)
character: enemy, stats: enemyStats, variant: 'enemy'

// ActionDock
skills: player.skills, turnPhase, onUseSkill, onPassTurn

遷移策略

階段 1:佈局基礎

  1. 建立 CombatLayout.tsx,使用 CSS 網格
  2. 建立佔位元件
  3. 在 Combat.tsx 中新增功能旗標

階段 2:元件提取

  1. 實作 CharacterPanel(從 PlayerHUD + CinematicViewscreen 提取)
  2. 實作 ActionDock(從技能網格提取)
  3. 實作 PhaseHeader(從內聯指示器提取)

階段 3:視覺打磨

  1. 新增帶有效果的 VSDivider
  2. 實作動畫
  3. 調整浮動文字位置

階段 4:清理

  1. 移除舊的劇場模式程式碼
  2. 移除功能旗標
  3. 更新測試

參考檔案

輸出格式

產生 TypeScript React 元件,包含:

  1. 屬性的 TypeScript 介面
  2. 樣式的 Tailwind CSS(符合現有程式碼庫)
  3. 響應式類別(行動裝置退回垂直佈局)
  4. 適當的 記憶化(卡片使用 React.memo)
  5. 無障礙屬性(aria-labels、roles)

現有程式碼參考

實作時,參考這些現有檔案:

新元件參考來源
CharacterPanel (玩家)src/components/PlayerHUD.tsx
CharacterPanel (敵方)src/scenes/Combat.tsx 第 113-305 行
ActionDocksrc/scenes/Combat.tsx 第 308-607 行
QuickActionCardsrc/components/SkillCard.tsx
MainActionCardsrc/components/SkillCard.tsx
PhaseHeadersrc/scenes/Combat.tsx 第 311-328 行

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

ComeOnOliver/skillshub

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual exploration rather than abstract choices.

ComeOnOliver/skillshub

Next.js 16+ 和 Turbopack — 增量打包、文件系统缓存、开发速度,以及何时使用 Turbopack 与 webpack。

ComeOnOliver/skillshub

SwiftUI architecture patterns, state management with @Observable, view composition, navigation, performance optimization, and modern iOS/macOS UI best practices.

ComeOnOliver/skillshub

See, Understand, Act on video and audio. See- ingest from local files, URLs, RTSP/live feeds, or live record desktop; return realtime context and playable stream links. Understand- extract frames, build visual/semantic/temporal indexes, and search moments with timestamps and auto-clips. Act- transcode and normalize (codec, fps, resolution, aspect ratio), perform timeline edits (subtitles, text/image overlays, branding, audio overlays, dubbing, translation), generate media assets (image, audio, video), and create real time alerts for events from live streams or desktop capture.

ComeOnOliver/skillshub

AI-assisted video editing workflows for cutting, structuring, and augmenting real footage. Covers the full pipeline from raw capture through FFmpeg, Remotion, ElevenLabs, fal.ai, and final polish in Descript or CapCut. Use when the user wants to edit video, cut footage, create vlogs, or build video content.

ComeOnOliver/skillshub

Next.js 15 애플리케이션을 위한 프론트엔드 개발 가이드라인. React 19, TypeScript, Shadcn/ui, Tailwind CSS를 사용한 모던 패턴. Server Components, Client Components, App Router, 파일 구조, Shadcn/ui 컴포넌트, 성능 최적화, TypeScript 모범 사례 포함. 컴포넌트, 페이지, 기능 생성, 데이터 페칭, 스타일링, 라우팅, 프론트엔드 코드 작업 시 사용.

ComeOnOliver/skillshub

Provides Tamagui patterns for config v4, compiler optimization, styled context, and cross-platform styling. Must use when working with Tamagui projects (tamagui.config.ts, @tamagui imports).

ComeOnOliver/skillshub

Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.

ComeOnOliver/skillshub

Create high-converting, visually distinctive landing pages. Use when building marketing pages, product launches, SaaS homepages, or any single-page conversion-focused website. Guides section-by-section composition with anti-AI-slop principles.

ComeOnOliver/skillshub

Auto-loaded context for Portfolio Buddy 2 development. Use for ANY task involving: React 19 development, TypeScript, portfolio analysis features, metrics calculations, trading strategy comparison, or working with the Portfolio Buddy 2 codebase. Contains tech stack, known issues, and architectural constraints.

ComeOnOliver/skillshub

Next.js development tooling via MCP. Inspect routes, components, build info, and debug Next.js apps. Use when working on Next.js applications, debugging routing, or inspecting app structure. NOT for general React or non-Next.js projects.

ComeOnOliver/skillshub

Implement UI using Shadcn MCP (atoms/theme) and 21st.dev MCP (complex sections). Use when adding buttons, layouts, or generating landing pages.

ComeOnOliver/skillshub

A conceptual skill for building an API client in Next.js that handles JWT tokens

ComeOnOliver/skillshub

Best practices and patterns for Next.js App Router, Server Actions, and Routing in this project.

ComeOnOliver/skillshub

The Design System, Theme, and UX rules for the Physical AI Hub.

ComeOnOliver/skillshub

Comprehensive frontend development skill for building modern, performant web applications using ReactJS, NextJS, TypeScript, Tailwind CSS. Includes component scaffolding, performance optimization, bundle analysis, and UI best practices. Use when developing frontend features, optimizing performance, implementing UI/UX designs, managing state, or reviewing frontend code.

ComeOnOliver/skillshub

This document captures learnings from fixing keyboard navigation issues when floating components (Select, DropdownMenu, Popover) have CSS open/close animations.

ComeOnOliver/skillshub

Build Next.js 16 applications with correct patterns and distinctive design. Use when creating pages, layouts, dynamic routes, upgrading from Next.js 15, or implementing proxy.ts. Covers breaking changes (async params/searchParams, Turbopack, cacheComponents) and frontend aesthetics. NOT when building non-React or backend-only applications.

ComeOnOliver/skillshub

Comprehensive Framer Motion animation library for React. Covers motion components, variants, gestures, page transitions, and scroll animations. Use when adding animations to React/Next.js applications.

ComeOnOliver/skillshub

Build interfaces that resonate, not just render. This skill enforces bold, intentional

相關技能