Token导航 LogoToken导航

Agent Skill · 前端设计

theone-cocos-standards(theone cocos 标准)

theone-cocos-standards 用于辅助前端页面、组件、样式和交互逻辑开发,适合在 Local Agent 中需要维护前端项目、生成组件或检查界面实现时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

theone-cocos-standards 是前端设计类 Agent Skill,可用宿主为 Local Agent,通过unknown获取,权限为只读;许可证信息还不明确,暂无第三方扫描结果,按安装量在前端设计类的 10,216 个 Skill 里排第 9,526。

总安装 212周安装 9下载 74核验 2026-05-01
前端设计只读unknown未标认证来源可访问许可证需确认审计未展示Local Agent

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:theone-cocos-standards(theone cocos 标准)
来源仓库:https://smithery.ai
仓库路径:theone-cocos-standards
安装命令:
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。当前暂无明确安装命令,请以来源页面说明为准。

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于辅助 Cocos Creator 前端开发和组件实现。提供 TypeScript 规范、架构模式和性能优化标准。涵盖 DrawCall 批处理、GPU 皮肤和小包体要求,提升游戏性能。安装前建议确认项目环境和权限范围,注意是否会触发文件读写。

theone-cocos-standards 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:theone-cocos-standards

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Local Agent;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    没有现成安装命令,按unknown的说明从来源页面获取,仓库路径是 theone-cocos-standards。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

theone-cocos-standards 怎么安装?

公开资料没有给出可以直接复制的命令,需要按来源页面说明手动安装,仓库内路径为 theone-cocos-standards。

theone-cocos-standards 支持哪些 AI 工具?

公开资料标注支持 Local Agent。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

theone-cocos-standards 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

theone-cocos-standards 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

theone-cocos-standards 用的人多吗?

公开数据是累计安装 212 次,近一周安装 9 次,下载 74 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

theone-cocos-standards 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 专注 Local Agent 一种宿主,触发方式和使用习惯不用来回切换。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Local Agent,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
theone-cocos-standards

theone cocos 标准 · 本页

212—只读未明确未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

TheOne Studio Cocos Creator Development Standards

⚠️ Cocos Creator 3.x (TypeScript 4.1+): All patterns and examples are compatible with Cocos Creator 3.x playable ads development.

Skill Purpose

This skill enforces TheOne Studio's comprehensive Cocos Creator development standards with CODE QUALITY FIRST:

Priority 1: Code Quality & Hygiene (MOST IMPORTANT)

  • TypeScript strict mode, ESLint configuration, access modifiers (public/private/protected)
  • Throw exceptions (never silent errors)
  • console.log for development, remove in production builds
  • readonly for immutable fields, const for constants
  • No inline comments (use descriptive names)
  • Proper error handling and type safety

Priority 2: Modern TypeScript Patterns

  • Array methods (map/filter/reduce) over loops
  • Arrow functions, destructuring, spread operators
  • Optional chaining, nullish coalescing
  • Type guards, utility types (Partial, Required, Readonly)
  • Modern TypeScript features

Priority 3: Cocos Creator Architecture

  • Component-based Entity-Component (EC) system
  • Lifecycle methods: onLoad→start→onEnable→update→onDisable→onDestroy
  • EventDispatcher pattern for custom events
  • Node event system (EventTouch, keyboard events)
  • Resource management and pooling for playables

Priority 4: Playable Ads Performance

  • DrawCall batching (<10 DrawCalls target)
  • Sprite atlas configuration (auto-atlas enabled)
  • GPU skinning for skeletal animations
  • Zero allocations in update() loop
  • Bundle size <5MB (texture compression, code minification)

When This Skill Triggers

  • Writing or refactoring Cocos Creator TypeScript code
  • Implementing playable ads features
  • Working with component lifecycle and events
  • Optimizing performance for playable ads
  • Reviewing code changes or pull requests
  • Setting up playable project architecture
  • Reducing bundle size or DrawCall counts

Quick Reference Guide

What Do You Need Help With?

