Yokai is a foundation library — claude-corp and other downstream consumers depend on its stability. The rules below are non-negotiable. Apply them on every commit, every PR, every feature.
- Never commit directly to
main. Every change starts on a branch cut frommain. - Open a PR into
mainwhen ready. - Merge with normal merge commits only. Never rebase-merge. Never squash-merge. The full commit graph is preserved on purpose — future debugging and refactoring depend on it.
- Granular and frequent. One logical change = one commit. If you're about to commit two unrelated things, split them.
- No "WIP" commits, no batched-up commits. A commit should always pass CI on its own.
- If there's any sense that "doing it the harder way will be harder now but better long-term" — do it the better way. Even if it takes more time.
- No rushed or underdeveloped solutions. No spaghetti.
- New public API gets tests. Bug fixes get a regression test that fails on the parent commit and passes on the fix.
- Prefer extracting pure helpers (e.g.
computeDraggedPos,computeResizedSize,handleDragPress) so behavior can be tested without spinning up React.
pnpm install
pnpm build # shared → renderer (always in this order)
pnpm typecheck
pnpm lint
pnpm testCI runs all four on every push and PR (.github/workflows/ci.yml). A red CI on a PR is a hard blocker — fix the underlying issue, never bypass.
Yokai follows semver:
- patch (
0.4.x) — bug fixes that don't change public API - minor (
0.x.0) — new public API, new components, new exported types - major (
x.0.0) — breaking changes (none yet on the0.xline)
@yokai-tui/renderer and @yokai-tui/shared move in lockstep — when one bumps, the other bumps to the same version. Root package.json syncs too.
Releases are cut on demand. The flow:
- Branch
release/vX.Y.Zcut frommain. - Bump version in root +
packages/renderer/package.json+packages/shared/package.json. - Open a PR with release notes summarising what's in this version (link to merged PRs by number).
- Merge the release PR.
- Tag
vX.Y.Zfrommain(git tag -a vX.Y.Z -m "..."+git push origin vX.Y.Z). - Publish a GitHub release with the same notes.
Consumers pin via git ref:
No npm publishing for now — that's an option for later if the consumer set grows beyond the current monorepo neighbours.
Read CLAUDE.md for the "things to know before changing things" — invariants in the renderer / event system / selection that are easy to break and hard to debug. Cross-reference with the relevant test files (*.test.ts(x) next to the source) before touching subtle pipeline code.