Cocos2d Patterns
Use when the user asks about Cocos2d-x internals: the Director loop, scene graph, render queue and auto-batching, event dispatcher, or Ref/retain/release and autorelease pools. Explains engine internals to write fast C++ game code. Not for Cocos Creator gameplay scripting (use cocos2d).
Install
npx skills add j4flmao/agent-skills --skill cocos2d-patternsgit clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/game/game-development/cocos2d-patterns ~/.claude/skills/cocos2d-patternsPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# Cocos2d-x Architectural Patterns
## Purpose
Cocos2d-x has a mature scene-graph architecture centered on the `Director` and `Node` tree. Understanding its internals lets you design for performance: batched rendering, minimal state changes, and memory discipline on mobile.
## Agent Protocol
### Trigger
"cocos2d-x internals", "cocos director", "cocos scene graph", "cocos render queue", "cocos memory management".
### Input Context
- Cocos2d-x version and language (C++, Lua, JS bindings)
- Platform targets
- Observed performance or memory problem
### Output Artifact
Architecture guidance and C++ code. No file unless requested.
### Response Format
```
Area: {director | scene graph | renderer | events | memory}
Finding: {cause}
Fix: {code}
Verify: {draw-call / memory measurement}
```
## 1. The Director Lifecycle
Status note: Cocos2d-x's last major release is 4.0 (2019) and it is no longer actively developed; Cocos Creator 3.x (whose native runtime evolved from Cocos2d-x) is the maintained product. Use this skill for existing Cocos2d-x codebases.
The `Director` singleton drives the game.
```
Director::mainLoop()
-> calculateDeltaTime()
-> update() // scheduled updates + physics step (if enabled)
-> drawScene() // render current scene
```
- `Director::runWithScene()` sets the initial scene.
- `Director::replaceScene()` swaps current scene (with optional transition).
- `Director::pushScene()/popScene()` for pause menus layered over gameplay.Details
- Skill name
cocos2d-patterns- Repository
- j4flmao/agent-skills
- Path
skills/game/game-development/cocos2d-patterns/SKILL.md- License
- MIT
- Repo updated
- 17 November 2026
FAQ
What does the Cocos2d Patterns skill do?
Use when the user asks about Cocos2d-x internals: the Director loop, scene graph, render queue and auto-batching, event dispatcher, or Ref/retain/release and autorelease pools. Explains engine internals to write fast C++ game code. Not for Cocos Creator gameplay scripting (use cocos2d).
How do I install the Cocos2d Patterns skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill cocos2d-patterns. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Cocos2d Patterns popular?
It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.
Related skills
Agent Observability
45j4flmao/agent-skills
Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).
AI Agent Architectures
45j4flmao/agent-skills
Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).
AI Agent Core Loop
45j4flmao/agent-skills
Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).
Cuda Programming
45j4flmao/agent-skills
Use when the user asks about a CUDA kernel, nvcc, shared memory tiling, coalesced access, warp divergence, occupancy, CUDA streams or __syncthreads. Produces CUDA C++ kernels with launch config, error checking and an Nsight Compute profiling plan. Not for Triton kernels (use triton-kernels) or PTX/SASS reading (use ptx-assembly).
Cocos2d
45j4flmao/agent-skills
Use when the user asks about Cocos Creator 3.x, Cocos2d-x, a Cocos game, node and component scripting in TypeScript, Cocos builds for web or mobile, or Cocos performance. Produces Cocos project structure, gameplay code and build settings. Not for Cocos2d-x engine internals (use cocos2d-patterns) or other engines (use unity or godot).
Data Data API
45j4flmao/agent-skills
Use when the user asks about an instant API over a database: Hasura GraphQL, PostgREST, WunderGraph, a data gateway, real-time subscriptions or row-level authorization for data APIs. Produces API layer config with JWT/RBAC permissions, caching and rate limits. Not for hand-written REST/GraphQL services (use backend-api-design) or federation (use api-graphql-federation).
Browse the most popular Claude skills, all software development skills, or write your own with the skills generator.