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 ==testing
--- name: ohos-req-value-decision description: Use after review meeting to record decision and route to next step. Triggers: 评审决策纪要, 评审结论回流, value decision, 评审接纳, 评审不接纳, 评审退回, 下次重新上会. Do NOT use for feature baseline (ohos-req-feature-baseline), review gate checks (ohos-req-review-gate), or IR generation (ohos-req-feature-to-ir). metadata: author: openharmony scope: common stage: requirements capability: value-decision version: 0.3.0 status: draft tags: - sdd - requirements
development
Use when converting an OpenHarmony requirement document, spec, or design proposal into an OpenHarmony review slide deck (需求评审 / 需求变更评审 / 设计评审 PPTX) — produces the fixed OpenHarmony-branded review-deck structure (OH logo on every page) with architecture/flow diagrams and field tables. Triggers on "需求评审PPT", "需求变更评审", "把需求文档转成评审PPT", "spec转评审PPT", "requirement/spec to review deck". NOT for arbitrary or generic slide decks unrelated to OpenHarmony requirement/design review.
testing
Use when performing the Phase 0 Step 0.5 Review Ready Gate on a 04-feature.md, especially when the user says "evaluate gate", "review readiness", "feature ready?", "should we generate IR", or when the ohos-req-intake-orchestration main session needs a structured Ready / Conditional Ready / Not Ready judgment instead of doing the check inline. Reads 01-04, runs seven fixed checks plus a conditional-items check, and returns a machine-readable JSON summary plus a human-readable table that the main session can route on. Do NOT use for feature baseline generation (ohos-req-feature-baseline), value decision recording (ohos-req-value-decision), or IR generation (ohos-req-feature-to-ir).
testing
--- name: ohos-req-requirement-intake description: Use when importing an OHOS requirement into Phase 0.1, especially for 01-requirement.md, requirement intake, background, user value, scenarios, scope, FR/NFR, affected modules, or priority. Triggers: 需求导入, 01-requirement, 需求基线, RR单号. Do NOT use for feasibility analysis (ohos-req-feasibility-analysis), architecture decision (ohos-req-arch-decision), or feature baseline (ohos-req-feature-baseline). metadata: author: openharmony scope: common