Daily Workflow Automation
Automatically processes daily notes when user mentions diary entries, daily summaries, or end-of-day workflows. Extracts insights, contexts, and categorizes content from "### š§ Notes" sections. Use when user discusses daily notes, asks "what did I work on today", mentions end-of-day, or talks about extracting diary content.
Packaged view
This page reorganizes the original catalog entry around fit, installability, and workflow context first. The original raw source lives below.
Install command
npx @skill-hub/cli install harrysayers7-claudelife-daily-workflow
Repository
Skill path: .claude/skills/daily-workflow
Automatically processes daily notes when user mentions diary entries, daily summaries, or end-of-day workflows. Extracts insights, contexts, and categorizes content from "### š§ Notes" sections. Use when user discusses daily notes, asks "what did I work on today", mentions end-of-day, or talks about extracting diary content.
Open repositoryBest for
Primary workflow: Write Technical Docs.
Technical facets: Full Stack, Tech Writer.
Target audience: everyone.
License: Unknown.
Original source
Catalog source: SkillHub Club.
Repository owner: harrysayers7.
This is still a mirrored public skill entry. Review the repository before installing into production workflows.
What it helps with
- Install Daily Workflow Automation into Claude Code, Codex CLI, Gemini CLI, or OpenCode workflows
- Review https://github.com/harrysayers7/claudelife before adding Daily Workflow Automation to shared team environments
- Use Daily Workflow Automation for productivity workflows
Works across
Favorites: 0.
Sub-skills: 0.
Aggregator: No.
Original source / Raw SKILL.md
---
name: Daily Workflow Automation
description: Automatically processes daily notes when user mentions diary entries, daily summaries, or end-of-day workflows. Extracts insights, contexts, and categorizes content from "### š§ Notes" sections. Use when user discusses daily notes, asks "what did I work on today", mentions end-of-day, or talks about extracting diary content.
---
# Daily Workflow Automation
Auto-process daily notes: extract entries ā classify ā route to appropriate files ā update trackers.
## When This Runs
Auto-triggers when user:
- Mentions "today's diary", "daily note", "extract content"
- Asks "what did I work on today?"
- Natural end-of-day: "done for today", "wrapping up", "extract today"
- References "### š§ Notes" section
## Quick Workflow
1. Scan daily notes in `00 - Daily/` for unprocessed files
2. Extract entries from `### š§ Notes` sections
3. Classify each entry (Diary/Insight/Context/Idea) with AI
4. Analyze relevance to 24 context areas (business, tech, health, etc.)
5. Route to primary + secondary destinations (>80% confidence)
6. Transform diary narratives ā factual knowledge (for context files)
7. Present routing plan with reasoning
8. Get user approval (y/n/edit)
9. Execute routing with cross-links
10. Update tracker (`.extract-daily-content-tracker.json`)
11. **Smart memory detection**: Suggest Serena/Graphiti updates
## Entry Classification
### Diary Entries
- **Primary**: `04-resources/diary.md` (always)
- **Secondary**: `[area]/diary-[area].md` (if >80% confidence)
- **Format**: Preserve original narrative with date headers
### Insights
- **Primary**: `01-areas/p-dev/insights.md` (always)
- **Secondary**: Never to context files (insights ā context)
### Context Entries
- **Primary**: `04-resources/context.md` (always)
- **Secondary**: Matching `CLAUDE.md` files (if >80% confidence)
- **Format**: Factual bullet points (no dates, no narrative)
### Ideas
- **Primary**: `04-resources/ideas.md` (always)
- **Secondary**: Never to context files
## Context Areas (24 files)
**Business** (8):
- `business/mokai/CLAUDE.md`
- `business/mokhouse/CLAUDE.md`
- `business/accounting/CLAUDE.md`
- `business/crypto/CLAUDE.md`
- `business/soletrader/CLAUDE.md`
- `business/SMSF/CLAUDE.md`
- `business/safia/CLAUDE.md`
- `business/trust/CLAUDE.md`
**Personal Development** (3):
- `p-dev/learning/CLAUDE.md`
- `p-dev/mindset/CLAUDE.md`
- `p-dev/psychedelics/CLAUDE.md`
**Health & Fitness** (4):
- `health-fitness/CLAUDE.md`
- `health-fitness/diet/CLAUDE.md`
- `health-fitness/medical/CLAUDE.md`
- `health-fitness/gym/CLAUDE.md`
**Tech** (5):
- `tech/CLAUDE.md`
- `tech/ableton/CLAUDE.md`
- `tech/mac/CLAUDE.md`
- `tech/ai/CLAUDE.md`
- `tech/ai/research-ai/context-engineering/CLAUDE.md`
**Other** (3):
- `claude-code/CLAUDE.md`
- `harry/CLAUDE.md`
- `people/CLAUDE.md`
## Diary ā Context Transformation
**Original diary entry**:
```
"Today I built a Supabase database for financial tracking for MOKAI. Took forever to set up auth but got it working. Will use for invoice management."
```
**Context file format** (`tech/CLAUDE.md`):
```markdown
- Supabase: Financial tracking database with auth
*From:* [[04-resources/diary#25-10-19 - Sun]]
*Related:* [[business/mokai/context-mokai]]
```
**Context file format** (`business/mokai/CLAUDE.md`):
```markdown
- Financial tracking system: Supabase database for invoice management
*From:* [[04-resources/diary#25-10-19 - Sun]]
*Related:* [[tech/context-tech]]
```
**Transformations applied**:
- ā
Extract topically relevant facts
- ā
Rephrase to third-person
- ā
Remove: dates, pronouns, temporal markers, feelings
- ā
Format: Bullet points with cross-links
- ā
Custom formulation for each context area
## Smart Memory Detection
After extraction, detect opportunities to update memory systems:
### Serena Memory Detection
**Triggers**: Technical patterns, workflows, commands, automation
**Keywords**: `workflow`, `pattern`, `convention`, `script`, `command`, `automation`, `process`
**Example**:
```
Entry: "Created new workflow using Supabase triggers for invoice automation"
Detection:
System: Serena
Memory: system_patterns_and_guidelines
Confidence: 0.87
Update: "Invoice automation: Supabase triggers reduce manual data entry"
```
### Graphiti Detection (3 instances)
**Triggers**: Strategic decisions, business events, personal insights
**Keywords**: `decided`, `strategy`, `planning`, `client`, `meeting`, `learned`, `insight`, `discovered`
**Routing**:
- `business/mokai/*` or `business/mokhouse/*` ā **graphiti-mokai**
- `business/accounting/*`, `crypto/*`, `SMSF/*` ā **graphiti-finance**
- Everything else ā **graphiti-personal**
**Example**:
```
Entry: "Discussed the future direction of MOKAI with Jack and Brie over dinner"
Detection:
System: Graphiti
Instance: graphiti-mokai
Confidence: 0.85
Episode: "MOKAI strategic planning session with Jack and Brie discussing future business direction and growth opportunities"
```
## File References
- Daily note template: [reference/templates.md](reference/templates.md)
- Formatting rules: [reference/formatting-rules.md](reference/formatting-rules.md)
- Extraction script: `scripts/extract_content.py <date>`
## MCP Integration
**Serena MCP** (preferred for file operations):
- `mcp__serena__list_dir` - Find daily notes
- `mcp__serena__search_for_pattern` - Extract ### š§ Notes sections
- `mcp__serena__find_file` - Locate context files
- `mcp__serena__write_memory` - Update Serena memories
**Graphiti MCP** (knowledge graph storage):
- `mcp__graphiti__add_memory` - Store strategic insights
**Use Serena for pattern matching** (faster than Read tool)
## Tracker System
**Location**: `.claude/commands/.extract-daily-content-tracker.json`
**Tracks**:
- Last scan timestamp
- Processed files (with modification times)
- Entries processed per file
- Routing decisions with confidence scores
**View tracker**:
```bash
cat .claude/commands/.extract-daily-content-tracker.json | jq '.processed_files | to_entries | last'
```
**Reset tracker** (force re-extraction):
```bash
rm .claude/commands/.extract-daily-content-tracker.json
```
## Critical Rules
- ā
**Always preserve frontmatter** (date, event) in daily notes
- ā
**Use Serena MCP** for pattern matching (faster than Read)
- ā
**Deduplicate insights** before storing in Graphiti
- ā
**Never delete original content** during extraction
- ā
**Transform diary ā factual** for context files
- ā
**Preserve narrative** for diary files
- ā
**Require >80% confidence** for secondary routing
- ā
**Create cross-links** bidirectionally
- ā
**Auto-create diary files** with proper frontmatter
- ā
**Get user approval** before memory updates
## User Approval Flow
After extraction, user chooses:
**[a] Update all** - Update all suggested memories (confidence >0.80)
**[s] Selective** - Choose which memories to update:
```
Which memories to update? (comma-separated)
1. Serena (system_patterns_and_guidelines) - Confidence: 0.87
2. Graphiti-MOKAI (strategic planning) - Confidence: 0.85
3. Graphiti-Personal (health insight) - Confidence: 0.78
Your choice: 2
```
**[n] Skip** - No memory updates
**[l] Later** - Queue for end-of-day batch review
## Example Workflow
**User**: "What did I work on today?"
**Claude**:
1. Scans `00 - Daily/` for today's note
2. Extracts entries from `### š§ Notes`
3. Classifies each entry
4. Presents routing plan:
```
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š Extraction Plan for [[25-10-21 - Mon]]
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Entry 1: "MOKAI uses Indigenous procurement..."
Type: Context (96% confidence)
Reason: Factual business practice information
Primary: 04-resources/context.md
Secondary:
ā business/mokai/CLAUDE.md (98%)
ā Direct MOKAI business strategy reference
ā harry/CLAUDE.md (87%)
ā Personal Indigenous identity context
Entry 2: "Finished mixing Nintendo track..."
Type: Diary (94% confidence)
Reason: Daily activity log, project completion
Primary: 04-resources/diary.md
Secondary:
ā business/mokhouse/diary-mokhouse.md (97%)
ā MOK HOUSE client project completion
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Actions: [y]es / [n]o / [e]dit / [s]kip entry
```
5. User approves: `y`
6. Executes routing with cross-links
7. Updates tracker
8. Detects memory opportunities:
```
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š§ Memory System Detection
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š Graphiti (MOKAI):
Episode: "MOKAI Indigenous procurement strategy"
Confidence: 0.96
Reason: Strategic business positioning
Would you like to update memory systems?
[a] Update all suggested memories
[s] Selective (choose which to update)
[n] Skip memory updates
[l] Later (remind me at EOD)
```
## Troubleshooting
**Issue**: AI misclassifies entries
- **Solution**: Use edit mode to correct, AI learns from patterns
**Issue**: Too many secondary destinations
- **Solution**: Increase confidence threshold (currently 0.8)
**Issue**: Diary files not created
- **Solution**: Verify auto-creation logic, check file permissions
**Issue**: Missing cross-links
- **Solution**: Verify append operations, check for write errors
**Issue**: Memory detection missing opportunities
- **Solution**: Review detection keywords, adjust confidence threshold
**Issue**: Wrong Graphiti instance selected
- **Solution**: Manually specify instance in selective mode
## Related Commands
- Fallback: `/extract-daily-content` (manual trigger)
- Memory: `/update-serena-memory`
- Documentation: `/report:document-system`
## Success Criteria
- ā
Correctly classify entry types (>90% accuracy)
- ā
Route to appropriate areas with good confidence
- ā
Show clear reasoning for routing decisions
- ā
Allow easy manual override
- ā
Create valid cross-links bidirectionally
- ā
Auto-create diary files with proper frontmatter
- ā
Track all routing decisions
- ā
Handle incremental runs efficiently
- ā
Maintain file integrity across all destinations
- ā
Respect >80% confidence threshold for secondary routing
---
## Referenced Files
> The following files are referenced in this skill and included for context.
### reference/templates.md
```markdown
# Daily Note Template Reference
This document describes the structure and patterns used in daily notes for proper extraction and categorization.
## Template Location
Main template: [98-templates/daily-note.md](../../../98-templates/daily-note.md)
## Frontmatter Structure
```yaml
---
type: daily note
date: "YYYY-MM-DD"
day: Mon
month: Jan
year: YYYY
event: "" # Optional: special events/occasions
---
```
## Standard Sections
### 1. Header
```markdown
# š¤ļø Day - DDth MMM YY
```
### 2. Tasks Section (Dataview)
```dataview
TASK
WHERE file.name = this.file.name
```
### 3. Events Section (Dataview)
```dataview
TABLE WITHOUT ID
file.link as "Event",
date as "Date",
time as "Time",
location as "Location"
FROM "00 - Daily"
WHERE type = "event" AND date >= date(today) AND date <= date(today) + dur(30 days)
SORT date ASC
LIMIT 10
```
### 4. Notes Section (PRIMARY EXTRACTION TARGET)
```markdown
### š§ Notes
[User's daily entries go here - this is what gets extracted and categorized]
```
**Extraction Pattern**:
- Scan all content between `### š§ Notes` header and next H3 heading (or EOF)
- Extract individual entries (paragraphs separated by blank lines)
- Classify each entry using AI
- Route to appropriate destination files
**Example entries**:
```markdown
### š§ Notes
Built a Supabase database for MOKAI financial tracking today. Authentication setup was tricky but got it working. Will use for invoice management system.
Had an insight about customer retention - need to focus on post-sale support rather than just acquisition. This could be a differentiator for MOK HOUSE.
Idea: Create automated workflow for extracting daily notes using MCP servers. Could classify entries by type and route to appropriate areas.
```
### 5. MOK HOUSE Projects Dashboard (Optional)
```dataview
TABLE WITHOUT ID
file.link as "Project",
status as "Status",
priority as "Priority",
client as "Client"
FROM "02-projects/mokhouse"
WHERE type = "project"
SORT priority DESC, status ASC
```
## Entry Types and Recognition Patterns
### Diary Entries
**Indicators**:
- First-person narrative ("I did...", "Today I...")
- Daily activities and events
- Project completion updates
- Meeting summaries
- Temporal markers (today, this morning, yesterday)
**Example**:
```markdown
Finished mixing the Nintendo track for the client. Took about 4 hours of tweaking the vocal chain. Client approved on first submission.
```
### Insights
**Indicators**:
- Learnings and realizations
- Patterns observed
- Reflections on experiences
- Strategic thinking
- Keywords: "learned", "realized", "insight", "noticed", "pattern"
**Example**:
```markdown
Realized that most client complaints come from unclear project scope. Need to implement detailed SOWs with acceptance criteria for every project.
```
### Context Entries
**Indicators**:
- Factual information
- Technical details
- How-to knowledge
- Configuration notes
- No emotional content
- Keywords: "setup", "configured", "installed", "works by"
**Example**:
```markdown
Supabase RLS policies work by filtering rows at the database level before they reach the application. More secure than application-level filtering.
```
### Ideas
**Indicators**:
- Future possibilities
- Feature concepts
- Business opportunities
- Process improvements
- Keywords: "could", "what if", "idea", "maybe", "potential"
**Example**:
```markdown
What if we created a Chrome extension that auto-captures Notion pages to the daily note? Could save 10 minutes per day.
```
## Nested Sections
Daily notes may include nested subsections:
```markdown
### š§ Notes
#### Deep Work Session
- Completed database schema design
- Implemented auth middleware
#### Client Calls
- Meeting with MOKAI prospect
- Discussed SOW for pentest engagement
```
**Extraction Rule**: Scan ALL H4, H5, H6 subsections within `### š§ Notes` recursively.
## Dataview Integration
Daily notes use Dataview for dynamic content:
### Tasks Query
Shows tasks associated with the daily note file.
### Events Query
Shows upcoming events from the next 30 days from the `00 - Daily/` folder where `type = "event"`.
### Projects Query (MOK HOUSE specific)
Shows active MOK HOUSE projects from `02-projects/mokhouse/` sorted by priority and status.
## Special Markers
### Tags
```markdown
#mokai #client-work #insight
```
Tags within entries help with additional routing context.
### Links
```markdown
Related to [[business/mokai/context-mokai]] and [[02-projects/mokhouse/nintendo-project]]
```
Existing links are preserved during extraction and inform secondary routing decisions.
### Priorities
```markdown
š„ URGENT: Follow up with Supply Nation application
```
Emoji markers indicate priority and can influence routing confidence.
## Cross-Linking Format
When entries are routed to destination files, cross-links are added:
```markdown
*From:* [[04-resources/diary#25-10-21 - Mon]]
*Related:* [[business/mokai/context-mokai]]
```
This creates bidirectional navigation between daily notes and context/diary files.
## File Naming Convention
Daily note files follow this pattern:
```
š¤ļø Day - DDth MMM YY.md
```
Examples:
- `š¤ļø Mon - 21st Oct 25.md`
- `š¤ļø Tue - 22nd Oct 25.md`
- `š¤ļø Wed - 23rd Oct 25.md`
**Parsing Pattern**: Extract date from filename for dating routed entries.
## Location
All daily notes stored in: `00 - Daily/`
## Related Templates
- **Diary file template**: `04-resources/diary.md` (narrative format with date headers)
- **Context file template**: `04-resources/context.md` (factual bullets with cross-links)
- **Insights file template**: `01-areas/p-dev/insights.md` (reflective format)
- **Ideas file template**: `04-resources/ideas.md` (concept format)
```
### reference/formatting-rules.md
```markdown
# Formatting Rules for Daily Workflow
This document specifies exact formatting rules for transforming, routing, and storing extracted daily note entries.
## Entry Type Formatting
### Diary Entries
**Characteristics**:
- Preserve first-person narrative voice
- Include date headers
- Maintain temporal context
- Keep emotional/subjective content
**Primary Destination**: `04-resources/diary.md`
**Format**:
```markdown
## YYYY-MM-DD - Day
[Narrative entry preserved exactly as written, including "I", "today", feelings, etc.]
```
**Secondary Destinations**: `[area]/diary-[area].md` (if confidence >80%)
**Format** (area-specific diary files):
```markdown
## YYYY-MM-DD - Day
[Narrative entry preserved, but filtered to area-relevant content only]
*From:* [[00 - Daily/š¤ļø Day - DDth MMM YY#š§ Notes]]
```
**Example**:
```markdown
## 2025-10-21 - Mon
Finished mixing the Nintendo track today. Took about 4 hours of vocal chain tweaking but client approved on first submission. Feeling good about the workflow improvements I made last month - they're really paying off now.
*From:* [[00 - Daily/š¤ļø Mon - 21st Oct 25#š§ Notes]]
```
---
### Context Entries
**Characteristics**:
- Transform to third-person factual statements
- Remove dates, pronouns, temporal markers
- Remove feelings and subjective assessments
- Extract topically relevant facts only
- Rephrase for each context area (different formulation per area)
**Primary Destination**: `04-resources/context.md`
**Format**:
```markdown
- [Topic]: [Factual statement]
*From:* [[00 - Daily/š¤ļø Day - DDth MMM YY#š§ Notes]]
```
**Secondary Destinations**: Matching `CLAUDE.md` files in specific areas (if confidence >80%)
**Format** (area-specific context files):
```markdown
- [Topic]: [Factual statement custom-formulated for this area]
*From:* [[00 - Daily/š¤ļø Day - DDth MMM YY#š§ Notes]]
*Related:* [[path/to/related/context-file]]
```
**Transformation Rules**:
1. **Remove pronouns**: "I built" ā "Supabase database built"
2. **Remove temporal markers**: "today", "this morning", "yesterday"
3. **Remove feelings**: "Took forever" ā (omit), "feeling good" ā (omit)
4. **Extract facts**: "Will use for invoice management" ā "for invoice management"
5. **Topic-first**: Lead with the main subject
6. **Custom formulation**: Phrase differently for each area to reflect that area's perspective
**Example Transformation**:
**Original Diary Entry**:
```markdown
Today I built a Supabase database for financial tracking for MOKAI. Took forever to set up auth but got it working. Will use for invoice management.
```
**Primary Context** (`04-resources/context.md`):
```markdown
- Supabase: Financial tracking database with auth, for invoice management
*From:* [[00 - Daily/š¤ļø Mon - 21st Oct 25#š§ Notes]]
```
**Secondary Context** (`tech/CLAUDE.md`):
```markdown
- Supabase: Financial tracking database with auth
*From:* [[00 - Daily/š¤ļø Mon - 21st Oct 25#š§ Notes]]
*Related:* [[business/mokai/context-mokai]]
```
**Secondary Context** (`business/mokai/CLAUDE.md`):
```markdown
- Financial tracking system: Supabase database for invoice management
*From:* [[00 - Daily/š¤ļø Mon - 21st Oct 25#š§ Notes]]
*Related:* [[tech/context-tech]]
```
---
### Insights
**Characteristics**:
- Preserve reflective/analytical tone
- Keep first-person if it enhances clarity
- Include date context if relevant to understanding
- Maintain strategic/learning focus
**Primary Destination**: `01-areas/p-dev/insights.md`
**Format**:
```markdown
## YYYY-MM-DD
[Insight preserved with minimal editing, maintaining analytical depth]
*From:* [[00 - Daily/š¤ļø Day - DDth MMM YY#š§ Notes]]
```
**Secondary Destinations**: NEVER route insights to context files (insights ā context)
**Example**:
```markdown
## 2025-10-21
Most client complaints stem from unclear project scope. Implementing detailed SOWs with acceptance criteria for every project could prevent 80% of scope creep issues.
*From:* [[00 - Daily/š¤ļø Mon - 21st Oct 25#š§ Notes]]
```
---
### Ideas
**Characteristics**:
- Preserve speculative/creative tone
- Keep future-oriented language ("could", "what if")
- Maintain brainstorming format
- No need for dates unless time-sensitive
**Primary Destination**: `04-resources/ideas.md`
**Format**:
```markdown
- [Idea statement]
*From:* [[00 - Daily/š¤ļø Day - DDth MMM YY#š§ Notes]]
```
**Secondary Destinations**: NEVER route ideas to context files
**Example**:
```markdown
- Chrome extension that auto-captures Notion pages to daily note - could save 10 minutes per day
*From:* [[00 - Daily/š¤ļø Mon - 21st Oct 25#š§ Notes]]
```
---
## Cross-Linking Format
All routed entries MUST include cross-links back to the source daily note.
### Link to Daily Note
```markdown
*From:* [[00 - Daily/š¤ļø Day - DDth MMM YY#š§ Notes]]
```
**Format Components**:
- `00 - Daily/` - Folder path
- `š¤ļø Day - DDth MMM YY` - Exact filename
- `#š§ Notes` - Section anchor (optional but recommended)
### Link to Related Context Files
```markdown
*Related:* [[path/to/context-file]]
```
**When to add Related links**:
- When an entry routes to multiple context areas
- Add bidirectional links between related areas
- Limit to 1-3 most relevant related files
**Example**:
```markdown
- Supabase: Financial tracking database
*From:* [[00 - Daily/š¤ļø Mon - 21st Oct 25#š§ Notes]]
*Related:* [[business/mokai/context-mokai]], [[tech/context-tech]]
```
---
## Auto-Creation Rules
### Diary Files
If area-specific diary file doesn't exist, create it with frontmatter:
```markdown
---
date created: Day, MM DDth YY, HH:MM:SS am/pm
date modified: Day, MM DDth YY, HH:MM:SS am/pm
---
# [Area Name] Diary
## YYYY-MM-DD - Day
[First entry]
*From:* [[00 - Daily/š¤ļø Day - DDth MMM YY#š§ Notes]]
```
**Locations**:
- `business/mokai/diary-mokai.md`
- `business/mokhouse/diary-mokhouse.md`
- `01-areas/p-dev/learning/diary-learning.md`
- etc.
### Context Files
Context files should already exist. If missing, create with:
```markdown
---
date created: Day, MM DDth YY, HH:MM:SS am/pm
date modified: Day, MM DDth YY, HH:MM:SS am/pm
---
# [Area Name] Context
- [First context entry]
*From:* [[00 - Daily/š¤ļø Day - DDth MMM YY#š§ Notes]]
```
---
## Frontmatter Rules
### Required Frontmatter (for auto-created files)
```yaml
---
date created: Day, MM DDth YY, HH:MM:SS am/pm
date modified: Day, MM DDth YY, HH:MM:SS am/pm
---
```
**Format**:
- Day: `Mon`, `Tue`, `Wed`, etc.
- MM: `10`, `01`, `12`, etc.
- DDth: `21st`, `02nd`, `13th`, etc.
- YY: `25`, `26`, etc.
- Time: `6:24:50 am` or `3:15:30 pm`
### Never Modify Frontmatter (for existing files)
- Preserve existing frontmatter exactly
- Only update `date modified` field on edits (if it exists)
---
## Deduplication Rules
Before appending to destination files, check for duplicates:
### Fuzzy Match Threshold: 80%
Use Levenshtein distance or similar algorithm to detect near-duplicates.
### What to Check
- **Diary entries**: Check last 30 entries in the file
- **Context entries**: Check entire file (usually smaller)
- **Insights**: Check last 50 entries
- **Ideas**: Check entire file
### Duplicate Detection Examples
**Original Entry**:
```markdown
Supabase: Financial tracking database with auth
```
**Existing Entry (DUPLICATE)**:
```markdown
Supabase: Financial tracking DB with authentication
```
**Similarity**: 85% ā Skip appending, log as duplicate
**Existing Entry (NOT DUPLICATE)**:
```markdown
Supabase: Project management database
```
**Similarity**: 60% ā Append as new entry
---
## Append vs Insert Rules
### Always Append (Never Prepend)
Append new entries to the END of destination files to maintain chronological order.
### Section Placement
**Diary Files**:
```markdown
## 2025-10-20 - Sun
[Older entry]
## 2025-10-21 - Mon
[Newer entry] ā APPEND HERE
```
**Context Files**:
```markdown
- Old context entry
*From:* [[old-daily-note]]
- New context entry ā APPEND HERE
*From:* [[new-daily-note]]
```
**Insights Files**:
```markdown
## 2025-10-20
[Older insight]
## 2025-10-21 ā APPEND HERE
[Newer insight]
```
**Ideas Files**:
```markdown
- Old idea
*From:* [[old-daily-note]]
- New idea ā APPEND HERE
*From:* [[new-daily-note]]
```
---
## Special Characters and Escaping
### Preserve Special Characters
- Keep emojis: `š„`, `š`, `ā
`
- Keep formatting: `**bold**`, `*italic*`, `` `code` ``
- Keep lists: `-`, `*`, numbered lists
### Escape Only When Necessary
- Markdown link brackets: Already handled by `[[wikilink]]` format
- Code blocks: Use triple backticks when code snippets are in entries
**Example**:
```markdown
- Configured Supabase RLS with this policy:
```sql
CREATE POLICY "user_access" ON invoices FOR SELECT USING (auth.uid() = user_id);
```
*From:* [[00 - Daily/š¤ļø Mon - 21st Oct 25#š§ Notes]]
```
---
## Validation Checklist
Before marking extraction as complete:
- [ ] All entries classified correctly (Diary/Insight/Context/Idea)
- [ ] Confidence scores >80% for secondary routing
- [ ] Diary entries preserve narrative tone
- [ ] Context entries transformed to factual statements
- [ ] All entries have `*From:*` links
- [ ] Related context files have bidirectional links
- [ ] No duplicate entries appended
- [ ] Frontmatter preserved on existing files
- [ ] New diary files created with proper frontmatter
- [ ] Tracker updated with processed files (but NOT today's file)
- [ ] User approved routing decisions
---
## Error Handling
### Missing Files
- **Diary/Context/Insights/Ideas base files missing**: Error and halt (these should always exist)
- **Area-specific files missing**: Auto-create with frontmatter
### Malformed Entries
- **No extractable content**: Log and skip, don't error
- **Ambiguous classification**: Default to Diary, log for manual review
- **Very short entries (<10 words)**: Classify but flag for review
### Write Failures
- **Permission errors**: Error and halt
- **Concurrent edit conflicts**: Retry once, then error
- **Disk full**: Error and halt
---
## File Integrity Rules
### Never Delete Original Content
- Daily note `### š§ Notes` section remains untouched after extraction
- Extraction is a **copy operation**, not a move operation
### Atomic Operations
- Write to temporary file first
- Verify write success
- Rename to final destination
- Prevents partial writes
### Tracker Updates
- Update tracker ONLY after ALL entries successfully routed
- Mark files as processed ONLY if today is PAST (allow re-processing today's file)
- Store confidence scores for audit trail
```