| name | add-remote-endpoint |
| description | Use when adding a new remote/network endpoint (a RemoteOperation / OCSRemoteOperation) to this Nextcloud Android library, or when the user says "add an endpoint", "new remote operation", "implement this API call", or "wire up <OCS/ocs> API". Scaffolds the models, constants, operation, and tests following the governance package conventions and the standards in AGENTS.md. |
Add a remote endpoint
Implement a new RemoteOperation for this library the way the existing ones are written. The full,
authoritative standards live in AGENTS.md — this skill is the step-by-step
procedure. When they disagree, AGENTS.md wins.
0. Ground yourself in the reference
Read the canonical package before writing anything:
library/src/main/java/com/nextcloud/android/lib/resources/governance/ — operations (GET/POST/DELETE)
library/src/main/java/com/nextcloud/android/lib/resources/governance/model/ — @Serializable models + enums
library/src/main/java/com/owncloud/android/lib/ocs/OcsResponse.kt — shared OcsResponse<T>, ocsJson, SEPARATOR
Pick the existing operation closest to the one you're adding (list-returning GET, single-object GET,
POST with body, DELETE) and mirror its structure.
1. Confirm the contract
Establish, from the user or the API: HTTP method, path (base + segments), path/query params, request
body shape (if any), and the JSON response shape. If any of these is unclear, ask before coding.
2. Models — under <feature>.model
For each new wire type create a Kotlin @Serializable data class (or enum with @SerialName) in
. Never put models beside the operation or in an
unrelated package. Reuse the shared envelope — do not model the //
wrapper yourself.