Skip to content

Slash command for applying text rewriting instructions to correct for user-defined grievances with AI-generated technical documentation

Notifications You must be signed in to change notification settings

danielrosehill/Declaude

Repository files navigation

alt text

Declaude - Custom Text Rewriting Rules for AI-Generated Content

A flexible system for creating personalized text rewriting rules and vocabulary guidelines that can be consolidated into a Claude Code slash command. Perfect for tech writers who love AI assistance but want to maintain their own voice and style.

What This Does

This tool helps you maintain a collection of your own writing pet peeves and vocabulary preferences, then consolidates them into a single prompt that can be used as a /declaude slash command in Claude Code. It addresses common issues in AI-generated technical writing while letting you customize everything to match your personal style.

Quick Start

# 1. Clone and setup
git clone <repo-url>
cd Declaude
uv venv
source .venv/bin/activate
uv pip install -r requirements.txt

# 2. Configure OpenRouter API key
echo "OPENROUTER_API_KEY=your_key_here" > .env

# 3. Customize your rules (see below)
# Edit files in rules/ and vocab/

# 4. Generate consolidated prompt
python consolidate_rules.py

# 5. Install as Claude Code slash command
./just-install.sh

Now use /declaude in Claude Code to apply your rules!

Features

  • Modular Rules: Keep each writing rule in its own file for easy management
  • Vocabulary Avoidance Lists: Simple text files for words/phrases you want to avoid
  • LLM-Powered Consolidation: Uses AI to intelligently combine and organize your rules
  • Version Control: Automatically creates versioned outputs
  • Easy Installation: One command to install as a Claude Code slash command
  • Completely Customizable: These are MY pet peeves - you'll have your own!

Directory Structure

Declaude/
├── rules/              # Your writing rules (one per file)
│   ├── emojis.md
│   ├── minimal-docs.md
│   ├── no-all-caps.md
│   └── tables-and-tables.md
├── vocab/              # Vocabulary avoidance lists
│   ├── overused-words.txt
│   ├── corporate-speak.txt
│   └── custom-avoid.txt
├── consolidated/       # Generated consolidated prompts
│   ├── v1/
│   ├── v2/
│   └── v3/
├── consolidate_rules.py
└── just-install.sh

Customizing Your Rules

Writing Rules (rules/*.md)

Each file in rules/ should contain a straightforward definition for the AI agent. No fancy titles needed - just clear instructions.

Example - rules/emojis.md:

Do not use emojis in any documentation, code comments, or file outputs. Emojis make technical documentation appear amateurish and unprofessional. Use plain text exclusively.

Example - rules/active-voice.md:

Prefer active voice over passive voice in technical writing. Write "The function returns an error" instead of "An error is returned by the function". Passive voice is acceptable for error messages and situations where the actor is unknown or irrelevant.

To add your own rule:

  1. Create a new .md file in rules/
  2. Write clear, direct instructions for the AI
  3. Run python consolidate_rules.py to regenerate
  4. Run ./just-install.sh to update the slash command

Vocabulary Lists (vocab/*.txt)

Simple text files listing words or phrases to avoid. One per line, with comments starting with #.

Example - vocab/overused-words.txt:

# Words AI overuses
comprehensive
robust
leverage
seamless
cutting-edge

Example - vocab/custom-avoid.txt:

# My personal word preferences
# Add whatever annoys you!
utilize
facilitate

Included Lists:

  • overused-words.txt - Words Claude tends to overuse
  • corporate-speak.txt - Buzzwords and jargon
  • custom-avoid.txt - Your personal preferences (empty template)

Edit these freely or create new .txt files in the vocab/ directory.

Current Default Rules

The repo includes my personal pet peeves as examples:

  1. No Emojis: Technical docs should be professional and emoji-free
  2. Minimal Documentation: Only create docs when truly necessary
  3. Proper File Naming: Only README.md gets all caps
  4. Balanced Structure: Avoid excessive subheadings, bullets, and tables

These are just examples! Delete what you don't need, modify what you want, and add your own.

Workflow

Initial Setup

# Customize rules and vocab lists
vim rules/my-custom-rule.md
vim vocab/custom-avoid.txt

# Generate consolidated prompt
python consolidate_rules.py

# Install to Claude Code
./just-install.sh

Using in Claude Code

/declaude              # Apply to selected text
/declaude README.md    # Apply to a file

Updating Rules

# Edit your rules
vim rules/emojis.md

# Regenerate (creates new version)
python consolidate_rules.py

# Update the slash command
./just-install.sh

Advanced Usage

Using Different LLM Models

# Default (Gemini Pro)
python consolidate_rules.py

# Specify a model
python consolidate_rules.py "anthropic/claude-3-opus"
python consolidate_rules.py "openai/gpt-4o"

# See options
python consolidate_rules.py --help

Version Management

Each consolidation creates a new version in consolidated/vN/:

  • consolidated_prompt.md - The full consolidated prompt
  • metadata.json - Generation details and source files

Manual Installation

If you prefer not to use just-install.sh:

# Copy latest consolidated prompt to Claude commands
cp consolidated/v3/consolidated_prompt.md ~/.claude/commands/declaude.md

Why This Exists

As a technical writer, I find AI writing assistants 90% helpful and 10% annoying. The annoying parts are predictable:

  • Unnecessary emojis everywhere
  • Overusing words like "comprehensive" and "robust"
  • Creating documentation for the sake of documentation
  • Excessive use of tables and bullet points

Rather than manually editing these patterns out every time, this tool lets me maintain my preferences and apply them consistently.

Your mileage will vary! What bothers me might not bother you. That's why everything is customizable.

Installation Location

The slash command installs to ~/.claude/commands/declaude.md, making it available across all your Claude Code sessions.

Requirements

  • Python 3.8+
  • OpenRouter API key (for LLM consolidation)
  • Claude Code CLI (for using the slash command)

Suggested Models for Consolidation

Models are accessed via OpenRouter:

  • google/gemini-pro-1.5-exp (fast, cost-effective, default)
  • anthropic/claude-3-haiku (fast, good for quick iterations)
  • openai/gpt-4o (balanced quality/cost)
  • anthropic/claude-3-opus (highest quality)

Contributing

This is a personal tool made public, but suggestions welcome! The goal is flexibility - everyone should be able to customize it for their own writing preferences.

License

See LICENSE file for details.

About AI-Generated Documentation

This tool was created while working extensively with Claude, hence the name, but the principles apply to any LLM generating technical documentation. As an experienced technical writer, I find AI-generated tech docs frequently very good - often reaching 80% usability right out of the gate.

Important perspective: AI isn't a substitute for human technical writing, but it's a powerful way to speed up the generation of good documentation. Good documentation quickly is often more valuable than perfect documentation slowly. These rules help polish that 80% usable output into 95% perfect content with minimal manual intervention.

The patterns this tool addresses (emojis, overused words, structural issues) appear across most LLMs when generating technical content. While I'm currently using Claude and love it, these are refinement rules, not criticisms. Think of this as the final polish step that brings AI-generated docs from "pretty good" to "publication ready" while maintaining your personal voice and style.

About

Slash command for applying text rewriting instructions to correct for user-defined grievances with AI-generated technical documentation

Topics

Resources

Stars

Watchers

Forks