diff --git a/CLAUDE.md b/CLAUDE.md index 2ea8319..b7cf3cf 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -56,7 +56,7 @@ frontend/src/ โ””โ”€โ”€ technical/ # MEMBERSHIP_SYSTEM.md ``` -## Aktuelle Version: v9d + Issue #28 ๐Ÿš€ Development seit 25.03.2026 +## Aktuelle Version: v9e (Issue #28 Complete) ๐Ÿš€ Ready for Production 26.03.2026 ### Implementiert โœ… - Login (E-Mail + bcrypt), Auth-Middleware alle Endpoints, Rate Limiting @@ -188,7 +188,7 @@ frontend/src/ ๐Ÿ“š Details: `.claude/docs/technical/MEMBERSHIP_SYSTEM.md` ยท `.claude/docs/architecture/FEATURE_ENFORCEMENT.md` -### Issue #28: Unified Prompt System โœ… (Development 25.03.2026) +### Issue #28: Unified Prompt System โœ… (Completed 26.03.2026) **AI-Prompts Flexibilisierung - Komplett รผberarbeitet:** @@ -220,21 +220,88 @@ frontend/src/ - JSON-Output erzwingbar pro Prompt - Cross-Module Korrelationen mรถglich +**Debug & Development Tools (26.03.2026):** +- โœ… **Comprehensive Debug System:** + - Test-Button in Prompt-Editor mit Debug-Modus + - Shows resolved/unresolved placeholders + - Displays final prompts sent to AI + - Per-stage debug info for pipelines + - Export debug data as JSON +- โœ… **Placeholder Export (per Test):** + - Button in Debug-Viewer + - Exports all placeholders with values per execution +- โœ… **Global Placeholder Export:** + - Settings โ†’ "๐Ÿ“Š Platzhalter exportieren" + - All 32 placeholders with current values + - Organized by category + - Includes metadata (description, example) +- โœ… **Batch Import/Export:** + - Admin โ†’ "๐Ÿ“ฆ Alle exportieren" (all prompts as JSON) + - Admin โ†’ "๐Ÿ“ฅ Importieren" (upload JSON, create/update) + - Devโ†’Prod sync in 2 clicks + +**Placeholder System Enhancements:** +- โœ… **6 New Placeholder Functions:** + - `{{sleep_avg_duration}}` - Average sleep duration (7d) + - `{{sleep_avg_quality}}` - Deep+REM percentage (7d) + - `{{rest_days_count}}` - Rest days count (30d) + - `{{vitals_avg_hr}}` - Average resting heart rate (7d) + - `{{vitals_avg_hrv}}` - Average HRV (7d) + - `{{vitals_vo2_max}}` - Latest VO2 Max value +- โœ… **7 Reconstructed Placeholders:** + - `{{caliper_summary}}`, `{{circ_summary}}` + - `{{goal_weight}}`, `{{goal_bf_pct}}` + - `{{nutrition_days}}` + - `{{protein_ziel_low}}`, `{{protein_ziel_high}}` + - `{{activity_detail}}` +- **Total: 32 active placeholders** across 6 categories + +**Bug Fixes (26.03.2026):** +- โœ… **PIPELINE_MASTER Response:** Analysis page now uses unified executor + - Fixed: Old `/insights/run` endpoint sent raw template to AI + - Now: `/prompts/execute` with proper stage processing +- โœ… **Age Calculation:** Handle PostgreSQL DATE objects + - Fixed: `calculate_age()` expected string, got date object + - Now: Handles both strings and date objects +- โœ… **Sleep Quality 0%:** Lowercase stage names + - Fixed: Checked ['Deep', 'REM'], but stored as ['deep', 'rem'] + - Now: Correct case-sensitive matching +- โœ… **SQL Column Name Errors:** + - Fixed: `bf_jpl` โ†’ `body_fat_pct` + - Fixed: `brust` โ†’ `c_chest`, etc. + - Fixed: `protein` โ†’ `protein_g` +- โœ… **Decimal ร— Float Type Error:** + - Fixed: `protein_ziel_low/high` calculations + - Now: Convert Decimal to float before multiplication + **Migrations:** - Migration 020: Unified Prompt System Schema **Backend Endpoints:** -- `POST /api/prompts/execute` - Universeller Executor +- `POST /api/prompts/execute` - Universeller Executor (with save=true param) - `POST /api/prompts/unified` - Create unified prompt - `PUT /api/prompts/unified/{id}` - Update unified prompt +- `GET /api/prompts/export-all` - Export all prompts as JSON +- `POST /api/prompts/import` - Import prompts from JSON (with overwrite option) +- `GET /api/prompts/placeholders/export-values` - Export all placeholder values **UI:** - Admin โ†’ KI-Prompts: Type-Filter (Alle/Basis/Pipeline) - Neuer Prompt-Editor mit dynamischem Stage-Builder - Inline editing von Stages + Prompts +- Test-Button mit Debug-Viewer (always visible) +- Export/Import Buttons (๐Ÿ“ฆ Alle exportieren, ๐Ÿ“ฅ Importieren) +- Settings โ†’ ๐Ÿ“Š Platzhalter exportieren ๐Ÿ“š Details: `.claude/docs/functional/AI_PROMPTS.md` +**Related Gitea Issues:** +- #28: Unified Prompt System - โœ… CLOSED (26.03.2026) +- #43: Enhanced Debug UI - ๐Ÿ”ฒ OPEN (Future enhancement) +- #44: BUG - Analysen lรถschen - ๐Ÿ”ฒ OPEN (High priority) +- #45: KI Prompt-Optimierer - ๐Ÿ”ฒ OPEN (Future feature) +- #46: KI Prompt-Ersteller - ๐Ÿ”ฒ OPEN (Future feature) + ## Feature-Roadmap > ๐Ÿ“‹ **Detaillierte Roadmap:** `.claude/docs/ROADMAP.md` (Phasen 0-3, Timeline, Abhรคngigkeiten)