DATEIEN: index-3.html (nur diese eine Datei)

Du bist Claude Code. Deine Aufgabe ist Task 5 von 7: Implementiere die automatische Story- und Session-Erzeugung aus dem Konzept-/Prompt-Flow in index-3.html.

VORAUSSETZUNG: Task 1 (STATUS_MAPS), Task 2 (Datenmodell), Task 3 (Session-Verkettung) muessen bereits implementiert sein.

KONTEXT: Der Konzept-Modus hat Felder: #pg-title, #pg-desc, #pg-agent, #pg-priority. Der 'Analysieren'-Button loest den Prompt-Flow aus. Aktuell werden weder Kanban-Stories noch Sessions automatisch erzeugt.

AUFGABEN:

  1. PLACEHOLDER createNotionAgentTaskFromPrompt EINFUEGEN (globaler JS-Block):

async function createNotionAgentTaskFromPrompt({ title, description, agentId, priority }) { // TODO: Spaeter ersetzen durch: fetch('/api/agent-tasks', { method:'POST', ... }) console.log('[createNotionAgentTask] called:', { title, agentId, priority }); return { notionPageId: null, status: 'Neu' }; }

  1. HANDLER DES 'ANALYSIEREN'-BUTTONS ERWEITERN: Am Ende des bestehenden Handler-Codes einfuegen:

const promptTitle = document.getElementById('pg-title')?.value || 'Neue Story'; const promptDesc = document.getElementById('pg-desc')?.value || ''; const promptAgent = document.getElementById('pg-agent')?.value || ''; const promptPrio = document.getElementById('pg-priority')?.value || 'Normal';

const { notionPageId } = await createNotionAgentTaskFromPrompt( { title: promptTitle, description: promptDesc, agentId: promptAgent, priority: promptPrio } );

const newTask = { id: ++nextTaskId, title: promptTitle, status: 'todo', owner: promptAgent, sessionId: null, epicId: null, notionPageId: notionPageId, notionStatus: 'Neu', }; kanbanData.tasks.push(newTask);

const newSession = { id: ++nextSessionId, title: promptTitle, agentId: promptAgent, status: 'neu', createdAt: Date.now(), primaryStoryId: newTask.id, }; sessions.push(newSession); newTask.sessionId = newSession.id;

if (promptAgent && agentStatuses[promptAgent] === 'todo') { agentStatuses[promptAgent] = 'in-progress'; }

saveState(); renderAll(); document.getElementById('kanban-section')?.scrollIntoView({ behavior: 'smooth' });

  1. nextTaskId / nextSessionId ABSICHERN: Falls nicht vorhanden: let nextTaskId = Math.max(0, ...kanbanData.tasks.map(t=>t.id)) + 1; Analog fuer nextSessionId.

ERWARTETES ERGEBNIS:

DATEIEN: index-3.html (nur diese eine Datei)