An always-on second brain you talk to. Voice notes in Telegram → typed, linked knowledge in your Obsidian vault. Runs 24/7 on the Claude subscription you already have.
Python ai-agentsai-automationclaudeclaude-codeebbinghausknowledge-graphllmmemory-systemobsidianpersonal-assistantpkmproductivitypythonsecond-braintelegram-botvoice-assistant
feat(processor): improve reliability and add process goals methodology
smixs4bd627730c15
diff --git a/scripts/process.sh b/scripts/process.shindex 089677b..ae7482e 100755--- a/scripts/process.sh+++ b/scripts/process.sh@@ -21,40 +21,68 @@ if [ -z "$TELEGRAM_BOT_TOKEN" ]; thenexit 1fi+# MCP timeout for stdio server (default 5 sec is too short)+export MCP_TIMEOUT=30000+export MAX_MCP_OUTPUT_TOKENS=50000+# Date and chat_idTODAY=$(date +%Y-%m-%d)CHAT_ID="${ALLOWED_USER_IDS//[\[\]]/}" # remove brackets from [123456]-cd "$PROJECT_DIR" # MCP configured for project root-echo "=== d-brain processing for $TODAY ==="-# Run Claude with --dangerously-skip-permissions and MCP+# Run Claude from vault/ for context (reads vault/.claude/CLAUDE.md)+cd "$VAULT_DIR"REPORT=$(claude --print --dangerously-skip-permissions \--mcp-config "$PROJECT_DIR/mcp-config.json" \- -p "Today is $TODAY. Execute daily processing according to dbrain-processor skill." \+ -p "Today is $TODAY. Execute daily processing according to dbrain-processor skill.++CRITICAL: MCP loads in 10-30 seconds. You are NOT in subprocess — MCP IS running, just initializing.++Algorithm:+1. Call mcp__todoist__find-tasks-by-date+2. Error? Wait 10 sec, read goals/, daily/ files+3. Call again+4. Error again? Wait 20 more sec+5. Third call — GUARANTEED to work++DO NOT say MCP unavailable. It is available. Just wait and call." \2>&1) || true+cd "$PROJECT_DIR"echo "=== Claude output ==="echo "$REPORT"echo "===================="+# Remove HTML comments (break Telegram HTML parser)+REPORT_CLEAN=$(echo "$REPORT" | sed '/<!--/,/-->/d')++# Rebuild vault graph (keeps structure up to date)+echo "=== Rebuilding vault graph ==="+cd "$VAULT_DIR"+uv run .claude/skills/graph-builder/scripts/analyze.py || echo "Graph rebuild failed (non-critical)"+cd "$PROJECT_DIR"+# Git commitgit add -Agit commit -m "chore: process daily $TODAY" || truegit push || true# Send to Telegram-if [ -n "$REPORT" ] && [ -n "$CHAT_ID" ]; then+if [ -n "$REPORT_CLEAN" ] && [ -n "$CHAT_ID" ]; thenecho "=== Sending to Telegram ==="- curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \+ RESULT=$(curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \-d "chat_id=$CHAT_ID" \- -d "text=$REPORT" \- -d "parse_mode=HTML" || \- # Fallback: send without HTML parsing- curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \- -d "chat_id=$CHAT_ID" \- -d "text=$REPORT"+ -d "text=$REPORT_CLEAN" \+ -d "parse_mode=HTML")++ # If HTML failed, send without formatting+ if echo "$RESULT" | grep -q '"ok":false'; then+ echo "HTML failed: $RESULT"+ curl -s -X POST "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage" \+ -d "chat_id=$CHAT_ID" \+ -d "text=$REPORT_CLEAN"+ fifiecho "=== Done ==="diff --git a/vault/.claude/CLAUDE.md b/vault/.claude/CLAUDE.mdindex 4c4f2f1..8f9e4b0 100644--- a/vault/.claude/CLAUDE.md+++ b/vault/.claude/CLAUDE.md@@ -207,7 +207,15 @@ Analyze and maintain vault link structure. Use `/graph` command or invoke `graphSee `skills/graph-builder/` for full documentation.+## Learnings (from experience)++1. **Don't rewrite working code** without reason (KISS, DRY, YAGNI)+2. **Don't add checks** that weren't there — let the agent decide+3. **Don't propose solutions** without studying git log/diff first+4. **Don't break architecture** (process.sh → Claude → skill is correct)+5. **Problems are usually simple** (e.g., sed one-liner for HTML fix)+----*System Version: 2.2*-*Updated: 2026-01-30*+*System Version: 2.3*+*Updated: 2026-02-01*diff --git a/vault/.claude/skills/dbrain-processor/SKILL.md b/vault/.claude/skills/dbrain-processor/SKILL.mdindex 0c51d51..66886c8 100644--- a/vault/.claude/skills/dbrain-processor/SKILL.md+++ b/vault/.claude/skills/dbrain-processor/SKILL.md@@ -35,7 +35,7 @@ mcp__todoist__find-tasks-by-date — Check workload## CRITICAL: MCP Tool Usage-**НИКАКИХ WORKAROUNDS. НИКАКИХ "добавь вручную". ТОЛЬКО ПРЯМЫЕ ВЫЗОВЫ.**+**СНАЧАЛА ВЫЗОВИ TOOL. ПОТОМ ДУМАЙ.**У тебя ЕСТЬ доступ к MCP tools:- `mcp__todoist__add-tasks`@@ -44,17 +44,29 @@ mcp__todoist__find-tasks-by-date — Check workload- `mcp__todoist__complete-tasks`- `mcp__todoist__update-tasks`-ЗАПРЕЩЕНО:-- Писать "MCP недоступен"-- Предлагать "добавь вручную"-- Использовать subprocess для вызова CLI-- Делать HTTP запросы к API напрямую-- Выводить команды для копирования--ОБЯЗАТЕЛЬНО:-- Вызывать `mcp__todoist__add-tasks` tool напрямую-- Если tool вернул ошибку — включить её в отчёт-- Если task создан — включить task ID в отчёт+### Обязательный алгоритм:++1. ВЫЗОВИ: mcp__todoist__find-tasks-by-date+ ↓+ Получил результат? → Продолжай+ ↓+ Ошибка? → Читай файлы 30 секунд, потом ВЫЗОВИ СНОВА+ ↓+ 3 ошибки подряд? → Покажи ТОЧНЫЙ текст ошибки++### ЗАПРЕЩЕНО:+- ❌ Писать "MCP недоступен"+- ❌ Предлагать "добавь вручную"+- ❌ Использовать subprocess для вызова CLI+- ❌ Делать HTTP запросы к API напрямую+- ❌ Выводить команды для копирования+- ❌ Решать что не работает БЕЗ вызова tool++### ОБЯЗАТЕЛЬНО:+- ✅ Вызывать MCP tool напрямую+- ✅ Если ошибка — подождать, вызвать снова+- ✅ 3 retry перед любыми выводами+- ✅ Если task создан — включить task ID в отчётПри ошибке MCP tool — показать ТОЧНУЮ ошибку от tool, не придумывать отговорки.@@ -62,10 +74,105 @@ mcp__todoist__find-tasks-by-date — Check workload1. Load context — Read goals/3-weekly.md (ONE Big Thing), goals/2-monthly.md2. Check workload — find-tasks-by-date for 7 days-3. Read daily — daily/YYYY-MM-DD.md-4. Process entries — Classify → task or thought-5. Build links — Connect notes with [[wiki-links]]-6. Generate HTML report — RAW HTML for Telegram+3. **Check process goals** — find-tasks with labels: ["process-goal"]+4. Read daily — daily/YYYY-MM-DD.md+5. Process entries — Classify → task or thought+6. Build links — Connect notes with [[wiki-links]]+7. **Log actions to daily** — append action log entry+8. **Evolve MEMORY.md** — update long-term memory if needed+9. Generate HTML report — RAW HTML for Telegram++## Process Goals Check (Step 3)++**ОБЯЗАТЕЛЬНО выполни при каждом /process:**++### 1. Проверь существующие process goals+Используй mcp__todoist__find-tasks с labels: ["process-goal"]++### 2. Если отсутствуют — создай+Читай goals/ и генерируй process commitments:++| Goal Level | Source | Process Pattern |+|------------|--------|-----------------|+| Weekly ONE Big Thing | goals/3-weekly.md | 2h deep work ежедневно |+| Monthly Top 3 | goals/2-monthly.md | 1 action/день на приоритет |+| Yearly Focus | goals/1-yearly-*.md | 30 мин/день на стратегию |++Создавай recurring tasks с label "process-goal" (max 5-7 активных).++### 3. Включи в отчёт++```html+<b>📋 Process Goals:</b>+• 2h deep work → ✅ активен+• 1 outreach/день → ⚠️ просрочен+{N} активных | {M} требуют внимания+```++See: references/process-goals.md for patterns and examples.++## Logging to daily/ (Step 7)++**После ЛЮБЫХ изменений в vault — СРАЗУ пиши в `daily/YYYY-MM-DD.md`:**++Format:+```+## HH:MM [text]+{Description of actions}++**Created/Updated:**+- [[path/to/file|Name]] — description+```++What to log:+- Files created in thoughts/+- Tasks created in Todoist (with task ID)+- Links built between notes++Example:+```+## 14:30 [text]+Daily processing complete++**Created tasks:** 3+- "Follow-up client" (id: 8501234567, p2, tomorrow)+- "Prepare proposal" (id: 8501234568, p2, friday)++**Saved thoughts:** 1+- [[thoughts/ideas/product-launch|Product Launch]] — new idea+```++## Evolve MEMORY.md (Step 8)++**GOAL:** Keep MEMORY.md current. Don't append — EVOLVE.++### When to update:+- ✅ Key decisions with impact (pivot, tool choice, architecture change)+- ✅ New patterns/insights (learnings)+- ✅ Changes in Active Context (new ONE Big Thing, Hot Projects)++### When NOT to update:+- ❌ Daily trivia (meetings, calls without impact)+- ❌ Temporary notes (stay in daily/)+- ❌ Duplicates of what's already there++### How to update (evolve, not append):++| Situation | Action |+|-----------|--------|+| New contradicts old | REPLACE old information |+| New complements old | Add to existing section |+| Info is outdated | Delete or archive |++Use Edit tool for precise changes.++### In report (if updated):++```html+<b>🧠 MEMORY.md updated:</b>+• Active Context → Hot Projects changed+• Key Decisions → +1 new decision+```## Entry Format@@ -108,6 +215,11 @@ Output RAW HTML (no markdown, no code blocks):<b>✅ Создано задач:</b> {M}• {task} <i>({priority}, {due})</i>+<b>📋 Process Goals:</b>+• {process goal 1} → {status}+• {process goal 2} → {status}+{N} активных | {M} требуют внимания+<b>📅 Загрузка на неделю:</b>Пн: {n} | Вт: {n} | Ср: {n} | Чт: {n} | Пт: {n} | Сб: {n} | Вс: {n}@@ -125,6 +237,10 @@ Output RAW HTML (no markdown, no code blocks):<b>📈 Прогресс:</b>• {goal}: {%} {emoji}+<b>🧠 MEMORY.md:</b>+• {section} → {change description}+<i>(if updated)</i>+---<i>Обработано за {duration}</i>@@ -137,6 +253,11 @@ If all entries have `<!-- ✓ processed -->` marker, return status report:<b>🎯 Текущий фокус:</b>{ONE_BIG_THING}+<b>📋 Process Goals:</b>+• {process goal 1} → {status}+• {process goal 2} → {status}+{N} активных | {M} требуют внимания+<b>📅 Загрузка на неделю:</b>Пн: {n} | Вт: {n} | Ср: {n} | Чт: {n} | Пт: {n} | Сб: {n} | Вс: {n}@@ -177,6 +298,7 @@ Read these files as needed:- references/classification.md — Entry classification rules- references/todoist.md — Task creation details- references/goals.md — Goal alignment logic+- references/process-goals.md — Process vs outcome goals, transformation patterns- references/links.md — Wiki-links building- references/rules.md — Mandatory processing rules- references/report-template.md — Full HTML report specdiff --git a/vault/.claude/skills/dbrain-processor/references/process-goals.md b/vault/.claude/skills/dbrain-processor/references/process-goals.mdnew file mode 100644index 0000000..d3c5ea2--- /dev/null+++ b/vault/.claude/skills/dbrain-processor/references/process-goals.md@@ -0,0 +1,108 @@+# Process Goals++## Concept++**Outcome goals** focus on WHAT you want to achieve:+- "Close the deal"+- "Hit $1M ARR"+- "Launch the product"++**Process goals** focus on HOW you do it:+- "Reach out to 100 potential clients"+- "Send 5 proposals per week"+- "Conduct 3 customer interviews this week"++## Why Process Goals Work Better++Based on research (meta-analysis of 27 experiments in sports):++1. **Control** — You control actions, not outcomes. "Close deal" creates anxiety; "send 3 follow-ups" is actionable.+2. **Confidence** — Process goals turn challenge into achievable steps, boosting self-efficacy.+3. **Focus** — Daily clarity on what to do, not vague aspiration.++## How to Transform++| Outcome Goal | Process Goal |+|--------------|--------------|+| "Close the deal with X" | "Send 1 follow-up per day to client X" |+| "Launch product" | "2h deep work on MVP every morning" |+| "Get 10 clients" | "Write 5 outreach messages per day" |+| "Prepare the program" | "30 min research analogs daily" |+| "Find a partner" | "1 networking message per day" |++## Patterns for Process Goals++### Time Blocks+Regular dedicated time for deep work:+- "2h deep work on [project] every morning 6-8am"+- "1h research [topic] after lunch"++### Frequency Commitments+Consistent action cadence:+- "1 outreach message per day"+- "3 customer calls per week"+- "5 proposals per week"++### Checkpoints+Review milestones:+- "Show draft to 1 person before Friday"+- "Review progress with mentor on Wednesday"++### Streaks+Daily habits:+- "30 min movement every day"+- "10 min journaling in the morning"++## When Processing Voice Entries++If user says outcome goal, consider transforming:++```+User: "Need to close the deal with client X"++BAD: Create task "Close deal with client X" p1+→ Vague, creates anxiety, unclear next action++GOOD: Create task "Send follow-up to client X with updated proposal" p1 due:tomorrow+→ Specific, actionable, controllable+```++## For Weekly Planning++When generating Process Commitments for ONE Big Thing:++1. **Ask:** What daily/weekly habits would make this inevitable?+2. **Limit:** 3-5 process commitments max+3. **Prioritize:** Time blocks > Frequency > Checkpoints+4. **Create:** Recurring tasks in Todoist with appropriate patterns++## Recurring Task Patterns++Map process goals to Todoist dueString:++| Process | dueString |+|---------|-----------|+| "every morning" | "every day at 6am" |+| "every day" | "every day" |+| "every workday" | "every weekday" |+| "3 times per week" | "every monday, wednesday, friday" |+| "once a week" | "every week" |+| "by Friday" | "friday" (one-time) |++## Anti-Patterns++Avoid creating process goals that are:+- Too vague: "Work on project" (how much? when?)+- Too ambitious: "4h deep work 5 days a week" (unsustainable)+- Untrackable: "Think about strategy" (not measurable)++Good process goals are:+- Specific in action+- Bounded in time/frequency+- Trackable (done/not done)++## Reference++Based on: Meta-analysis of 27 experiments in sports showing process goals significantly outperform outcome/performance goals.++See also: "The Success Equation" by Mauboussin — Results = Skill + Luck. Focus on skill (process) is the only controllable strategy.