Skip to content

Commit 99b3bcb

Browse files
qnbsclaude
andauthored
chore(agent): slim and deduplicate repository instruction context (#659)
* chore(agent): slim and deduplicate repository instruction context * fix(agent): align scoped rules with actual context boundaries * fix(agent): cover remaining persistence boundaries * fix(agent): complete scoped rule boundary coverage * fix(agent): close canonical guidance routing gaps * fix(agent): close final scoped guidance gaps * fix(agent): complete specialist guidance routing * fix(agent): close final context routing gaps * fix(agent): preserve specialist safety routing * fix(agent): complete specialist governance routing * fix(agent): preserve specialist integration guidance * fix(agent): close final blocking guidance gaps Route encryption-recovery/passphrase UI to the storage boundary rule, add features/voice/**/* and the full Plot Board view/hook/context to their specialist mappings, route plugin sandbox surfaces to the service-integration guide, and align the metrics-update example with AGENTS.md's unconditional doc-metrics requirement. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019VbSS2cs5Tbz5ApGPfhfgC --------- Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 7976f37 commit 99b3bcb

27 files changed

Lines changed: 250 additions & 1442 deletions

.cursor/index.mdc

Lines changed: 12 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,18 @@
11
---
2-
description: Project Manifest and Global Architecture
3-
alwaysApply: true
2+
description: Open the canonical repository guidance and relevant specialist rules on demand
3+
alwaysApply: false
44
---
55

6-
# StoryCraft Studio — Manifest
6+
# Cursor context index
77

8-
**Zweck:** Offline-first Schreib- und Erzählwerkzeug (v1.3+): Dashboard, Manuskript, Szenenboard, Plot Board, Charaktergraph, Version Control, KI-Copilot — **kein Ghostwriting-Fokus**. Daten lokal; Privacy-first; Cloud-KI nur nutzergetriggert.
8+
`AGENTS.md` is the canonical repository-wide rule source. Load it for repository work, then
9+
load only the matching `.cursor/rules/*.mdc` rule and nearest nested `CLAUDE.md` for the paths
10+
being changed. Follow the explicit cross-directory mappings in the root `CLAUDE.md` when a
11+
caller is governed by a specialist guide elsewhere.
912

10-
**Frontend:** React 19, Vite 8, TypeScript 6 (`strict`, `exactOptionalPropertyTypes`, restrike Index/Switch). Alias `@` → Repo-Root. **pnpm 10** Workspace (`packages/*`); Node ≥22. Optional **Turbo** (`*:turbo`-Skripte).
13+
Useful deep references:
1114

12-
**State:** Redux Toolkit + `redux-undo` (Projekt/Undo); **Zustand** für transientes UI (`app/transientUiStore.ts` — z. B. Command-Palette). Listener-Middleware für Auto-Save/Side-Effects.
13-
14-
**Persistenz:** Dual IndexedDB (`dbService.ts`: State vs. Data, Migration, LZ-String, AES-GCM für Keys); **`storageService` → `storageBackend`** (Web/Tauri, Binder-Blobs, typisiertes Envelope). Kein serverseitiges ORM.
15-
16-
**KI (Hybrid):** `@google/genai` + **Vercel AI SDK** (`ai`, `@ai-sdk/*`); Orchestrierung `services/ai/` (Strangler) + Legacy `aiProviderService.ts` / `geminiService.ts`. **RAG assembly:** `services/ragPromptAssembly.ts` (Writer, Plot Board, Consistency pattern). DuckDB `rag_chunks.embedding` (384-dim). Lokal: Ollama, WebLLM/ONNX/Transformers (`packages/ai-core`). Thunks: `features/project/thunks/`.
17-
18-
**Desktop:** Tauri 2 (`src-tauri`); `@tauri-apps/api` im Vite-Bundle **external**; FS/Dialog nur über Services — UI-Atoms ohne direkte Tauri-Imports.
19-
20-
**Kollaboration:** Yjs + `y-webrtc` (`collaborationService.ts`); Signaling: `settings.collaboration.webrtcSignalingUrls`; CSP `connect-src` für benutzerdefinierte `wss:`/`https:`.
21-
22-
**UI:** Tailwind 4 (`@tailwindcss/vite`), Tokens optional `@domain/ui`; Primitive `components/ui/*`. Storybook 10 + **addon-a11y**. Biome 2 (`--error-on-warnings`), `lineWidth` 100.
23-
24-
**PWA:** `vite-plugin-pwa`, `injectManifest`, `public/sw.js` (Version-Sync via `scripts/sync-sw-version.mjs`).
25-
26-
**i18n:** Quelle `locales/<lang>/*.json` (de, en, fr, es, it); Runtime **`public/locales/<lang>/bundle.json`** via `pnpm run i18n:bundle` / `i18n:check` + `content:guard`. Keine hardcodierten UI-Strings.
27-
28-
**Tests:** Vitest 4 (jsdom, `tests/setup.ts`, `maxWorkers: 1`); Coverage-Schwellen **63/55/54/62** % (lines/branches/functions/statements). E2E Playwright **CI-first** (`CI=true`). Stryker informativ. Siehe [`docs/CI.md`](../docs/CI.md).
29-
30-
**Qualität (lokal schnell):** `pnpm run lint`, `typecheck`, `i18n:check`; optional `pnpm exec vitest run` **ohne** `--coverage`. Schwere Gates (E2E, LHCI, Coverage) = GitHub Actions.
31-
32-
**Barrierefreiheit:** `LiveRegionProvider` / `useAnnounce()`; Settings-Presets + Zod (`accessibilitySchema.ts`); [`docs/ACCESSIBILITY.md`](../docs/ACCESSIBILITY.md); E2E [`tests/e2e/a11y.spec.ts`](../tests/e2e/a11y.spec.ts).
33-
34-
**Command Center:** `services/commands/` → Palette; `CommandExecutorContext`; Shortcuts `useGlobalKeyboardShortcuts` + `services/keyboard/`; Hilfe `helpCatalog.ts` + `helpDocRetrieval.ts` + `tryActionId`; Settings-Guide-Kategorie `experimental` für 12 Feature-Flags.
35-
36-
**v1.10:** Mobile-Nav (Scene Board), Branches ≥55 %, Help-Artikel (Plot Board v2, Hybrid RAG, Tauri). v1.9: Lazy cold-start (`duckdbListenerLoader`, deferred `aiApi`), Help/Settings-Hub, Tauri menu/window-state/updater — [`docs/SPRINT-V1.10.md`](../docs/SPRINT-V1.10.md).
37-
38-
**Pfad-Konventionen:** `app/`, `components/`, `features/*`, `hooks/`, `services/`, `packages/*`, `types.ts`, `tests/`.
39-
40-
## Cursor-Regelkatalog
41-
42-
| Datei | Wann |
43-
|-------|------|
44-
| [`.cursorrules`](../.cursorrules) | QNBS-Masterprompt, Kommentar-Konvention |
45-
| [`000-cursor-rules.mdc`](rules/000-cursor-rules.mdc) | Neue/geänderte `.mdc` |
46-
| [`001-core-security.mdc`](rules/001-core-security.mdc) | Secrets, Logs, CSP |
47-
| [`100-ai-providers-and-storage.mdc`](rules/100-ai-providers-and-storage.mdc) | KI, IDB, Storage |
48-
| [`150-i18n-and-content.mdc`](rules/150-i18n-and-content.mdc) | Locales, Copy, Templates |
49-
| [`200-architecture-limits.mdc`](rules/200-architecture-limits.mdc) | KISS/DRY, Dateigrößen |
50-
| [`300-ui-components.mdc`](rules/300-ui-components.mdc) | React UI, A11y |
51-
| [`800-testing-standards.mdc`](rules/800-testing-standards.mdc) | Vitest, E2E, CI-first |
52-
| [`850-mcp-and-prd.mdc`](rules/850-mcp-and-prd.mdc) | Roadmap, MCP, Doku-Hub |
53-
54-
**Maintainer-Doku:** [`docs/BEST-PRACTICES.md`](../docs/BEST-PRACTICES.md), [`AUDIT.md`](../AUDIT.md), [`ROADMAP.md`](../ROADMAP.md). Nach größeren Code-Änderungen optional `pnpm run graphify:update`.
15+
- `README.md` / `CONTRIBUTING.md` — product and setup
16+
- `docs/CI.md` / `docs/PR-CI-MERGE-WORKFLOW.md` — CI and PR operations
17+
- `docs/native/CORE-MIGRATION-LEDGER.md` — native direction
18+
- `docs/graphify.md` / `docs/codegraph.md` — on-demand architecture investigation

.cursor/rules/000-cursor-rules.mdc

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
description: ALWAYS use when asked to CREATE A RULE or UPDATE A RULE or when taught a lesson to RETAIN AS NEW RULE
3-
globs: ~
43
alwaysApply: false
54
---
65

@@ -22,8 +21,11 @@ alwaysApply: false
2221
- `300–399` UI
2322
- `800–899` Testing/Workflows
2423
- Frontmatter **`description`:** ATO (Action, Trigger, Outcome), **< 120 Zeichen**.
25-
- **`globs`:** kommagetrennt, **keine Leerzeichen**, keine Anführungszeichen — z. B. `globs: services/**/*.ts,features/**/*.ts`.
26-
- **`alwaysApply: true`** nur für [`.cursor/index.mdc`](../index.mdc) (Manifest). Fachregeln: `false` + passende `globs`.
24+
- **`globs`:** optional, comma-separated patterns with **no spaces** or quotation marks — e.g.
25+
`globs: services/**/*.ts,features/**/*.ts`. Omit it for description-based Apply Intelligently
26+
rules; use real patterns for path-specific rules.
27+
- An always-applied repository rule is not needed. Use `alwaysApply: false` with precise globs or
28+
a useful description.
2729
- **≤ 200 Zeilen** pro Datei; Code nicht duplizieren — verweise auf kanonische Pfade (`@services/logger.ts`).
2830
- Pflicht: `<example>` und `<example type="invalid">`.
2931
- Regeln mit **Plain-Text-Editor** schreiben (MDC-UI-Bugs vermeiden).
@@ -33,8 +35,7 @@ alwaysApply: false
3335
```yaml
3436
---
3537
description: <ATO unter 120 Zeichen>
36-
globs: <Pfadmuster oder ~ für manuell>
37-
alwaysApply: <true nur Manifest>
38+
alwaysApply: false
3839
---
3940
```
4041

@@ -49,5 +50,6 @@ Hybrid-KI-Regel: `101-hybrid-ai-orchestration.mdc`, `globs: services/ai/**/*.ts,
4950
</example>
5051

5152
<example type="invalid">
52-
`globs: *.ts, *.tsx` (Leerzeichen); 300-Zeilen-Regel mit kopiertem Redux-Reducer; `alwaysApply: true` auf jeder Fachregel.
53+
`globs: **/*` für jede Fachregel; copied architecture encyclopedias; or an always-applied
54+
specialist rule.
5355
</example>

.cursor/rules/001-core-security.mdc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
description: Protect secrets,logs,and CSP when touching any project file
3-
globs: **/*
2+
description: Protect secrets, logging, CSP, and privacy boundaries on executable and security-sensitive paths
3+
globs: .mcp/proforge-mcp-server/**/*.ts,app/**/*.ts,app/**/*.tsx,api/**/*.ts,components/**/*.ts,components/**/*.tsx,config/**/*,features/**/*.ts,features/**/*.tsx,functions/**/*.ts,hooks/useLanguageToolCheck.ts,hooks/useWorldScriptAI.ts,hooks/useFactoryReset.ts,hooks/useIdbUnlockStartupGuard.ts,hooks/useSettingsView.ts,App.tsx,index.tsx,register-sw.ts,index.html,nginx.conf,package.json,packages/**/*.ts,packages/**/*.tsx,public/_headers,public/sw.js,scripts/**/*.mjs,scripts/**/*.ts,services/**/*.ts,services/**/*.tsx,vercel.json,vite.config.ts,workers/**/*,wrangler.toml,.github/**/*,src-tauri/**/*,crates/**/*
44
alwaysApply: false
55
---
66

7-
# Core Security & Betrieb
7+
# Core security red lines
88

99
## Secrets & Konfiguration
1010

@@ -16,6 +16,7 @@ alwaysApply: false
1616
## Tauri / CSP / Integrationen
1717

1818
- Neue externe Endpunkte (KI, LanguageTool, Signaling): `src-tauri` **CSP** `connect-src` prüfen/erweitern — nicht nur Web-`fetch`.
19+
- CSP-Surfaces werden durch `scripts/sync-csp.mjs` synchronisiert; Änderungen müssen alle von diesem Script definierten Deployment-Flächen konsistent halten.
1920
- LanguageTool und ähnliche Dienste: nur **nutzerkonfigurierte URL** + Privacy-Gating (`integrations.languageTool*`).
2021
- Community-Templates: Zod + `pnpm run content:guard` — keine eingebetteten Secrets oder `eval`-ähnliche Payloads.
2122

.cursor/rules/100-ai-providers-and-storage.mdc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
description: Apply hybrid AI,IndexedDB,and storage patterns when editing services or features
3-
globs: services/**/*.ts,features/**/*.ts,packages/ai-core/**/*.ts
2+
description: Apply hybrid AI, persistence, and privacy patterns on AI and storage boundaries
3+
globs: app/listenerMiddleware.ts,app/persistenceCoordinator.ts,app/persistedStateFlush.ts,components/ApiKeySection.tsx,components/BinderPanel.tsx,components/CharacterView.tsx,components/ManuscriptResearchSplit.tsx,components/WelcomePortal.tsx,components/WorldView.tsx,components/dashboard/BackupQuickActionsCard.tsx,components/settings/AiProviderCard.tsx,components/settings/GeneralSections.tsx,components/settings/OpenRouterSection.tsx,components/settings/EncryptionRecoveryModal.tsx,components/settings/IdbUnlockModal.tsx,components/settings/IdbUnlockModalGate.tsx,components/settings/PassphraseModal.tsx,components/settings/PrivacySection.tsx,features/lora/loraThunks.ts,features/project/projectSchemaVersion.ts,features/project/projectSchemaVersionShadow.ts,features/project/thunks/**/*.ts,features/settings/settingsSlice.ts,features/writer/writerSlice.ts,hooks/useCharacterInterviewsView.ts,hooks/useCharacterView.ts,hooks/useFactoryReset.ts,hooks/useIdbUnlockStartupGuard.ts,hooks/useSettingsView.ts,hooks/useWorldView.ts,hooks/useWorldScriptAI.ts,App.tsx,index.tsx,services/ai/**/*.ts,services/aiProviderService.ts,services/appBootstrap.ts,services/cloudSync/**/*.ts,services/codexService.ts,services/crossProjectIndexService.ts,services/crossProjectSearchService.ts,services/dbInitialization.ts,services/dbMigration.ts,services/dbService.ts,services/diagnostics/logSinks.ts,services/factoryResetService.ts,services/fs/**/*.ts,services/geminiService.ts,services/keyboard/shortcutActions.ts,services/libraryBackupService.ts,services/localAiFacade.ts,services/workerBusManager.ts,services/localFirst/**/*.ts,services/localRag*.ts,services/lora/**/*.ts,services/loraAdapterService.ts,services/pluginRegistry.ts,services/projectDocument.ts,services/projectImportSchema.ts,services/proForge/adapters/nodeProForgeCapability.ts,services/proForge/proForgeHistoryStore.ts,services/proForge/proForgeMemoryBank.ts,services/proForge/proForgeOrchestrator.ts,services/rag*.ts,services/sceneRevisionService.ts,services/settingsExchange.ts,services/startupRecovery.tsx,services/startupRecoveryPolicy.ts,services/storage/**/*.ts,services/storageBackend.ts,services/storageService.ts,services/duckdb/**/*.ts,services/logger.ts,services/collaborationService.ts,workers/v2/webllm.worker.ts,packages/ai-core/**/*.ts,packages/collab-transport/**/*
44
alwaysApply: false
55
---
66

@@ -10,15 +10,16 @@ alwaysApply: false
1010

1111
- Einstieg **`services/ai/index.ts`**: Strangler neben Legacy; Writer-Streaming → **`writer`-Slice**, Manuskript erst nach **Accept**.
1212
- Netzwerk-KI: **`aiProviderService.ts`**, **`geminiService.ts`** — keine parallele SDK-Init in Komponenten.
13-
- Vercel AI SDK (`ai`, `@ai-sdk/google`, `@ai-sdk/openai`): neue Pfade über `services/ai/` und Hooks (`useStoryCraftAI` o. ä.), nicht doppelte Retry-Logik.
13+
- Vercel AI SDK (`ai`, `@ai-sdk/google`, `@ai-sdk/openai`): new paths belong in `services/ai/` and `hooks/useWorldScriptAI.ts`; do not duplicate retry logic.
1414
- **`assertCloudAiAllowed`:** Cloud nur wenn Policy/Settings es erlauben.
1515

1616
## Hybrid & lokale Inferenz
1717

1818
- Presets: Ollama/LM Studio/vLLM via `settings.advancedAi`; Cloud-Router über `openAiCompatibleBaseUrl` + Key-Slot.
1919
- Fallback-Kette in `aiProviderService` für Legacy-Thunks respektieren.
2020
- WebLLM/GPU: **`gpuResourceManager`**, Tab-Leader (`packages/ai-core` / BroadcastChannel) — kein zweiter schwerer Inferenz-Tab.
21-
- Lokales RAG/Embeddings: bestehende Speicher (`saveRagVectors`), chunked yields; `@xenova/transformers` nur über etablierte Pfade.
21+
- WebLLM offload follows ADR 0005: keep the dedicated worker-first pool, capability-based main-thread fallback, and progress bridge; do not couple it to `enableWorkerBusV2` or move model loading back to the UI thread.
22+
- Lokales RAG/Embeddings: bestehende Speicher (`saveRagVectors`), chunked yields; `@huggingface/transformers` nur über etablierte Pfade.
2223

2324
## Google GenAI
2425

@@ -29,7 +30,7 @@ alwaysApply: false
2930
- Zugriff über `dbService.ts`, `storageService.ts`, **`storageBackend.ts`** (`saveEnvelopeFromProjectData` — kein roher Cast im Listener).
3031
- Record-Keys/Migrationen nicht willkürlich umbenennen; Scene-Revisions → `sceneRevisionService.ts` (eigener Store).
3132
- `checkStorageHealth()` in `services/dbInitialization.ts` — liefert `StorageHealth`; wird beim App-Start ausgeführt (Low-Storage-Toast).
32-
- Kollaboration: nur **eine** CRDT-Schicht (`collaborationService.ts` + Yjs). RTCDataChannel-Verschlüsselung läuft über den y-webrtc-Patch (`patches/y-webrtc@10.3.0.patch`) — nicht erneut implementieren.
33+
- Kollaboration: nur **eine** CRDT-Schicht (`collaborationService.ts` + Yjs). RTCDataChannel-Verschlüsselung lebt in `packages/collab-transport`; Änderungen folgen `VENDOR-FORKS.md` und `pnpm run verify:vendor` — keine parallele Schicht implementieren.
3334

3435
## Privacy
3536

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
---
22
description: Enforce i18n key parity and content guard when editing locales or copy
3-
globs: locales/**/*.json,public/locales/**/*,community-templates/**/*,scripts/build-i18n.mjs,scripts/check-i18n-keys.mjs,scripts/content-guard.mjs
3+
globs: i18n/locales.ts,contexts/I18nContext.tsx,locales/**/*.json,public/locales/**/*,community-templates/**/*,scripts/build-i18n.mjs,scripts/check-i18n-keys.mjs,scripts/content-guard.mjs,scripts/i18n-locales.mjs,scripts/i18n-quality-report.mjs,scripts/i18n-status-dashboard.ts,scripts/check-doc-metrics.mjs,scripts/bulk-translate-locales.mjs,services/i18n/**/*.ts,services/i18nBootstrap.ts,services/projectI18nRepair.ts,services/help/helpCatalog.ts,services/help/helpSearch.ts,tests/unit/i18n/localesRegistry.test.ts
44
alwaysApply: false
55
---
66

77
# i18n & Content
88

99
## Schlüssel & Bundles
1010

11-
- Quelle: **`locales/<lang>/*.json`** (de, en, fr, es, it) — **alle fünf** Locales bei neuen Keys.
12-
- Runtime: **`public/locales/<lang>/bundle.json`** via `node scripts/build-i18n.mjs` (läuft in `predev` / `i18n:check`).
11+
- Source: **`locales/<lang>/*.json`** for every locale returned by the canonical registries (`i18n/locales.ts` and `scripts/i18n-locales.mjs`); add every new key to every locale tree.
12+
- Registry authority: keep the typed locale SSOT, filesystem bridge, and their integrity test aligned; do not duplicate a locale roster or count here.
13+
- Runtime: **`public/locales/<lang>/bundle.json`** via `node scripts/build-i18n.mjs` (also used by `i18n:check`).
1314
- CI: **`pnpm run i18n:check`** (Key-Parität + Bundle + `content:guard`).
1415
- UI-Text nur als **Übersetzungsschlüssel** (Dot-Notation), nie hardcodiert in TSX — außer Dev-Debug.
1516

@@ -21,19 +22,19 @@ alwaysApply: false
2122
## Community & Help
2223

2324
- Templates: kanonisches **Englisch** in `community-templates/index.json` + Spiegel unter `public/community-templates/`; Zod in `fetchCommunityTemplates`.
24-
- Help-Struktur: **`services/help/helpCatalog.ts`** (nicht `help.categories` in JSON); Texte in `locales/<lang>/help.json`. Neue Artikel: Katalog + alle 5 Locales (siehe `scripts/help-extra-keys.json`, `scripts/help-locales-es-fr-it.json`).
25+
- Help structure: **`services/help/helpCatalog.ts`** (not `help.categories` in JSON); text lives in `locales/<lang>/help.json`. New articles require the catalog plus every locale tree.
2526
- Help-Artikel: **`tryActionId`** für Palette/Navigation; Suche über `helpSearch.ts`; Demo-Feedback über Toasts, nicht `alert`.
2627

2728
## PR-Checkliste
2829

29-
1. Keys in allen Locales
30+
1. Keys in every locale tree defined by the canonical registries
3031
2. `pnpm run i18n:check` lokal (Quick-Tier)
3132
3. Keine Secrets/PII in JSON-Beispielen
3233

3334
<example>
34-
Neuer Settings-String: Key in `locales/en/settings.json` + de/fr/es/it; `i18n:check` grün; Help-Link mit `tryActionId: 'nav-settings'`.
35+
New Settings copy: key in every `locales/*/settings.json`, rebuild bundles, and keep `i18n:check` green.
3536
</example>
3637

3738
<example type="invalid">
38-
Nur `en` befüllt; UI zeigt rohe Keys weil `bundle.json` nicht gebaut; deutscher Fließtext direkt in `components/Dashboard.tsx`.
39+
Only `en` updated; runtime bundles not rebuilt; or user-visible text hardcoded in a component.
3940
</example>

.cursor/rules/200-architecture-limits.mdc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
11
---
22
description: Keep files small and reuse logic via services,hooks,and feature slices
3-
globs: **/*
3+
globs: App.tsx,types.ts,types/**/*.ts,app/**/*.ts,components/**/*.tsx,contexts/**/*.ts,contexts/**/*.tsx,features/**/*.ts,hooks/**/*.ts,services/**/*.ts,packages/**/*.ts,packages/**/*.tsx,vite.config.ts
44
alwaysApply: false
55
---
66

7-
# Architektur: KISS, DRY, Grenzen
7+
# Architecture limits
88

99
## Prinzipien
1010

1111
- **KISS:** Einfachste Lösung mit `strict` Types und testbaren Seams.
1212
- **DRY:** Logik in `services/`, `hooks/`, `features/*/thunks` — nicht in Views duplizieren.
1313

14-
## View-Muster (StoryCraft)
14+
## View pattern (WorldScript Studio)
1515

16-
- **Component + Hook + Context:** Rendering in `components/*View.tsx`, Logik in `hooks/use*View.ts`, Kontext für Kindbaum.
16+
- **Component + Hook + Context:** rendering in `components/*View.tsx`, logic in `hooks/use*View.ts`, context for child trees.
1717
- **Redux** für persistierten App-State; **Zustand** nur transient (`app/transientUiStore.ts`).
1818
- **Undo:** `redux-undo` am Projekt-Slice; Plot-Board-**Viewport** lokal — Verbindungen/Subplots im `projectSlice` wenn undo-relevant.
1919
- Schwere Views: `React.lazy` in `App.tsx`; Plot-Board-Subchunks, ForceGraph, Collaboration lazy; `listenerMiddleware` + `aiApi` dynamic import für DuckDB/RAG/Provider.
20-
- **ProForge Pipeline** (`services/proForge/`, `features/proForge/`, `components/proForge/`): 8-stage Agentic-Pipeline hinter `enableProForge`-Flag. Orchestrator nie direkt in Komponenten instantiieren — über `hooks/useProForgeOrchestrator.ts`.
21-
- **Voice** (`services/voice/`): Abstract-Engine-Pattern; `VoiceCommandService` als Singleton hinter `enableVoiceSupport`-Flag.
20+
- Neue schwere optionale Chunks müssen in `vite.config.ts` gemeinsam in `manualChunks` und PWA-`globIgnores` gepflegt werden; siehe ADR 0002, damit sie nicht service-worker-vorinstalliert werden.
21+
- ProForge orchestration stays behind `hooks/useProForgeOrchestrator.ts`; do not instantiate it in components.
22+
- Voice uses the existing engine abstractions and `VoiceCommandService`; honor its feature/settings gates.
2223

2324
## Dateigrößen
2425

@@ -32,9 +33,8 @@ alwaysApply: false
3233

3334
## Feature Flags
3435

35-
- Experimentelles über `features/featureFlags/featureFlagsSlice.ts` (19 Flags) — nicht verstreute `if (true)`-Hacks.
36-
- Standard **ein**: `enableCodexAutoTracking`, `enableCrossProjectSearch`, `enablePlotBoardV2`. Alle anderen: aus.
37-
- Major-Features (Voice, ProForge, DuckDB, LoRA, CloudSync, PluginSystem) müssen per Flag ein-/ausgeschaltet werden.
36+
- Experimental behavior belongs in `features/featureFlags/featureFlagsSlice.ts`; do not use scattered `if (true)` hacks.
37+
- Read current flag defaults from that slice; do not duplicate a stale flag count or default table in rules.
3838

3939
<example>
4040
Manuskript >700 Zeilen: `ManuscriptInspector.tsx` + `hooks/useManuscript.ts`; Plot-Board-Canvas eigene Datei unter `components/plotBoard/`.

0 commit comments

Comments
 (0)