ark-layer

Official

Build compliant ArkTS apps with Service lifecycle guardrails.

Authoropenharmonyinsight
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps you follow a strict ArkTS architecture for OpenHarmony apps by preventing broken layering, incorrect Service lifecycle usage, and invalid ArkTS syntax that can lead to unstable behavior and hard-to-debug integration issues.

Core Features & Use Cases

  • Architecture规范校验: Check that Services inherit the required base class, declare dependencies via the constructor, and respect the infra/domain/pages separation rules.
  • Service生命周期指导与落地: Enforce init/load/unload responsibilities (e.g., no network I/O in init) to ensure predictable startup and login/logout flows.
  • 多阶段加载(Phase)编排: Map services to GLOBAL/BUSINESS/FEATURE/LAZY phases to control ordering and parallelism, including cross-phase dependency handling.
  • ArkTS语法限制修复建议: Detect prohibited syntax patterns (e.g., object/array spread, destructuring, throw) and propose compatible alternatives.
  • 模板与快速开始: Generate Service scaffolds and provide a minimal runnable example for wiring pages via ServiceManager.

Quick Start

Tell me how to create a UserProfileService that follows the ark-layer three-layer rule, declares its StorageService dependency through the constructor, assigns the correct Phase for login-time loading, and ensures ArkTS syntax stays within the allowed subset.

Dependency Matrix

Required Modules

None required

Components

references

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: ark-layer
Download link: https://github.com/openharmonyinsight/openharmony-skills/archive/main.zip#ark-layer

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.