> android-networking
Standards for Retrofit, OkHttp, and API Communication. Use when integrating Retrofit, OkHttp, or API clients in Android apps. (triggers: **/*Api.kt, **/*Service.kt, **/*Client.kt, Retrofit, OkHttpClient, @GET, @POST)
curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/android-networking?format=md"Android Networking Standards
Priority: P0
Implementation Guidelines
Libraries
- Client: Retrofit 2 + OkHttp 4.
- Serialization: Kotlinx Serialization (Preferred over Moshi/Gson).
- Format: JSON. Use
@SerialNamefor field mapping.
Best Practices
- Interceptors: Use for Auth Headers (Bearer Token) and Logging (
HttpLoggingInterceptor). - Response Handling: Wrap responses in a
Resulttype (Success/Error/Loading) in Repository/DataSource, NOT in the API interface. - Threads: API calls must be
suspendfunctions.
Anti-Patterns
- Main Thread:
**No Blocking Calls**: Use suspend. - Logic in API:
**No Logic in Interface**: Only definitions. - Missing Content-Type:
**No Raw Factory**: When using kotlinx.serialization, always explicitly specify "application/json" MediaType in your converter factory.
References
> related_skills --same-repo
> typescript-tooling
Development tools, linting, and build config for TypeScript. Use when configuring ESLint, Prettier, Jest, Vitest, tsconfig, or any TS build tooling. (triggers: tsconfig.json, .eslintrc.*, jest.config.*, package.json, eslint, prettier, jest, vitest, build, compile, lint)
> typescript-security
Secure coding practices for TypeScript. Use when validating input, handling auth tokens, sanitizing data, or managing secrets and sensitive configuration. (triggers: **/*.ts, **/*.tsx, validate, sanitize, xss, injection, auth, password, secret, token)
> typescript-language
Modern TypeScript standards for type safety and maintainability. Use when working with types, interfaces, generics, enums, unions, or tsconfig settings. (triggers: **/*.ts, **/*.tsx, tsconfig.json, type, interface, generic, enum, union, intersection, readonly, const, namespace)
> typescript-best-practices
Idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic. (triggers: **/*.ts, **/*.tsx, class, function, module, import, export, async, promise)