PriorityTaskReference
🔴 PRIORITY 1: Code Quality (Check FIRST)
1TypeScript strict mode, ESLint, access modifiersQuality & Hygiene ⭐
1Throw exceptions, proper error handlingQuality & Hygiene ⭐
1console.log (development only), remove in productionQuality & Hygiene ⭐
1readonly/const, no inline comments, descriptive namesQuality & Hygiene ⭐
🟡 PRIORITY 2: Modern TypeScript Patterns
2Array methods, arrow functions, destructuringModern TypeScript
2Optional chaining, nullish coalescingModern TypeScript
2Type guards, utility typesModern TypeScript
🟢 PRIORITY 3: Cocos Architecture
3Component system, @property decoratorComponent System
3Lifecycle methods (onLoad→start→update→onDestroy)Component System
3EventDispatcher, Node events, cleanupEvent Patterns
3Resource loading, pooling, memory managementPlayable Optimization
🔵 PRIORITY 4: Performance & Review
4DrawCall batching, sprite atlas, GPU skinningPlayable Optimization
4Update loop optimization, zero allocationsPerformance
4Bundle size reduction (<5MB target)Size Optimization
4Architecture review (components, lifecycle, events)Architecture Review
4TypeScript quality reviewQuality Review
4Performance review (DrawCalls, allocations)Performance Review

🔴 CRITICAL: Code Quality Rules (CHECK FIRST!)

⚠️ MANDATORY QUALITY STANDARDS

ALWAYS enforce these BEFORE writing any code:

  1. Enable TypeScript strict mode - "strict": true in tsconfig.json
  2. Use ESLint configuration - @typescript-eslint rules enabled
  3. Use access modifiers - public/private/protected on all members
  4. Throw exceptions for errors - NEVER silent failures or undefined returns
  5. console.log for development only - Remove all console statements in production builds
  6. Use readonly for immutable fields - Mark fields that aren't reassigned
  7. Use const for constants - Constants should be const, not let
  8. No inline comments - Use descriptive names; code should be self-explanatory
  9. Proper null/undefined handling - Use optional chaining and nullish coalescing
  10. Type safety - Avoid any type, use proper types and interfaces

Example: Enforce Quality First

// ✅ EXCELLENT: All quality rules enforced
import { _decorator, Component, Node, EventTouch } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('PlayerController')
export class PlayerController extends Component {
    // 3. Access modifier, 6. readonly for immutable
    @property(Node)
    private readonly targetNode: Node | null = null;

    // 7. const for constants
    private static readonly MAX_HEALTH: number = 100;
    private currentHealth: number = 100;

    // Lifecycle: onLoad → start → onEnable
    protected onLoad(): void {
        // 4. Throw exception for errors
        if (!this.targetNode) {
            throw new Error('PlayerController: targetNode is not assigned');
        }

        // 9. Proper event listener setup
        this.node.on(Node.EventType.TOUCH_START, this.onTouchStart, this);
    }

    protected onDestroy(): void {
        // 9. Always cleanup event listeners
        this.node.off(Node.EventType.TOUCH_START, this.onTouchStart, this);
    }

    private onTouchStart(event: EventTouch): void {
        // 5. console.log only for development (remove in production)
        if (CC_DEBUG) {
            console.log('Touch detected');
        }

        this.takeDamage(10);
    }

    // 8. Descriptive method names (no inline comments needed)
    private takeDamage(amount: number): void {
        this.currentHealth -= amount;

        if (this.currentHealth <= 0) {
            this.handlePlayerDeath();
        }
    }

    private handlePlayerDeath(): void {
        // Death logic
    }
}

⚠️ Cocos Creator Architecture Rules (AFTER Quality)

Component System Fundamentals

Entity-Component (EC) System:

  • Components extend Component class
  • Use @ccclass and @property decorators
  • Lifecycle: onLoad → start → onEnable → update → lateUpdate → onDisable → onDestroy

Execution Order:

  1. onLoad() - Component initialization, one-time setup
  2. start() - After all components loaded, can reference other components
  3. onEnable() - When component/node enabled (can be called multiple times)
  4. update(dt) - Every frame (use sparingly for playables)
  5. lateUpdate(dt) - After all update() calls
  6. onDisable() - When component/node disabled
  7. onDestroy() - Cleanup, remove listeners, release resources

