Introduction

Under the plugin architecture of DSH, the preview, node inspection, and code modification of Cocos projects can be integrated into a single session. Common issues for DSH/Agent developers extend beyond “letting the agent modify code”; they also require simultaneously viewing runtime results, pinpointing specific nodes, and passing the node selection as precise context to the agent. Modifying only the browser runtime makes it difficult to apply changes to project files, leaving a gap in the foundation for subsequent review and development.

The kurenai-studio/kurenai introduced below is a DSH-native plugin designed for this scenario: it provides a Headless Cocos real-time preview alongside the DSH session, checks the runtime scene tree, passes the node selection as precise agent context upon clicking, and directly edits Cocos project source files on disk.

What is this

kurenai-studio/kurenai is a DSH-native Cocos vibe coding studio, positioned as a plugin featuring headless preview and runtime inspection. The repository is maintained by kurenai-studio, and the Kurenai source code is licensed under the MIT License.

The current status is a working MVP. Kurenai directly uses the workspace directory of each DSH session as the root directory of the Cocos project. It integrates the DSH session, Headless Cocos preview, runtime inspector, and project source file editing into a single workflow.

Core Features

Kurenai’s core capabilities revolve around “Preview, Inspect, Edit, Refresh”:

  1. Provides Headless Cocos real-time preview alongside the DSH session.
  2. Inspects the runtime scene tree; upon clicking a node, passes the node selection as precise agent context.
  3. Directly edits Cocos project source files on disk, rather than only modifying the browser runtime.
  4. Refreshes the iframe via HMR after Headless Cocos compilation.
  5. Detects Cocos projects from the current DSH Workspace (based on package.json) and starts the preview.
  6. Supports selecting base-ai (2D) or base-ai-3d templates from a local headless-cocos checkout.
  7. Provides the following DSH tools:
kurenai_project_initialize
kurenai_project_current
kurenai_preview_start
kurenai_preview_status
kurenai_preview_stop
kurenai_publish
  1. Supports headless static publishing (currently a platform=web MVP, extensible).

Installation and Enablement

The following is the path for installation via development build. First, perform dependency installation and checks:

npm install
npm run check

Then, install it to the specified DSH profile. Replace <profile> and <absolute-path-to-this-repo> in the command below with actual values:

dsh plugin --profile <profile> add <absolute-path-to-this-repo>

After installation, configure the generated Cordis entry. The id, name, port, and controlPort here are the provided configuration items:

- id: kurenai
  name: "@kurenai-studio/dsh-plugin-kurenai"
  config:
    port: 7460
    controlPort: 7459

Kurenai requires an external Headless Cocos stack. Point to a local headless-cocos checkout or runtime kit via KURENAI_HEADLESS_ROOT:

KURENAI_HEADLESS_ROOT

The project path is always read from the current DSH session cwd. The historical preview research tree shinjiyu/headless-cocos has been migrated or is read-only; do not treat it as the main production repository.

Typical Usage

New Project

Create or open an empty DSH Workspace, then select a template from the local headless-cocos checkout:

base-ai
base-ai-3d

Here, base-ai is the 2D template and base-ai-3d is the 3D template.

Existing Project

Open an existing Cocos project directory as a DSH Workspace. Kurenai will detect the Cocos project based on package.json and start the preview.

Continue Working

Re-open an existing DSH Workspace/session. DSH maintains the project path, recent workspace, and session as the source of truth.

Invoke DSH tools

These tools can be used within a DSH session:

kurenai_project_initialize
kurenai_project_current
kurenai_preview_start
kurenai_preview_status
kurenai_preview_stop
kurenai_publish

No Creator Publish

kurenai_publish corresponds to headless static publishing, currently supporting a platform=web MVP. When Cocos Creator is not available, you can use the CLI included in the local Headless Cocos stack:

node $env:KURENAI_HEADLESS_ROOT\spike\publish\cli.mjs --project=<cocos-project> --platform=web

Scenarios and Notes

Suitable for developers performing Cocos client development in DSH who want to keep “viewing nodes, selecting nodes, letting the agent modify code, and refreshing the preview” within the same workflow.

Special attention is required before use:

  • The plugin runs with the permissions of the current dsh process. You should check the source code, dependencies, and license before installing.
  • Currently a working MVP; Kurenai directly uses the workspace directory of each DSH session as the root directory of the Cocos project.
  • DSH does not expose the native center-split slot; Kurenai mounts via the additive shell.overlay slot and temporarily preserves the right-side frame padding when opened.
  • Node selection allows copying structured context blocks; direct insertion into the current DSH composer still requires a supported conversation API adapter.
  • Initial canvas picking is limited to 2D UITransform bounds; camera-aware 3D raycasting and complex multi-camera scenes are not yet implemented.
  • Runtime suites and Cocos engine binaries are not distributed with the repository. You must follow the instructions of the Headless Cocos runtime-kit and Cocos license requirements.
  • The Kurenai source code is MIT; Cocos Creator engine snapshots, packer binaries, and other vendor assets retain their respective licenses.
  • The plugin has version requirements for its peerDependencies, including @deepseek-ai/cordis ^4.0.1, version ranges for DSH client runtime/UI slots, and react >=18. Refer to the repository’s package.json for specific ranges.

Conclusion

Kurenai’s value lies in connecting the DSH session, Headless Cocos preview, runtime inspector, and disk source editing, making it suitable for development scenarios that require converting Cocos node selection into agent context and then having the agent modify project files.

GitHub:

https://github.com/kurenai-studio/kurenai

Directory page clues:

https://www.skillhub.cn/plugins/kurenai-studio/kurenai

The community directory is an independent site with no official affiliation to DeepSeek/Huafang; it should not be considered an official app store.