Index of every page on this site: llms.txt
All skills
oahc09 avatar

/cocosair-project-setup

@ed38648
by oahc09oahc09/cocosairjs3 stars
2
Run it yourself

Set up npm imports, package entries, importmap, TypeScript and variant builds. Use for cocosair.js installation, unresolved-import errors, page shells or build artifacts.

  • 9 files
  • 27.7 KB
  • MIT
  • Updated last month
  • GitHub
Use this Skill: https://skilld.dev/gh/oahc09/cocosairjs/cocosair-project-setup

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesquick-start.md

≈522 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Derived from the cocosair-project-setup skill and its canonical docs/source pointers; reorganized on 2026-10-11. Source annotations below identify repository inputs, not files guaranteed to ship to npm consumers.

Environment: the HTML examples using /build/ require the AIR development server and an existing bundle. In npm applications use the installed package name and the application's own bundler/server; resolve docs and declarations from that package. Do not copy repository URLs into a consumer app. Browser behavior is verified only for explicitly tested snippets and candidates.

Quick Start

From source (runnable today, and the only currently executable path - the package is not on the npm registry yet; the pattern the repo itself uses):

npm install
npm run build      # -> build/cocosair.module.js + .map (package.json scripts build)
npm run dev        # serves http://127.0.0.1:7454/ with /build/* mounted
<canvas id="GameCanvas"></canvas>
<script type="importmap">
  { "imports": { "cocosair": "/build/cocosair.module.js" } }
</script>
<script type="module">
  import { createAirApp, Scene } from 'cocosair'; // alias name is the app's choice
  const app = await createAirApp({ canvas: '#GameCanvas' });
  app.run(new Scene('Main'));
</script>

The canvas must already be in the DOM when the main entry is evaluated - the screen adapter initializes at import time.

From npm (bundler app - Vite/Rollup/esbuild). Conditional: applies once the release package is available; docs/manual/installation.md:19 states this precondition and public release is still gated by license/acceptance (docs/manual/installation.md:23, docs/reference/verification.md:39). Do not expect npm install cocosair.js to resolve today (registry returns E404 as of 2026-10-07).

npm install cocosair.js@1.0.0
// Named exports only - the package has no default export (docs/manual/installation.md).
import { createAirApp, Scene } from 'cocosair.js';

const app = await createAirApp({ canvas: '#GameCanvas' });
app.run(new Scene('Main'));

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at ed38648. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated last month
layer
subsystem
All 1 allowed tools
Read Edit Write Bash
Other metadata
compatibility
Cocos AIR source checkout or installed cocosair.js package. Browser rendering requires WebGL 2; source tooling requires Node.js >=18. Use the host-provided tools and user-authorized workspace.
when_to_use
[
  "install or import cocosair.js",
  "imports resolve to the wrong entry",
  "TypeScript editor declarations fail",
  "wire a page importmap and canvas",
  "which build command produces this artifact"
]
owns
[
  "package-entries",
  "importmap",
  "typescript",
  "html-shell",
  "feature-flags",
  "build-artifacts"
]
not_for
[
  "createAirApp startup failures -> cocosair-application",
  "live HTML textures or overlays -> cocosair-graphics-and-dom",
  "proving build artifacts -> cocosair-verification"
]
metadata
{
  "author": "oahc09@gmail.com",
  "version": "1.0.0",
  "last-updated": "2026-10-13",
  "description_zh": "安装和配置 Cocos AIR 项目,选择包入口、importmap、TypeScript 声明和变体构建。用于安装导入、页面骨架、类型解析或构建产物问题。"
}

README badge

README badge for oahc09/cocosairjs/cocosair-project-setup