This skill helps you implement robust network communication using Retrofit and OkHttp with secure, scalable error handling and data serialization.
npx playbooks add skill pluginagentmarketplace/custom-plugin-android --skill networking
interface UserApi {
@GET("/users/{id}")
suspend fun getUser(@Path("id") id: Int): UserDto
@POST("/users")
suspend fun createUser(@Body user: UserDto): UserDto
}
val retrofit = Retrofit.Builder()
.baseUrl("https://api.example.com/")
.addConverterFactory(GsonConverterFactory.create())
.build()
val api = retrofit.create(UserApi::class.java)
val client = OkHttpClient.Builder()
.addInterceptor(HttpLoggingInterceptor())
.connectTimeout(30, TimeUnit.SECONDS)
.certificatePinner(CertificatePinner.Builder()
.add("api.example.com", "sha256/...").build())
.build()
sealed class Result<T> {
data class Success<T>(val data: T) : Result<T>()
data class Error<T>(val exception: Exception) : Result<T>()
}
✅ Use HTTPS always
✅ Implement SSL pinning
✅ Handle errors gracefully
✅ Optimize request/response size
✅ Cache when possible
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.