Logo: Kotlin Kmp Refactor Safety

Kotlin Kmp Refactor Safety

Communautéit
mmiani
kotlin-kmp-refactor-safety

Use when the task is primarily a refactor, migration, reliability hardening, or architectural cleanup of existing Kotlin Multiplatform code — scope control, behavioral preservation, migration safety, compatibility, observability, and rollback planning.

Iwwersiicht

Editeurmmiani
Repositorykotlin-kmp-claude-agent-skills
Skill-Nummkotlin-kmp-refactor-safety
Stären
89
Forks
9
Matgeliwwert Dateien
Nëmmen Instruktiounen
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    mmiani huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Kotlin Kmp Refactor Safety an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/mmiani/kotlin-kmp-claude-agent-skills/tree/main/skills/kotlin-kmp-refactor-safety
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/mmiani/kotlin-kmp-claude-agent-skills.git /tmp/kotlin-kmp-claude-agent-skills
mkdir -p .claude/skills
cp -r /tmp/kotlin-kmp-claude-agent-skills/skills/kotlin-kmp-refactor-safety .claude/skills/kotlin-kmp-refactor-safety
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Kotlin Kmp Refactor Safety an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Kotlin Kmp Refactor Safety automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Kotlin Kmp Refactor Safety net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

KMP Refactor Safety Skill

Use this skill when the task is primarily a refactor, migration, reliability hardening, or architectural cleanup of existing code (not a greenfield feature). This skill is about change discipline and reviewability, not system architecture itself. Pair it with your architecture/style/testing skills as needed.

Primary objective

Deliver refactors that are:

  • minimal in surface area
  • safe to review and merge
  • free of parallel/competing implementations
  • regression-resistant (tests + observability)

Non-negotiables

1) Scope control (no opportunistic rewrites)

  • Touch only files required to achieve the goal.
  • Do not reformat, rename, or “clean up” unrelated code.
  • Avoid broad mechanical changes unless explicitly requested.
  • Keep diffs small and intention-revealing.

2) No parallel implementations

  • Do not introduce a new pattern while leaving the old pattern active.
  • End state must be one of:
    • old path removed, OR
    • old path gated behind a feature flag with a clear removal plan (explicit TODO + tracking issue).
  • Avoid duplicate sources of truth. If ownership must move, move it once and rewire callers deterministically.

3) Preserve public contracts unless required

  • Keep public APIs stable (interfaces, model shapes, routing/public endpoints, configuration surface).
  • If a contract must change:
    • update all call sites in the same change-set
    • document the breaking change in PR notes/release notes
    • add targeted tests proving compatibility and intent

4) Refactor in safe phases

Prefer this order:

  1. Foundation: introduce the new core abstraction (e.g., manager/store/service) and wire it without changing behavior.
  2. Adoption: migrate existing call sites incrementally to the new abstraction.
  3. Lock-in: remove the old path or gate it behind a flag (default off) and make the new path the default.
  4. Cleanup: delete dead code, consolidate configuration, reduce complexity.

Never ship an ambiguous half-state where both old and new paths may run without a flag and clear routing.

5) Observability (redacted)

For flows prone to edge cases (auth, payments, retries, background/foreground, webhooks, state restoration):

  • add logs/metrics around transitions and decisions
  • never log secrets (tokens, passwords, codes, personal data)
  • log only:
    • booleans/branch decisions
    • status codes and operation names
    • hashed or truncated IDs if needed (e.g., last 4 chars)
  • ensure logs can be disabled or are appropriate for production environments

6) Tests are part of the refactor

Minimum expectations:

  • unit tests for pure logic/state transitions/mappers
  • regression tests for the bug or failure mode motivating the refactor
  • coverage for:
    • success path
    • failure path
    • concurrency/race behavior when applicable (mutex, retry, idempotency)
  • avoid brittle tests; prefer deterministic inputs/outputs and stable assertions

7) Idempotency and re-entrancy for callbacks

For events that can repeat (callbacks, deep links, webhooks, background resume):

  • handle duplicates safely
  • validate inputs before side effects
  • operations should be safe to retry without corrupting state

8) Backwards compatibility and migration safety

  • Use versioning or feature flags for behavior changes that might break existing users.
  • Provide migration steps (data migrations, config updates) in a single place.
  • If data shape changes:
    • define transitional support window
    • ensure rollback strategy (or non-destructive migrations)

9) Performance and resource safety

  • Avoid adding disk/network reads on hot paths (e.g., per-request storage reads).
  • Prefer caching with explicit invalidation when correctness requires it.
  • Ensure retries are bounded (max 1 retry unless specified) and do not create loops.

10) PR hygiene (reviewable output)

  • Prefer small, coherent commits with clear messages.
  • Avoid reordering code blocks unless necessary.
  • Include PR notes:
    • What changed
    • Why
    • How to test
    • Flags/migration steps
    • Rollback plan (if relevant)

Quick refactor checklist

  • Single source of truth after refactor
  • No stale in-memory state alongside persisted state (unless intentionally synchronized)
  • No competing interceptors/validators/plugins that overwrite each other
  • Duplicate events/callbacks are handled idempotently
  • Failure modes are explicit and do not cause silent data loss/logouts
  • Tests cover the motivating regression and key edge cases
  • Clear migration/flag/rollback notes included

Heefeg gestallte Froen

Wat mécht de KI-Skill Kotlin Kmp Refactor Safety?

Use when the task is primarily a refactor, migration, reliability hardening, or architectural cleanup of existing Kotlin Multiplatform code — scope control, behavioral preservation, migration safety, compatibility, observability, and rollback planning.

Firwat Kotlin Kmp Refactor Safety op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Kotlin Kmp Refactor Safety besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Kotlin Kmp Refactor Safety an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/mmiani/kotlin-kmp-claude-agent-skills/tree/main/skills/kotlin-kmp-refactor-safety an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Kotlin Kmp Refactor Safety benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Kotlin Kmp Refactor Safety benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Kotlin Kmp Refactor Safety domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Kotlin Kmp Refactor Safety gratis?

Jo. mmiani huet de Skill ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