macOS/.agent/skills/upsert-case/SKILL.md
Add a new API example or modify an existing one. Covers both creation and modification scenarios, including file structure, registration, and ARCHITECTURE.md updates.
npx skillsauth add agoraio/api-examples upsert-caseInstall 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.
Use this skill when you need to:
Trigger: User requests a new API demo (e.g., "Add a screen sharing example")
Steps:
Basic/ or Advanced/ViewController.swiftARCHITECTURE.md Case IndexTrigger: User requests changes to an existing example (e.g., "Update JoinChannelVideo to support token")
Steps:
APIExample/Examples/[Basic|Advanced]/<ExampleName>/ARCHITECTURE.md Case Index if APIs changed| File | Action | Notes |
|------|--------|-------|
| APIExample/Examples/[Basic\|Advanced]/<ExampleName>/<ExampleName>.swift | Create | Main implementation file |
| APIExample/ViewController.swift | Modify | Register example in menu/list |
| ARCHITECTURE.md | Modify | Add entry to Case Index |
| File | Action | Notes |
|------|--------|-------|
| APIExample/Examples/[Basic\|Advanced]/<ExampleName>/<ExampleName>.swift | Modify | Update implementation |
| ARCHITECTURE.md | Modify | Update Case Index if APIs changed |
mkdir -p APIExample/Examples/[Basic|Advanced]/<ExampleName>
Example folder name must be PascalCase and match the class name.
Create APIExample/Examples/[Basic|Advanced]/<ExampleName>/<ExampleName>.swift
Use the template from references/example-template.swift as a starting point. Replace <ExampleName> with your example name.
Edit APIExample/ViewController.swift and add the example to the menu/list:
// In the example list or menu setup
let examples = [
// ... existing examples
("ExampleName", <ExampleName>Main.self),
]
Add a new row to the Case Index table in ARCHITECTURE.md:
| ExampleName | `Examples/[Basic|Advanced]/ExampleName/` | `api1()`, `api2()`, `api3()` | Brief description of what this example demonstrates |
Key APIs column: List 2-5 core SDK methods used in this example.
leaveChannel() and destroy() are called on closeSee references/ directory for code patterns:
lifecycle-pattern.swift — Proper engine lifecyclethread-safety-pattern.swift — Thread-safe UI updatesDo NOT:
destroy() — this causes engine leaksDispatchQueue.main.asyncKeyCenterAgoraRtcEngineDelegate for event handlingleaveChannel() firstAPIExample/Examples/[Basic|Advanced]/ structureARCHITECTURE.md Case Index after adding/modifying an exampleAfter completing the upsert, verify:
APIExample/Examples/[Basic|Advanced]/<ExampleName>/)<ExampleName>.swift (PascalCase)<ExampleName>Main and extends BaseViewControllerViewController.swiftinitializeAgoraEngine() creates engine with correct configjoinChannel() uses token from KeyCenterleaveChannel() and destroy() are called in viewWillClose()ARCHITECTURE.md Case Index includes new/updated examplereferences/ directory for Swift code templatesAPIExample/Examples/Basic/JoinChannelVideo/ for reference implementationdevelopment
Add a new API example or modify an existing one. Covers both creation and modification scenarios, including dialog class structure, message map registration, and ARCHITECTURE.md updates.
development
Code review for API examples. Ensures examples follow project conventions, handle lifecycle correctly, manage threads safely, and use APIs properly.
development
Code review for API examples. Ensures examples follow project conventions, handle lifecycle correctly, manage threads safely, and use APIs properly.
development
Guide for implementing video call functionality in business scenarios, including SDK initialization, joining channels, video encoding configuration, and event handling