obsidian-weaklog-processor
CLAUDE.md0 starsChanged 10 months agoMITView on GitHub
Target: Obsidian v1.4.0+ Core Technology: TypeScript, Obsidian Plugin API, Anthropic Claude API
- Installs packages
In this repository2 other files it gives its agents.
- llm-integrationSkill
- obsidian-plugin-devSkill
The file
Show its rules and text
We split this CLAUDE.md into the rules it gives an agent
17 rules. About 0 are common, 6 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 49
Use strict mode ("strict": true in tsconfig.json)
- Very specific: line 50
Prefer interface over type for object shapes
- Very specific: line 51
Use ES modules (import/export), never require
- Very specific: line 63
Always use try/catch for file operations and API calls
- Distinctive: line 66
Never silently fail: either notify user or log error
- Very specific: line 71
ALWAYS use this.app.vault methods, never Node.js fs
- Very specific: line 72
Check file existence before operations: await this.app.vault.adapter.exists(path)
- Very specific: line 73
Use TFile and TFolder types from Obsidian API
- Very specific: line 78
Update frontmatter via this.app.fileManager.processFrontMatter()
- Very specific: line 83
Use Setting class for forms (see Obsidian API docs)
- Very specific: line 84
Call new Notice(message, duration) for notifications
- Distinctive: line 105
Use structured JSON output for parsing AI responses
- Very specific: line 141
Commit messages: <type>: <description> (e.g., feat: add triage modal)
- Distinctive: line 143
Always test in Obsidian before committing functional changes
- Distinctive: line 148
NEVER delete files without user confirmation
- Distinctive: line 153
Avoid reading all files at once.
- Distinctive: line 160
Never execute user-provided code
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Obsidian Weaklog Processor
Project Overview
An Obsidian plugin implementing the "Minimum Protocol" for transforming personal weaknesses into creative works through a 5-step process: Raw input, Cooling period, AI-powered Triage, Synthesis guidance, and Publishing.
Target: Obsidian v1.4.0+ Core Technology: TypeScript, Obsidian Plugin API, Anthropic Claude API
Architecture
Folder Structure (in Vault)
Weaklog/
├── 01_Raw/ # Step 1: Initial capture
├── 02_Cooling/ # Step 2: Time-based waiting
│ └── .cooldown.json # Cooldown state management
├── 03_Triaged/ # Step 3: AI-filtered entries
├── 04_Synthesized/ # Step 4: Transformed content
└── 05_Published/ # Step 5: Final outputPlugin Structure
src/
├── main.ts # Entry point, plugin lifecycle
├── settings.ts # Settings UI and persistence
├── types.ts # Shared type definitions
├── managers/
│ ├── FileManager.ts # All Vault operations (CRUD, move, metadata)
│ └── CooldownManager.ts # .cooldown.json read/write, time checks
├── llm/
│ ├── LLMClient.ts # Anthropic API abstraction
│ ├── TriageAnalyzer.ts # Step 3: 4-criteria evaluation
│ └── SynthesisGuide.ts # Step 4: Question generation
├── views/
│ ├── RawLogModal.ts # Step 1: Input UI
│ ├── TriageModal.ts # Step 3: AI result display
│ └── SynthesisModal.ts # Step 4: Interactive Q&A
└── commands/
├── AddRawLogCommand.ts
├── CheckCooldownCommand.ts
├── TriageCommand.ts
└── SynthesizeCommand.tsCode Style
TypeScript
- Use strict mode (
"strict": truein tsconfig.json) - Prefer
interfaceovertypefor object shapes - Use ES modules (
import/export), neverrequire - Explicit return types for all public methods
- Destructure imports:
import { TFile, Notice } from 'obsidian'
Naming Conventions
- Files: PascalCase for classes (
FileManager.ts), camelCase for utilities - Classes: PascalCase (
CooldownManager) - Methods/Variables: camelCase (
getCooldownStatus) - Constants: UPPER_SNAKE_CASE (
TRIAGE_PROMPT) - File IDs:
YYYY-MM-DD_NNNformat (e.g.,2026-01-27_001)
Error Handling
- Always use
try/catchfor file operations and API calls - Show user-friendly errors via Obsidian's
Noticeclass - Log detailed errors to console:
console.error('[Weaklog]', error) - Never silently fail: either notify user or log error
Obsidian-Specific Rules
File Operations
- ALWAYS use
this.app.vaultmethods, never Node.jsfs - Check file existence before operations:
await this.app.vault.adapter.exists(path) - Use
TFileandTFoldertypes from Obsidian API - Normalize paths with
normalizePath()fromobsidian-normalizePath
Metadata Management
- Store metadata in YAML frontmatter at file top
- Update frontmatter via
this.app.fileManager.processFrontMatter() - Required fields:
weaklog_id,created,cooldown_days,status
UI Components
- Extend
Modalfor all dialogs - Use
Settingclass for forms (see Obsidian API docs) - Call
new Notice(message, duration)for notifications - Modal cleanup: always call
this.close()in button handlers
Command Registration
this.addCommand({
id: 'weaklog:add-raw',
name: 'Add Raw Log',
callback: () => { /* ... */ }
});LLM Integration
API Configuration
- Provider: Anthropic (Claude 3.5 Sonnet)
- Model:
claude-sonnet-4-5 - API Key: User-provided in settings (never hardcode)
- Timeout: 30s for triage, 20s for synthesis
Prompt Guidelines
- Use structured JSON output for parsing AI responses
- Include clear output format examples in prompts
- Temperature: 0.3 for triage (objectivity), 0.7 for synthesis (creativity)
- Max tokens: 1000 for triage, 500 for synthesis
- Handle API failures gracefully: offer manual fallback
Triage Criteria (4 checks)
- hasSpecifics: Concrete situations, not abstract
- canBeCorePhrase: Condensable to one question (<40 chars)
- isTransferable: Universal, not overly personal
- isNonHarmful: Constructive, non-harmful to reader
Workflow
Development
# Install dependencies
npm install
# Build plugin (outputs to main.js)
npm run build
# Watch mode for development
npm run dev
# Type checking
npm run typecheckTesting Workflow
- Build plugin:
npm run build - Copy
main.js,manifest.json,styles.cssto Obsidian vault's.obsidian/plugins/weaklog-processor/ - Reload Obsidian: Ctrl+R (Windows/Linux) or Cmd+R (Mac)
- Enable plugin in Settings > Community Plugins
Git Workflow
- Commit messages:
<type>: <description>(e.g.,feat: add triage modal) - Types:
feat,fix,refactor,docs,test,chore - Always test in Obsidian before committing functional changes
Important Notes
Data Safety
- NEVER delete files without user confirmation
- Archive rejected files to
01_Raw/.archived/instead of deleting - Backup
.cooldown.jsonbefore writes
Performance
- Avoid reading all files at once; process iteratively
- Cache frequently accessed data (e.g., cooldown status)
- Debounce user input in modals (300ms)
Security
- Validate all user inputs before file operations
- Sanitize file names (no
..,/,\) - Never execute user-provided code
- API keys stored in Obsidian's data.json (encrypted by Obsidian)
API References
Do NOT Include
- Standard TypeScript conventions (Claude already knows these)
- Detailed API documentation (link to docs instead)
- Implementation details of individual functions (these belong in code comments)
- Temporary notes or TODO lists (use issues or separate files)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

