R019: .key重复

Official

Detect duplicate .key values within XTS projects

Authoropenharmonyinsight
Version1.0.0
Installs0

System Documentation

What problem does it solve?

It prevents UI state and component identity issues by ensuring that .key() string literals are unique across all source files inside the same independent XTS project.

Core Features & Use Cases

  • Detect duplicate .key('...') string literals across recursively collected .ets, .ts, and .js files within each independent XTS project.
  • Group duplicates and report once per duplicate group, using the first occurrence location while listing other locations in the suggestion.
  • Avoid false positives by ignoring non-string .key(...) arguments and empty-string keys, and by not comparing keys across different independent projects.

Example use case: You maintain an ArkTS/XTS UI test suite where multiple pages accidentally reuse the same .key('customPropertyValue') across different test files; this Skill identifies every duplicated key within the project so you can rename them to stable unique identifiers.

Quick Start

Use this skill to scan an independent XTS project directory for duplicated .key('...') values and return a single consolidated issue per duplicated key group.

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: R019: .key重复
Download link: https://github.com/openharmonyinsight/openharmony-skills/archive/main.zip#r019-key

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.