skills/generate-interface-uml/SKILL.md
This skill should be used when user asks to "generate UML", "create sequence diagram", "生成时序图", "生成类图", "generate PlantUML", or discusses generating UML diagrams for new interfaces or API design.
npx skillsauth add openharmonyinsight/openharmony-skills generate-interface-umlInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill helps generate PlantUML sequence diagrams and class diagrams for new interfaces, based on existing similar interfaces in the codebase.
User wants to create UML diagrams (sequence diagrams, class diagrams) for:
Start with what the user provides (often just an interface name), then ask questions to collect:
Essential Information:
AddGlocalBlackList, RemoveGlocalBlackListOptional Information (ask if needed): 5. Output directory - Where should the PlantUML files be saved? 6. Diagram types - Sequence diagram? Class diagram? Both? 7. Call chain destination - Which class/method does it ultimately call?
Search the codebase for the reference interface to understand the call chain:
# Find the reference interface implementation
grep -r "SetFocusAppInfo" --include="*.h" --include="*.cpp"
Key files to examine:
RSInterfaces, RSRenderInterfaceRSIClientToRenderConnection, RSClientToRenderConnectionRSRenderPipelineAgent, RSMainThread@startuml InterfaceName序列图
title InterfaceName 接口调用时序图
autonumber
skinparam maxMessageSize 150
skinparam boxPadding 10
actor "客户端应用" as Client
box "客户端进程 (Client Process)" #LightBlue
participant "RSInterfaces" as RSInterfaces
participant "RSRenderInterface" as RSRenderInterface
participant "RSRenderPipelineClient\n(IPC Proxy)" as IPCProxy
end box
box "跨进程通信 (IPC)" #LightYellow
participant "Binder/Hipc\n通信通道" as Binder
end box
box "服务端进程 (Render Service)" #LightGreen
participant "RSClientToRenderConnection\n(IPC Stub)" as IPCStub
participant "RSRenderPipelineAgent" as Agent
participant "RSMainThread" as MainThread
participant "TargetClass\n(在RSMainThread线程中执行)" as Target
end box
== 客户端调用流程 ==
Client -> RSInterfaces: InterfaceName(params)
activate RSInterfaces
RSInterfaces -> RSRenderInterface: InterfaceName(params)
activate RSRenderInterface
RSRenderInterface -> IPCProxy: InterfaceName(params)
activate IPCProxy
== 跨进程IPC调用 ==
IPCProxy -> Binder: IPC调用\nInterfaceName
activate Binder
Binder -> IPCStub: 接收IPC调用\nInterfaceName
activate IPCStub
== 服务端处理流程 ==
IPCStub -> Agent: InterfaceName(params)
activate Agent
Agent -> Agent: ScheduleMainThreadTask(\nlambda任务)
Agent -> MainThread: PostTask(\n执行InterfaceName)
activate MainThread
MainThread -> Target: TargetMethod(params)
activate Target
note right of Target
描述具体操作
end note
Target --> MainThread: 返回
deactivate Target
MainThread --> Agent: 任务完成
deactivate MainThread
Agent --> IPCStub: 返回结果\n(ERR_OK)
deactivate Agent
IPCStub --> Binder: 返回IPC结果
deactivate IPCStub
Binder --> IPCProxy: 返回IPC结果
deactivate Binder
IPCProxy --> RSRenderInterface: 返回结果
deactivate IPCProxy
RSRenderInterface --> RSInterfaces: 返回结果
deactivate RSRenderInterface
RSInterfaces --> Client: 返回结果
deactivate RSInterfaces
@enduml
@startuml InterfaceName类图
title InterfaceName系列接口涉及的类关系图
skinparam classAttributeIconSize 0
skinparam class {
BackgroundColor<<client>> LightBlue
BackgroundColor<<service>> LightGreen
BackgroundColor<<static>> LightYellow
BorderColor Black
}
package "客户端 (Client)" <<client>> {
class RSInterfaces {
+ {static} GetInstance(): RSInterfaces&
+ InterfaceName(params): ReturnType
--
- renderInterface_: RSRenderInterface*
}
class RSRenderInterface {
+ InterfaceName(params): ReturnType
--
- renderPipelineClient_: RSRenderPipelineClient*
}
RSInterfaces --> RSRenderInterface
}
package "IPC通信层" {
interface RSIClientToRenderConnection {
+ InterfaceName(params, ErrorCode&): ErrCode
}
class RSClientToRenderConnection {
+ InterfaceName(params, ErrorCode&): ErrCode
--
- renderPipelineAgent_: sptr<RSRenderPipelineAgent>
}
RSClientToRenderConnection ..|> RSIClientToRenderConnection
}
package "服务端 (Render Service)" <<service>> {
class RSRenderPipelineAgent {
+ InterfaceName(params, ErrorCode&): ErrCode
--
- rsRenderPipeline_: std::shared_ptr<RSRenderPipeline>
}
class RSMainThread {
+ PostTask(RSTask): void
+ ScheduleTask(Task): std::future<Return>
--
- mainThreadId_: std::thread::id
}
}
package "TargetClass (静态类)" <<static>> {
class TargetClass {
+ {static} TargetMethod(params): void
--
- {static} member_: Type
}
}
RSRenderInterface --> RSIClientToRenderConnection: 通过IPC调用
RSClientToRenderConnection --> RSRenderPipelineAgent
RSRenderPipelineAgent ..> RSMainThread: ScheduleMainThreadTask
RSRenderPipelineAgent ..> TargetClass: 调用静态方法
@enduml
Write the generated PlantUML files to the specified directory:
InterfaceName_sequence.puml, InterfaceName_ClassDiagram.pumlIf comparing with existing interfaces, create a comparison diagram showing:
User provides:
Generate UML for AddGlocalBlackList, RemoveGlocalBlackList, SetGlocalBlackList
Ask follow-up questions:
const std::vector<NodeId>&SetFocusAppInfoScreenSpecialLayerInfoGenerate output:
AddGlocalBlackList_sequence.pumlRemoveGlocalBlackList_sequence.pumlSetGlocalBlackList_sequence.pumlInterfaceName_ClassDiagram.pumlautonumber for sequence diagrams== Section Name ==development
Run local code quality checks covering a subset of OpenHarmony gate CI (copyright, CodeArts C/C++) plus additional local checks (pylint/flake8, shellcheck/bashate, gn format). Use before committing to reduce gate failures. Triggers on: /oh-precommit-codecheck, "门禁检查", "门禁预检", "检查代码", "run codecheck", "check code quality", "lint my code", "代码检查", or after completing code implementation. WHEN to use: before git commit, before creating PR, after modifying C/C++/Python/Shell/GN files, when gate CI fails with codecheck defects, or when you want to preview what gate will flag.
development
OpenHarmony PR full lifecycle workflow. Five modes: - Commit: standardized commit with DCO sign-off and Issue linking - Create PR: commit + push to fork + create Issue + create PR on upstream - Fix Codecheck: fetch gate CI codecheck defects from a PR and auto-fix them - Review PR: fetch a PR's changes to local for code review - Fix Review: fetch unresolved review comments from a PR and auto-fix them Triggers on: /oh-pr-workflow, "提交代码", "创建PR", "提个PR", "commit", "修复告警", "修复门禁", "修复codecheck", "fix codecheck", "review pr", "review这个pr", "看下这个pr", "检视pr", "修复review", "修复检视意见", "fix review", or a GitCode PR URL with fix/review intent.
testing
分析 HM Desktop PRD 文档,提取需求信息、验证完整性、检查章节顺序(需求来源→需求背景→需求价值分析→竞品分析→需求描述)、检查 KEP 定义、检测需求冲突并生成结构化分析报告。适用于用户请求:(1) 分析或审查 PRD 文档, (2) 从需求中提取 KEP 列表, (3) 检查 PRD 完整性或一致性, (4) 将需求映射到模块架构, (5) 验证 PRD 格式合规性, (6) 验证竞品分析章节完整性。关键词:PRD分析, requirement extraction, KEP验证, completeness check, chapter order validation, 竞品分析检查, analyze PRD, 需求提取, 完整性检查, 章节顺序验证
development
基于 PRD 文档自动生成鸿蒙系统设计文档,包括架构设计文档和功能设计文档。生成前会分析 OpenHarmony 存量代码结构,确保与现有架构兼容。架构设计文档第2章必须为竞品方案分析,位于需求背景之后。适用于用户请求:(1) 生成架构设计文档, (2) 生成功能设计文档, (3) 从 PRD 生成设计文档, (4) 创建系统架构设计, (5) 编写功能规格说明, (6) 分析 OH 代码结构。关键词:architecture design, functional design, design doc, 竞品方案分析, OpenHarmony code analysis, 架构设计, 功能设计, 设计文档生成, OH代码分析, analyze codebase, competitor analysis