cocos-creator-dev
- Repo stars 29
- Author updated Live
- Author repo cocos-creator-dev-skill
- Domain
- Writing
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 88 / 100 · community maintained
- Author / version / license
- @Dailiduzhou · no license declared
- Token usage
- Lean
- Setup complexity
- Guided setup
- External API key
- Not required
- Operating systems
- macOS · Linux · Windows
- Runtime requirements
- Node.js
- Permissions
-
- Read-only
- Write / modify
- Shell exec
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: cocos-creator-dev
description: Comprehensive Cocos Creator 3.x development guide covering TypeScript scripting, component syste…
category: writing
runtime: Node.js
---
# cocos-creator-dev output preview
## PART A: Task fit
- Use case: Comprehensive Cocos Creator 3.x development guide covering TypeScript scripting, component system, node hierarchy, scene management, resource loading, and event handling. Use this skill when: (1) Writing or debugging Cocos Creator 3.x TypeScript scripts, (2) Creating and managing components and their lifecycle, (3) Working with nodes, hierarchy, and scene organization, (4) Loading and managing game resources, (5) Implementing event systems and input handling, (6) Optimizing performance and memory in Cocos Creator projects, (7) Migrating from 2.x to 3.x versions.
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Quick Start / Basic Component Template / Common Operations” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Comprehensive Cocos Creator 3.x development guide covering TypeScript scripting, component system, node hierarchy, scene management, resource loading, and event handling. Use this skill when: (1) Writing or debugging Cocos Creator 3.x TypeScript scripts, (2) Creating and managing components and their lifecycle, (3) Working with nodes, hierarchy, and scene organization, (4) Loading and managing game resources, (5) Implementing event systems and input handling, (6) Optimizing performance and memory in Cocos Creator projects, (7) Migrating from 2.x to 3.x versions”.
- **02** When the source has headings, the agent prioritizes “Quick Start / Basic Component Template / Common Operations” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files, run shell commands.
Start with a small task and check whether the result follows “Quick Start / Basic Component Template / Common Operations”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: cocos-creator-dev
description: Comprehensive Cocos Creator 3.x development guide covering TypeScript scripting, component syste…
category: writing
source: Dailiduzhou/cocos-creator-dev-skill
---
# cocos-creator-dev
## When to use
- Comprehensive Cocos Creator 3.x development guide covering TypeScript scripting, component system, node hierarchy, sce…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Quick Start / Basic Component Template / Common Operations” and keep inference separate from source facts.
- read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "cocos-creator-dev" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Quick Start / Basic Component Template / Common Operations
rules -> SKILL.md triggers / order / output contract
runtime -> Node.js | read files, write/modify files, run shell commands | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} Cocos Creator 3.x Development Guide
Guide for Cocos Creator 3.x game development using TypeScript.
Quick Start
Basic Component Template
import { _decorator, Component, Node } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('MyComponent')
export class MyComponent extends Component {
@property(Node)
targetNode: Node = null;
@property
speed: number = 10;
onLoad() {
// Initialization
}
start() {
// First frame update
}
update(deltaTime: number) {
// Per-frame update
}
}
Common Operations
Add component dynamically:
this.node.addComponent(MyComponent);
Get component:
const comp = this.node.getComponent(MyComponent);
Load scene:
director.loadScene('SceneName');
Load resource:
resources.load('textures/sprite', SpriteFrame, (err, asset) => {
this.node.getComponent(Sprite).spriteFrame = asset;
});
Reference Documentation
For detailed information on specific topics, consult these reference files:
- Script Basics: references/script-basics.md - TypeScript setup, decorators, class definitions, property declarations
- Component System: references/component-system.md - Lifecycle methods, component management, execution order
- Node & Hierarchy: references/node-hierarchy.md - Node creation, traversal, transformations, coordinate systems
- Scene Management: references/scene-management.md - Scene loading, persist nodes, preloading
- Resource Management: references/resource-management.md - Asset loading, releasing, Asset Bundles, memory management
- Event System: references/event-system.md - Input handling, custom events, node events
Development Guidelines
Version Check
Always confirm the user is working with Cocos Creator 3.x, not 2.x. APIs and workflows differ significantly.
Code Style
- Use TypeScript exclusively (JavaScript not supported in 3.x)
- Follow decorator pattern:
@ccclass,@property - Use type annotations for all properties
- Prefer
this.nodefor current node access
Performance Best Practices
- Release unused resources with
assetManager.releaseAsset() - Use object pooling for frequently created/destroyed nodes
- Cache component references instead of repeated
getComponent()calls - Use
scheduleOnceinstead of timers for one-time delays
Common Pitfalls
- Lifecycle order:
onLoad→start→update. Don't access other components inonLoadif they might not be ready. - Resource leaks: Always release dynamically loaded assets
- Node activation: Check
node.activebefore accessing components - Scene switching: Use persist nodes for data that needs to survive scene changes
Key APIs Reference
Node Operations
this.node- Current nodethis.node.parent- Parent nodethis.node.children- Child nodes arraythis.node.addChild(child)- Add child nodethis.node.removeFromParent()- Remove from parentthis.node.destroy()- Destroy nodethis.node.setPosition(x, y, z)- Set positionthis.node.setRotation(x, y, z)- Set rotationthis.node.setScale(x, y, z)- Set scale
Component Operations
this.node.addComponent(T)- Add componentthis.node.getComponent(T)- Get componentthis.getComponentInChildren(T)- Get component in childrenthis.getComponentsInChildren(T)- Get all components in children
Scene Operations
director.loadScene(name)- Load scenedirector.preloadScene(name)- Preload scenedirector.getScene()- Get current scenegame.addPersistRoot(node)- Add persist nodegame.removePersistRoot(node)- Remove persist node
Resource Operations
resources.load(path, type, callback)- Load resourceassetManager.loadRemote(url, type, callback)- Load remote resourceassetManager.releaseAsset(asset)- Release resourceresources.loadDir(path, type, callback)- Load directory
Event Operations
this.node.on(type, callback, target)- Register eventthis.node.off(type, callback, target)- Unregister eventthis.node.emit(type, detail)- Emit eventinput.on(type, callback, target)- Register input event
External Resources
- Official Manual: https://docs.cocos.com/creator/3.8/manual/zh/
- API Reference: https://docs.cocos.com/creator/3.8/api/zh/
- Example Projects: https://github.com/cocos/cocos-example-projects
Troubleshooting
Component Not Found
- Verify component is attached in editor
- Check node is active:
if (this.node.active) - Use
getComponentInChildren()for nested components
Scene Not Loading
- Check scene name in Build Settings
- Verify scene is added to build
- Use
preloadScene()for large scenes
Memory Leaks
- Release assets after use
- Destroy unused nodes
- Remove event listeners in
onDestroy - Use Asset Bundles for modular loading
Performance Issues
- Profile with Chrome DevTools
- Reduce draw calls with batching
- Use object pooling
- Optimize sprite atlases
- Check script execution time in updates
When to Read References
Read specific reference files when:
- script-basics.md: Creating new components, defining properties, configuring TypeScript
- component-system.md: Implementing lifecycle callbacks, managing component dependencies
- node-hierarchy.md: Creating/destroying nodes, building scene hierarchy, coordinate transformations
- scene-management.md: Loading scenes, passing data between scenes, managing game flow
- resource-management.md: Loading assets, managing memory, using Asset Bundles
- event-system.md: Handling user input, implementing custom events, component communication
Decision Guide
Multiple valid approaches? Use high freedom - provide options and let context guide choice.
Standard pattern exists? Use medium freedom - provide template code with parameters.
Error-prone operation? Use low freedom - provide specific, validated code pattern.
Decide Fit First
Design Intent
How To Use It
Boundaries And Review