Imported from nimiplatform/nimi (
apps/lab/AGENTS.md). Install upstream withnpx skills add nimiplatform/nimi --skill lab. Copyright stays with the author.
AGENTS.md
Scope
- Applies to
apps/lab/**; treat.nimi/app-scaffold/{intent,lock}.jsonas app-scaffold intent and lock state. - Treat
.nimi/{config,contracts,methodology}/**as@nimiplatform/nimi-codingmanaged projections; keep auth, Runtime, permission, manifest, and shell glue in scaffold-managed files. - The app-owned area is
src/shell/routes/product-area.tsx,src/lab/**,src-electron/**, and lab contract tests.
Hard Boundaries
- Consume Runtime and Realm only through SDK and reusable UI through Kit; do not create app-local platform truth, private transport, provider/model constants, or admission truth.
- Do not add app-local persistence commands or modules; history, export, artifacts, and storage use admitted Kit shell capabilities.
- Nimi Lab is local-development-only and must not carry public admission, listing, release, registry, or install truth.
Capability Coverage
- A new canonical capability or important contract behavior from a third-party App adaptation ships with its Lab entry, a focused regression, and the real Desktop-supervised Lab acceptance path in the same task; if Lab cannot host it, record the specific lifecycle or input reason. See the README section "AI capability coverage".
- Lab-only entries live in
src/lab/lab-only/**and join navigation throughdescriptor.section; they never change App Tools scaffold admission. Extend the existing inventory test, history policy and assets instead of adding a parallel capability list or evidence store.
Retrieval Defaults
- Read the affected lab route, its direct SDK/Kit or shell dependency, and the matching lab contract test.
Internationalization
- All user-visible copy in
src/lab/**and product shell surfaces goes throughsrc/shell/i18n/index.js(useTranslationin components, baret()in pure modules); never importreact-i18nextdirectly. - Locale bundles live in
src/shell/i18n/locales/{en,zh}/*.json, one top-level section object per file (e.g.studio.json→"Studio"); new section files must be registered insrc/shell/i18n/index.tsand mirrored in both locales (test/i18n-parity.test.mjsenforces key parity). - Static data modules store i18n keys (e.g.
labelKey) and translate at render time; prompts/directives sent to Runtime and UI Recipes gallery copy stay English.
Styling
src/styles.cssimports Tailwind withsource(none)and adds@source "./**/*.{ts,tsx}"so app composition classes are generated; Kit component classes come from the@sourcerules inside Kit's ownstyles.css. Keep new app utilities inside that scan.- App plain CSS is wrapped in
@scope (.nimi-workbench-host); Kit Popover/Dialog content portals to<body>and escapes that scope, so portal-targeted styles must live in their own@scope (<panel-root-class>)block (single root per block) — see the history filter popover and image preview modal blocks at the end ofsrc/ai-studio-core/ai-studio-core.css. - Kit
Buttonwraps children in one inline content span with pointer events disabled; composite rows that lay out structured children dissolve that wrapper with> span { display: contents; }(and restorepointer-events: autowhere nested Tooltips need hover).
Verification Commands
- For implementation changes, run the directly affected test and
pnpm --filter @nimiplatform/lab typecheck; locale-key or bundle-registration changes includetest/i18n-parity.test.mjs. - Run
pnpm --filter @nimiplatform/lab testfor app-wide behavior or shared shell/SDK/Kit integration changes. - Run
pnpm --filter @nimiplatform/lab run validatewhennimi.app.yaml, its App Access declaration, submitted-input role, or the validator changes; this checks manifest declarations, not product behavior.
