From 47e4d701ffbaf7df36012607f6888770f8e9f6a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hartmut=20N=C3=B6renberg?= Date: Sun, 29 Mar 2026 12:47:12 +0200 Subject: [PATCH] chore(repo): checkpoint current capakraken implementation state --- .agents/config.toml.pre-gpt-5.4.bak | 298 --- .../widget-field-refactor/A1-architect.md | 2 +- .../C1-field-domain-coder.md | 2 +- .../C2-blueprint-ui-coder.md | 2 +- .../C3-widget-platform-coder.md | 2 +- .../C4-dashboard-data-coder.md | 2 +- .../widget-field-refactor/GPT-5.4-README.md | 4 +- .../widget-field-refactor/O1-orchestrator.md | 2 +- .../widget-field-refactor/R1-reviewer.md | 2 +- .../widget-field-refactor/T1-test-agent.md | 2 +- .claude/commands/gitlooper/gitlooper.md | 6 +- .claude/commands/implement.md | 10 +- .claude/commands/perf.md | 8 +- .claude/commands/plan.md | 4 +- .claude/commands/research.md | 10 +- .claude/commands/review.md | 4 +- .claude/commands/visualaudit.md | 8 +- .gitignore | 1 + AGENTS.md | 2 +- CLAUDE.md | 12 +- Claude.md | 2 +- LEARNINGS.md | 8 +- apps/web/next-env.d.ts | 2 +- apps/web/public/sw.js | 6 +- apps/web/src/app/(app)/layout.tsx | 4 +- apps/web/src/app/api/sse/timeline/route.ts | 2 +- apps/web/src/app/page.tsx | 2 +- .../src/components/assistant/ChatPanel.tsx | 3 + .../components/dashboard/DashboardClient.tsx | 189 +- .../widgets/BudgetForecastWidget.tsx | 2 +- .../dashboard/widgets/ChargeabilityWidget.tsx | 18 +- .../dashboard/widgets/ProjectHealthWidget.tsx | 2 +- .../dashboard/widgets/ResourceTableWidget.tsx | 60 +- .../dashboard/widgets/TopValueWidget.tsx | 2 +- .../components/timeline/TimelineContext.tsx | 117 +- .../timeline/TimelineQuickFilters.tsx | 27 +- apps/web/src/hooks/useDashboardLayout.ts | 6 +- apps/web/src/hooks/useReferenceData.ts | 99 + apps/web/src/hooks/useWidgetFilterOptions.ts | 49 +- apps/web/src/server/auth.ts | 1 + docs/README.md | 34 +- docs/assistant-capability-gap-analysis.md | 74 +- docs/calculation-reference.md | 2 +- docs/ci-cd-manual.md | 28 +- docs/dispo-import-implementation-tickets.md | 6 +- docs/dispo-import-implementation.md | 30 +- docs/estimating-extension-design.md | 14 +- docs/gitlooper-strategy.md | 2 +- docs/holiday-calendar-implementation-plan.md | 2 +- docs/imports/departed-sync-2026-03-14.md | 8 +- docs/old-markdowns/PLAN_SKILLMATRIX.md | 2 +- .../architecture-evaluation-2026-03-06.md | 2 +- .../cgi-breakdown-implementation-proposal.md | 2 +- .../old-markdowns/estimating-field-mapping.md | 2 +- docs/old-markdowns/perf-audit-2026-03-09.md | 2 +- docs/old-markdowns/plan.md | 2 +- docs/old-markdowns/refactor-sprint-plan.md | 2 +- .../rename-legacy-to-capakraken-plan.md | 56 +- ...iew-report-2026-03-15-computation-graph.md | 0 ...formance-optimization-review-2026-03-18.md | 30 +- docs/product-roadmap.md | 22 +- docs/refactor-v2-plan.md | 2 +- docs/security-audit-2026-03-15.md | 6 +- package.json | 3 + .../src/__tests__/assistant-router.test.ts | 110 +- .../assistant-tools-advanced.test.ts | 710 ++++++- .../__tests__/assistant-tools-country.test.ts | 181 ++ .../assistant-tools-holidays.test.ts | 195 +- .../api/src/__tests__/staffing-router.test.ts | 10 +- packages/api/src/lib/resource-capacity.ts | 451 +---- packages/api/src/router/assistant-tools.ts | 1756 ++++++++++++++++- packages/api/src/router/assistant.ts | 70 +- packages/application/src/index.ts | 14 + .../application/src/lib/resource-capacity.ts | 508 +++++ .../use-cases/dashboard/holiday-capacity.ts | 470 +---- packages/db/package.json | 1 + packages/db/prisma/schema.prisma | 2 +- packages/db/src/destructive-db-guard.test.ts | 6 +- packages/db/src/destructive-db-guard.ts | 2 +- packages/db/src/generate-excel.ts | 8 +- packages/db/src/import-dispo-batch.ts | 2 +- packages/db/src/reset-dispo-import.ts | 2 +- packages/db/src/update-excel.mjs | 72 +- .../v2-architecture-proposal-2026-03-11.md | 40 +- samples/Dispov2/plan-chargeability-report.md | 8 +- samples/Dispov2/plan-client-wbs-model.md | 2 +- samples/Dispov2/plan-country-sah-fte.md | 2 +- samples/Dispov2/plan-org-unit-hierarchy.md | 2 +- samples/Dispov2/plan-overview.md | 6 +- samples/Dispov2/plan-resource-extensions.md | 2 +- .../Dispov2/plan-utilization-categories.md | 2 +- samples/generate_skillmatrix.mjs | 6 +- scripts/db-doctor.mjs | 5 - scripts/prisma-with-env.mjs | 31 + 94 files changed, 4283 insertions(+), 1710 deletions(-) delete mode 100644 .agents/config.toml.pre-gpt-5.4.bak create mode 100644 apps/web/src/hooks/useReferenceData.ts rename plan.md => docs/old-markdowns/rename-legacy-to-capakraken-plan.md (75%) rename review-report.md => docs/old-markdowns/review-report-2026-03-15-computation-graph.md (100%) create mode 100644 packages/api/src/__tests__/assistant-tools-country.test.ts create mode 100644 packages/application/src/lib/resource-capacity.ts create mode 100644 scripts/prisma-with-env.mjs diff --git a/.agents/config.toml.pre-gpt-5.4.bak b/.agents/config.toml.pre-gpt-5.4.bak deleted file mode 100644 index 9110b8e..0000000 --- a/.agents/config.toml.pre-gpt-5.4.bak +++ /dev/null @@ -1,298 +0,0 @@ -# ============================================================================= -# Claude Flow V3 - Codex Configuration -# ============================================================================= -# Generated by: @claude-flow/codex -# Documentation: https://github.com/ruvnet/claude-flow -# -# This file configures the Codex CLI for Claude Flow integration. -# Place in .agents/config.toml (project) or .codex/config.toml (user). -# ============================================================================= - -# ============================================================================= -# Core Settings -# ============================================================================= - -# Model selection - the AI model to use for code generation -# Options: gpt-5.3-codex, gpt-4o, claude-sonnet, claude-opus -model = "gpt-5.3-codex" - -# Approval policy determines when human approval is required -# - untrusted: Always require approval -# - on-failure: Require approval only after failures -# - on-request: Require approval for significant changes -# - never: Auto-approve all actions (use with caution) -approval_policy = "on-request" - -# Sandbox mode controls file system access -# - read-only: Can only read files, no modifications -# - workspace-write: Can write within workspace directory -# - danger-full-access: Full file system access (dangerous) -sandbox_mode = "workspace-write" - -# Web search enables internet access for research -# - disabled: No web access -# - cached: Use cached results when available -# - live: Always fetch fresh results -web_search = "cached" - -# ============================================================================= -# Project Documentation -# ============================================================================= - -# Maximum bytes to read from AGENTS.md files -project_doc_max_bytes = 65536 - -# Fallback filenames if AGENTS.md not found -project_doc_fallback_filenames = [ - "AGENTS.md", - "TEAM_GUIDE.md", - ".agents.md" -] - -# ============================================================================= -# Features -# ============================================================================= - -[features] -# Enable child AGENTS.md guidance -child_agents_md = true - -# Cache shell environment for faster repeated commands -shell_snapshot = true - -# Smart approvals based on request context -request_rule = true - -# Enable remote compaction for large histories -remote_compaction = true - -# ============================================================================= -# MCP Servers -# ============================================================================= - -[mcp_servers.claude-flow] -command = "npx" -args = ["-y", "@claude-flow/cli@latest"] -enabled = true -tool_timeout_sec = 120 - -# ============================================================================= -# Skills Configuration -# ============================================================================= - -[[skills.config]] -path = ".agents/skills/swarm-orchestration" -enabled = true - -[[skills.config]] -path = ".agents/skills/memory-management" -enabled = true - -[[skills.config]] -path = ".agents/skills/sparc-methodology" -enabled = true - -[[skills.config]] -path = ".agents/skills/security-audit" -enabled = true - -# ============================================================================= -# Profiles -# ============================================================================= - -# Development profile - more permissive for local work -[profiles.dev] -approval_policy = "never" -sandbox_mode = "danger-full-access" -web_search = "live" - -# Safe profile - maximum restrictions -[profiles.safe] -approval_policy = "untrusted" -sandbox_mode = "read-only" -web_search = "disabled" - -# CI profile - for automated pipelines -[profiles.ci] -approval_policy = "never" -sandbox_mode = "workspace-write" -web_search = "cached" - -# ============================================================================= -# History -# ============================================================================= - -[history] -# Save all session transcripts -persistence = "save-all" - -# ============================================================================= -# Shell Environment -# ============================================================================= - -[shell_environment_policy] -# Inherit environment variables -inherit = "core" - -# Exclude sensitive variables -exclude = ["*_KEY", "*_SECRET", "*_TOKEN", "*_PASSWORD"] - -# ============================================================================= -# Sandbox Workspace Write Settings -# ============================================================================= - -[sandbox_workspace_write] -# Additional writable paths beyond workspace -writable_roots = [] - -# Allow network access -network_access = true - -# Exclude temp directories -exclude_slash_tmp = false - -# ============================================================================= -# Security Settings -# ============================================================================= - -[security] -# Enable input validation for all user inputs -input_validation = true - -# Prevent directory traversal attacks -path_traversal_prevention = true - -# Scan for hardcoded secrets -secret_scanning = true - -# Scan dependencies for known CVEs -cve_scanning = true - -# Maximum file size for operations (bytes) -max_file_size = 10485760 - -# Allowed file extensions (empty = allow all) -allowed_extensions = [] - -# Blocked file patterns (regex) -blocked_patterns = ["\\.env$", "credentials\\.json$", "\\.pem$", "\\.key$"] - -# ============================================================================= -# Performance Settings -# ============================================================================= - -[performance] -# Maximum concurrent agents -max_agents = 8 - -# Task timeout in seconds -task_timeout = 300 - -# Memory limit per agent -memory_limit = "512MB" - -# Enable response caching -cache_enabled = true - -# Cache TTL in seconds -cache_ttl = 3600 - -# Enable parallel task execution -parallel_execution = true - -# ============================================================================= -# Logging Settings -# ============================================================================= - -[logging] -# Log level: debug, info, warn, error -level = "info" - -# Log format: json, text, pretty -format = "pretty" - -# Log destination: stdout, file, both -destination = "stdout" - -# ============================================================================= -# Neural Intelligence Settings -# ============================================================================= - -[neural] -# Enable SONA (Self-Optimizing Neural Architecture) -sona_enabled = true - -# Enable HNSW vector search -hnsw_enabled = true - -# HNSW index parameters -hnsw_m = 16 -hnsw_ef_construction = 200 -hnsw_ef_search = 100 - -# Enable pattern learning -pattern_learning = true - -# Learning rate for neural adaptation -learning_rate = 0.01 - -# ============================================================================= -# Swarm Orchestration Settings -# ============================================================================= - -[swarm] -# Default topology: hierarchical, mesh, ring, star -default_topology = "hierarchical" - -# Default strategy: balanced, specialized, adaptive -default_strategy = "specialized" - -# Consensus algorithm: raft, byzantine, gossip -consensus = "raft" - -# Enable anti-drift measures -anti_drift = true - -# Checkpoint interval (tasks) -checkpoint_interval = 10 - -# ============================================================================= -# Hooks Configuration -# ============================================================================= - -[hooks] -# Enable lifecycle hooks -enabled = true - -# Pre-task hook -pre_task = true - -# Post-task hook (for learning) -post_task = true - -# Enable neural training on post-edit -train_on_edit = true - -# ============================================================================= -# Background Workers -# ============================================================================= - -[workers] -# Enable background workers -enabled = true - -# Worker configuration -[workers.audit] -enabled = true -priority = "critical" -interval = 300 - -[workers.optimize] -enabled = true -priority = "high" -interval = 600 - -[workers.consolidate] -enabled = true -priority = "low" -interval = 1800 diff --git a/.agents/sprints/widget-field-refactor/A1-architect.md b/.agents/sprints/widget-field-refactor/A1-architect.md index 6ffb5c7..884c3db 100644 --- a/.agents/sprints/widget-field-refactor/A1-architect.md +++ b/.agents/sprints/widget-field-refactor/A1-architect.md @@ -35,7 +35,7 @@ Define the contracts that remove field and widget drift before implementation st ## Agent Prompt ```text -You are A1, the architect for the Planarchy widget + field refactor sprint. +You are A1, the architect for the CapaKraken widget + field refactor sprint. Your job is to define stable contracts before implementation starts. Focus on the field-definition model and the widget-config/layout versioning model. diff --git a/.agents/sprints/widget-field-refactor/C1-field-domain-coder.md b/.agents/sprints/widget-field-refactor/C1-field-domain-coder.md index 2a9c23e..79605de 100644 --- a/.agents/sprints/widget-field-refactor/C1-field-domain-coder.md +++ b/.agents/sprints/widget-field-refactor/C1-field-domain-coder.md @@ -33,7 +33,7 @@ Centralize dynamic-field validation and filter construction so project and resou ## Agent Prompt ```text -You are C1, the field domain coder for the Planarchy refactor sprint. +You are C1, the field domain coder for the CapaKraken refactor sprint. Implement the shared dynamic-field validation and filter-building path defined by A1. Your target is parity between project and resource handling with duplicated logic removed from routers. diff --git a/.agents/sprints/widget-field-refactor/C2-blueprint-ui-coder.md b/.agents/sprints/widget-field-refactor/C2-blueprint-ui-coder.md index 860ce63..70fb1da 100644 --- a/.agents/sprints/widget-field-refactor/C2-blueprint-ui-coder.md +++ b/.agents/sprints/widget-field-refactor/C2-blueprint-ui-coder.md @@ -33,7 +33,7 @@ Align blueprint and dynamic-field UI to the canonical field contract so UI behav ## Agent Prompt ```text -You are C2, the blueprint UI coder for the Planarchy refactor sprint. +You are C2, the blueprint UI coder for the CapaKraken refactor sprint. Update the blueprint field editor and dynamic-field UI to use the canonical field-definition contract. Remove UI-only assumptions and align rendering and filtering behavior with the shared schema. diff --git a/.agents/sprints/widget-field-refactor/C3-widget-platform-coder.md b/.agents/sprints/widget-field-refactor/C3-widget-platform-coder.md index 4ec653e..76e037f 100644 --- a/.agents/sprints/widget-field-refactor/C3-widget-platform-coder.md +++ b/.agents/sprints/widget-field-refactor/C3-widget-platform-coder.md @@ -34,7 +34,7 @@ Make dashboard widget persistence typed and versioned, then move rendering towar ## Agent Prompt ```text -You are C3, the widget platform coder for the Planarchy refactor sprint. +You are C3, the widget platform coder for the CapaKraken refactor sprint. Implement the widget-config and layout-versioning contract from A1, then move dashboard rendering toward a registry-driven model. diff --git a/.agents/sprints/widget-field-refactor/C4-dashboard-data-coder.md b/.agents/sprints/widget-field-refactor/C4-dashboard-data-coder.md index 5b7493e..084cfdc 100644 --- a/.agents/sprints/widget-field-refactor/C4-dashboard-data-coder.md +++ b/.agents/sprints/widget-field-refactor/C4-dashboard-data-coder.md @@ -30,7 +30,7 @@ Thin the dashboard router and prepare the path to SQL-first performance work. ## Agent Prompt ```text -You are C4, the dashboard data coder for the Planarchy refactor sprint. +You are C4, the dashboard data coder for the CapaKraken refactor sprint. Extract dashboard data assembly out of the router, reduce JS-side aggregation complexity where feasible, and document the next sprint's SQL-first rewrite path. diff --git a/.agents/sprints/widget-field-refactor/GPT-5.4-README.md b/.agents/sprints/widget-field-refactor/GPT-5.4-README.md index 1762085..f4db77e 100644 --- a/.agents/sprints/widget-field-refactor/GPT-5.4-README.md +++ b/.agents/sprints/widget-field-refactor/GPT-5.4-README.md @@ -24,7 +24,7 @@ Claude Flow does not expose an `orchestrator` agent type in the CLI. The sprint - `O1` orchestrator role -> CLI `coordinator` type -The role behavior still comes from [O1-orchestrator.md](/home/hartmut/Documents/Copilot/planarchy/.agents/sprints/widget-field-refactor/O1-orchestrator.md), which explicitly forbids implementation work. +The role behavior still comes from [O1-orchestrator.md](/home/hartmut/Documents/Copilot/capakraken/.agents/sprints/widget-field-refactor/O1-orchestrator.md), which explicitly forbids implementation work. ## Azure Requirement @@ -35,7 +35,7 @@ This launcher is intended to run against Azure OpenAI-backed Codex. It will fail - the config references `AZURE_OPENAI_API_KEY` - `AZURE_OPENAI_API_KEY` is present in the shell environment -See [docs/azure_codex_setup.md](/home/hartmut/Documents/Copilot/planarchy/docs/azure_codex_setup.md). +See [docs/azure_codex_setup.md](/home/hartmut/Documents/Copilot/capakraken/docs/azure_codex_setup.md). ## Start diff --git a/.agents/sprints/widget-field-refactor/O1-orchestrator.md b/.agents/sprints/widget-field-refactor/O1-orchestrator.md index ecb2783..c1c5478 100644 --- a/.agents/sprints/widget-field-refactor/O1-orchestrator.md +++ b/.agents/sprints/widget-field-refactor/O1-orchestrator.md @@ -111,7 +111,7 @@ Do not accept a story unless all are true: ## Orchestrator Prompt ```text -You are O1, the sprint orchestrator for the Planarchy widget + field refactor. +You are O1, the sprint orchestrator for the CapaKraken widget + field refactor. You never implement. You do not patch files, write tests, fix lint errors, or edit migrations. Your job is to sequence work, issue precise tickets, review handoffs against acceptance criteria, control merge order, and escalate blockers. diff --git a/.agents/sprints/widget-field-refactor/R1-reviewer.md b/.agents/sprints/widget-field-refactor/R1-reviewer.md index c7f7e97..98615d4 100644 --- a/.agents/sprints/widget-field-refactor/R1-reviewer.md +++ b/.agents/sprints/widget-field-refactor/R1-reviewer.md @@ -33,7 +33,7 @@ Review every merge candidate for regressions, contract drift, and unsafe persist ## Agent Prompt ```text -You are R1, the reviewer for the Planarchy refactor sprint. +You are R1, the reviewer for the CapaKraken refactor sprint. Review every merge candidate with a regression-first mindset. Prioritize correctness, contract discipline, persistence safety, and behavior parity across project/resource flows. diff --git a/.agents/sprints/widget-field-refactor/T1-test-agent.md b/.agents/sprints/widget-field-refactor/T1-test-agent.md index 252d298..47aaf68 100644 --- a/.agents/sprints/widget-field-refactor/T1-test-agent.md +++ b/.agents/sprints/widget-field-refactor/T1-test-agent.md @@ -35,7 +35,7 @@ Add the regression and integration tests that make this refactor safe to land. ## Agent Prompt ```text -You are T1, the test agent for the Planarchy refactor sprint. +You are T1, the test agent for the CapaKraken refactor sprint. Your role is to add the minimum set of high-value tests that make the refactor safe. Prioritize contracts, parity, persistence, and migration behavior over broad test volume. diff --git a/.claude/commands/gitlooper/gitlooper.md b/.claude/commands/gitlooper/gitlooper.md index 90d92d2..30a0c13 100644 --- a/.claude/commands/gitlooper/gitlooper.md +++ b/.claude/commands/gitlooper/gitlooper.md @@ -1,6 +1,6 @@ --- name: gitlooper -description: Gitea ticket processing agent — fetches, triages, analyses, implements, and submits Planarchy issues for review +description: Gitea ticket processing agent — fetches, triages, analyses, implements, and submits CapaKraken issues for review allowed-tools: Bash, Read, Write, Edit, Glob, Grep, Agent, WebFetch --- @@ -427,9 +427,9 @@ AGENT_DRY_RUN="false" --- -## 9. Planarchy-Specific Context +## 9. CapaKraken-Specific Context -The agent operates within the Planarchy monorepo and must adhere to all engineering rules defined in `CLAUDE.md`: +The agent operates within the CapaKraken monorepo and must adhere to all engineering rules defined in `CLAUDE.md`: - **Money:** Always integer cents, never floats - **Prisma:** After schema changes, run `pnpm db:push`, clear `.next/` cache, restart dev server diff --git a/.claude/commands/implement.md b/.claude/commands/implement.md index 57c99cc..3f67aff 100644 --- a/.claude/commands/implement.md +++ b/.claude/commands/implement.md @@ -1,13 +1,13 @@ -Du bist der **Implementer** für das Planarchy-Projekt. +Du bist der **Implementer** fuer das CapaKraken-Projekt. ## Deine Aufgabe Lies `plan.md` und implementiere die Tasks Schritt für Schritt. Führe nach jedem Task die Quality Gates aus. -## Planarchy-Kontext +## CapaKraken-Kontext - Monorepo: pnpm workspaces + Turborepo - Stack: Next.js 15 App Router + tRPC v11 + Prisma + PostgreSQL - Dev-Server: `pnpm dev` auf Port 3100 -- DB: PostgreSQL auf Port 5433 (`postgresql://planarchy:capakraken_dev@localhost:5433/planarchy`) +- DB: PostgreSQL auf Port 5433 (`postgresql://capakraken:capakraken_dev@localhost:5433/capakraken`) ## Implementierungs-Reihenfolge (immer einhalten) 1. **Prisma Schema** (`packages/db/prisma/schema.prisma`) → `pnpm db:push` @@ -18,8 +18,8 @@ Lies `plan.md` und implementiere die Tasks Schritt für Schritt. Führe nach jed ## Nach jeder Schema-Änderung (Pflicht!) ```bash -DATABASE_URL="postgresql://planarchy:capakraken_dev@localhost:5433/planarchy" \ - pnpm --filter @capakraken/db exec prisma generate +pnpm db:generate +pnpm db:validate rm -rf apps/web/.next ``` diff --git a/.claude/commands/perf.md b/.claude/commands/perf.md index 1e33b9b..15824ee 100644 --- a/.claude/commands/perf.md +++ b/.claude/commands/perf.md @@ -1,12 +1,12 @@ # PerformanceAgent — Web App & Data Optimization Specialist -Du bist der **PerformanceAgent** für das Planarchy-Projekt. Du bist Spezialist für Performance-Optimierung von datenintensiven Web-Applikationen mit großen PostgreSQL-Datenbanken, komplexen Berechnungen und visuell anspruchsvollen Interfaces. +Du bist der **PerformanceAgent** für das CapaKraken-Projekt. Du bist Spezialist für Performance-Optimierung von datenintensiven Web-Applikationen mit großen PostgreSQL-Datenbanken, komplexen Berechnungen und visuell anspruchsvollen Interfaces. ## Deine Aufgabe Profil erstellen → Bottlenecks identifizieren → Fixes nach Impact ranken → Implementierungsplan ausgeben. Implementiere NICHTS selbst — du lieferst einen priorisierten Befundbericht, den der Implementer umsetzt. -## Planarchy-Stack (immer im Blick) +## CapaKraken-Stack (immer im Blick) - **Frontend:** Next.js 15 App Router, React 19, tRPC v11, Tailwind CSS v4 - **Backend:** tRPC Procedures, Prisma ORM, PostgreSQL 16 - **Auth:** Auth.js v5, dbUser-Caching per Request in TRPCContext @@ -61,7 +61,7 @@ DB Seq Scan auf großer Tabelle → Index anlegen Erstelle `research/perf-audit-[datum].md`: ```markdown -# Performance Audit — Planarchy +# Performance Audit — CapaKraken **Datum:** YYYY-MM-DD **Analysiert:** [welche Bereiche] @@ -98,7 +98,7 @@ Erstelle `research/perf-audit-[datum].md`: - ... ``` -## Typische Planarchy-Bottlenecks (bekannte Kandidaten) +## Typische CapaKraken-Bottlenecks (bekannte Kandidaten) - **Timeline:** Viele Allocations auf einmal rendern (SVG-Elemente, keine Virtualisierung) - **Dashboard:** Widget-Queries laufen parallel, könnten gebündelt werden diff --git a/.claude/commands/plan.md b/.claude/commands/plan.md index 9cd867f..9032ae1 100644 --- a/.claude/commands/plan.md +++ b/.claude/commands/plan.md @@ -1,9 +1,9 @@ -Du bist der **Planner** für das Planarchy-Projekt. +Du bist der **Planner** für das CapaKraken-Projekt. ## Deine Aufgabe Analysiere die gegebene Anforderung und erstelle einen konkreten Umsetzungsplan. Implementiere NICHTS selbst. -## Planarchy-Kontext +## CapaKraken-Kontext - Monorepo: `apps/web` (Next.js 15) + `packages/` (shared, db, engine, staffing, api, ui) - Paketabhängigkeiten: `web → api → engine/staffing/db → shared` (keine Zyklen!) - Prisma-Schema-Änderungen erfordern immer `prisma generate` + `.next/` Cache löschen diff --git a/.claude/commands/research.md b/.claude/commands/research.md index 45d9713..bf54484 100644 --- a/.claude/commands/research.md +++ b/.claude/commands/research.md @@ -1,11 +1,11 @@ -# Research-Agent für Planarchy +# Research-Agent für CapaKraken -Du bist der **Research-Agent** für das Planarchy-Projekt. Deine Aufgabe ist es, komplexe technische oder fachliche Fragen zu analysieren, Optionen zu bewerten und strukturierte Entscheidungsgrundlagen für den Planner- und Implementer-Agenten bereitzustellen. +Du bist der **Research-Agent** für das CapaKraken-Projekt. Deine Aufgabe ist es, komplexe technische oder fachliche Fragen zu analysieren, Optionen zu bewerten und strukturierte Entscheidungsgrundlagen für den Planner- und Implementer-Agenten bereitzustellen. ## Deine Aufgabe Führe tiefgehende Recherche durch. Implementiere NICHTS. Schreibe Code nur als Beispiele/Prototypen zur Veranschaulichung. -## Planarchy-Kontext (immer im Blick behalten) +## CapaKraken-Kontext (immer im Blick behalten) - **Stack:** Next.js 15 App Router + tRPC v11 + Prisma + PostgreSQL + pnpm Monorepo - **Ziel:** Ressourcenplanung für 3D-Produktionsstudio (Producer & Chapter Leads) - **Kritische Constraints:** @@ -36,7 +36,7 @@ Erstelle `research/[thema]-[datum].md` im Projekt-Root: - ... **Cons:** - ... -**Kompatibilität mit Planarchy-Stack:** ✅/⚠️/❌ +**Kompatibilität mit CapaKraken-Stack:** ✅/⚠️/❌ **Aufwand:** Klein / Mittel / Groß ### Option B: [Name] @@ -55,7 +55,7 @@ Erstelle `research/[thema]-[datum].md` im Projekt-Root: - [ ] ... ``` -## Typische Research-Themen für Planarchy +## Typische Research-Themen für CapaKraken - **Skalierung:** SSE Event-Bus → Redis Pub/Sub Migration - **Performance:** Timeline-Rendering-Optimierung (1000+ Allocations) - **Auth:** Produktions-taugliche Auth-Strategie (aktuell nur SHA-256 dev-only) diff --git a/.claude/commands/review.md b/.claude/commands/review.md index b518683..5453639 100644 --- a/.claude/commands/review.md +++ b/.claude/commands/review.md @@ -1,9 +1,9 @@ -Du bist der **Reviewer** für das Planarchy-Projekt. +Du bist der **Reviewer** für das CapaKraken-Projekt. ## Deine Aufgabe Prüfe den aktuellen Code gegen alle Quality Gates, Coding-Standards und Architektur-Prinzipien. Erstelle einen Review-Report. -## Planarchy-Kontext +## CapaKraken-Kontext - Monorepo: pnpm workspaces + Turborepo - Stack: Next.js 15 App Router + tRPC v11 + Prisma + PostgreSQL - TypeScript: `strict: true`, `exactOptionalPropertyTypes: true` diff --git a/.claude/commands/visualaudit.md b/.claude/commands/visualaudit.md index 730824c..835a336 100644 --- a/.claude/commands/visualaudit.md +++ b/.claude/commands/visualaudit.md @@ -1,8 +1,8 @@ -You are an expert UX auditor, QA engineer, and frontend performance specialist working on the **Planarchy** project — an internal resource planning and project staffing tool for a 3D production studio. +You are an expert UX auditor, QA engineer, and frontend performance specialist working on the **CapaKraken** project — an internal resource planning and project staffing tool for a 3D production studio. Your task is to perform a thorough audit of the running web service at **http://localhost:3100** and produce a structured report with prioritized, actionable feedback for the plan agent. -## Planarchy Context +## CapaKraken Context - **Stack:** Next.js 15 (App Router) + tRPC v11 + Tailwind CSS v4 + Auth.js v5 - **Target users:** Producers, Chapter Leads, resource managers (internal tool, desktop-first) - **Design system:** Custom Tailwind-based with `brand-*` color tokens, dark mode support @@ -111,7 +111,7 @@ For each suggestion include: Structure your final report as follows — this will be used directly as feedback for the plan agent: -# Planarchy — UX & Quality Audit Report +# CapaKraken — UX & Quality Audit Report **Date**: [date] **Audited URL**: http://localhost:3100 **Overall Score**: [X/10] @@ -158,7 +158,7 @@ Structure your final report as follows — this will be used directly as feedbac - Be constructive: every criticism should come with a concrete suggestion - Prioritize ruthlessly: not everything is equally important - Think like a first-time user AND a power user — they have different needs -- Planarchy is a desktop-first internal tool — mobile is secondary but should not be broken +- CapaKraken is a desktop-first internal tool — mobile is secondary but should not be broken - The goal is: less lag, better functionality, more clarity, easy-to-use options, consistent UI, and perfectly working themes - After the report, suggest 3–5 concrete tasks the plan agent should pick up next diff --git a/.gitignore b/.gitignore index d8051bf..e5d25db 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ node_modules/ # Build outputs .next/ .next-e2e/ +**/.next.root-owned.* dist/ build/ .turbo/ diff --git a/AGENTS.md b/AGENTS.md index d8c7216..252bd18 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,4 +1,4 @@ -# planarchy +# CapaKraken > Multi-agent orchestration framework for agentic coding diff --git a/CLAUDE.md b/CLAUDE.md index 14d9b00..2b43be5 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -19,7 +19,7 @@ CapaKraken ist ein Ressourcenplanungs- und Projektbesetzungs-Tool fuer eine 3D-P ## Monorepo-Struktur ```text -planarchy/ +capakraken/ ├── apps/web ├── packages/shared ├── packages/db @@ -46,10 +46,10 @@ planarchy/ ## Dokumente -- Einstiegspunkt: [docs/README.md](/home/hartmut/Documents/Copilot/planarchy/docs/README.md) -- Aktiver Backlog: [docs/product-roadmap.md](/home/hartmut/Documents/Copilot/planarchy/docs/product-roadmap.md) -- Estimating-Design: [docs/estimating-extension-design.md](/home/hartmut/Documents/Copilot/planarchy/docs/estimating-extension-design.md) -- Historische Entscheidungen: [LEARNINGS.md](/home/hartmut/Documents/Copilot/planarchy/LEARNINGS.md) +- Einstiegspunkt: [docs/README.md](docs/README.md) +- Aktiver Backlog: [docs/product-roadmap.md](docs/product-roadmap.md) +- Estimating-Design: [docs/estimating-extension-design.md](docs/estimating-extension-design.md) +- Historische Entscheidungen: [LEARNINGS.md](LEARNINGS.md) ## Routing-Regeln Fuer Agenten @@ -72,4 +72,4 @@ planarchy/ ## Learnings -Wichtige Entscheidungen und Problemloesungen werden zentral in [LEARNINGS.md](/home/hartmut/Documents/Copilot/planarchy/LEARNINGS.md) festgehalten. +Wichtige Entscheidungen und Problemloesungen werden zentral in [LEARNINGS.md](LEARNINGS.md) festgehalten. diff --git a/Claude.md b/Claude.md index bf0d476..807f9fe 100644 --- a/Claude.md +++ b/Claude.md @@ -1,5 +1,5 @@ # Compatibility Note -The canonical project guidance now lives in [CLAUDE.md](/home/hartmut/Documents/Copilot/planarchy/CLAUDE.md). +The canonical project guidance now lives in [CLAUDE.md](CLAUDE.md). This file is kept only as a lightweight compatibility entry point. diff --git a/LEARNINGS.md b/LEARNINGS.md index 6dabb53..865c3b0 100644 --- a/LEARNINGS.md +++ b/LEARNINGS.md @@ -1,4 +1,4 @@ -# Planarchy – Projekt-Learnings +# CapaKraken – Projekt-Learnings ## Format **Datum | Kategorie | Problem → Lösung** @@ -122,7 +122,7 @@ For modal focus trapping: create a `panelRef = useRef(null)`, ca ### 2026-03-05 | Build | MCP-Server im falschen Projektpfad registriert **Problem:** `claude mcp add` wurde aus einem Unterverzeichnis (`packages/db`) heraus ausgeführt. Die Server wurden unter dem Unterverzeichnis-Pfad registriert, nicht unter dem Projekt-Root. -**Lösung:** MCP-Server-Einträge manuell in `~/.claude.json` in den richtigen Projekt-Pfad (`/home/hartmut/Documents/Copilot/planarchy`) verschieben. +**Lösung:** MCP-Server-Einträge manuell in `~/.claude.json` in den richtigen Projekt-Pfad (`/home/hartmut/Documents/Copilot/capakraken`) verschieben. **Für künftige Projekte:** `claude mcp add` immer vom Projekt-Root aus ausführen. --- @@ -181,7 +181,7 @@ For modal focus trapping: create a `panelRef = useRef(null)`, ca ### 2026-03-06 | Architektur | Redis Pub/Sub für SSE **Problem:** SSE Event-Bus war ein In-Memory-Singleton, funktioniert nicht bei mehreren Server-Instanzen. -**Lösung:** `ioredis` in `@capakraken/api` hinzugefügt. Publisher schreibt Events in Redis-Channel `planarchy:sse`, Subscriber auf jeder Instanz empfängt und liefert lokal aus. Graceful Degradation: bei Redis-Ausfall weiterhin lokale Delivery. +**Lösung:** `ioredis` in `@capakraken/api` hinzugefügt. Publisher schreibt Events in Redis-Channel `capakraken:sse`, Subscriber auf jeder Instanz empfängt und liefert lokal aus. Graceful Degradation: bei Redis-Ausfall weiterhin lokale Delivery. **Import-Pattern:** `import { Redis } from "ioredis"` (named export, nicht default) – notwendig mit `moduleResolution: NodeNext` + ioredis v5. **Offene Frage:** In Dev-Umgebung reicht lokale Delivery; Redis läuft auf Port 6380 via Docker Compose. @@ -313,7 +313,7 @@ prisma.user.upsert({ where: ..., update: { passwordHash: adminHash }, create: { ### 2026-03-06 | Architektur | Granulares RBAC-System: Permission-Override-Muster -**Kontext:** Planarchy hatte 3 hartkodierte Procedure-Levels (protectedProcedure → managerProcedure → adminProcedure) ohne Granularität. Ziel: neue Rolle CONTROLLER + individuelle Permission-Overrides pro User. +**Kontext:** CapaKraken hatte 3 hartkodierte Procedure-Levels (protectedProcedure → managerProcedure → adminProcedure) ohne Granularität. Ziel: neue Rolle CONTROLLER + individuelle Permission-Overrides pro User. **Lösung:** Zweigeteiltes System: 1. **`ROLE_DEFAULT_PERMISSIONS`** — statische Lookup-Tabelle: jede SystemRole hat eine Default-Menge an PermissionKeys. diff --git a/apps/web/next-env.d.ts b/apps/web/next-env.d.ts index 2781e99..830fb59 100644 --- a/apps/web/next-env.d.ts +++ b/apps/web/next-env.d.ts @@ -1,6 +1,6 @@ /// /// -/// +/// // NOTE: This file should not be edited // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/apps/web/public/sw.js b/apps/web/public/sw.js index e52a98b..a64ed96 100644 --- a/apps/web/public/sw.js +++ b/apps/web/public/sw.js @@ -1,6 +1,6 @@ /// -const CACHE_NAME = "planarchy-v1"; +const CACHE_NAME = "capakraken-v2"; const STATIC_EXTENSIONS = /\.(js|css|png|jpg|jpeg|svg|gif|ico|woff2?|ttf|eot)$/; // Offline fallback page (simple inline HTML) @@ -9,7 +9,7 @@ const OFFLINE_HTML = ` - Planarchy — Offline + CapaKraken - Offline