Files
clz 9e29282be3 refactor: 启动监控 Startup 命名统一为 Launch
- demo 页面与诊断类重命名:StartupLogin/StartupNetwork/StartupPrivacy → LaunchLogin/LaunchNetwork/LaunchPrivacy,StartupDiagnostics → LaunchDiagnostics(含 main_pages.json 注册与全部引用)
- 生产监控类重命名:StartupMonitor → LaunchMonitor,StartupElkBuilder → LaunchElkBuilder(含 EntryAbility/Index/LauncherPage/NetworkAnomalyPage 引用)
- 命名与 APP_LAUNCH 事件及 launch 模块对齐
- 接入方案文档同步页面名与类名,并修正 6 处过时内容:4 维度(is_first_install 入维度出候选)、分桶 4 维度、4.1 阶段时间已上传、§6 章节顺序(6.1 在 6.2 前)、§2 双通道链路
- demo 改名后 devecocli build 编译通过;真机运行回归待设备恢复补跑

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-06 14:24:31 +08:00

3.9 KiB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Repository Overview

Mixed-purpose repository with three distinct areas:

  1. Root level — Obsidian-friendly documentation workspace for HarmonyOS APM (Application Performance Management) analysis of 同花顺期货 (THS Futures). Two main reports:
    • HarmonyOS APM分析报告_20260731.md — crash analysis with supporting screenshots in report-assets/.
    • HarmonyOS 启动性能监控接入方案_20260805.md — cold-start performance monitoring integration plan.
  2. CrashDiagnosticsDemo/ — Standalone HarmonyOS demo app demonstrating HiAppEvent crash subscription, persistent crash records, and native crash simulation via NAPI. Full project with its own CLAUDE.md.
  3. future_entry_demo/ — Extracted entry HAP module from THS Futures. NOT a full workspace — depends on sibling modules (biz_common, biz_trade, etc.) via file:../.... Has its own CLAUDE.md and AGENTS.md. Contains src/main/ets/monitor/LaunchMonitor.ets (cold-start performance monitoring implementation referenced by the startup report).

When working in a subdirectory, read that subdirectory's own CLAUDE.md first — it contains build commands, architecture details, and constraints specific to that project. This file covers the repo-level conventions and cross-cutting concerns. The companion AGENTS.md has additional detail on PR guidelines and validation checklists.

Build & Development Commands

There is no top-level build system. Work in the appropriate subdirectory:

  • CrashDiagnosticsDemo: Full HarmonyOS project — devecocli build from its root.
  • future_entry_demo: Entry module only — build from the parent workspace with devecocli build --modules entry@default.
  • Root documentation: No build step. Edit Markdown in Obsidian or any CommonMark viewer.

The .claude/settings.local.json pre-approves devecocli build *, devecocli device *, and devecocli run * commands.

Useful repo-wide checks before committing documentation changes:

git status --short
rg 'report-assets/' '*.md'
find report-assets -type f | sort

Cross-Cutting Conventions

HarmonyOS / ArkTS

All HarmonyOS projects in this repo use the Hvigor build system with DevEco Studio as the IDE. Use the deveco-cli skill for build, run, and device operations. ArkTS is a strict subset of TypeScript — load the arkts-grammar-standards skill before writing .ets files.

Documentation (Markdown)

  • UTF-8 Markdown with ATX headings (#, ##), fenced code blocks with language tags, pipe tables with right-aligned numeric columns.
  • Name screenshots with a two-digit sequence and short lowercase description (e.g., 08-grafana-native-detail.png). Do not reuse an existing image filename for unrelated evidence.
  • New reports use descriptive filenames with a date (YYYYMMDD). Place images in report-assets/ or a report-specific subdirectory.
  • Use backticks for event types, API names, versions, and identifiers.

Before Committing Documentation

  1. Preview all headings, tables, code blocks, and image captions in a Markdown viewer.
  2. Recalculate totals and confirm date ranges, versions, and event classifications against source screenshots.
  3. Verify all referenced asset files exist and no local absolute paths or sensitive data are exposed.
  4. Ensure stray images at the repo root are moved into report-assets/ or deleted.

Git

  • Use Conventional Commits format: <type>: <summary> (e.g., docs: clarify OOM crash accounting, feat: 完善启动性能监控流程, chore: save current workspace changes).
  • For non-trivial changes, add a blank line followed by - list items describing the concrete change, implementation, and verification.
  • Keep report text and supporting screenshots in the same commit.
  • Avoid committing personal Obsidian workspace-state changes (.obsidian/) unless intentionally shared.