async function renderStandards() { const content = document.getElementById('pageContent'); content.innerHTML = `
Loading...
`; try { const data = await api.getStandards(); const standards = data.standards || []; const index = data.index || ''; const container = document.getElementById('standardsContent'); let html = ''; if (index) { html += `
Standards Index
${escapeHtml(index)}
`; } if (standards.length === 0) { html += '
📐

No standards defined

Run "Discover" to extract patterns from your codebase

'; } else { standards.forEach(s => { html += `
${s.name}
${escapeHtml(s.content)}
`; }); } container.innerHTML = html; } catch (err) { document.getElementById('standardsContent').innerHTML = `

${escapeHtml(err.message)}

`; } } async function runStandardsDiscovery() { try { const r = await api.discoverStandards(); showToast(r.message, 'success'); } catch (err) { showToast(`Error: ${err.message}`, 'error'); } }