kamehadb
AGENTS.md15 starsChanged 57 days agoApache-2.0View on GitHub
This file provides guidance for coding agents working in this repository. KamehaDB is a local-first database GUI centered on a Tauri desktop app plus a local Node sidecar. The current app supports PostgreSQL, MySQL, SQLite, MongoDB, Redis, Qdrant, SQL Server, Oracle, ClickHouse, DuckDB, MariaDB, and TigerBeetle. It includes schema browsing, a Monaco SQL editor, query history, PostgreSQL stats views, schema timeline/diff workflows, Redis/Mongo/Qdrant/TigerBeetle explorers, embedded PostgreSQL and Mongo shells, PostgreSQL backup/restore flows, pgvector exploration tools, an in-app logs viewer, and…
- Installs packages
- Commits and pushes
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository17 other files it gives its agents.
- landing/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- brainstorm-featureSkill
- bump-versionSkill
- context-handoffSkill
- document-wikiSkill
- estimate-featureSkill
- implement-taskSkill
- lean-auditSkill
- plan-featureSkill
- preparing-releasesSkill
- read-codebase-contextSkill
- review-and-verifySkill
- setup-codebaseSkill
- setup-openezSkill
- systematic-debuggingSkill
- using-devkitSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
46 rules. About 0 are common, 21 are distinctive, and 25 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈21
Distinctive · estimate
This author's own choices. Worth a look.
25
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 101
If frontend and backend disagree on data shape, fix packages/shared first.
- Very specific: line 110
Default metadata DB path is ./kamehadb.db
- Very specific: line 111
If KAMEHADB_DATA_DIR is set, the DB path becomes ${KAMEHADB_DATA_DIR}/kamehadb.db
- Very specific: line 234
When changing sidecar contracts, verify both packages/shared types and desktop usage
- Distinctive: line 235
When changing desktop UI behavior, prefer running the desktop tests and a targeted app build
- Very specific: line 245
If a bundled workflow fails only in the built app, check the in-app Logs page first, then inspect ${KAMEHADB_DATA_DIR}/logs/ if you need …
- Very specific: line 250
Import the shared pino logger: import { log } from '../lib/logger.js'.
- Very specific: line 251
Use log.info(), log.warn(), log.error(), log.debug() instead of console.log() / console.warn() / console.error().
- Distinctive: line 283
Push Back: If a simpler approach exists or the requested path is flawed, suggest an alternative.
- Distinctive: line 284
Clarify First: If a request is unclear, stop and name the specific confusion.
- Distinctive: line 289
No Over-Abstraction: Avoid abstractions for single-use code.
- Distinctive: line 290
Surgical Error Handling: Do not add error handling for impossible scenarios.
- Distinctive: line 291
Aggressive Simplification: If a solution is overcomplicated, rewrite it to be simpler.
- Distinctive: line 295
Zero Collateral Damage: Do not "improve" adjacent code, comments, or formatting.
- Distinctive: line 297
Orphan Cleanup: Remove imports/variables that YOUR changes made unused.
- Distinctive: line 298
Traceability: Every changed line must trace directly back to the user's request.
- Distinctive: line 304
Verification Gate: No task is "done" until success criteria are verified via tool output.
- Very specific: line 308
Rule: ALWAYS use the shadcn UI components from apps/desktop/src/components/ui/ instead of raw HTML elements when an equivalent exists.
- Very specific: line 322
Rule: Never hardcode database kind strings (e.g.
- Very specific: line 323
Use
KINDfrom@kamehadb/shared: All database kind comparisons must use KIND.POSTGRES, KIND.MYSQL, etc. - Very specific: line 324
Use
DEFAULT_PORTS: All port numbers must come from DEFAULT_PORTS[KIND.X] — never hardcode 5432, 3306, etc. - Very specific: line 325
Use timeout constants: All timeouts, cache durations, and intervals must use named constants from apps/sidecar/src/lib/constants.ts or …
- Very specific: line 326
Use
ALL_KINDS,SQL_KINDS,NOSQL_KINDS: When iterating over or validating database kinds, use these arrays — never inline a list of … - Very specific: line 329
Zod enums: Use z.enum(ALL_KINDS as [string, ...string[]]) — never inline a list of kind string literals.
- Distinctive: line 336
Rule: Every non-trivial function, hook, or block of logic must carry a short comment that explains the what (one line), the why (one line …
- Very specific: line 354
Package Manager: ALWAYS use pnpm for this project, except for the landing/ directory which is managed via npm.
- Very specific: line 355
Changelog: All user-facing changes must be recorded in CHANGELOG.md under [Unreleased] before merging.
- Distinctive: line 359
When a feature wave adds new engines, major workflows, or changes the product descriptor, sync these five surfaces in the same PR so they …
- Very specific: line 367
Run npm --prefix landing run build and pnpm build after any landing or README change to confirm nothing is broken.
- Distinctive: line 369
After every material product change, run through this list before merging.
- Distinctive: line 378
If the same shape appears in two places, extract it into a shared type or helper
- Very specific: line 384
Use interface for object shapes, type for unions, mapped types, and utility compositions
- Very specific: line 385
Never use any — use unknown and narrow with type guards
- Distinctive: line 389
Prefer string literal unions over enums:
- Distinctive: line 395
When a value can be one of several shapes, model it as a discriminated union (see below)
- Distinctive: line 418
Use a literal "tag" field so the compiler narrows automatically:
- Very specific: line 438
Use kind, type, or status as the discriminator field — pick one and stay consistent
- Very specific: line 439
Use as const on values that feed the union so literal types are preserved
- Distinctive: line 481
Place the comment above the line it explains, not as a trailing line
- Distinctive: line 482
Use full sentences with proper punctuation.
- Distinctive: line 511
Use a skill when its description matches the task.
- Very specific: line 517
Before code work in a new session, call memory_recall using 1–3 keywords from the task.
- Very specific: line 518
Use code_query before filesystem search.
- Very specific: line 519
Use code_context for symbol/file relationships.
- Very specific: line 520
Call memory_write after an architectural decision or a non-obvious constraint is confirmed.
- Distinctive: line 521
Use explicit workspace scope for cross-workspace work.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
This file provides guidance for coding agents working in this repository.
Project Overview
KamehaDB is a local-first database GUI centered on a Tauri desktop app plus a local Node sidecar. The current app supports PostgreSQL, MySQL, SQLite, MongoDB, Redis, Qdrant, SQL Server, Oracle, ClickHouse, DuckDB, MariaDB, and TigerBeetle. It includes schema browsing, a Monaco SQL editor, query history, PostgreSQL stats views, schema timeline/diff workflows, Redis/Mongo/Qdrant/TigerBeetle explorers, embedded PostgreSQL and Mongo shells, PostgreSQL backup/restore flows, pgvector exploration tools, an in-app logs viewer, and an AI chat panel with schema-aware context.
There is also a separate marketing/docs site in landing/, but it is not part of the pnpm workspace used by the desktop app and sidecar.
Repository Layout
├── apps/
│ ├── desktop/ # Tauri v2 + React 19 desktop app
│ └── sidecar/ # Hono HTTP server + DB adapters + metadata SQLite
├── packages/
│ ├── shared/ # Shared Zod schemas, app state types, adapter contracts
│ └── ui/ # Shared UI utilities/components
├── landing/ # Separate Next.js marketing site (not in pnpm workspace)
├── docker-compose.yml # Local dev databases
└── docker-init/ # Seed SQL for Postgres/MySQL/MariaDBWorkspace And Package Boundaries
- The pnpm workspace includes only
apps/*andpackages/*. landing/has its ownpackage-lock.jsonand is managed separately with npm.- Most root scripts target the pnpm workspace only. Do not assume they affect
landing/unless they explicitly usenpm --prefix landing. - Landing site image generation: use
node scripts/capture-images.mjsto update the AI Compare panel screenshots inpublic/images/. - Landing animated OG image: use
npm --prefix landing run render:ogto regeneratepublic/og-animated.gif(requiresffmpeg-static, runs locally — not a Vercel runtime route).
Commands
Workspace root
# Install workspace dependencies
pnpm install
# Start dev databases
docker compose up -d
# Run sidecar + desktop together
pnpm dev
# Run only the desktop app
pnpm dev:desktop
# Run only the sidecar
pnpm dev:sidecar
# Build shared -> sidecar -> desktop
pnpm build
# Typecheck all workspace packages
pnpm typecheck
# Lint all workspace packages that expose a lint script
pnpm lint
# Run all workspace package tests that expose a test script
pnpm test
# Run Tauri CLI in the desktop package
pnpm tauriImportant package-level scripts
# Desktop app
pnpm --filter @kamehadb/desktop dev
pnpm --filter @kamehadb/desktop build
pnpm --filter @kamehadb/desktop test
pnpm --filter @kamehadb/desktop tauri build
# Sidecar
pnpm --filter @kamehadb/sidecar dev
pnpm --filter @kamehadb/sidecar build
pnpm --filter @kamehadb/sidecar start
# Landing site
npm --prefix landing run dev
npm --prefix landing run build
npm --prefix landing run lint
node landing/scripts/capture-images.mjs # Regenerate AI compare panelsCurrent Architecture
Shared contract
packages/shared/src/index.ts is the source of truth for:
- Connection profile schemas and validation
- SQL, Redis, MongoDB, and AI-related types
- App store state and workspace tab types
SqlAdapterand related contracts
If frontend and backend disagree on data shape, fix packages/shared first.
Sidecar
apps/sidecar/src/index.ts starts a Hono server on 127.0.0.1, default port 3170.
Key details:
- Metadata is stored in a local SQLite database via
better-sqlite3 - Default metadata DB path is
./kamehadb.db - If
KAMEHADB_DATA_DIRis set, the DB path becomes${KAMEHADB_DATA_DIR}/kamehadb.db - Runtime logs are also written under
${KAMEHADB_DATA_DIR}/logs/when the app data dir is available - The sidecar prints
KAMEHADB_SIDECAR_PORT=<port>on startup
Current route groups:
/connectionsfor saved connection profiles and connection health checks/sqlfor SQL metadata, query execution, preview rows, autocomplete, and PostgreSQL stats/query-historyfor saved SQL history and favorites/mongofor MongoDB databases, collections, documents, stats, update/delete/redisfor key scanning, value lookup, TTL lookup, and connection testing/qdrantfor vector collections, point browsing, search, recommend, and stats/tigerbeetlefor accounts, balances, and transfers/aifor provider settings, chat, schema cache, and chat history
Important sidecar internals:
apps/sidecar/src/db/metadata-store.tspersists connections, AI settings, and chat historyapps/sidecar/src/lib/cache.tscaches schema and metadata resultsapps/sidecar/src/lib/sql-safety.tscontains SQL safety helpers used by the backendapps/sidecar/src/lib/mongosh.tsresolves a localmongoshbinary or installs an app-managed copy under the app data directoryapps/sidecar/src/lib/logger.tsexports the shared pino logger (log) for the entire sidecar. All sidecar code must importlogfrom this module instead of usingconsole.log.apps/sidecar/src/ai/contains provider abstraction and schema-context generation
Desktop app
apps/desktop/src/App.tsx drives the top-level app views (workspace, api-settings, logs) and the tabbed workspace.
Design system tokens and conventions are documented in apps/desktop/DESIGN-SYSTEM.md.
Main areas:
components/sidebar.tsxfor connection and schema navigationcomponents/workspace-screen.tsx,components/workspace-tab-bar.tsx, andcomponents/workspace-content.tsxfor tab orchestrationcomponents/sql-editor.tsxfor Monaco query editing and executioncomponents/table-view.tsxfor SQL table browsingcomponents/schema-graph.tsxfor ER diagramscomponents/schema-timeline.tsx,components/schema-diff-view.tsx, andcomponents/migration-assistant.tsxfor schema change workflowscomponents/database-stats.tsxandcomponents/table-stats.tsxfor PostgreSQL metricscomponents/postgres-psql-tab.tsx,components/postgres-backup-dialog.tsx, andcomponents/postgres-restore-dialog.tsxfor PostgreSQL maintenance workflowscomponents/postgres-vector-query.tsxandcomponents/postgres-vector-map.tsxfor pgvector search and map viewscomponents/mongo-view.tsx,components/mongo-shell.tsx,components/redis-view.tsx,components/qdrant-view.tsx,components/qdrant-query.tsx,components/qdrant-vector-map.tsx,components/qdrant-stats.tsx, andcomponents/tigerbeetle-explorer.tsxfor non-SQL enginescomponents/query-history-panel.tsxfor saved SQL history/favoritescomponents/logs-page.tsxfor viewing frontend, Tauri, and sidecar logs inside the appcomponents/ai-chat-panel.tsxandcomponents/api-settings-page.tsxfor AI
State and data flow:
apps/desktop/src/store/index.tsuses TanStack Store for workspace stateapps/desktop/src/hooks/contains TanStack Query-based data hooksapps/desktop/src/lib/api.tstalks to the sidecar athttp://127.0.0.1:3170by defaultapps/desktop/src/lib/sql-autocomplete.tscontains client-side SQL completion logicapps/desktop/src/lib/app-logs.tssends frontend errors to Tauri and reads the combined log snapshot for the Logs pageapps/desktop/src-tauri/src/contains native commands for app logs, PostgreSQLpsql, and PostgreSQL backup/restore jobs
Database Support
Supported now:
- PostgreSQL
- MySQL
- SQLite
- MongoDB
- Redis
- Qdrant
- SQL Server
- Oracle
- ClickHouse
- DuckDB
- TigerBeetle
- MariaDB
Notes:
- PostgreSQL has the richest stats support.
- PostgreSQL, MySQL, MariaDB, SQLite, SQL Server, Oracle, ClickHouse, and DuckDB use the SQL adapter path.
- MongoDB uses a dedicated route and adapter flow.
- Redis uses a dedicated route and adapter flow, not the SQL route.
- Qdrant uses a dedicated route and adapter flow for collections, points, similarity search, recommend, and stats.
- DuckDB connects to local .duckdb files (file-based).
- TigerBeetle uses a dedicated adapter and connects to a local or remote TigerBeetle cluster.
- PostgreSQL also has app-managed
psql, backup, restore, schema diff/timeline, and pgvector workflows on the desktop side. - MongoDB can open an embedded
mongoshsession; ifmongoshis missing locally, the sidecar can install an app-managed copy without modifying the user's global installation.
Connection Defaults For Docker
| Engine | Port | User | Password | Database |
| PostgreSQL | 5432 | kameha | kameha | kamehadb |
| MySQL | 3306 | kameha | kameha | kamehadb |
| MariaDB | 3307 | kameha | kameha | kamehadb |
| Redis | 6379 | — | — | — |
| SQL Server | 1433 | sa | Kameha1! | kamehadb |
| Oracle | 1521 | SYS | oracle | ORCLPDB1 |
| ClickHouse | 8123 | default | default | kamehadb |
| DuckDB | 5432 | — | — | — |
| TigerBeetle | 3001 | — | — | — |
TigerBeetle Initialization
TigerBeetle requires a one-time format step before first start. The docker-compose entrypoint auto-detects missing data files and runs format automatically.
To seed sample data (accounts + transfers):
docker compose up -d tigerbeetle # Start (auto-formats if first run)
pnpm seed:tigerbeetle # Create sample accounts + transfersOr from the sidecar package:
pnpm --filter @kamehadb/sidecar seed:tigerbeetleOverride connection with env vars: TB_HOST, TB_PORT, TB_CLUSTER_ID.
Testing And Verification
pnpm testcurrently depends mainly on workspace packages that expose atestscript- The desktop package uses
vitest run - Native desktop changes should also be verified with
cargo test --quietinapps/desktop/src-tauriwhen they touch Tauri commands or Rust-side process management - CI currently runs
pnpm typecheck,pnpm --filter @kamehadb/desktop test,pnpm build, and a fulltauri build - When changing sidecar contracts, verify both
packages/sharedtypes and desktop usage - When changing desktop UI behavior, prefer running the desktop tests and a targeted app build
Logs And Diagnostics
- The desktop app exposes a built-in Logs page that reads frontend, Tauri, and sidecar logs from one place.
- Frontend runtime errors are forwarded through
apps/desktop/src/lib/app-logs.tsinto the Tauri log store. - Sidecar logs are produced by pino via
apps/sidecar/src/lib/logger.tsand persisted to${KAMEHADB_DATA_DIR}/logs/sidecar.log(or<workspace>/logs/sidecar.login dev mode whenKAMEHADB_DATA_DIRis unset). - Tauri logs are written by Rust code via
append_tauri_log()inapps/desktop/src-tauri/src/app_logs.rsto${app_data_dir}/logs/tauri.log. - The Tauri command
read_app_logsinapp_logs.rsreads all three log files (frontend.log,tauri.log,sidecar.log) from${app_data_dir}/logs/and merges them into a single snapshot. - In dev mode (
pnpm dev, Vite browser without Tauri runtime),readAppLogs()falls back to localStorage and only frontend logs are visible. Tauri and sidecar logs require the built Tauri app. - If a bundled workflow fails only in the built app, check the in-app Logs page first, then inspect
${KAMEHADB_DATA_DIR}/logs/if you need the raw files.
Sidecar Logger Usage
- Never use
console.login sidecar code. ESLint enforces this vialocal/no-restricted-syntax. - Import the shared pino logger:
import { log } from '../lib/logger.js'; - Use
log.info(),log.warn(),log.error(),log.debug()instead ofconsole.log()/console.warn()/console.error(). - The only exception is
console.log('KAMEHADB_SIDECAR_PORT=...')inindex.tswhich is intentionally stdout for Tauri to parse the port — it has an inlineeslint-disablecomment. - Pino writes to both stdout and
${KAMEHADB_DATA_DIR}/logs/sidecar.logvia multistream. - The Tauri Rust side parses pino's JSON output from
sidecar.log(seeparse_sidecar_log_lineinapp_logs.rs).
Release Workflow
The checked-in GitHub workflow is .github/workflows/release.yml.
Key facts:
- Releases are triggered by tags matching
v* workflow_dispatchexpects an existing tag input- The workflow creates a draft GitHub release, then builds platform bundles, then uploads assets
- Expected uploaded assets are
.dmg,.exe,.msi,.deb,.AppImage, and.rpm - GitHub still adds source archives automatically; those are not the installable app bundles
Typical release flow:
git push origin <branch>
git tag v0.1.0-rc.1
git push origin v0.1.0-rc.1Behavioral Guidelines
These guidelines prioritize caution and precision over speed.
1. Think Before Coding
- No Assumptions: Surface tradeoffs explicitly. If uncertain or multiple interpretations exist, ask before picking.
- Push Back: If a simpler approach exists or the requested path is flawed, suggest an alternative.
- Clarify First: If a request is unclear, stop and name the specific confusion.
2. Simplicity First
- Minimum Viable Code: Implement only what is asked. No speculative features or "future-proofing."
- No Over-Abstraction: Avoid abstractions for single-use code.
- Surgical Error Handling: Do not add error handling for impossible scenarios.
- Aggressive Simplification: If a solution is overcomplicated, rewrite it to be simpler.
3. Surgical Changes
- Zero Collateral Damage: Do not "improve" adjacent code, comments, or formatting.
- Style Match: Match the existing codebase style strictly, even if you prefer another pattern.
- Orphan Cleanup: Remove imports/variables that YOUR changes made unused. Do not touch pre-existing dead code unless asked.
- Traceability: Every changed line must trace directly back to the user's request.
4. Goal-Driven Execution
- Verifiable Goals: Transform "fix bug" into "write reproducing test $\rightarrow$ make it pass."
- Structured Plans: For multi-step tasks, define:
[Step] $\rightarrow$ verify: [check]. - Verification Gate: No task is "done" until success criteria are verified via tool output.
5. Always Use shadcn Components
- Rule: ALWAYS use the shadcn UI components from
apps/desktop/src/components/ui/instead of raw HTML elements when an equivalent exists. - Available components (in
ui/):Button,Input,Textarea,Label,Select(+ parts),Table(+ parts),Card,Badge,Dialog,Sheet,DropdownMenu,Tabs,Tooltip,ScrollArea,Progress,Separator,Command,Sonnertoaster. - Mapping:
<input>→<Input><textarea>→<Textarea><label>→<Label><button>→<Button>(usevariant/sizeprops, not bespoke className hacks)<select>→<Select>+<SelectTrigger>+<SelectContent>+<SelectItem>+<SelectValue><table>/<thead>/<tbody>/<tr>/<th>/<td>→<Table>/<TableHeader>/<TableBody>/<TableRow>/<TableHead>/<TableCell>
- No new shadcn components without a shadcn CLI install — if a shadcn component does not exist in
ui/, install it via the shadcn CLI before using it; never hand-roll a parallel component. - Acceptable exceptions (document the reason inline): buttons required by a third-party library (e.g. React Flow's
<Controls>), elements with requiredroleattributes that shadcn doesn't expose (e.g.role="switch"toggles).
6. No Magic Strings or Numbers
- Rule: Never hardcode database kind strings (e.g.
'postgres','mysql'), port numbers, timeout values, or cache durations as literals in application code. Always use the shared constants. - Use
KINDfrom@kamehadb/shared: All database kind comparisons must useKIND.POSTGRES,KIND.MYSQL, etc. — never raw string literals. - Use
DEFAULT_PORTS: All port numbers must come fromDEFAULT_PORTS[KIND.X]— never hardcode5432,3306, etc. - Use timeout constants: All timeouts, cache durations, and intervals must use named constants from
apps/sidecar/src/lib/constants.tsorapps/desktop/src/lib/constants.ts— never inline5000,30000, etc. - Use
ALL_KINDS,SQL_KINDS,NOSQL_KINDS: When iterating over or validating database kinds, use these arrays — never inline a list of kind strings. - Use helper functions:
isSqlKind(),isNoSqlKind(),isPasswordRequired(),isFileDatabaseKind()— never write manualkind === 'postgres' || kind === 'mysql'chains. - Use
PROTOCOL_ALIASES: For URL protocol parsing, use the sharedPROTOCOL_ALIASESmap — never hardcode'postgresql'or'rediss'. - Zod enums: Use
z.enum(ALL_KINDS as [string, ...string[]])— never inline a list of kind string literals. - SQL CHECK constraints: Generate from
ALL_KINDS— never inline a list of kind string literals. - Exception: String literals inside SQL query text (e.g.
'mysql' AS applicationName) are SQL values, not DbKind comparisons — these are acceptable. - Exception: Minor query config values like
retry: 1are not considered magic numbers.
7. Always Comment Non-Trivial Code (How / Why / What)
- Rule: Every non-trivial function, hook, or block of logic must carry a short comment that explains the what (one line), the why (one line of intent / tradeoff), and the how only when the mechanism is non-obvious.
- What is "non-trivial": anything that isn't a one-liner that re-states its name. Trivial
return x + 1lines don't need a comment. A new function, a hook, a state machine, a tricky expression, a side effect, a workaround — these all do. - Comment style (match the existing project style; short, plain prose):
// Resize a column by direct DOM mutation during the drag for smoothness, // then commit the final pixel width to React state on mouseup so re-renders // only happen once per drag. (How / Why / What) - Bad: comments that just repeat the function name (
// Increments counter), comments that lie, comments without intent ("TODO" without context). - Good: comments that name the tradeoff, call out a workaround, or document a non-obvious invariant.
- No section-header comment walls — keep comments tight and attached to the code they describe.
File Search
For any file search or grep in the current git-indexed directory, use fff tools (ffgrep, fffind) instead of glob or grep. fff is the MCP server at ~/.local/bin/fff-mcp — it's faster, supports smart-case with fuzzy fallback, frecency-ranked results, and git-aware annotations.
Operational Rules
- Package Manager: ALWAYS use
pnpmfor this project, except for thelanding/directory which is managed vianpm. - Changelog: All user-facing changes must be recorded in
CHANGELOG.mdunder[Unreleased]before merging.
Public-Surface Drift Prevention
When a feature wave adds new engines, major workflows, or changes the product descriptor, sync these five surfaces in the same PR so they do not drift:
landing/src/components/home-view.tsx— hero copy, engine carousel, feature cards, Compare panel screenshotslanding/src/app/layout.tsx—<title>,<meta name="description">, keywords, OG/Twitter metadatalanding/src/app/opengraph-image.tsx— the active OG image source; regenerate the animated asset withlanding/scripts/render-og-animated.mjsintolanding/public/og-animated.giflanding/public/images/— Compare panel screenshots (sql-panel.png,chat-panel.png, plus any new ones)README.md— one-liner, feature list, engine table, install docs
Run npm --prefix landing run build and pnpm build after any landing or README change to confirm nothing is broken.
After every material product change, run through this list before merging.
TypeScript Coding Standards
These rules apply to all TypeScript code in apps/, packages/, and landing/.
No Code Duplication
- Reuse Zod schemas and types from
packages/shared/src/index.ts— it is the source of truth - If the same shape appears in two places, extract it into a shared type or helper
- For logic duplicated across desktop and sidecar, promote it to
packages/sharedor a co-located utility
Use Types
- Annotate exported functions, public APIs, and component props explicitly
- Use
interfacefor object shapes,typefor unions, mapped types, and utility compositions - Never use
any— useunknownand narrow with type guards
Use Union Types
Prefer string literal unions over enums:
type QueryStatus = 'idle' | 'running' | 'success' | 'error';- When a value can be one of several shapes, model it as a discriminated union (see below)
Emit Type When Possible
Derive types from values so runtime and types stay in sync:
// typeof for object literals
const ADAPTER_LIMITS = { postgres: 100, mysql: 50 } as const;
type AdapterLimits = typeof ADAPTER_LIMITS;
// ReturnType / Awaited for function and promise return types
type Connection = Awaited<ReturnType<typeof loadConnection>>;
// z.infer for Zod schemas
const connectionSchema = z.object({ host: z.string(), port: z.number() });
type ConnectionInput = z.infer<typeof connectionSchema>;This avoids drift between the schema and the type.
Discriminated Unions
Use a literal "tag" field so the compiler narrows automatically:
type SqlResult =
| { kind: 'rows'; columns: string[]; rows: unknown[][] }
| { kind: 'affected'; count: number }
| { kind: 'error'; message: string };
function format(result: SqlResult): string {
switch (result.kind) {
case 'rows':
return `${result.rows.length} rows`;
case 'affected':
return `${result.count} affected`;
case 'error':
return result.message;
}
}- Use
kind,type, orstatusas the discriminator field — pick one and stay consistent - Use
as conston values that feed the union so literal types are preserved - Exhaustive
switchwith aneverdefault catches missed branches at compile time
Code Comments
For code that is long or has moderate-to-high complexity, add clear comments. Trivial code stays uncommented — match the existing density in the file.
When To Comment
- A function or block runs past ~30 lines
- Logic has non-obvious branches, side effects, or invariants
- Magic numbers, regex, or domain-specific constants appear
- Async, timing, retry, or concurrency behavior is hard to follow
- The reader would have to hold more than 2–3 things in their head at once
What To Write
- Why the code exists or why this approach was chosen
- Non-obvious invariants: "this list is always sorted by
createdAtdesc" - Correctness or performance tradeoffs the code encodes
- Pointer to the ticket, spec, or external constraint that drove the decision
What To Skip
- Restating what the code does in English
- Section banners like
// ============ Validation ============ - Comments that just rename a variable or repeat the line below
// GOOD: explains the why
// SQLite returns BigInt for INTEGER columns; clamp to MAX_SAFE_INTEGER
// to avoid JSON serialization precision loss above 2^53.
const id = Number(row.id % Number.MAX_SAFE_INTEGER);
// BAD: restates the what
// Convert id to number
const id = Number(row.id);Style
- One short line per comment is the default; multi-line only when truly needed
- Place the comment above the line it explains, not as a trailing line
- Use full sentences with proper punctuation; no "TODO later" or "fix me" leftovers
Agent Devkit Skills
This repo uses Agent Devkit for shared agent workflows. Skills live in .agents/skills/; using-devkit routes each task to its owning workflow. The bump-version and preparing-releases skills are repository-specific and remain alongside the Devkit set.
Available Agent Devkit Skills
| Skill | Use |
using-devkit | Select the owning workflow skill |
brainstorm-feature | Clarify new, ambiguous, or behavior-changing requests |
plan-feature | Plan approved non-trivial designs |
implement-task | Implement an approved bounded task or plan |
read-codebase-context | Trace code, callers, dependencies, and tests |
systematic-debugging | Investigate bugs, failures, and unexpected behavior |
review-and-verify | Review diffs and verify changes |
setup-codebase | Set up repository context and conventions |
setup-openez | Set up or refresh OpenEZ when needed |
document-wiki | Create or refresh the LLM-facing wiki |
lean-audit | Audit the repository for unnecessary complexity |
estimate-feature | Estimate work from an implementation plan |
context-handoff | Prepare a handoff when work must pause |
Repository-Specific Skills
bump-version— update the app version and changelog.preparing-releases— prepare and verify a desktop release.
Use a skill when its description matches the task. User instructions and this file take precedence over skills.
<!-- openez:start -->OpenEZ workflow
- Before code work in a new session, call
memory_recallusing 1–3 keywords from the task. - Use
code_querybefore filesystem search. - Use
code_contextfor symbol/file relationships. - Call
memory_writeafter an architectural decision or a non-obvious constraint is confirmed. - Use explicit workspace scope for cross-workspace work.
<!-- openez:end -->Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

