

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# Chat2DB Community Agent Contract23## Context45This file applies to the entire repository. Chat2DB Community is a Java 17,6Spring Boot, Maven, React, TypeScript, and Umi application distributed as a web7application, Docker image, and JCEF desktop package.89The current repository is the source of truth for current behavior. A user10request can define a desired behavior change, but it does not turn a historical11assumption into fact or grant permission for an unrelated external action.1213Instruction authority and factual evidence are separate:1415- Follow applicable higher-level instructions, then the nearest scoped16 `AGENTS.md`, then the latest user request. At the same authority level, the17 newer explicit instruction wins.18- For current checkout behavior, prefer current source and tests, then19 repository-local workflows and scripts, and then documentation. For current20 runtime state, live evidence wins only after the process `cwd`, artifact,21 branch/ref, or equivalent provenance ties it to the intended checkout.22 Unproven processes from another checkout do not override source facts.23 Prior memory or subagent reports rank below inspected evidence; inference is24 last.25- Treat prior memory and subagent output as potentially stale leads. Verify26 consequential claims against this checkout and never let memory authorize a27 mutation or external action.28- Do not write durable memory about the repository unless the user explicitly29 asks for it. Never carry secrets or user data into memory.3031### Product invariants3233- Backend Community behavior is selected by34 `-Dchat2db.runtime.mode=community`.35- Frontend Community behavior is selected by `UMI_ENV=community`.36- `-Dchat2db.finalName=chat2db-community` changes the artifact name only; it is37 not a runtime-mode signal.38- Community desktop/package scripts and the documented local backend command39 bind `127.0.0.1:10825`. The Community frontend dev server uses port `8889`40 and proxies to that backend. `application-dev.yml` sets only port `10825`, so41 local launchers must pass the address when loopback-only behavior is required.42- The Docker container intentionally listens on `0.0.0.0:10825` internally;43 Compose limits the default host publication to `127.0.0.1:10825`.44- Packaged Community desktop runtime is offline-first and local: keep45 `-Dchat2db.network.status=OFFLINE`, loopback binding, Community identity, and46 Community storage paths intact unless the task explicitly changes the47 product contract.48- Do not reintroduce Enterprise Gateway forwarding, cloud account,49 subscription, payment, commercial license, Local-edition packaging, or50 Electron runtime paths into Community code.51- Community desktop supports in-app updates. Keep the renderer update UI and52 state, JCEF update handlers, updater metadata, packaged payloads, and Windows53 elevated updater helper aligned when changing the release format.54- Do not treat hidden frontend UI as backend isolation. Remote calls, headers,55 cookies, controllers, and service registration must also be Community-safe.56- Preserve public API, storage, datasource, namespace, console, task, pin,57 operation-log, and ER-position semantics unless an explicit compatibility or58 migration change is requested.5960### Repository map6162- `chat2db-community-client/`: Umi/React frontend and JCEF renderer bridge.63- `chat2db-community-server/`: Maven reactor containing domain, storage, web,64 JCEF, SPI, plugin, tools, and startup modules.65- `chat2db-community-server/chat2db-community-start/`: executable backend,66 configuration, assembled frontend resources, and final jar.67- `chat2db-community-server/chat2db-community-plugins/`: database-specific68 implementations. Keep dialect-specific behavior inside the owning plugin.69- `docker/`: Community image, Compose file, and local image build entry point.70- `script/package/`: Community desktop preparation, metadata, and native71 packaging entry points.72- `jpackage/`: only versioned native packaging resources belong in source;73 runtime images, staged jars/libraries, renderer output, and installers are74 generated.75- `.github/workflows/`: Community desktop artifact and Docker publication76 workflows.77- `spec/code/server/`: maintained Java boundary and contract documentation.78 These Markdown files are rules, not executable checks.7980### Structural code navigation8182Use CodeGraph for structural questions when `.codegraph/` is initialized and83the CodeGraph tools are available:8485- `codegraph_context` first for a feature, architecture, or bug path.86- `codegraph_explore` once for the related source surfaced by context.87- `codegraph_search` for symbol lookup, `codegraph_callers` and88 `codegraph_callees` for call paths, and `codegraph_impact` before shared89 symbol changes.90- `codegraph_files` for indexed source-tree exploration and91 `codegraph_status` for index health.9293Use `rg` for literal strings, configuration keys, logs, comments, generated94flags, and command lines. Do not repeat CodeGraph results with a grep/read loop.95The index can lag writes, and build tools remain the correctness authority. If96CodeGraph is unavailable, use focused native file reads and `rg` without97pretending indexed results exist. If the repository has no initialized98CodeGraph index, ask before creating one.99100## Request101102Classify the request before acting:103104- Answer, explain, review, diagnose, and status requests are read-only by105 default. Use non-mutating inspection and report evidence; do not edit files,106 run mutation-heavy builds, or implement a fix unless requested.107- Change, fix, and cleanup requests authorize local source edits and relevant108 local commands within the named scope. A build request authorizes build109 commands, dependency caches, and generated output only; it does not authorize110 source repair unless the user also asks for a fix.111- Commit, push, tag, workflow dispatch, publication, deployment, signing, and112 production or customer-data actions require explicit authorization for that113 external effect.114115For an authorized implementation task, deliver the requested outcome end to116end within the smallest coherent scope.1171181. Confirm the exact repository, branch, status, and existing user changes.1192. Read the nearest implementation, tests, configuration, and workflow before120 editing. Trace cross-layer behavior when a change spans frontend, backend,121 storage, Docker, or desktop packaging.1223. Classify the change by affected surface and choose verification from the123 matrix below.1244. Edit narrowly. Follow existing module ownership and local conventions.1255. Run the relevant checks, inspect the final diff, and distinguish executed126 verification from checks that were not available.1276. Report the result, remaining risk, and exact uncommitted or unpushed state.128129### Backend boundaries130131- Keep controllers and transport adapters thin. Business behavior belongs in132 domain services; persistence belongs behind storage APIs/providers.133- Preserve Maven module direction and the contracts documented under134 `spec/code/server/`. Do not bypass domain APIs with new web-to-storage135 coupling.136- Use Java 17 and existing Spring/MyBatis/Lombok patterns. Avoid introducing a137 parallel framework or utility abstraction for behavior already owned by a138 module.139- New Community runtime branches must use the real runtime-mode signal. Never140 infer mode from jar name, app name, port, or artifact path.141- Changes to shared request context, identity, Gateway isolation, storage142 routing, AI services, or JCEF startup require explicit call-path and143 regression review.144- Keep database-specific SQL, metadata, completion, and type behavior in its145 plugin. Add focused plugin tests for dialect changes.146147### Frontend boundaries148149- Use TypeScript, React, Umi, Zustand, Ant Design, and existing project150 components and service helpers.151- Community conditions must derive from the current runtime-edition helpers or152 `UMI_ENV=community`; do not scatter unrelated environment checks.153- Do not add Electron APIs, `ipcRenderer`, Electron packaging, or a duplicate154 desktop bridge. Desktop renderer communication uses the existing JCEF155 `window.javaQuery` wrappers.156- Preserve service response contracts and storage keys. UI removal does not157 authorize deleting a backend contract that another Community path uses.158- Keep user-facing strings in the existing i18n system when the surrounding159 feature is localized.160161### Configuration and generated files162163- Never commit credentials, tokens, signing material, private URLs, local164 database contents, IDE files, runtime downloads, Maven/Yarn output, frontend165 `dist`, staged `jpackage` content, or installers.166- Read secrets only when the explicitly authorized operation requires them.167 Never print, log, paste, summarize, or persist secret values. Do not reuse a168 credential for a different repository, registry, account, or environment.169- Do not access or mutate production data, user data, or an unrelated local170 database for build or diagnostic convenience. Use fixtures or a named local171 test datasource unless the user explicitly places another system in scope.172- Keep desktop and host-published listeners on loopback unless remote exposure173 is explicitly requested and documented with its security impact. Do not174 change the container's required internal `0.0.0.0` binding to enforce a host175 publication policy.176- Keep these six `jpackage/input` resources versioned:177 `icons/community/logo.icns`, `icons/community/logo.ico`,178 `icons/community/logo.png`, `macres/Info.plist`, `win/updater.jar`, and179 `win/run-as-admin.vbs`.180- Treat `target/`, frontend `dist/`, `jpackage/output/`,181 `jpackage/input/runtime/`, and generated platform content such as182 `chat2db-community.jar`, `dist/`, `lib/`, and macOS `Frameworks/` as183 reproducible output. Do not184 remove a tracked resource merely because it shares a parent directory with185 generated files.186- Update README and workflow examples when a public command, port, artifact,187 environment variable, or release input changes.188189## Output Format190191At handoff, state:192193- what behavior changed and which files own it;194- which commands were actually run and whether they passed;195- any verification that remains CI-only, platform-only, or otherwise unrun;196- the current Git state, including unrelated modifications left untouched; and197- every attempted external action and its commit, remote branch, workflow run,198 image, release, or artifact identifier, including partial or failed actions.199200For code review, report findings first in severity order with `file:line`, the201affected runtime surface, the behavioral risk, and the required fix or missing202evidence. If there are no findings, say so and list residual test gaps.203204Do not claim that a build ran tests when Maven was invoked with205`-Dmaven.test.skip=true`. Do not claim a native package works from shell syntax206or `prepare` alone.207208## Constraints209210### Baseline commands211212Use Java 17, Maven 3.8 or later, Node.js 18 or later, and Yarn with the checked-in213`chat2db-community-client/yarn.lock`.214215Frontend setup and verification:216217```bash218cd chat2db-community-client219yarn install --frozen-lockfile220yarn run lint221yarn run test:sql-in-clipboard222yarn run build:web:community --app_version=0.0.0223```224225Run a focused backend test with tests explicitly enabled because the parent BOM226defaults `maven.test.skip` to `true`. The reactor POM also has a stale Surefire227include and `testFailureIgnore=true`; override both. Replace the example module228and test with the owning artifact ID and test class:229230```bash231MODULE=:chat2db-community-spi232TEST=DefaultSqlBuilderSegmentTest233mvn -B -f chat2db-community-server/pom.xml \234 -pl "${MODULE}" -am \235 -Dmaven.test.skip=false -DskipTests=false \236 -Dtest="${TEST}" \237 -Dsurefire.failIfNoSpecifiedTests=false \238 -Dmaven.test.failure.ignore=false \239 test240```241242For the owning module's full test set, replace `-Dtest` with the quoted argument243`'-Dsurefire.includes=**/*Test.java'`. This can surface stale test-compilation244failures elsewhere in that module; report those instead of weakening test245discovery. Always confirm the Surefire summaries report a nonzero test count246with zero failures and errors; `BUILD SUCCESS` alone is not sufficient in this247reactor.248249Build the executable Community backend:250251```bash252mvn -B clean package \253 -Dmaven.test.skip=true \254 -Dchat2db.finalName=chat2db-community \255 -f chat2db-community-server/pom.xml \256 -pl chat2db-community-start -am257```258259Run it locally with the explicit Community contract:260261```bash262java -Dloader.path=chat2db-community-server/chat2db-community-start/target/lib \263 -Dchat2db.gui=false \264 -Dchat2db.runtime.mode=community \265 -Dchat2db.network.status=OFFLINE \266 -Dserver.address=127.0.0.1 \267 -Dserver.port=10825 \268 -Dspring.profiles.active=dev \269 -jar chat2db-community-server/chat2db-community-start/target/chat2db-community.jar270```271272Build local distribution surfaces only when relevant:273274```bash275./docker/docker-build.sh 0.0.0-local chat2db-community:local276docker compose -f docker/docker-compose.yml config277script/package/package-community-jcef.sh 0.0.0-local prepare278```279280The desktop script's `mac`, `linux`, and `win` targets are platform-specific and281may download a JBR. Signed macOS packages require CI secrets. A manual desktop282workflow dispatch only uploads GitHub Actions artifacts. Pushing a numeric283`v5.3.0`-style tag validates all nine native installers, adds `SHA256SUMS`,284stages a draft GitHub Release, calls the reusable Docker workflow for the285versioned and `latest` tags, and publishes the Release only after Docker286succeeds. Neither path uploads to the updater CDN. These are external287publication actions, not routine local verification commands.288289### Tool and environment boundaries290291- For an authorized change/build task, repository edits, generated build292 output, standard Maven/Yarn caches, and ordinary dependency downloads are293 allowed. Do not change global package-manager configuration or install system294 packages unless the task requires it and the impact is explicit.295- Starting a local service is allowed only when needed for the requested smoke296 test. Inspect the port first, bind to loopback, record the process, and stop297 only the process started for this task. Never bounce an unrelated service.298- Docker build and task-scoped test containers/images are allowed for a Docker299 build request. Do not prune the daemon, remove unrelated resources, or start300 Compose services that are outside the task.301- Use only named local/test databases for autonomous verification. Schema/data302 mutation in shared, staging, or production systems requires explicit scope,303 a recovery plan, and authorization.304- Read-only network access for dependency resolution and public source checks305 is allowed when needed. Authenticated writes, uploads, workflow dispatches,306 messages, and publication remain external actions requiring explicit user307 authority.308- If a required tool is unavailable, report the missing check or use an309 equivalent read-only fallback. Do not fabricate tool output or silently310 broaden the environment.311312### Verification matrix313314- Frontend logic, route, service, or state: relevant focused test, `yarn run315 lint`, and `build:web:community`.316- Backend domain, web, storage, SPI, or plugin code: focused tests with Maven317 tests explicitly enabled, the stale Surefire include and failure-ignore318 behavior overridden, and a confirmed nonzero test count; then package the319 affected module and dependencies.320- Shared API or persistence contract: add compatibility coverage and inspect321 callers plus serialization/storage effects.322- Runtime-mode, identity, Gateway, AI, or network isolation: inspect both the323 registration path and call path; run a Community-mode smoke when feasible.324- JCEF Java bridge: focused JCEF tests, reactor compile/package, and matching325 renderer bridge verification.326- Desktop scripts/resources: `bash -n` for touched shell scripts, plist or327 platform metadata validation, `prepare`, and cross-platform workflow review.328 Only claim native installer success for an installer actually built and run329 on its target platform.330- Docker: script syntax, Compose expansion, image build, and an HTTP/static331 asset smoke when Docker is available.332- Workflow YAML: parse or inspect the resolved workflow inputs and commands;333 distinguish artifact upload from GitHub Release publication and CDN upload.334- Documentation-only changes: verify commands, links, paths, ports, and names335 against current source and workflows.336- Every change: `git diff --check`, focused diff review, and final `git status`.337338### Git and external-action rules339340- Preserve unrelated user changes, including changes in files you also need to341 edit. Never reset, checkout, clean, or overwrite them to simplify the task.342- Do not use destructive Git commands. Do not remove local data or generated343 caches outside the requested scope.344- Do not stage, commit, push, tag, dispatch workflows, publish releases, upload345 packages, or push images unless the user explicitly requests that action.346- When commit or push is requested, stage only the intended semantic scope,347 inspect the staged diff, check it for credentials or generated output, run348 its checks, and verify local/remote commit IDs.349- Treat workflow dispatch, release publication, Docker push, CDN upload,350 `latest` updates, and signing as external mutations with an explicit approval351 boundary.352353## Checkpoint354355Continue autonomously for normal read, edit, build, and test work within the356requested scope. Stop and ask only when one of these conditions materially357changes the result:358359- applicable instructions conflict, or the desired behavior remains ambiguous360 after current source has established the existing behavior;361- the task requires deleting user data, changing a public compatibility362 contract, exposing a listener, or crossing into Enterprise/Local behavior;363- credentials, signing identity, release destination, or production authority364 are missing;365- an irreversible or externally visible action was not explicitly requested;366- unrelated user edits make the requested change unsafe to isolate; or367- required verification still fails after one diagnosis-and-repair cycle and368 no safe in-scope recovery remains.369370Retry a transient, idempotent operation at most twice. Never blindly repeat a371push, workflow dispatch, release, upload, signing request, or other external372mutation after an ambiguous result. Inspect the remote or provider state first.373After interruption or partial completion, recheck branch, worktree, remote, and374workflow state before resuming.375376On failure, keep the worktree recoverable, record the exact command and error,377avoid unsupported success claims, and hand off the current goal, evidence,378actions already attempted, identifiers, open risks, and next safe action.379
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| deepseek-ai/deepseek-harnessnative/landlock-run/AGENTS.md · 104k | AGENTS.md | setupteststylearch+3 | 100/100 | today | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 100/100 | 14 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 14 days ago | |
| unoplat/unoplat-code-confluenceunoplat-code-confluence-frontend/AGENTS.md · 95 | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 13 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | today | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 13 days ago | |
| netdata/netdatasrc/go/plugin/ibm.d/AGENTS.md · 80k | AGENTS.md | buildtestlint-formatarch+3 | 99/100 | today | |
| react/react-nativepackages/react-native-compatibility-check/AGENTS.md · 126k | AGENTS.md | testlint-formatstylearch+4 | 99/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/ottermind-chat2db-agents)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.