Communitygithub.com

ComeOnOliver/skillshub

为《SHINOBI WAY》游戏实现分屏对战UI(模式A)。当用户希望创建横向对峙战斗布局、角色面板、动作基座、阶段标题、VS分隔线或模式A战斗UI系统中的任何组件时使用。按照既定架构指导组件创建。

skillshub 是什么?

此技能为《SHINOBI WAY》游戏实现模式A分屏对战UI,将垂直剧场模式转变为横向对峙布局。它定义了一个明确的组件层级,包括CombatLayout(CSS网格容器)、PhaseHeader(顶部状态栏)、ConfrontationZone(战斗区域,含玩家和敌人角色面板)、VSDivider(中央VS徽章)和ActionDock(底部技能栏)。该技能遵循四步实施工作流:识别目标组件、加载参考文件(如布局规格、组件接口)、生成带有TypeScript接口和Tailwind CSS样式的React组件代码,以及将其接入主Combat.tsx场景。它适用于任何支持React和Tailwind CSS的项目,尤其适合分阶段迁移,从布局基础开始,逐步提取和优化组件,最终清理旧剧场模式代码。

兼容平台~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 (SIDE技能)
│       │   └── QuickActionCard (TOGGLE技能)
│       ├── MainActionsSection
│       │   └── MainActionCard (MAIN技能)
│       └── ControlButtons (自动、结束回合)
│
└── FloatingTextLayer (z-50, 保持不变)

文件结构

src/components/combat/
├── index.ts                  # 桶导出
├── CombatLayout.tsx          # 网格容器
├── PhaseHeader.tsx           # 顶部状态栏
├── ConfrontationZone.tsx     # 玩家 vs 敌人区域
├── CharacterPanel.tsx        # 可复用的角色显示
├── VSDivider.tsx             # 中央VS徽章
├── ActionDock.tsx            # 底部技能栏
├── QuickActionCard.tsx       # 紧凑的SIDE/TOGGLE卡片
└── MainActionCard.tsx        # 大型MAIN技能卡片

实施工作流

步骤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

桶导出模板

// 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-label、role)

现有代码参考

实现时,参考这些现有文件:

新组件参考来源
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

相关技能