Kotlin context parameters

From alexandru/social-publish · View interactive version

Kotlin context parameters is an AI agent skill from the GitHub repository alexandru/social-publish. Kotlin context parameters (`context(...)`) for scoped dependencies, DSL scopes, and migrations from context receivers. Use when designing, reviewing, or refactoring Kotlin code that uses implicit contextual values.

How to use this skill

Skill file

Kotlin Context Parameters

Quick start

Workflow

  1. Identify the contextual capability: service dependency, DSL/scope marker, typeclass-like evidence, or migration from context receivers.
  2. Decide names: named parameter when code needs the value; _ plus bridge functions when the context should only unlock operations.
  3. Add a boundary that supplies the context (context(...) {} or a wrapper accepting a context(Type) () -> A block).
  4. Check restrictions: no constructor/class contexts, no context-property initializers/backing fields/delegation.
  5. Compile-test syntax with the target Kotlin version.

Rules of thumb

Output expectations

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.