docs: 更新仓库 CLAUDE.md
- 补充第二份报告(启动性能监控接入方案)与 StartupMonitor 说明 - 合并 AGENTS.md 的 Conventional Commits 规范与提交前校验清单 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -6,11 +6,13 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|||||||
|
|
||||||
Mixed-purpose repository with three distinct areas:
|
Mixed-purpose repository with three distinct areas:
|
||||||
|
|
||||||
1. **Root level** — Obsidian-friendly documentation workspace for HarmonyOS APM (Application Performance Management) crash analysis of 同花顺期货 (THS Futures). The main report is `HarmonyOS APM分析报告_20260731.md` with supporting screenshots in `report-assets/`.
|
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`.
|
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`.
|
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/StartupMonitor.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.
|
**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
|
## Build & Development Commands
|
||||||
|
|
||||||
@@ -22,6 +24,14 @@ There is no top-level build system. Work in the appropriate subdirectory:
|
|||||||
|
|
||||||
The `.claude/settings.local.json` pre-approves `devecocli build *`, `devecocli device *`, and `devecocli run *` commands.
|
The `.claude/settings.local.json` pre-approves `devecocli build *`, `devecocli device *`, and `devecocli run *` commands.
|
||||||
|
|
||||||
|
Useful repo-wide checks before committing documentation changes:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git status --short
|
||||||
|
rg 'report-assets/' '*.md'
|
||||||
|
find report-assets -type f | sort
|
||||||
|
```
|
||||||
|
|
||||||
## Cross-Cutting Conventions
|
## Cross-Cutting Conventions
|
||||||
|
|
||||||
### HarmonyOS / ArkTS
|
### HarmonyOS / ArkTS
|
||||||
@@ -31,12 +41,20 @@ All HarmonyOS projects in this repo use the **Hvigor** build system with **DevEc
|
|||||||
### Documentation (Markdown)
|
### Documentation (Markdown)
|
||||||
|
|
||||||
- UTF-8 Markdown with ATX headings (`#`, `##`), fenced code blocks with language tags, pipe tables with right-aligned numeric columns.
|
- 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`).
|
- 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.
|
- New reports use descriptive filenames with a date (`YYYYMMDD`). Place images in `report-assets/` or a report-specific subdirectory.
|
||||||
- Validate manually: preview all headings/tables/images, recalculate totals against source screenshots, verify no absolute paths or sensitive data leak in.
|
- 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
|
### Git
|
||||||
|
|
||||||
- Concise, imperative commit subjects (e.g., `docs: clarify OOM crash accounting`, `assets: add native crash evidence`).
|
- 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.
|
- Keep report text and supporting screenshots in the same commit.
|
||||||
- Avoid committing personal Obsidian workspace-state changes unless intentionally shared.
|
- Avoid committing personal Obsidian workspace-state changes (`.obsidian/`) unless intentionally shared.
|
||||||
|
|||||||
Reference in New Issue
Block a user