Important: Ensure to include AppMgrService layer implementation (was missing in previous versions)
See references/patterns.md for advanced patterns or special cases.
1---2name: appmgr-api-generator3description: AppMgr API Generator4---56# AppMgr API Generator78Automatically generate complete API call chain from client to service for new AppMgr APIs.910## Quick Start1112Ask: "Add a new API named [ApiName] with parameters [params] and return type [type]"1314The skill will:151. Ask for interface details (name, parameters, return type, functionality)162. Generate all necessary code modifications173. Show diff preview for each file1819## Generated Files2021For each new API, code is generated for the following files:22- `interfaces/inner_api/app_manager/include/appmgr/app_mgr_client.h`23- `interfaces/inner_api/app_manager/src/appmgr/app_mgr_client.cpp`24- `interfaces/inner_api/app_manager/include/appmgr/app_mgr_ipc_interface_code.h`25- `interfaces/inner_api/app_manager/include/appmgr/app_mgr_proxy.h`26- `interfaces/inner_api/app_manager/src/appmgr/app_mgr_proxy.cpp`27- `interfaces/inner_api/app_manager/include/appmgr/app_mgr_interface.h`28- `services/appmgr/include/app_mgr_service.h` (**NEW**)29- `services/appmgr/src/app_mgr_service.cpp` (**NEW**)30- `services/appmgr/src/app_mgr_service_inner.cpp`31- `services/appmgr/src/app_mgr_service_inner.h`32- `services/appmgr/src/appmgrstub/app_mgr_stub.cpp`3334## Workflow35361. **Interface Definition**: Provide API name, parameters, return type372. **Code Generation**: Use `scripts/generate_appmgr_api.py`383. **Review**: Check generated code before applying changes394. **Apply**: Apply changes to all files in the call chain4041## Architecture Overview4243Complete call chain path:44```45AppMgrClient → AppMgrProxy → IPC → AppMgrStub → AppMgrService → AppMgrServiceInner46```4748- **AppMgrClient**: Client-side API wrapper49- **AppMgrProxy**: Client-side IPC proxy, marshals parameters50- **AppMgrStub**: Server-side IPC handler, unmarshals parameters51- **AppMgrService**: Service implementation, checks service status and delegates52- **AppMgrServiceInner**: Business logic implementation5354## Implementation Notes5556- Follow existing code patterns in ability_runtime57- Generate appropriate IPC serialization/deserialization code58- Handle synchronous/asynchronous calls appropriately59- Include error handling and logging60- **Important**: Ensure to include AppMgrService layer implementation (was missing in previous versions)6162See [references/patterns.md](references/patterns.md) for advanced patterns or special cases.
Run npx skillmds@latest add openharmonyinsight/appmgr-api-generator in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
AppMgr API Generator It is listed under Integrations & APIs on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
openharmonyinsight (@openharmonyinsight) published this skill. Their other Agent Skills are listed on their SkillMD profile.