Pattern Documentation (CLAUDE_CONTEXT/)

Purpose: Maintain reusable implementation patterns to avoid repeating mistakes and rediscovering solutions.

When to create:

Workflow:

  1. Before implementing: Check existing CLAUDE_CONTEXT/ files for similar patterns
  2. After success: Ask permission to document the pattern (specify filename)
  3. When updated: Ask permission to update existing documents when understanding evolves

Pattern document should include:

Cross-reference: When encountering recurring problems, see “Common Problems Registry” below

Common Problems Registry (CLAUDE_CONTEXT/PROBLEMS.md)

Purpose: Track recurring issues that appear across multiple implementation sessions.

When to add entries:

Entry format:

### Problem: [Brief Description]
**Symptoms:** What the user sees / error messages
**Root Cause:** Why it happens
**Solution:** Reference to pattern document in CLAUDE_CONTEXT/
**Last Encountered:** [Date or commit hash]

Workflow:

Reference Check Protocol

Before implementing any feature:

  1. Check CLAUDE_CONTEXT/PROBLEMS.md for known issues related to the task
  2. Search CLAUDE_CONTEXT/ for pattern files matching the feature type
  3. Review referenced pattern documents before writing code
  4. If no pattern exists but task is non-trivial, ask if user wants pattern documented after success

This protocol helps avoid:

Root Cause Analysis Protocol

CRITICAL - Fix Root Causes, Not Symptoms:

Examples of symptom fixes to AVOID:

Examples of root cause fixes to PURSUE:

Implementation approach:

  1. When encountering a problem, investigate WHY it happened, not just WHAT is broken
  2. Trace the issue back to its source in the automated systems
  3. Fix the automated system so the problem cannot recur
  4. Verify the fix works when the system runs without manual intervention
  5. Document the root cause in pattern files if it’s likely to appear elsewhere

The test of a good fix:

Git Commit Message Format

DO NOT include emoji or “Generated with Claude Code” attribution in commit messages. Use clean, professional commit messages without decorative elements:

Code Standards

File Content Standards

Documentation Standards

  1. Documentation Organization:
    • Place ALL documentation files in the ../chatsubo-docs/ folder (separate repository)
    • NEVER use docs/ folder inside chatsubo-mud - it is not used
    • Documentation repository is at: /data/docker/chatsubo-dev/chatsubo-docs/
    • Exception: Files required by GitHub conventions (README.md, CONTRIBUTING.md, LICENSE, .github/)
    • Never create documentation files in root unless they are GitHub-standard files
  2. Large System Documentation Structure:
    • For complex systems (3+ related files), create dedicated folders under ../chatsubo-docs/
    • Example: ../chatsubo-docs/Discord Integration/ for all Discord-related documentation
    • Each system folder MUST include a README.md as navigation hub
    • Use descriptive folder names with proper capitalization
  3. Testing Documentation Requirements:
    • ALL major systems MUST include a TESTING.md file in their documentation folder
    • TESTING.md should provide clear instructions for play testers
    • Include: what to test, how to test it, expected behaviors, known issues
    • Write for non-technical users who will be testing the system
    • Example: ../chatsubo-docs/Help System/TESTING.md for the help ticket system
  4. Code Documentation:
    • Write clear docstrings for all classes and methods
    • Document public APIs and complex logic
    • Include usage examples in docstrings
    • Explain non-obvious implementation details

Question Response Protocol

CRITICAL - Questions Require Answers, Not Code Changes:

Recommendations and Analysis Protocol

CRITICAL - Lead with Your Best Thinking:

Shell Command Overrides