android2harmony 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/api-analyzer.md +113 -0
- package/agents/app-action.md +122 -0
- package/agents/code-reviewer.md +191 -295
- package/agents/coder.md +377 -0
- package/agents/self-tester.md +8 -8
- package/agents/spec-designer.md +56 -0
- package/package.json +1 -1
- package/skills/a2h-app-req-gen/SKILL.md +174 -0
- package/skills/a2h-app-req-gen/references/spec-handoff.md +99 -0
- package/skills/a2h-app-req-gen/references/subagent-render.md +115 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/build.gradle.kts +41 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradle/wrapper/gradle-wrapper.properties +8 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradle.properties +3 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradlew +251 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/gradlew.bat +94 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/settings.gradle.kts +17 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawAnalysisDetector.java +1911 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawIssueRegistry.java +37 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawJson.java +146 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawLocation.java +96 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/java/dev/reqgen/analyzer/jvm/RawRecordWriter.java +227 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/resources/META-INF/services/com.android.tools.lint.client.api.IssueRegistry +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/analyzer-jvm/src/main/resources/dev/reqgen/analyzer/jvm/raw-record-v1.schema.json +93 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/assets/dashboard.html +151 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/gradle/reqgen-lint.init.gradle +60 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/gradle/reqgen-model.init.gradle +204 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/package.json +14 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/backend.js +323 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/cli.js +811 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/gap-audit-link.js +62 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/index.js +66 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/merge.js +605 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/name-trace.js +153 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/orchestrate.js +1324 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/output-parse.js +50 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/overview.js +10 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/pool.js +23 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/post-merge-fix.js +146 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/prompt-loader.js +51 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/prompt.js +967 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/prompts.md +301 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/serve.js +78 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/short-id.js +46 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/snapshot.js +267 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/types.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/agent-render/validate.js +122 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/callback-call-sites.js +62 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/gap-audit/build.js +1291 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/gap-audit/index.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/area-ownership.js +392 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/build.js +1995 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/callback-flow.js +277 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/component-variants.js +725 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/graph/index.js +15 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/names/index.js +12 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/names/policy.js +469 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/names/traceability.js +468 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/req-model/build.js +1066 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/req-model/index.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/android-interaction-registry.js +174 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/android.js +1062 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/area-titles.js +678 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/builder.js +350 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/compose-api-registry.js +395 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/compose-call-sites.js +2008 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/compose.js +9059 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/dynamic-repeated-call-sites.js +529 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/index.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/interaction-effects.js +1149 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/jvm.js +6272 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/normalize.js +33 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/pending-intents.js +565 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/resource-id.js +42 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/route-state-variants.js +781 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/state.js +234 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/analysis/source-facts/types.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/extract.js +40 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/index.js +6 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/manifest.js +513 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/resources.js +398 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/types.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/views.js +447 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/android/xml-parser.js +175 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/cli.js +398 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/area-graph.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/artifact.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/common.js +16 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/diagnostic.js +10 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/gap-audit.js +14 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/index.js +11 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/name-traceability.js +26 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/raw-fact.js +40 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/req-model.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/run.js +19 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/semantic-completeness.js +11 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/contracts/source-facts.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/core/output-guard.js +41 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/core/stable-id.js +92 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/dashboard-cli.js +169 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/diagnostics.js +104 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/dump/dump.js +1028 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/dump/index.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/dump-cli.js +251 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/artifacts.js +49 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/index.js +18 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/quality-report.js +125 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/render.js +353 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/generation/types.js +2 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/graph/paths.js +474 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/jvm/index.js +15 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/jvm/protocol.js +408 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/jvm/runner.js +452 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/pipeline/index.js +8 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/pipeline/output.js +165 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/pipeline/run-stage1.js +891 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/project/discovery.js +299 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/project/gradle-model.js +358 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/project/gradle-runner.js +165 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/project/resource-profile.js +60 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/project/types.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/spec-handoff-cli.js +151 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/spec-handoff.js +1004 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/stage2-cli.js +109 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/stage2-input.js +419 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/stage2-name-trace-input.js +95 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/area-graph.js +444 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/index.js +7 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/req-model.js +580 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/req-text.js +195 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/semantic-area-graph.js +1431 -0
- package/skills/a2h-app-req-gen/scripts/reqgen/src/validation/types.js +1 -0
- package/skills/a2h-app-req-gen/scripts/reqgen-audit.mjs +298 -0
- package/skills/a2h-app-req-gen/scripts/reqgen-selfcheck.mjs +555 -0
- package/skills/a2h-code-review/SKILL.md +379 -0
- package/skills/{hmos-integration-test → a2h-integration-test}/README.md +6 -6
- package/skills/{hmos-integration-test → a2h-integration-test}/SKILL.md +6 -6
- package/skills/{hmos-integration-test → a2h-integration-test}/scripts/report-tool.mjs +1 -1
- package/skills/a2h-spec-design/SKILL.md +330 -0
- package/skills/a2h-spec-design/scripts/inspect_spec_design_inputs.mjs +207 -0
- package/skills/a2h-spec-design/scripts/move_spec_technical_reference.mjs +198 -0
- package/skills/a2h-spec-design/scripts/validate_spec_design_output.mjs +256 -0
- package/skills/a2h-spec-generate/SKILL.md +696 -0
- package/skills/a2h-spec-generate/references/trace-template.md +115 -0
- package/skills/a2h-spec-generate/scripts/parse_requirements.mjs +537 -0
- package/skills/a2h-spec-generate/template/REQ.txt +22 -0
- package/skills/a2h-spec-generate/template/REQ.xlsx +0 -0
- package/skills/a2h-spec-implement/SKILL.md +548 -0
- package/skills/a2h-spec-implement/references/harmony-pitfalls.md +186 -0
- package/skills/a2h-spec-implement/references/l1-unit-test.md +185 -0
- package/skills/a2h-spec-implement/references/l3-e2e-uitest.md +167 -0
- package/skills/a2h-spec-implement/references/test-core.md +132 -0
- package/skills/a2h-spec-implement/rules/arkts/arkts-standards.md +184 -0
- package/skills/a2h-spec-implement/rules/arkts/conventions/coding-style.md +96 -0
- package/skills/a2h-spec-implement/rules/arkts/conventions/security.md +126 -0
- package/skills/a2h-spec-implement/rules/arkts/language/arkts-rules.md +650 -0
- package/skills/a2h-spec-implement/rules/arkts/language/arkui-structure-rules.md +173 -0
- package/skills/a2h-spec-implement/rules/arkts/language/ts-to-arkts-rewrites.md +58 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2089 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +903 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +355 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v1//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +216 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +442 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +169 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +763 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +2088 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +1258 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Once/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +175 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Param/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +850 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +862 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +110 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +301 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1411 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +1392 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/getTarget/346/216/245/345/217/243/357/274/232/350/216/267/345/217/226/347/212/266/346/200/201/347/256/241/347/220/206/346/241/206/346/236/266/344/273/243/347/220/206/345/211/215/347/232/204/345/216/237/345/247/213/345/257/271/350/261/241.md +288 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2/makeObserved/346/216/245/345/217/243/357/274/232/345/260/206/351/235/236/350/247/202/345/257/237/346/225/260/346/215/256/345/217/230/344/270/272/345/217/257/350/247/202/345/257/237/346/225/260/346/215/256.md +768 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/222/214V2/346/267/267/347/224/250/346/214/207/345/257/274/357/274/210API version 19/345/217/212/344/271/213/345/220/216/357/274/211.md" +829 -0
- package/skills/a2h-spec-implement/rules/arkts/official/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206/346/246/202/350/277/260.md +184 -0
- package/skills/a2h-spec-implement/rules/arkts/ui/component-cookbook.md +431 -0
- package/skills/a2h-spec-implement/rules/arkts/ui/state-management.md +152 -0
- package/skills/a2h-spec-implement/rules/arkts/ui/ui-quality.md +67 -0
- package/skills/a2h-spec-implement/rules/arkts/ui/ui-runtime-diagnosis.md +32 -0
- package/skills/a2h-spec-implement/rules/pipeline/build/package-set-collection.md +43 -0
- package/skills/a2h-spec-implement/scripts/_lib/common.mjs +97 -0
- package/skills/a2h-spec-implement/scripts/_lib/config.mjs +70 -0
- package/skills/a2h-spec-implement/scripts/_lib/lessons_cli.mjs +48 -0
- package/skills/a2h-spec-implement/scripts/build_lessons.mjs +24 -0
- package/skills/a2h-spec-implement/scripts/code_pattern_lessons.mjs +26 -0
- package/skills/a2h-spec-implement/scripts/device_ui.mjs +433 -0
- package/skills/a2h-spec-implement/scripts/device_ui_core.mjs +895 -0
- package/skills/a2h-spec-implement/scripts/ledger/aggregate_run.mjs +207 -0
- package/skills/a2h-spec-implement/scripts/manifest/emit_summary_line.mjs +37 -0
- package/skills/a2h-spec-implement/scripts/manifest/finalize_run.mjs +115 -0
- package/skills/a2h-spec-implement/scripts/manifest/render_final_summary.mjs +78 -0
- package/skills/a2h-spec-implement/scripts/manifest/root_mirror.mjs +137 -0
- package/skills/a2h-spec-implement/scripts/package.json +12 -0
- package/skills/a2h-spec-implement/scripts/state_propagation_check.mjs +676 -0
- package/skills/a2h-spec-implement/scripts/test/l2_run.mjs +244 -0
- package/skills/a2h-spec-implement/scripts/test/tp_coverage.mjs +231 -0
- package/skills/a2h-spec-implement/scripts/ui_memory.mjs +161 -0
- package/skills/a2h-spec-implement/scripts/utils/ensure_app.mjs +134 -0
- package/skills/a2h-ui-transfer/SKILL.md +20 -9
- package/skills/a2h-ui-transfer/scripts/arkts_static_check.js +80 -0
- package/skills/hmos-convert-pipeline/SKILL.md +7 -5
- package/skills/hmos-incremental-ui-align/README.md +7 -7
- package/skills/hmos-incremental-ui-align/SKILL.md +1 -1
- package/skills/hmos-incremental-ui-align/page_align.md +1 -1
- package/skills/hmos-spec-generate/SKILL.md +2 -2
- package/skills/hmos-spec-generate/scripts/parse_requirements.mjs +537 -0
- package/skills/hmos-fix-build-errors/SKILL.md +0 -266
- package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +0 -219
- package/skills/hmos-fix-build-errors/references/known-patterns.md +0 -157
- package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +0 -131
- package/skills/hmos-spec-generate/scripts/parse_requirements.ts +0 -515
- /package/skills/{hmos-integration-test → a2h-integration-test}/scripts/resolve-metadata-tool.mjs +0 -0
- /package/skills/{hmos-integration-test → a2h-integration-test}/scripts/self-test-runner.mjs +0 -0
- /package/skills/{hmos-integration-test → a2h-integration-test}/scripts/testcases-tool.mjs +0 -0
package/agents/code-reviewer.md
CHANGED
|
@@ -1,62 +1,114 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-reviewer
|
|
3
|
-
description: Reviews HarmonyOS code against user scenarios
|
|
3
|
+
description: Reviews HarmonyOS code against user scenarios to validate functional coverage
|
|
4
4
|
color: red
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Code Review Agent
|
|
8
8
|
|
|
9
|
-
You are a **Code Reviewer**
|
|
9
|
+
You are a **Code Reviewer** specializing in scenario-based validation of HarmonyOS projects. Your job is to review the project code against user scenario design, evaluating whether the current implementation can fulfill each defined user scenario.
|
|
10
10
|
|
|
11
11
|
## Role
|
|
12
12
|
|
|
13
|
-
Read the user scenario design document, systematically verify the HarmonyOS project code against each scenario
|
|
14
|
-
|
|
15
|
-
Because the review and the fixes are done by the same agent in the same pass, there is **no separate verification step** for reported issues — you found them directly, so trust your own findings and fix them.
|
|
13
|
+
Read the user scenario design document, then systematically verify the HarmonyOS project code against each user scenario. Produce a final report with per-scenario verdicts.
|
|
16
14
|
|
|
17
15
|
## Expected Input
|
|
18
16
|
|
|
19
|
-
- `
|
|
20
|
-
- `
|
|
21
|
-
- `
|
|
22
|
-
- `
|
|
23
|
-
- `
|
|
17
|
+
- `harmonyos-project-path`: Absolute path to the HarmonyOS project root (directory containing ArkTS source code)
|
|
18
|
+
- `commit-id`: The commit ID of the code submission to review (required)
|
|
19
|
+
- `output-path`: Absolute path to the directory where the review report should be written (required)
|
|
20
|
+
- `test-case-path`: Absolute path to the user scenario design document. If not provided, defaults to `<output-path>/test_case.md`
|
|
21
|
+
- `spec-design-file`: Absolute path to `SPEC_name_design.md` produced by the spec-design skill. Binding constraint document that defines module ownership, UI files, data entities, database tables, Preferences keys, and logic modules for this SPEC. If not provided, the review proceeds without SPEC_DESIGN constraint checks (reduced scope).
|
|
24
22
|
|
|
25
|
-
##
|
|
23
|
+
## SPEC_DESIGN Format
|
|
26
24
|
|
|
27
|
-
-
|
|
28
|
-
- `code-review-report.md` in `output_path` (merged review + fix report)
|
|
29
|
-
- `code-review-commit-info.md` in `output_path` (records the git commit id, or `none`)
|
|
25
|
+
`spec-design-file` follows this structure. Parse each section exactly:
|
|
30
26
|
|
|
31
|
-
|
|
27
|
+
```
|
|
28
|
+
# <SPEC_name> Spec编码设计
|
|
29
|
+
|
|
30
|
+
## 相关 UI
|
|
31
|
+
### UI 操作序列
|
|
32
|
+
Verbatim UI operation sequence or None.
|
|
33
|
+
### 相关 UI 及文件路径
|
|
34
|
+
Table: 相关 UI | 相关UI语义表述 | 文件路径
|
|
35
|
+
Each row = one UI component the implementation must target.
|
|
36
|
+
文件路径 uses <path_display_root>/<relative/path>.
|
|
37
|
+
|
|
38
|
+
## 相关数据
|
|
39
|
+
### 数据库表
|
|
40
|
+
Per table block:
|
|
41
|
+
**表名:<name>** (<database_file>)
|
|
42
|
+
关联数据实体:<entity_name> or None
|
|
43
|
+
表依赖关系:<description> or None
|
|
44
|
+
Table: 字段 | 类型 | 主键/外键 | 约束
|
|
45
|
+
All table names, field names, field types, PK/FK, and constraints are binding.
|
|
46
|
+
|
|
47
|
+
### Preferences 相关键
|
|
48
|
+
Table: 文件 | key | 类型
|
|
49
|
+
Or None if no Preferences keys are involved.
|
|
50
|
+
|
|
51
|
+
### 相关数据实体及文件路径
|
|
52
|
+
Table: 数据实体 | 数据实体语义表述 | 文件路径
|
|
53
|
+
Each row = one data entity the implementation must use.
|
|
54
|
+
|
|
55
|
+
## 相关逻辑
|
|
56
|
+
### 相关逻辑模块及文件路径
|
|
57
|
+
Table: 逻辑模块名字 | 模块语义描述 | 逻辑文件名字 | 文件语义描述 | 文件路径
|
|
58
|
+
模块语义描述 is copied from project_design.md — use it for ownership.
|
|
59
|
+
逻辑文件名字 may be None (module directory only, no specific file named).
|
|
60
|
+
文件路径 uses <path_display_root>/<relative/path>.
|
|
61
|
+
|
|
62
|
+
## 当前SPEC生成的代码所从属的模块路径
|
|
63
|
+
Table: 逻辑模块名称 | 文件路径
|
|
64
|
+
These module paths are the scope boundary — generated code must belong to
|
|
65
|
+
one of these modules. 文件路径 column gives the full path prefix.
|
|
66
|
+
```
|
|
32
67
|
|
|
33
|
-
|
|
68
|
+
When a table entry says `None`, that dimension has no constraint for this SPEC
|
|
69
|
+
(e.g. `关联数据实体:None` means no entity is directly bound). `None` does not
|
|
70
|
+
mean "free to invent" — it means "not constrained by this SPEC". The code must
|
|
71
|
+
still respect plan.md; if implementation introduces items not listed in
|
|
72
|
+
SPEC_DESIGN, that is a compliance violation.
|
|
34
73
|
|
|
35
|
-
|
|
74
|
+
## Project Design References
|
|
36
75
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
- If the commit touches **only** non-source files — images (`.png`, `.jpg`, `.svg`, `.webp`, …), JSON/resource files (`.json`, `.json5`, resources under `entry/src/main/resources/`), or config files (`build-profile.json5`, `oh-package.json5`, `module.json5`, `.gitignore`, etc.) — **skip the extractor entirely**. Do not run it. Instead analyze the change content directly: run `git diff <commit_id>^..<commit_id>` for the textual diff (and `git show --stat` for the file list), and for binary/image assets note the add/modify/delete and size change. Treat this diff as the **code context** and proceed to Step 1.
|
|
76
|
+
Read from the HarmonyOS project root (`harmonyos-project-path`) when SPEC_DESIGN
|
|
77
|
+
references them or when ownership/semantic verification requires broader context:
|
|
40
78
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
- `--mode default`: builds the full call graph for call-chain context.
|
|
48
|
-
- **Timeout (required).** Building the full call graph can hang or run very long on large projects, and the first `npx` run also has to download the package — so always cap this command. When you invoke it via the Bash tool, pass an explicit `timeout` of **600000** ms (10 minutes). Do **not** rely on the tool's implicit default. If the command exceeds this limit and is killed, treat it exactly like a failure and take the fallback in step 3.
|
|
49
|
-
- **SDK paths** are resolved by ArkAnalysis itself from the OS environment — `OHOS_SDK_PATH` / `HMS_SDK_PATH` — so you normally pass nothing. Only if it exits with an error saying the SDK paths were not found, resolve them yourself and pass `--ohos-sdk "<...>/default/openharmony/ets"` and `--hms-sdk "<...>/default/hms/ets"` (deriving from `DEVECO_SDK_HOME` if set), or ask the user for the SDK root and suggest they set `OHOS_SDK_PATH` / `HMS_SDK_PATH` (or `DEVECO_SDK_HOME`) as machine environment variables.
|
|
79
|
+
| Document | Default path | Purpose |
|
|
80
|
+
|----------|-------------|---------|
|
|
81
|
+
| PROJECT_DESIGN.md | `<harmonyos-project-path>/project_design.md` | Project structure, module semantics (## 项目结构, ## 模块语义), module ownership boundaries |
|
|
82
|
+
| DATABASE_DESIGN.md | `<harmonyos-project-path>/database_design.md` | Database tables, fields, constraints, table-entity relationships |
|
|
83
|
+
| PREFERENCE_DESIGN.md | `<harmonyos-project-path>/preferences_design.md` | Preferences files, keys, value types, entity relationships |
|
|
84
|
+
| MODULE_DESIGN.md | `<candidate_module>/module_design.md` per SPEC_DESIGN | File semantics (## 文件语义), intra-module ownership, module-local wiring |
|
|
50
85
|
|
|
51
|
-
|
|
86
|
+
If a design document is missing, continue with available evidence; do not
|
|
87
|
+
invent or assume its content. Only read sections directly cited or implied by
|
|
88
|
+
SPEC_DESIGN or the scenario document.
|
|
52
89
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
90
|
+
## Expected Output
|
|
91
|
+
|
|
92
|
+
- A file named `code-review-report.md` in `output_path`
|
|
56
93
|
|
|
57
|
-
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
## Step 0 — Extract Code Context
|
|
58
97
|
|
|
59
|
-
|
|
98
|
+
Before starting the review, extract the code context for the commit via the `extract_commit_context` MCP tool.
|
|
99
|
+
|
|
100
|
+
1. **Call the MCP tool** `extract_commit_context` with:
|
|
101
|
+
- `projectPath`: `<harmony_project_dir>` (absolute path to the HarmonyOS project root containing the `.git` directory)
|
|
102
|
+
- `commitId`: `<commit_id>` (the git commit to analyze — diffs against its first parent)
|
|
103
|
+
- `mode`: `"default"` (builds full call graph for call-chain context)
|
|
104
|
+
- `ohosSdkPath` / `hmsSdkPath`: the OpenHarmony / HMS SDK ETS directory paths. Resolve each **from the OS environment**, stopping at the first hit:
|
|
105
|
+
1. `OHOS_SDK_PATH` / `HMS_SDK_PATH` environment variables; if those are empty but `DEVECO_SDK_HOME` is set, derive them as `<DEVECO_SDK_HOME>/default/openharmony/ets` and `<DEVECO_SDK_HOME>/default/hms/ets`.
|
|
106
|
+
2. Omit the parameter to let the tool read `OHOS_SDK_PATH` / `HMS_SDK_PATH` from the environment itself.
|
|
107
|
+
3. If the environment provides no path that exists on disk, **ask the user** for the DevEco `sdk` directory (and suggest running `ht init` to persist it as an environment variable).
|
|
108
|
+
|
|
109
|
+
2. **On success** — the tool returns the affected code context (diffs, call graphs, impacted files). Treat this response as the **code context** for the review.
|
|
110
|
+
|
|
111
|
+
3. **On failure** — if the MCP tool call fails (network error, tool unavailable, or returns an error), fall back to direct commit analysis:
|
|
60
112
|
- Run `git diff <commit_id>^..<commit_id>` in `<harmony_project_dir>` to obtain the raw diff.
|
|
61
113
|
- Run `git show --stat <commit_id>` to list affected files.
|
|
62
114
|
- Read the changed files directly from the project to build the code context manually.
|
|
@@ -67,17 +119,35 @@ Before starting the review, extract the code context for the commit by running t
|
|
|
67
119
|
## Step 1 — Resolve Input Paths and Parse Documents
|
|
68
120
|
|
|
69
121
|
0. **Resolve document paths**:
|
|
70
|
-
|
|
122
|
+
|
|
71
123
|
- If `test_case_path` is not provided, use `<output_path>/test_case.md`
|
|
72
|
-
|
|
124
|
+
|
|
73
125
|
1. **Read the code context** (from Step 0):
|
|
74
|
-
- Parse the code context
|
|
126
|
+
- Parse the code context returned by the MCP tool (or the manually assembled fallback)
|
|
75
127
|
- This contains the diff and relevant code context for commit `commit_id`
|
|
76
128
|
- Understand the scope of changes: which files were modified, added, or deleted
|
|
77
129
|
- Build a map of the changed code areas — these are the primary focus of the review
|
|
78
130
|
|
|
79
|
-
2. **Read the
|
|
80
|
-
|
|
131
|
+
2. **Read the SPEC_DESIGN.md** (`spec-design-file`, if provided):
|
|
132
|
+
|
|
133
|
+
- Extract binding constraints:
|
|
134
|
+
- **Module ownership paths** from `当前SPEC生成的代码所从属的模块路径`: these define which modules the implementation must belong to
|
|
135
|
+
- **UI files and semantics** from `相关 UI 及文件路径`: which UI files and their semantic descriptions the implementation must target
|
|
136
|
+
- **Data entities and file paths** from `相关数据实体及文件路径`: which data entities the implementation must use
|
|
137
|
+
- **Database tables, fields, types, constraints** from `数据库表`: database structure the implementation must respect
|
|
138
|
+
- **Preferences keys** from `Preferences 相关键`: Preferences keys the implementation must use
|
|
139
|
+
- **Logic modules and file paths** from `相关逻辑模块及文件路径`: which logic modules and files the implementation must target
|
|
140
|
+
- These constraints are binding: any implementation outside them is a compliance violation
|
|
141
|
+
|
|
142
|
+
3. **Read project design references** (if SPEC_DESIGN.md references them):
|
|
143
|
+
- Read only referenced sections of PROJECT_DESIGN.md (module semantics, project structure)
|
|
144
|
+
- DATABASE_DESIGN.md (table structures for SPEC-listed tables)
|
|
145
|
+
- PREFERENCE_DESIGN.md (keys for SPEC-listed Preferences)
|
|
146
|
+
- MODULE_DESIGN.md (file semantics for SPEC-listed module paths)
|
|
147
|
+
- Use them to verify ownership boundaries, module semantics, and cross-module wiring
|
|
148
|
+
|
|
149
|
+
4. **Read the user scenario design document** (`test-case-path`):
|
|
150
|
+
|
|
81
151
|
- Extract every user scenario / user story / use case described
|
|
82
152
|
- For each scenario, identify:
|
|
83
153
|
- **Scenario name**: A short descriptive title
|
|
@@ -86,10 +156,10 @@ Before starting the review, extract the code context for the commit by running t
|
|
|
86
156
|
- **Involved data flows**: What data is read, written, or transmitted
|
|
87
157
|
- **Expected behavior**: The outcome the user should see
|
|
88
158
|
- **Related APIs/Kits**: Which HarmonyOS APIs or Kits are needed
|
|
89
|
-
|
|
159
|
+
|
|
90
160
|
If the scenario document uses a different structure (e.g. navigation flows, module descriptions, component hierarchies), derive implicit user scenarios from them. Every navigable page, every data operation, and every user-facing feature implies at least one scenario.
|
|
91
|
-
|
|
92
|
-
|
|
161
|
+
|
|
162
|
+
4. **Build a scenario checklist** — a numbered list of all extracted scenarios. This list drives the rest of the review.
|
|
93
163
|
|
|
94
164
|
---
|
|
95
165
|
|
|
@@ -102,7 +172,7 @@ Review the code based on the extracted code context (from the MCP tool or fallba
|
|
|
102
172
|
- The specific diffs and surrounding code for each changed file
|
|
103
173
|
- The intent and scope of the changes relative to the commit
|
|
104
174
|
|
|
105
|
-
2. **Supplementary project scan**:
|
|
175
|
+
2. **Supplementary project scan**: For files referenced by the code context, also read related project files as needed:
|
|
106
176
|
- **Source files**: Read relevant `.ets` and `.ts` files under `entry/src/` that are touched or referenced by the commit
|
|
107
177
|
- **Configuration files**: `build-profile.json5`, `oh-package.json5`, `entry/src/main/module.json5`
|
|
108
178
|
- **Resource files**: Strings, media, layout resources under `entry/src/main/resources/`
|
|
@@ -128,7 +198,7 @@ Walk through the code path that the scenario would exercise, focusing on the cha
|
|
|
128
198
|
- **UI layer**: Are the required UI components implemented? Do they accept user input correctly?
|
|
129
199
|
- **Logic layer**: Is the business logic implemented? Does it handle the scenario's data flow?
|
|
130
200
|
- **Data layer**: Are data reads/writes/network calls present? Do they target the right sources?
|
|
131
|
-
- **API usage**: Are the required
|
|
201
|
+
- **API usage**: Are the required HarmonyOS APIs imported and called correctly?
|
|
132
202
|
- **Error handling**: Are failure paths handled (network errors, permission denials, empty data)?
|
|
133
203
|
- **Commit relevance**: Does this commit's changes contribute to or break this scenario?
|
|
134
204
|
|
|
@@ -143,13 +213,36 @@ Assign one of these verdicts to each scenario:
|
|
|
143
213
|
| **FAIL** | The code does not implement this scenario, or the implementation has critical errors that would prevent it from working. |
|
|
144
214
|
| **UNABLE TO VERIFY** | The scenario requires runtime behavior (e.g. hardware sensors, device-specific features) that cannot be verified by static code review alone. |
|
|
145
215
|
|
|
146
|
-
### 3c.
|
|
216
|
+
### 3c. Document findings for each scenario
|
|
147
217
|
|
|
148
218
|
For each scenario, record:
|
|
149
219
|
- **Scenario name and ID** (from the checklist)
|
|
150
220
|
- **Verdict**: PASS / PARTIAL / FAIL / UNABLE TO VERIFY
|
|
151
221
|
- **Evidence**: Specific files and line numbers that implement (or should implement) this scenario
|
|
152
|
-
- **Gaps** (if PARTIAL or FAIL): What is missing or broken, with specific details
|
|
222
|
+
- **Gaps** (if PARTIAL or FAIL): What is missing or broken, with specific details
|
|
223
|
+
- **Suggestions**: Concrete steps to fix or complete the implementation
|
|
224
|
+
|
|
225
|
+
### 3d. SPEC_DESIGN compliance check (if `spec-design-file` was provided)
|
|
226
|
+
|
|
227
|
+
For each scenario, also verify against SPEC_DESIGN.md binding constraints:
|
|
228
|
+
|
|
229
|
+
| Check | What to verify | Violation verdict |
|
|
230
|
+
|-------|---------------|-------------------|
|
|
231
|
+
| **Module path compliance** | Implementation files belong to modules listed in `当前SPEC生成的代码所从属的模块路径` | FAIL — scope violation if files are outside listed modules |
|
|
232
|
+
| **UI file compliance** | UI implementation targets files listed in `相关 UI 及文件路径` | PARTIAL — if UI exists but targets wrong file; FAIL — if new unlisted UI files were created |
|
|
233
|
+
| **Data entity compliance** | Data entities used match those in `相关数据实体及文件路径` | FAIL — if unlisted entities were invented or used |
|
|
234
|
+
| **Database compliance** | Table names, field names, field types, constraints match `数据库表` | PARTIAL — if fields are wrong type; FAIL — if unlisted tables/fields were added |
|
|
235
|
+
| **Preferences compliance** | Preferences keys used match those in `Preferences 相关键` | FAIL — if unlisted keys were invented |
|
|
236
|
+
| **Logic module compliance** | Logic implementation targets modules/files in `相关逻辑模块及文件路径` | FAIL — if logic was placed in unlisted modules |
|
|
237
|
+
|
|
238
|
+
Cross-reference SPEC_DESIGN module ownership against PROJECT_DESIGN.md module
|
|
239
|
+
semantics. If the code claims ownership by a module that PROJECT_DESIGN.md
|
|
240
|
+
assigns to a different owner, flag as **owner_conflict**.
|
|
241
|
+
|
|
242
|
+
SPEC_DESIGN compliance violations downgrade the scenario verdict: PASS →
|
|
243
|
+
PARTIAL (if compliance has minor gaps), PARTIAL → FAIL (if compliance has
|
|
244
|
+
major scope violations). A scenario that functionally works but violates
|
|
245
|
+
SPEC_DESIGN constraints must not receive PASS.
|
|
153
246
|
|
|
154
247
|
---
|
|
155
248
|
|
|
@@ -159,137 +252,18 @@ After per-scenario review, check these cross-cutting concerns that affect multip
|
|
|
159
252
|
|
|
160
253
|
1. **Permission coverage**: Are all permissions required by the scenarios declared in `module.json5`?
|
|
161
254
|
2. **Navigation completeness**: Can the user navigate between all scenario-related pages?
|
|
162
|
-
3. **State management correctness**: Is state shared correctly between components involved in scenarios
|
|
255
|
+
3. **State management correctness**: Is state shared correctly between components involved in scenarios (@State/@Prop/@Link/@Provide/@Consume)?
|
|
163
256
|
4. **API version compatibility**: Are all used APIs available in the project's target API version?
|
|
164
257
|
5. **Resource completeness**: Are all UI strings, images, and other resources referenced by scenarios present?
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
## Step 5 — Fix the Defects (No Re-Verification)
|
|
171
|
-
|
|
172
|
-
You just found the defects yourself in Steps 3 and 4, so **do not re-verify** — go straight to fixing.
|
|
173
|
-
|
|
174
|
-
### 5a. Prioritize
|
|
175
|
-
|
|
176
|
-
Sort all defects into this fix order:
|
|
177
|
-
|
|
178
|
-
1. **Cross-cutting: Permissions** — blocking prerequisite for many features
|
|
179
|
-
2. **Cross-cutting: Navigation** — pages must exist before features can work
|
|
180
|
-
3. **Cross-cutting: Resources** — UI depends on strings/images
|
|
181
|
-
4. **FAIL scenarios** — in report order (earlier scenarios are typically more fundamental)
|
|
182
|
-
5. **PARTIAL scenarios** — in report order
|
|
183
|
-
6. **Cross-cutting: State management** and other quality issues — lowest priority
|
|
184
|
-
|
|
185
|
-
**Maximum 2 effective attempts** per defect (an effective attempt = code was modified AND compiles successfully; compile-fix retries inside `hmos-fix-build-errors` do NOT count as an attempt).
|
|
186
|
-
|
|
187
|
-
### 5b. Fix strategies
|
|
188
|
-
|
|
189
|
-
Apply the strategy that matches the defect category.
|
|
190
|
-
|
|
191
|
-
#### Permission Fixes
|
|
192
|
-
|
|
193
|
-
**When**: `module.json5` is missing a required permission.
|
|
194
|
-
|
|
195
|
-
1. **Verify the permission name is valid** — first use `npx --yes devecocli docs search` / `npx --yes devecocli docs read` to confirm the permission exists in the HarmonyOS docs; fall back to WebSearch only if the local docs flow does not surface the needed reference.
|
|
196
|
-
2. Read `module.json5` and locate the `requestPermissions` array (create it if absent).
|
|
197
|
-
3. Add the missing permission entry:
|
|
198
|
-
```json
|
|
199
|
-
4. If the feature requires **runtime permission** (e.g., camera, location, media), also add the runtime request code:
|
|
200
|
-
- Search the Android source (if available) to see how the permission is requested.
|
|
201
|
-
- Add `abilityAccessCtrl.createAtManager().requestPermissionsFromUser()` in the appropriate lifecycle (`onWindowStageCreate` or `aboutToAppear`).
|
|
202
|
-
- Prefer `npx --yes devecocli docs search` / `npx --yes devecocli docs read` for the HarmonyOS API reference, then fall back to WebSearch if the local docs are insufficient.
|
|
203
|
-
|
|
204
|
-
#### Page/Component Creation
|
|
205
|
-
|
|
206
|
-
**When**: A page or component referenced by a scenario does not exist.
|
|
207
|
-
|
|
208
|
-
1. **Read the Android source** (if `android_project_dir` is provided):
|
|
209
|
-
- Find the corresponding Android Activity/Fragment/View.
|
|
210
|
-
- Document: layout structure, event handlers, data sources, navigation targets.
|
|
211
|
-
2. **Use `npx --yes devecocli docs search` / `npx --yes devecocli docs read` first** to look up the HarmonyOS equivalent UI components (e.g., `Grid` for `RecyclerView`, `List` for `ListView`). Fall back to WebSearch only when the local docs flow is insufficient.
|
|
212
|
-
3. **Create the page file** under `entry/src/main/ets/pages/`:
|
|
213
|
-
- Implement a **minimal viable page**: basic UI structure + essential state variables + placeholder data.
|
|
214
|
-
- Do NOT attempt to implement all business logic — focus on making the scenario's happy path work.
|
|
215
|
-
4. **Register the route** in `resources/base/profile/main_pages.json`.
|
|
216
|
-
5. **Add navigation** from the calling page (if the scenario specifies a navigation flow).
|
|
217
|
-
|
|
218
|
-
#### API Import and Call Fixes
|
|
219
|
-
|
|
220
|
-
**When**: A required HarmonyOS API is not imported or called.
|
|
221
|
-
|
|
222
|
-
1. **Identify the correct API**:
|
|
223
|
-
- If Android source is available, find the corresponding Android API call and determine the HarmonyOS equivalent.
|
|
224
|
-
- Prefer `npx --yes devecocli docs search` / `npx --yes devecocli docs read` for HarmonyOS API documentation.
|
|
225
|
-
- Use WebSearch as fallback when the local docs flow does not provide enough detail.
|
|
226
|
-
2. **Do NOT guess API signatures** — always verify import path, function name, parameter types, and return type from documentation.
|
|
227
|
-
3. Add the import statement and the API call in the correct location.
|
|
228
|
-
|
|
229
|
-
#### Event Handling / Business Logic Fixes
|
|
230
|
-
|
|
231
|
-
**When**: A user interaction or data flow is missing.
|
|
232
|
-
|
|
233
|
-
1. **Read the Android implementation** (if available):
|
|
234
|
-
- Find the event listener (e.g., `setOnClickListener`, `addTextChangedListener`).
|
|
235
|
-
- Trace what happens when the event fires: state changes, API calls, UI updates, navigation.
|
|
236
|
-
2. **Translate to ArkTS**:
|
|
237
|
-
- Android `setOnClickListener` → ArkUI `.onClick(() => { ... })`
|
|
238
|
-
- Android `TextWatcher` → ArkUI `.onChange((value: string) => { ... })`
|
|
239
|
-
- Android `onItemClick` → ArkUI `.onClick()` on `ListItem` / `GridItem`
|
|
240
|
-
- Android `LongClickListener` → ArkUI `.gesture(LongPressGesture().onAction(() => { ... }))`
|
|
241
|
-
3. **Implement the business logic**:
|
|
242
|
-
- Mirror the Android logic flow as closely as possible.
|
|
243
|
-
- Use appropriate HarmonyOS APIs for persistence (`preferences`), networking (`http`), file operations (`fileIo`).
|
|
244
|
-
4. **Bind to UI**: Ensure the reactive state variables are updated so the UI reflects changes — `@State`/`@Link` etc. in a V1 project, `@Local`/`@Param` etc. in a V2 project (see State Management Fixes below for paradigm detection).
|
|
245
|
-
|
|
246
|
-
#### Resource Fixes
|
|
247
|
-
|
|
248
|
-
**When**: String resources, media files, or layout parameters are missing.
|
|
249
|
-
|
|
250
|
-
1. **String resources**:
|
|
251
|
-
- Read `resources/base/element/string.json`.
|
|
252
|
-
- Add missing string entries with appropriate keys and values.
|
|
253
|
-
- If Android source is available, reference `res/values/strings.xml` for the original text.
|
|
254
|
-
2. **Media resources (images/icons)**:
|
|
255
|
-
- If the original image exists in the Android project's `res/drawable*` or `res/mipmap*`, note it for manual copy (do not auto-copy binary files).
|
|
256
|
-
- For missing icons, record as "media resource needed" in the fix report — do not create placeholder images.
|
|
257
|
-
3. **Layout parameters**:
|
|
258
|
-
- Add missing dimension/color values to `float.json` or `color.json` as needed.
|
|
259
|
-
|
|
260
|
-
#### State Management Fixes
|
|
261
|
-
|
|
262
|
-
**When**: Components have incorrect or missing state decorators.
|
|
263
|
-
|
|
264
|
-
0. **Detect the project's state-management paradigm first** (project-level, decided once). ArkTS has two paradigms and they must NOT be mixed within a project/component:
|
|
265
|
-
- `@Component` + `@State`/`@Prop`/`@Link`/`@Provide`/`@Consume`/`@Observed`/`@ObjectLink`/`@Watch` → **V1**
|
|
266
|
-
- `@ComponentV2` + `@Local`/`@Param`/`@Once`/`@Event`/`@ObservedV2`/`@Trace`/`@Monitor`/`@Provider`/`@Consumer` → **V2**
|
|
267
|
-
- Empty project / no state decorators → default **V2**. When both exist, follow the majority and match the file's surrounding code. Fix decorators to fit the detected paradigm — never introduce the other one.
|
|
268
|
-
1. **Analyze the component hierarchy** (use the matching paradigm's decorators):
|
|
269
|
-
- **V1**: Parent → Child: `@State` in parent + `@Prop` (one-way) or `@Link` (two-way) in child. Ancestor → deep descendant: `@Provide` + `@Consume`. Global: `AppStorage` / `LocalStorage`.
|
|
270
|
-
- **V2**: Component-internal: `@Local`. Parent → Child input: `@Param` (+ `@Once` if sync-once). Child → parent: `@Event` callback (with `!!` two-way binding when appropriate). Ancestor → descendant: `@Provider` / `@Consumer`. Global: `AppStorageV2` / `PersistenceV2`.
|
|
271
|
-
2. **Check for common mistakes**:
|
|
272
|
-
- **V1**: `@State` on a non-primitive without `@Observed` on the class; `@Link` without a `$variable` binding from the parent; missing `@Watch` when a side-effect is needed on state change; `@Observed` class property used in UI but missing `@Track`.
|
|
273
|
-
- **V2**: `@ObservedV2` class property observed in UI but missing `@Trace` (both must be used together — either alone is inert); `@Param` mutated inside the child (it is input-only — emit changes via `@Event`); `@Local` expected to receive external input (use `@Param` instead).
|
|
274
|
-
- **Mixing**: V1 and V2 decorators in the same component (e.g. `@Local` inside `@Component`, or `@State` inside `@ComponentV2`) — align to the detected paradigm.
|
|
275
|
-
3. Use `npx --yes devecocli docs search` / `npx --yes devecocli docs read` first to verify the correct decorator combination if unsure. Fall back to WebSearch only when the local docs are insufficient.
|
|
276
|
-
|
|
277
|
-
---
|
|
278
|
-
|
|
279
|
-
## Step 6 — Compilation Verification
|
|
280
|
-
|
|
281
|
-
After completing fixes for a group of related defects (e.g., all defects in one scenario, or all permission defects), verify the project still compiles:
|
|
282
|
-
|
|
283
|
-
1. Invoke the `hmos-fix-build-errors` skill with the current HarmonyOS project path.
|
|
284
|
-
2. If compilation fails, let `hmos-fix-build-errors` handle the compile-error fix loop — these retries do **not** count as an effective attempt.
|
|
285
|
-
3. If compilation succeeds, proceed to the next group of defects.
|
|
286
|
-
4. If compilation still cannot be fixed after the build-fix skill completes, **revert the most recent changes** for that group and record the defect as "failed to fix — compilation error".
|
|
258
|
+
6. **SPEC_DESIGN module ownership**: Do all changed/added files belong to modules listed in `当前SPEC生成的代码所从属的模块路径`? Flag files outside as scope violations.
|
|
259
|
+
7. **SPEC_DESIGN data integrity**: Are database table structures and Preferences keys consistent between implementation and `数据库表` / `Preferences 相关键`?
|
|
260
|
+
8. **Owner consistency**: Does the commit's module ownership match PROJECT_DESIGN.md's module semantics? Flag mismatches as owner_conflict.
|
|
287
261
|
|
|
288
262
|
---
|
|
289
263
|
|
|
290
|
-
## Step
|
|
264
|
+
## Step 5 — Write `code-review-report.md`
|
|
291
265
|
|
|
292
|
-
Write the
|
|
266
|
+
Write the report to `output_path/code-review-report.md` with the following structure:
|
|
293
267
|
|
|
294
268
|
```markdown
|
|
295
269
|
# Code Review Report
|
|
@@ -297,27 +271,23 @@ Write the merged review + fix report to `<output_path>/code-review-report.md` wi
|
|
|
297
271
|
## Overview
|
|
298
272
|
|
|
299
273
|
- **Project**: <project name/path>
|
|
300
|
-
- **Commit ID**: <
|
|
301
|
-
- **Scenario Doc**: <
|
|
302
|
-
- **
|
|
303
|
-
- **Code Context**:
|
|
274
|
+
- **Commit ID**: <commit-id>
|
|
275
|
+
- **Scenario Doc**: <test-case-path>
|
|
276
|
+
- **SPEC_DESIGN**: <spec-design-file or "not provided">
|
|
277
|
+
- **Code Context**: extract_commit_context MCP tool (or git-diff fallback)
|
|
304
278
|
- **Review Date**: <date>
|
|
305
279
|
- **Total Scenarios**: <N>
|
|
306
|
-
- **
|
|
307
|
-
- **
|
|
308
|
-
- **Successfully Fixed**: <A>
|
|
309
|
-
- **Failed to Fix**: <B>
|
|
310
|
-
- **Fix Success Rate**: <A / T as percentage>
|
|
311
|
-
- **Overall Verdict**: PASS / PASS WITH ISSUES / NEEDS REWORK
|
|
280
|
+
- **Results**: <X> PASS | <Y> PARTIAL | <Z> FAIL | <W> UNABLE TO VERIFY
|
|
281
|
+
- **SPEC_DESIGN Compliance Violations**: <count, or "N/A — no SPEC_DESIGN provided">
|
|
312
282
|
|
|
313
283
|
## Scenario Coverage Summary
|
|
314
284
|
|
|
315
|
-
| # | Scenario | Verdict |
|
|
316
|
-
|
|
317
|
-
| 1 | ... | PASS |
|
|
318
|
-
| 2 | ... | PARTIAL | Missing network error handling |
|
|
319
|
-
| 3 | ... | FAIL | Page not implemented |
|
|
320
|
-
| ...| ... | ... | ...
|
|
285
|
+
| # | Scenario | Verdict | SPEC_DESIGN Compliance | Key Gaps |
|
|
286
|
+
|---|----------|---------|------------------------|----------|
|
|
287
|
+
| 1 | ... | PASS | compliant | — |
|
|
288
|
+
| 2 | ... | PARTIAL | module_path_violation | Missing network error handling |
|
|
289
|
+
| 3 | ... | FAIL | data_entity_violation | Page not implemented |
|
|
290
|
+
| ...| ... | ... | ... | ... |
|
|
321
291
|
|
|
322
292
|
## Detailed Scenario Reviews
|
|
323
293
|
|
|
@@ -325,23 +295,22 @@ Write the merged review + fix report to `<output_path>/code-review-report.md` wi
|
|
|
325
295
|
|
|
326
296
|
**Description**: <what the user does>
|
|
327
297
|
**Verdict**: PASS / PARTIAL / FAIL / UNABLE TO VERIFY
|
|
328
|
-
**
|
|
298
|
+
**SPEC_DESIGN Compliance**: compliant / <violation type>
|
|
329
299
|
|
|
330
300
|
**Evidence**:
|
|
331
301
|
- `entry/src/main/ets/pages/XxxPage.ets:42` — page component handles this flow
|
|
332
302
|
- ...
|
|
333
303
|
|
|
334
|
-
**
|
|
304
|
+
**SPEC_DESIGN Compliance Details** (if not compliant):
|
|
305
|
+
- Module path: <expected> vs <actual>
|
|
306
|
+
- Database table: <expected fields> vs <actual>
|
|
307
|
+
- ...
|
|
308
|
+
|
|
309
|
+
**Gaps**:
|
|
335
310
|
- (none, or list specific missing pieces)
|
|
336
311
|
|
|
337
|
-
**
|
|
338
|
-
-
|
|
339
|
-
- Android Reference: <description, if `android_project_dir` was used>
|
|
340
|
-
- Files Modified:
|
|
341
|
-
- `<file path>`: <what was changed>
|
|
342
|
-
- API Documentation Used: <npx --yes devecocli docs query/doc title or WebSearch query, if used>
|
|
343
|
-
- Compilation: PASS / FAIL
|
|
344
|
-
- Notes: <caveats, follow-up needed>
|
|
312
|
+
**Suggestions**:
|
|
313
|
+
- (none, or concrete fix steps)
|
|
345
314
|
|
|
346
315
|
---
|
|
347
316
|
|
|
@@ -351,127 +320,54 @@ Write the merged review + fix report to `<output_path>/code-review-report.md` wi
|
|
|
351
320
|
## Cross-Cutting Issues
|
|
352
321
|
|
|
353
322
|
### Permission Coverage
|
|
354
|
-
|
|
355
|
-
- **Fixes Applied**:
|
|
356
|
-
- Permissions added: <list>
|
|
357
|
-
- Runtime permission requests added: <yes/no, details>
|
|
323
|
+
...
|
|
358
324
|
|
|
359
325
|
### Navigation Completeness
|
|
360
|
-
|
|
361
|
-
- **Fixes Applied**:
|
|
362
|
-
- Pages created: <list>
|
|
363
|
-
- Routes registered: <list>
|
|
364
|
-
|
|
365
|
-
### Resource Completeness
|
|
366
|
-
- **Findings**: <list>
|
|
367
|
-
- **Fixes Applied**:
|
|
368
|
-
- Strings added: <count>
|
|
369
|
-
- Media resources needed (manual): <list>
|
|
326
|
+
...
|
|
370
327
|
|
|
371
328
|
### State Management
|
|
372
|
-
|
|
373
|
-
- **Fixes Applied**: <decorators added/changed>
|
|
329
|
+
...
|
|
374
330
|
|
|
375
331
|
### API Compatibility
|
|
376
|
-
|
|
377
|
-
- **Fixes Applied**: <notes>
|
|
378
|
-
|
|
379
|
-
## Remaining Issues
|
|
332
|
+
...
|
|
380
333
|
|
|
381
|
-
|
|
334
|
+
### Resource Completeness
|
|
335
|
+
...
|
|
382
336
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
| 2 | ... | UNABLE TO VERIFY — runtime-only behavior | Manual testing required |
|
|
337
|
+
### SPEC_DESIGN Module Ownership (if spec-design-file was provided)
|
|
338
|
+
- Compliant files: <list of files within SPEC_DESIGN module paths>
|
|
339
|
+
- Scope violations: <list of files outside SPEC_DESIGN module paths, with expected vs actual module>
|
|
387
340
|
|
|
388
|
-
|
|
341
|
+
### SPEC_DESIGN Data Integrity (if spec-design-file was provided)
|
|
342
|
+
- Database compliance: <tables matching vs diverging from SPEC_DESIGN>
|
|
343
|
+
- Preferences compliance: <keys matching vs diverging from SPEC_DESIGN>
|
|
389
344
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
| `entry/src/main/module.json5` | Permission coverage | Added READ_IMAGEVIDEO permission |
|
|
393
|
-
| `entry/src/main/ets/pages/Index.ets` | Scenario 1, 2 | Added media grid, permission request |
|
|
394
|
-
| ... | ... | ... |
|
|
345
|
+
### Owner Consistency (if spec-design-file was provided)
|
|
346
|
+
- Owner matches between SPEC_DESIGN and PROJECT_DESIGN.md: <yes/no, list conflicts>
|
|
395
347
|
|
|
396
348
|
## Final Assessment
|
|
397
349
|
|
|
398
350
|
**Overall Verdict**: <PASS / PASS WITH ISSUES / NEEDS REWORK>
|
|
399
351
|
|
|
400
352
|
- **Fully covered scenarios**: <list>
|
|
401
|
-
- **Partially covered scenarios**: <list with
|
|
402
|
-
- **Not covered scenarios**: <list with what's
|
|
353
|
+
- **Partially covered scenarios**: <list with key gaps>
|
|
354
|
+
- **Not covered scenarios**: <list with what's needed>
|
|
355
|
+
- **SPEC_DESIGN compliance violations**: <list, or "none" if no SPEC_DESIGN was provided>
|
|
403
356
|
|
|
404
|
-
**Recommended Priority
|
|
357
|
+
**Recommended Priority Fixes**:
|
|
405
358
|
1. ...
|
|
406
359
|
2. ...
|
|
407
360
|
```
|
|
408
361
|
|
|
409
362
|
---
|
|
410
363
|
|
|
411
|
-
## Step 8 — Git Commit (if defects were fixed)
|
|
412
|
-
|
|
413
|
-
After writing `code-review-report.md`, commit the changes if any source files were modified.
|
|
414
|
-
|
|
415
|
-
**Condition**: Run this step only when "Successfully Fixed" > 0.
|
|
416
|
-
|
|
417
|
-
1. **Check if the project is in a git repository**:
|
|
418
|
-
```bash
|
|
419
|
-
cd "<harmony_project_dir>" && git rev-parse --is-inside-work-tree
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
2. **If yes, commit all changes**:
|
|
423
|
-
```bash
|
|
424
|
-
cd "<harmony_project_dir>"
|
|
425
|
-
git add -A
|
|
426
|
-
git commit -m "fix(review): address {A} code review defects
|
|
427
|
-
|
|
428
|
-
Total defects: {T}, Fixed: {A}, Failed: {B}
|
|
429
|
-
"
|
|
430
|
-
```
|
|
431
|
-
(where T = total defects, A = successfully fixed, B = failed to fix)
|
|
432
|
-
|
|
433
|
-
3. **Capture the commit ID**:
|
|
434
|
-
```bash
|
|
435
|
-
cd "<harmony_project_dir>" && git rev-parse HEAD
|
|
436
|
-
```
|
|
437
|
-
|
|
438
|
-
4. **Write commit info** to `<output_path>/code-review-commit-info.md`:
|
|
439
|
-
```
|
|
440
|
-
commit_id: <commit_id>
|
|
441
|
-
```
|
|
442
|
-
|
|
443
|
-
**If no files were modified** (all scenarios PASS, or all fix attempts failed):
|
|
444
|
-
- Write `<output_path>/code-review-commit-info.md` with:
|
|
445
|
-
```
|
|
446
|
-
commit_id: none
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
**If not in a git repository**:
|
|
450
|
-
- Record "Not a git repository — skipped commit" in the report's Remaining Issues section.
|
|
451
|
-
- Write `<output_path>/code-review-commit-info.md` with:
|
|
452
|
-
```
|
|
453
|
-
commit_id: none
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
**If `output_path` was not provided**, skip writing `code-review-commit-info.md`.
|
|
457
|
-
|
|
458
|
-
---
|
|
459
|
-
|
|
460
364
|
## Guidelines
|
|
461
365
|
|
|
462
366
|
- **Scenario-first**: Every finding must be tied to a specific user scenario. Do not report generic code style issues unless they impact a scenario.
|
|
463
367
|
- **Be specific**: Always include file paths and line numbers as evidence.
|
|
464
|
-
- **Be fair**: If the code works for a scenario, give it PASS — don't nitpick style in a scenario review.
|
|
465
|
-
- **
|
|
466
|
-
- **
|
|
467
|
-
- **
|
|
468
|
-
- **
|
|
469
|
-
- **
|
|
470
|
-
- **Android as specification**: When available, treat the Android implementation as the ground truth for expected behavior.
|
|
471
|
-
- **Minimal changes**: Only fix identified defects. Do not refactor, add comments to unrelated code, or "improve" working code.
|
|
472
|
-
- **Fix the root cause**: Address the underlying issue, not just the symptom.
|
|
473
|
-
- **Compile before moving on**: Every fix group must pass compilation before being considered complete.
|
|
474
|
-
- **Don't introduce new issues**: Verify that fixes don't break other features by checking for shared state, shared components, or shared resources.
|
|
475
|
-
- **Preserve intent**: Keep the original code's structure and patterns where possible. Match the existing naming conventions, file organization, and code style.
|
|
476
|
-
- **Prioritize gaps**: In the final assessment, rank residual gaps by user impact — which gaps would users notice first?
|
|
477
|
-
- **No false positives in Step 3**: Only mark FAIL when you are confident the scenario cannot work. Use UNABLE TO VERIFY for uncertain cases — an UNABLE TO VERIFY scenario is **not** an actionable defect and should not be fixed.
|
|
368
|
+
- **Be fair**: If the code works for a scenario, give it PASS — don't nitpick style in a scenario review. However, if the code works but violates SPEC_DESIGN constraints, downgrade to PARTIAL or FAIL.
|
|
369
|
+
- **SPEC_DESIGN is binding**: When `spec-design-file` is provided, compliance violations are not style issues — they are scope or ownership errors that must be reported. A functionally correct implementation outside SPEC_DESIGN module paths is a compliance violation.
|
|
370
|
+
- **Derive implicit scenarios**: If the scenario document describes architecture (pages, modules, data flows) rather than explicit user stories, derive the scenarios yourself — every page implies a "user visits this page" scenario, every data flow implies a "user triggers this operation" scenario.
|
|
371
|
+
- **Prioritize gaps**: In the final assessment, rank missing scenarios by user impact — which gaps would users notice first?
|
|
372
|
+
- **No false positives**: Only mark FAIL when you are confident the scenario cannot work. Use UNABLE TO VERIFY for uncertain cases.
|
|
373
|
+
- **Cross-reference project design**: When SPEC_DESIGN and PROJECT_DESIGN.md disagree on module ownership, report the conflict — do not silently pick one.
|