Free tools
Drucker-inspired thinking tool

Turn scattered work into clear contribution.

A free set of guided exercises for employees and teams. Move through a few focused prompts, then generate a one-page overview you can copy, print, or use in a planning conversation.

All work saved locally

Saved sessions

`; } function triggerDownload(html, filename) { const blob = new Blob([html], { type: 'text/html' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = filename; document.body.appendChild(a); a.click(); a.remove(); setTimeout(() => URL.revokeObjectURL(url), 1000); } function stamp(d) { return d.toISOString().slice(0, 16).replace(/[:T]/g, '-'); } document.getElementById('downloadBtn').addEventListener('click', () => { saveCurrent(); const now = new Date(); triggerDownload(reportHtml(answers, now), `drucker-plan-${stamp(now)}.html`); toast.textContent = 'Drucker Plan downloaded.'; }); /* ---------- Session history ---------- */ function loadSessions() { return JSON.parse(localStorage.getItem(SESSIONS_KEY) || '[]'); } function saveSessions(list) { localStorage.setItem(SESSIONS_KEY, JSON.stringify(list)); } function countAnswered(data) { let n = 0; modules.forEach(mod => mod.fields.forEach(([, key]) => { if (data[mod.id] && (data[mod.id][key] || '').trim()) n++; })); return n; } function totalFields() { return modules.reduce((s, m) => s + m.fields.length, 0); } function renderHistory() { const list = loadSessions(); if (!list.length) { historyList.innerHTML = '

No saved sessions yet. Click "Save this session" to snapshot your answers and revisit them later.

'; return; } historyList.innerHTML = list.map(s => `
${escapeHtml(s.label)}${s.answered}/${totalFields()} prompts answered
`).join(''); } function reopenSession(s) { Object.keys(answers).forEach(k => delete answers[k]); Object.assign(answers, JSON.parse(JSON.stringify(s.data))); persist(); activeStep = 0; render(); toast.textContent = `Reopened session from ${s.label}.`; } historyList.addEventListener('click', e => { const btn = e.target.closest('button[data-act]'); if (!btn) return; const list = loadSessions(); const s = list.find(x => x.id === btn.dataset.id); if (!s) return; if (btn.dataset.act === 'open') reopenSession(s); else if (btn.dataset.act === 'download') triggerDownload(reportHtml(s.data, new Date(s.ts)), `drucker-plan-${stamp(new Date(s.ts))}.html`); else if (btn.dataset.act === 'delete') { saveSessions(list.filter(x => x.id !== s.id)); renderHistory(); toast.textContent = 'Session deleted.'; } }); document.getElementById('saveSessionBtn').addEventListener('click', () => { saveCurrent(); const now = new Date(); const list = loadSessions(); list.unshift({ id: String(now.getTime()), ts: now.toISOString(), label: fmtDate(now), answered: countAnswered(answers), data: JSON.parse(JSON.stringify(answers)) }); saveSessions(list.slice(0, 25)); renderHistory(); toast.textContent = 'Session snapshot saved below.'; }); render(); renderHistory(); setSaved('idle');