Freewriting Cleanup
pendingby Alexander Kucera
Use AI to clean up your freewriting typos and create a proper paragraph.
Freewriting Cleanup
Transform your messy freewriting into polished prose using AI. Clean up typos, improve grammar, and format your stream-of-consciousness writing into readable paragraphs with a single command.
Table of Contents
- Key Features
- Why This Plugin?
- Installation
- Quick Start
- Configuration
- Commands
- Settings
- Troubleshooting
- Contributing
- License
Key Features
- π€ AI-Powered Cleanup: Uses Anthropic's Claude models to intelligently clean up freewriting
- β‘ One-Click Processing: Select text and run a single command to transform your writing
- π― Smart Formatting: Converts stream-of-consciousness into proper paragraphs
- π Typo Correction: Fixes spelling and grammar errors while preserving your voice
- π¬ AI Commentary: Optional thoughtful feedback on your freewriting session and ideas
- π± Cross-Platform: Works on both desktop and mobile Obsidian
- π API Key Testing: Built-in connectivity testing with detailed feedback
- π§ Configurable: Customize the AI's cleanup behavior to match your needs
Why This Plugin?
Freewriting is a powerful technique for overcoming writer's block and generating ideas, but the resulting text is often messy, full of typos, and poorly formatted. This plugin bridges the gap between raw creative output and polished writing by:
- Preserving Your Voice: The AI cleans up technical issues without changing your writing style
- Saving Time: No more manual proofreading and reformatting of freewriting sessions
- Maintaining Flow: Stay in creative mode without switching to editing mindset
- Seamless Integration: Works within your existing Obsidian workflow
Transform your "brain dump" into readable content without losing the spontaneity and creativity that makes freewriting valuable.
Perfect Plugin Combination
This plugin works exceptionally well with other freewriting tools to create a complete writing workflow:
π― Freewriting Prompts
Generate AI-powered writing prompts to spark your creativity, then use Freewriting Cleanup to polish the results. The perfect one-two punch for overcoming writer's block:
- Generate inspiration with creative prompts
- Write freely without worrying about mistakes
- Clean up the output with this plugin
π Digital Paper
Write without the ability to delete or edit - just like pen on paper. Perfect for true freewriting sessions:
- Enable Digital Paper mode to disable all delete functions (backspace, delete key, Ctrl+X)
- Write continuously without stopping to edit or second-guess yourself
- Clean up afterwards using Freewriting Cleanup to polish the unedited output
Recommended Workflow:
- Enable Digital Paper mode for uninterrupted freewriting sessions
- Generate prompts with Freewriting Prompts when you need inspiration
- Use Freewriting Cleanup to polish your raw, unedited writing into readable text
Installation
Method 1: Community Plugin Store (Recommended)
- Open Settings β Community Plugins
- Disable Safe Mode if needed
- Click Browse and search for "Freewriting Cleanup"
- Install and Enable the plugin
Method 2: Manual Installation
- Go to GitHub Releases
- Download the latest
main.js,manifest.json, andstyles.css - Create a folder
{VaultFolder}/.obsidian/plugins/freewriting-cleanup/ - Place the downloaded files in this folder
- Reload Obsidian (
Ctrl/Cmd + Ror restart) - Enable the plugin in Settings β Community Plugins
Method 3: BRAT (Beta Reviewer's Auto-update Tool)
- Install the BRAT plugin
- Add this repository:
https://github.com/AlexKucera/freewriting-cleanup - Enable the plugin after installation
Quick Start
1. Get Your Anthropic API Key
- Visit Anthropic Console
- Create an account or sign in
- Generate an API key from the dashboard
- Copy the key (starts with
sk-ant-)
2. Configure the Plugin
- Go to Settings β Community Plugins β Freewriting Cleanup
- Paste your API key in the Anthropic API Key field
- Click Test Connection to verify it works
- Adjust other settings as desired
3. Clean Up Your Writing
- Select the freewriting text you want to clean up
- Use
Ctrl/Cmd + Pβ "Clean up text" - The selected text will be replaced with the cleaned-up version
- Review and make any final adjustments
Configuration
API Configuration
| Setting | Description | Default |
|---|---|---|
| API Key | Your Anthropic API key | (required) |
| Model | Claude model to use | claude-3-5-haiku-latest |
Cleanup Behavior
| Setting | Description | Default |
|---|---|---|
| System Prompt | Instructions for how AI should clean up text | (customizable) |
| Preserve Style | Keep the author's writing voice | Yes |
| Fix Grammar | Correct grammatical errors | Yes |
| Format Paragraphs | Structure into readable paragraphs | Yes |
AI Commentary
| Setting | Description | Default |
|---|---|---|
| Enable Commentary | AI provides feedback on your writing | Disabled |
| Commentary Style | Type of feedback to receive | Constructive |
| Custom Prompt | Personalized commentary instructions | (when using custom style) |
Commentary Styles:
- Constructive: Balanced feedback noting strengths and areas for development
- Encouraging: Positive, supportive observations focusing on what worked well
- Analytical: Analysis of writing structure, themes, and thought patterns
- Brief: 2-3 concise but insightful observations
- Custom: Use your own prompt for personalized feedback
Commands
Clean up text
The main command that transforms your selected text:
- Select the freewriting text in your note
- Run the command via Command Palette (
Ctrl/Cmd + P) - Wait for the AI to process your text
- Review the cleaned-up result that replaces your selection
Processing Steps:
- Fixes spelling and typos
- Corrects grammar while preserving voice
- Structures text into coherent paragraphs
- Maintains the original meaning and style
- Optionally provides thoughtful commentary on your writing
What You Get:
- Cleaned Text: Your original text with errors fixed and proper formatting
- AI Commentary (if enabled): Insightful feedback about your writing session, including:
- Observations about your thought patterns and creativity
- Analysis of themes and ideas that emerged
- Encouragement and suggestions for further exploration
- Constructive feedback on your writing flow
Use Cases:
- Cleaning up morning pages or stream-of-consciousness writing
- Preparing freewriting for sharing or publication
- Converting voice-to-text output into readable prose
- Processing timed writing exercises
- Getting feedback on your creative process and ideas
- Understanding patterns in your thinking and writing style
Settings
Advanced Features
-
Test API Key: Verify your connection with detailed feedback including:
- Response time
- Token usage
- Model confirmation
- Specific error messages for troubleshooting
-
Custom System Prompt: Tailor the AI's behavior to your specific needs:
- Adjust the level of editing (light touch vs. heavy revision)
- Specify formatting preferences
- Set tone and style guidelines
Supported Models
- claude-3-haiku-20240307 (fastest, most cost-effective)
- claude-3-sonnet-20240229 (balanced performance)
- claude-3-opus-20240229 (highest quality)
- claude-3-5-sonnet-20241022 (latest sonnet)
- claude-3-5-haiku-20241022 (latest haiku)
Troubleshooting
Common Issues
| Problem | Solution |
|---|---|
| "API key is required" | Enter your Anthropic API key in settings |
| "No text selected" | Select the text you want to clean up before running the command |
| "Network error" | Check internet connection and API key validity |
| "Rate limit exceeded" | Wait a moment and try again, or upgrade your Anthropic plan |
Error Messages
The plugin provides detailed error messages for different scenarios:
- 401 Unauthorized: Invalid API key
- 403 Forbidden: Account or billing issues
- 429 Rate Limited: Too many requests
- 500 Server Error: Anthropic service issues
- Network Error: Connection problems
Debug Steps
- Test API Key: Use the "Test Connection" button in settings
- Check Selection: Ensure you have text selected before running the command
- Check Console: Open Developer Tools (F12) for detailed error logs
- Verify Settings: Ensure all required fields are filled
- Restart Plugin: Disable and re-enable the plugin
Getting Help
- Issues: Report bugs on GitHub Issues
- Discussions: Ask questions in GitHub Discussions
Development
Setup
# Clone the repository
git clone https://github.com/alexanderkucera/obsidian-freewriting-cleanup.git
cd obsidian-freewriting-cleanup
# Install dependencies
npm install
# Start development server
npm run dev
Project Structure
freewriting-cleanup/
βββ api/
β βββ anthropicClient.ts # Anthropic API integration
βββ commands/
β βββ cleanupCommand.ts # Text cleanup command
βββ services/
β βββ cleanupService.ts # Cleanup processing service
βββ main.ts # Plugin entry point
βββ settings.ts # Settings interface
βββ types.ts # Type definitions
Build Commands
npm run dev # Development with file watching
npm run build # Production build with type checking
npm run version # Version bump and manifest update
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Development Guidelines
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Follow TypeScript and ESLint conventions
- Test your changes thoroughly
- Commit with descriptive messages
- Submit a Pull Request
License
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.
Support
If you find this plugin helpful, consider supporting its development:
Contact
Author: Alexander Kucera Website: alexanderkucera.com GitHub: @AlexKucera
Transform your freewriting into polished prose! βοΈβ¨
For plugin developers
Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.