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.

referencescontracts.md

≈532 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.

Contracts

  • Package name is cocosair.js (root package.json name), version 1.0.0; toolchain requires Node >=18.0.0; browsers require WebGL 2 - failure rejects createAirApp() with WEBGL2_REQUIRED.
  • Runtime is ESM only: no UMD/CJS build, no default export. The repo root package.json is type: commonjs for the toolchain; runtime files under build/ are ESM because build/package.json says type: module.
  • The sole package export is .: the full default browser engine, AIR startup and HTML texture helpers.
  • Main may be imported before canvas creation. Pass canvas and pixelRatioCap through createAirApp; repeated equivalent options share one admission/initPromise. For lazy loading, dynamically import the main entry in the application.
  • Existing GameDiv/Cocos3dGameContainer must belong to the selected canvas; startup fills missing wrappers and binds input once. Custom canvas IDs are retained. Main remains browser-only; there are no independent light package entries.
  • Top-level await requires <script type="module">.
  • Version literals differ: AIR_VERSION is "1.0.0" (SDK), VERSION is "4.0.0" (engine baseline). Do not mix them.
  • The default candidate is built from 26 feature units declared in src/cc.config.json. Feature-set membership is not reachability: custom-pipeline-post-process is in the default list yet post-process sits at decision-packet row 6 (D11/LV12-17, docs/reference/owner-decisions.md:42), approved as recommendation (b) in the r46 approval record (docs/reference/owner-decisions.md:108-121): variant-build-level evidence only. State layers separately: source export / default-bundle reachable / browser-verified.
  • Never hand-edit build/ - regenerate: build -> build:min -> build:dts, or build:all. npm run prepack (run by npm pack) copies source-map-free runtime files to build/npm/, which is what exports targets.

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