Imported from wspulse/client-kt (
AGENTS.md). Install upstream withnpx skills add wspulse/client-kt. Copyright stays with the author.
AGENTS.md — wspulse/client-kt
This file is the entry point for all AI coding agents (GitHub Copilot, Codex,
Cursor, Claude, etc.). Full working rules are in
.github/copilot-instructions.md — read it completely before
making any changes.
Quick Reference
Maven coordinates: com.github.wspulse:client-kt (via JitPack) | Package: com.wspulse.client
Key files:
WspulseClient.kt—Clientinterface,WspulseClient.connect()factory,readLoop/writeLoop/reconnectLoop/pingLoopcoroutinesClientConfig.kt— Builder DSL for configurationCodec.kt—Codecinterface,WireTypeenum,JsonCodecdefaultMessage.kt—data class Message(event, payload)Errors.kt—sealed class WspulseExceptionhierarchyBackoff.kt—backoff(attempt, base, max)with equal jitter
Pre-commit gate: make check (lint → test)
Non-negotiable Rules
- Read before write — read the target file before any edit.
- Coroutine safety —
send()andclose()must be safe for concurrent use from any coroutine or thread. - Coroutine lifecycle — every launched coroutine must have an explicit exit
condition.
close()must guarantee all child coroutines have completed. - No breaking changes without version bump.
- No hardcoded secrets.
- Minimal changes — one concern per edit; no drive-by refactors.
Session Protocol
doc/local/is git-ignored. Never commit files under it.
- Start of session: read
doc/local/ai-learning.mdin full (create with header if missing) and checkdoc/local/plan/for any in-progress plan. - Feature work: save plan to
doc/local/plan/<feature-name>.mdbefore starting. - End of session: append at least one entry to
doc/local/ai-learning.md— mandatory even if no mistakes were made. An empty file proves the session protocol was ignored. Format:Date/Issue or Learning/Root Cause/Prevention Rule.