Universal Rules:

  • ✅ Initialize in onLoad(), reference other components in start()
  • ✅ Register events in onEnable(), unregister in onDisable()
  • ✅ Always cleanup listeners in onDestroy()
  • ✅ Avoid heavy logic in update() (performance critical for playables)
  • ✅ Use readonly for @property fields that shouldn't be reassigned
  • ✅ Throw exceptions for missing required references

Brief Examples

🔴 Code Quality First

// ✅ EXCELLENT: Quality rules enforced
import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('GameManager')
export class GameManager extends Component {
    @property(Node)
    private readonly playerNode: Node | null = null;

    private static readonly MAX_SCORE: number = 1000;
    private currentScore: number = 0;

    protected onLoad(): void {
        // Throw exception for missing required references
        if (!this.playerNode) {
            throw new Error('GameManager: playerNode is required');
        }

        if (CC_DEBUG) {
            console.log('GameManager initialized'); // Development only
        }
    }

    public addScore(points: number): void {
        if (points <= 0) {
            throw new Error('GameManager.addScore: points must be positive');
        }

        this.currentScore = Math.min(
            this.currentScore + points,
            GameManager.MAX_SCORE
        );
    }
}

🟡 Modern TypeScript Patterns

// ✅ GOOD: Array methods instead of loops
const activeEnemies = allEnemies.filter(e => e.isActive);
const enemyPositions = activeEnemies.map(e => e.node.position);

// ✅ GOOD: Optional chaining and nullish coalescing
const playerName = player?.name ?? 'Unknown';

// ✅ GOOD: Destructuring
const { x, y } = this.node.position;

// ✅ GOOD: Arrow functions
this.enemies.forEach(enemy => enemy.takeDamage(10));

// ✅ GOOD: Type guards
function isPlayer(node: Node): node is PlayerNode {
    return node.getComponent(PlayerController) !== null;
}

🟢 Cocos Creator Component Pattern

import { _decorator, Component, Node, EventTouch, Vec3 } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('TouchHandler')
export class TouchHandler extends Component {
    @property(Node)
    private readonly targetNode: Node | null = null;

    private readonly tempVec3: Vec3 = new Vec3(); // Reusable vector

    // 1. onLoad: Initialize component
    protected onLoad(): void {
        if (!this.targetNode) {
            throw new Error('TouchHandler: targetNode is required');
        }
    }

    // 2. start: Reference other components (if needed)
    protected start(): void {
        // Can safely access other components here
    }

    // 3. onEnable: Register event listeners
    protected onEnable(): void {
        this.node.on(Node.EventType.TOUCH_START, this.onTouchStart, this);
        this.node.on(Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
    }

    // 4. onDisable: Unregister event listeners
    protected onDisable(): void {
        this.node.off(Node.EventType.TOUCH_START, this.onTouchStart, this);
        this.node.off(Node.EventType.TOUCH_MOVE, this.onTouchMove, this);
    }

    // 5. onDestroy: Final cleanup
    protected onDestroy(): void {
        // Release any additional resources
    }

    private onTouchStart(event: EventTouch): void {
        // Handle touch
    }

    private onTouchMove(event: EventTouch): void {
        // Reuse vector to avoid allocations
        this.targetNode!.getPosition(this.tempVec3);
        this.tempVec3.y += 10;
        this.targetNode!.setPosition(this.tempVec3);
    }
}

🟢 Event Dispatcher Pattern

import { _decorator, Component, EventTarget } from 'cc';
const { ccclass } = _decorator;

// Custom event types
export enum GameEvent {
    SCORE_CHANGED = 'score_changed',
    LEVEL_COMPLETE = 'level_complete',
    PLAYER_DIED = 'player_died',
}

export interface ScoreChangedEvent {
    oldScore: number;
    newScore: number;
}

@ccclass('EventManager')
export class EventManager extends Component {
    private static instance: EventManager | null = null;
    private readonly eventTarget: EventTarget = new EventTarget();

