Skip to content

Latest commit

 

History

History
70 lines (64 loc) · 7.19 KB

CLAUDE.md

File metadata and controls

70 lines (64 loc) · 7.19 KB

koppter — instructions for Claude

Session protocol

  • Session history lives in git commit messages: subject line plus a short paragraph on what and why.
  • PLAN.md in the root of the long-lived experimental worktree is the working plan (untracked). A per-task worktree has no copy of its own; read and tick it there. Read it first, continue at the first unchecked item, tick items as they are completed.

Conventions

  • Gate: ./gradlew build traceRequirements must be green before every commit. The build runs on JDK 25 (gradle/gradle-daemon-jvm.properties, generated by ./gradlew updateDaemonJvm --jvm-version=25) and compiles for it (jvmToolchain(25)); Gradle provides that JDK.
  • Branches: commit and push to experimental after every change; no pull requests, except those that Dependabot opens against experimental for new versions of dependencies and actions. The daily release workflow (.github/workflows/release.yml) merges experimental into main, tags the release and publishes it on GitHub with its changelog section, the signed Android APK and the desktop packages — sessions do not merge into main or tag by hand.
  • Git: when a push is rejected, git pull --no-rebase. Never rebase.
  • Changelog: CHANGELOG.md in Keep a Changelog format with CalVer releases (decision 0002). Every user-visible change adds a bullet under ## [Unreleased]; released sections are never edited. Check: jbang heylogs@nbbrd check CHANGELOG.md.
  • Requirements: OpenFastTrace in docs/requirements/, chain feat → req → dsn → impl/utest (decision 0003). New behavior means a new or updated specification item and the covering tags in the same commit. An item gains its Needs: line in the commit that adds the covering item.
  • Decisions: MADR in docs/decisions/ with honest considered options. Each record defines an adr~<slug>~1 item directly below its title, covered by dsn items or by impl tags. Check: jbang madrlint@adr/madrlint --no-warn 11,12 <file> (needs Java 25).
  • Markdown: one sentence per line. Check: npx markdownlint-cli2.
  • Spelling: typos (configuration in .typos.toml), and aspell for the Markdown files in American English. A name or term that it does not know goes into .aspell.en.pws, whose first line states the number of words. Check: for f in $(git ls-files '*.md'); do aspell --mode=markdown -l en_US --encoding=utf-8 -p ./.aspell.en.pws list < "$f" | sort -u | sed "s|^|$f: |"; done prints nothing.
  • Prose in documents, comments, commit messages and UI texts: precise and sober, no marketing language.
  • Code comments explain a non-obvious why, not the what.
  • Kotlin, official code style, package io.github.koppor.koppter. :core commonMain stays free of JVM APIs; dates are kotlinx.datetime.LocalDate, and "today" is always passed in.
  • Tests: unit tests for logic in :core (kotlin.test); Compose UI tests for UI behavior.
  • User interface: a change that a user can see follows .claude/skills/ux-review/SKILL.md, before it is written and before it is committed: the questions about the flow, the settled rules, the screens at the size of a phone and of a laptop, and a reviewer that sees only the images.
  • License is MIT: no strong-copyleft dependencies.

Architecture

  • :core — Kotlin Multiplatform, JVM target. commonMain: todo.txt model, parser, filter, sort, storage interface, settings. commonMain plan: time maps, barriers, planner (tasks with at: keep their time, decision 0021; tt: adds travel blocks, decision 0023), calendar.txt and iCalendar writer (decision 0019); the todo.txt file leads and planning never changes it. commonMain sync: mergeLines (three-way line merge), taskDates (dates from history). jvmMain: file storage, settings file, GitStorage (JGit; used automatically when the file lies in a git working tree), GitSetup (SSH key, known hosts and clone for devices without ~/.ssh). JGit types stay out of the public API of :core. KOPPTER_SSH_TEST_URL=git@github.com:owner/repo.git ./gradlew :core:jvmTest --tests '*SshRemoteTest*' checks SSH against a real server.
  • :app — Compose Multiplatform. commonMain: all screens and TodoController (state and operations). desktopMain: entry point. desktopTest: UI tests (runComposeUiTest, headless); ScreenshotTest writes app/build/screenshots/. The README shows copies in docs/screenshots/: after a change of the user interface, run ./gradlew :app:desktopTest --tests '*ScreenshotTest*' and copy the images there. The tasks in that test are invented; never put real data into it. Android library target: compiled from the same commonMain. The icon is drawn in docs/logo.svg; after a change, export it with inkscape docs/logo.svg -w 256 -o app/src/desktopMain/resources/koppter.png repeat the paths in android/src/icon/res/drawable/ic_launcher_foreground.xml and android/src/main/res/drawable/ic_notification.xml, and run app/packaging/icons.sh for the icons of the desktop packages. just run-loop (scripts/run-loop.sh, .cmd) runs the application from the checkout; its exit code 55, from Restart to update, makes the loop pull, build and start it again. ./gradlew :app:packageDistributionForCurrentOS builds the package of the system it runs on (deb, msi or dmg) into app/build/compose/binaries/.
  • :android — the Android application: MainActivity, DocumentStorage (file behind a content: URI), FolderStorage (folder behind one, with the files next to todo.txt). The dialogs for a file and a folder come from FileKit, on the desktop as well (decision 0036). Not run on a device or emulator in development sessions; say so when reporting Android changes. CI signs the release APK with the key from the secrets SIGNING_KEYSTORE_BASE64 and SIGNING_KEYSTORE_PASSWORD (decision 0010); the key store itself is never committed.
  • :wear — the application for a watch with Wear OS (decision 0048): one activity with Wear Compose and a tile, fed by Watch.kt of :android through the Data Layer. It has the application id and the signature of :android and shares its launcher icon (android/src/icon/res). The paths and keys of the Data Layer stand in both modules; the two are installed apart, so a released name stays and an addition is optional. Not run on a device or emulator either.
  • Files next to todo.txt (notes/, ice_recur.txt, koppter.yml, calendar.txt, calendar.ics, timelog.txt) go through CompanionFiles; GitStorage commits them with the next todo.txt change.
  • skills/ holds skills for agents that work on a todo.txt file of a user, not on this repository. A change of the todo.txt notation or of ice_recur.txt also changes skills/koppter-tasks; its evals/ hold test cases in the layout of claude plugin eval. The skills for sessions that work on this repository are in .claude/skills/.
  • UI elements carry a testTag; colors come from MaterialTheme.colorScheme, never from literals; Theme.kt builds the scheme from the palettes (decision 0015).
  • The file is the data store. A line that the user did not edit is written back unchanged.