    protected onLoad(): void {
        if (EventManager.instance) {
            throw new Error('EventManager: instance already exists');
        }
        EventManager.instance = this;
    }

    public static emit(event: GameEvent, data?: any): void {
        if (!EventManager.instance) {
            throw new Error('EventManager: instance not initialized');
        }
        EventManager.instance.eventTarget.emit(event, data);
    }

    public static on(event: GameEvent, callback: Function, target?: any): void {
        if (!EventManager.instance) {
            throw new Error('EventManager: instance not initialized');
        }
        EventManager.instance.eventTarget.on(event, callback, target);
    }

    public static off(event: GameEvent, callback: Function, target?: any): void {
        if (!EventManager.instance) {
            throw new Error('EventManager: instance not initialized');
        }
        EventManager.instance.eventTarget.off(event, callback, target);
    }
}

// Usage in component
@ccclass('ScoreDisplay')
export class ScoreDisplay extends Component {
    protected onEnable(): void {
        EventManager.on(GameEvent.SCORE_CHANGED, this.onScoreChanged, this);
    }

    protected onDisable(): void {
        EventManager.off(GameEvent.SCORE_CHANGED, this.onScoreChanged, this);
    }

    private onScoreChanged(data: ScoreChangedEvent): void {
        console.log(`Score: ${data.oldScore} → ${data.newScore}`);
    }
}

🔵 Playable Performance Optimization

import { _decorator, Component, Node, Sprite, SpriteAtlas } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('OptimizedSpriteManager')
export class OptimizedSpriteManager extends Component {
    // Use sprite atlas for DrawCall batching
    @property(SpriteAtlas)
    private readonly characterAtlas: SpriteAtlas | null = null;

    // Preallocate arrays to avoid allocations in update()
    private readonly tempNodes: Node[] = [];
    private frameCount: number = 0;

    protected onLoad(): void {
        if (!this.characterAtlas) {
            throw new Error('OptimizedSpriteManager: characterAtlas is required');
        }

        // Prewarm sprite frames from atlas
        this.prewarmSpriteFrames();
    }

    private prewarmSpriteFrames(): void {
        // Load all sprites from atlas (batched in single DrawCall)
        const spriteFrame = this.characterAtlas!.getSpriteFrame('character_idle');
        if (!spriteFrame) {
            throw new Error('Sprite frame not found in atlas');
        }
    }

    // Optimize update: avoid allocations, use object pooling
    protected update(dt: number): void {
        // Run expensive operations every N frames instead of every frame
        this.frameCount++;
        if (this.frameCount % 10 === 0) {
            this.updateExpensiveOperation();
        }
    }

    private updateExpensiveOperation(): void {
        // Reuse array instead of creating new one
        this.tempNodes.length = 0;

        // Batch operations to reduce DrawCalls
    }
}

Code Review Checklist

Quick Validation (before committing)

🔴 Code Quality (CHECK FIRST):

  • TypeScript strict mode enabled in tsconfig.json
  • ESLint rules passing (no errors)
  • All access modifiers correct (public/private/protected)
  • Exceptions thrown for errors (no silent failures)
  • console.log removed or wrapped in CC_DEBUG
  • readonly used for non-reassigned fields
  • const used for constants
  • No inline comments (self-explanatory code)
  • Proper null/undefined handling
  • No any types (use proper types)

🟡 Modern TypeScript Patterns:

  • Array methods used instead of manual loops
  • Arrow functions for callbacks
  • Optional chaining (?.) for safe property access
  • Nullish coalescing (??) for default values
  • Destructuring for cleaner code
  • Type guards for type narrowing

🟢 Cocos Creator Architecture:

  • Component lifecycle methods in correct order
  • onLoad() for initialization, start() for references
  • Event listeners registered in onEnable()
  • Event listeners unregistered in onDisable()
  • Resources released in onDestroy()
  • @property decorator used correctly
  • Required references validated (throw if null)

🔵 Playable Performance:

  • No allocations in update() loop
  • Sprite atlas used for DrawCall batching
  • GPU skinning enabled for skeletal animations
  • Expensive operations throttled (not every frame)
  • Object pooling for frequently created objects
  • Texture compression enabled
  • Bundle size <5MB target
  • DrawCall count <10 target

Common Mistakes to Avoid

❌ DON'T:

  1. Ignore TypeScript strict mode → Enable "strict": true
  2. Silent error handling → Throw exceptions for errors
  3. Leave console.log in production → Remove or wrap in CC_DEBUG
  4. Skip access modifiers → Use public/private/protected
  5. Use any type → Define proper types and interfaces
  6. Add inline comments → Use descriptive names instead
  7. Skip event cleanup → Always unregister in onDisable/onDestroy
  8. Allocate in update() → Preallocate and reuse objects
  9. Forget sprite atlas → Use atlas for DrawCall batching
  10. Heavy logic in update() → Throttle expensive operations
  11. Skip null checks → Validate required references in onLoad
  12. Mutable @property fields → Use readonly when appropriate
  13. Manual loops over arrays → Use map/filter/reduce
  14. Ignore bundle size → Monitor and optimize (<5MB target)

✅ DO:

  1. Enable TypeScript strict mode ("strict": true)
  2. Throw exceptions for errors (never silent failures)
  3. Use console.log for development only (remove in production)
  4. Use access modifiers (public/private/protected)
  5. Define proper types (avoid any)
  6. Use descriptive names (no inline comments)
  7. Always cleanup events (onDisable/onDestroy)
  8. Preallocate objects (reuse in update())
  9. Use sprite atlas (DrawCall batching)
  10. Throttle expensive operations (not every frame)
  11. Validate required references (throw in onLoad if null)
  12. Use readonly for @property (when appropriate)
  13. Use array methods (map/filter/reduce)
  14. Monitor bundle size (<5MB target for playables)

Review Severity Levels

🔴 Critical (Must Fix)

  • TypeScript strict mode disabled - Must enable "strict": true
  • Silent error handling - Must throw exceptions for errors
  • console.log in production code - Remove or wrap in CC_DEBUG
  • Missing access modifiers - All members must have modifiers
  • Using any type without justification - Define proper types
  • Inline comments instead of descriptive names - Rename and remove comments
  • Event listeners not cleaned up - Memory leak, must unregister
  • Missing required reference validation - Must throw in onLoad if null
  • Allocations in update() loop - Performance critical, must preallocate
  • No sprite atlas for multiple sprites - DrawCall explosion, must use atlas
  • Bundle size >5MB - Exceeds playable limit, must optimize

🟡 Important (Should Fix)

  • Missing readonly on @property fields - Should be readonly when not reassigned
  • Missing const for constants - Should use const instead of let
  • Manual loops instead of array methods - Should use map/filter/reduce
  • Missing optional chaining - Should use?. for safe access
  • Missing nullish coalescing - Should use?? for default values
  • Heavy logic in update() - Should throttle expensive operations
  • No object pooling for frequent allocations - Should implement pooling
  • Texture compression not enabled - Should enable for smaller bundle
  • DrawCall count >10 - Should optimize batching

🟢 Nice to Have (Suggestion)

  • Could use arrow function for callback
  • Could destructure for cleaner code
  • Could use type guard for type safety
  • Could improve naming for clarity
  • Could add interface for better typing
  • Could optimize algorithm for better performance

Detailed References

TypeScript Language Standards

Cocos Creator Framework

Code Review

Summary

This skill provides comprehensive Cocos Creator development standards for TheOne Studio's playable ads team:

  • TypeScript Excellence: Strict mode, modern patterns, type safety
  • Cocos Architecture: Component lifecycle, event patterns, resource management
  • Playable Performance: DrawCall batching, GPU skinning, <5MB bundles
  • Code Quality: Enforced quality, hygiene, and performance rules

Use the Quick Reference Guide above to navigate to the specific pattern you need.

平台分布

Local Agent

72.71%
按下载量换算54

安全审计

暂无安全审计结果可展示。

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills