+
+
+```
+
+## Scripting and Automation
+
+### Debug Scripts
+
+```javascript
+#!/usr/bin/env node
+// debug-script.js
+
+const { RusticDebug } = require('@rustic-ai/debug-client');
+
+async function analyzeErrorPatterns() {
+ const debug = new RusticDebug({
+ url: 'http://localhost:3000'
+ });
+
+ // Get all errors from last hour
+ const errors = await debug.search({
+ status: 'error',
+ timeRange: 'last_hour'
+ });
+
+ // Group by error type
+ const grouped = {};
+ errors.forEach(error => {
+ const type = error.error?.type || 'unknown';
+ grouped[type] = (grouped[type] || 0) + 1;
+ });
+
+ // Generate report
+ console.log('Error Analysis Report:');
+ Object.entries(grouped)
+ .sort(([,a], [,b]) => b - a)
+ .forEach(([type, count]) => {
+ console.log(` ${type}: ${count} occurrences`);
+ });
+}
+
+analyzeErrorPatterns();
+```
+
+### CI/CD Integration
+
+```yaml
+# .github/workflows/debug-check.yml
+name: Debug Analysis
+
+on:
+ schedule:
+ - cron: '0 */6 * * *' # Every 6 hours
+
+jobs:
+ analyze:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+
+ - name: Run Debug Analysis
+ run: |
+ npx @rustic-ai/debug-cli analyze \
+ --url ${{ secrets.DEBUG_URL }} \
+ --token ${{ secrets.DEBUG_TOKEN }} \
+ --threshold-errors 100 \
+ --threshold-latency 1000
+
+ - name: Upload Report
+ if: failure()
+ uses: actions/upload-artifact@v2
+ with:
+ name: debug-report
+ path: debug-analysis.html
+```
+
+## Security Features
+
+### Audit Logging
+
+```javascript
+// Enable audit logging
+const debug = new RusticDebug({
+ audit: {
+ enabled: true,
+ logLevel: 'detailed',
+ storage: 'elasticsearch',
+ retention: '90d'
+ }
+});
+
+// Query audit logs
+const audits = await debug.getAuditLogs({
+ user: 'john.doe',
+ action: 'message_export',
+ timeRange: 'last_week'
+});
+```
+
+### Data Masking
+
+```javascript
+// Configure data masking
+const debug = new RusticDebug({
+ masking: {
+ enabled: true,
+ rules: [
+ {
+ path: 'content.creditCard',
+ type: 'credit-card'
+ },
+ {
+ path: 'content.email',
+ type: 'email'
+ },
+ {
+ path: 'content.ssn',
+ type: 'custom',
+ pattern: /\d{3}-\d{2}-\d{4}/,
+ replacement: 'XXX-XX-XXXX'
+ }
+ ]
+ }
+});
+```
+
+## WebSocket Advanced Usage
+
+### Custom WebSocket Handlers
+
+```javascript
+// Advanced WebSocket client
+const ws = new WebSocket('ws://localhost:3000/stream');
+
+// Custom protocol handling
+ws.on('open', () => {
+ // Subscribe with filters
+ ws.send(JSON.stringify({
+ type: 'subscribe',
+ topics: ['payments'],
+ filters: {
+ amount: { gt: 1000 },
+ status: { in: ['pending', 'processing'] }
+ }
+ }));
+
+ // Request historical data
+ ws.send(JSON.stringify({
+ type: 'history',
+ count: 100,
+ before: new Date().toISOString()
+ }));
+});
+
+// Handle different message types
+ws.on('message', (data) => {
+ const msg = JSON.parse(data);
+
+ switch(msg.type) {
+ case 'message':
+ handleNewMessage(msg.data);
+ break;
+ case 'history':
+ handleHistoricalData(msg.data);
+ break;
+ case 'stats':
+ updateStatistics(msg.data);
+ break;
+ case 'alert':
+ handleAlert(msg.data);
+ break;
+ }
+});
+```
+
+## Plugin System
+
+### Creating Plugins
+
+```javascript
+// custom-plugin.js
+class CustomAnalyzer {
+ constructor(debug) {
+ this.debug = debug;
+ this.name = 'custom-analyzer';
+ this.version = '1.0.0';
+ }
+
+ async init() {
+ // Initialize plugin
+ console.log('Custom Analyzer initialized');
+ }
+
+ async analyze(messages) {
+ // Custom analysis logic
+ return {
+ totalMessages: messages.length,
+ customMetric: this.calculateCustomMetric(messages)
+ };
+ }
+
+ calculateCustomMetric(messages) {
+ // Custom calculation
+ return messages.filter(m => m.custom_flag).length;
+ }
+}
+
+// Register plugin
+debug.registerPlugin(CustomAnalyzer);
+```
+
+## Next Steps
+
+- [API Reference](../dev-guide/api.html) - Complete API documentation
+- [Integration Guide](../dev-guide/integration.html) - Integration patterns
+- [Contributing](../dev-guide/contributing.html) - Contribute to Rustic Debug
\ No newline at end of file
diff --git a/docs/src/content/user-guide/basic-usage.md b/docs/src/content/user-guide/basic-usage.md
new file mode 100644
index 0000000..aa7f5db
--- /dev/null
+++ b/docs/src/content/user-guide/basic-usage.md
@@ -0,0 +1,399 @@
+---
+title: Basic Usage & Examples
+description: Learn the core debugging workflows with practical examples
+tags: [usage, examples, tutorial]
+---
+
+# Basic Usage & Examples
+
+This guide walks you through common debugging scenarios and practical examples using Rustic Debug.
+
+## Starting the Debugger
+
+### Quick Start
+
+```bash
+# Install globally
+npm install -g @rustic-ai/rustic-debug
+
+# Start with default settings (connects to localhost:6379)
+rustic-debug start
+
+# Start with custom Redis URL
+rustic-debug start --redis-url redis://192.168.1.100:6379
+
+# Start with specific database
+rustic-debug start --redis-url redis://localhost:6379 --db 2
+```
+
+### Docker Usage
+
+```bash
+# Run with Docker
+docker run -p 3000:3000 \
+ -e REDIS_URL=redis://host.docker.internal:6379 \
+ rustic-ai/rustic-debug
+
+# With docker-compose
+docker-compose up rustic-debug
+```
+
+## Common Debugging Workflows
+
+### 1. Monitoring Message Flow
+
+**Scenario:** You want to see all messages flowing through a specific guild.
+
+```bash
+# Open the debugger UI
+open http://localhost:3000
+
+# Navigate to Guild Explorer
+# Select your guild (e.g., "chat-service-guild")
+# Watch real-time messages appear in the flow graph
+```
+
+**What to look for:**
+- Message frequency and patterns
+- Topics with high activity
+- Agent response times
+- Error messages or retries
+
+### 2. Inspecting Individual Messages
+
+**Scenario:** A specific message seems to be causing issues.
+
+1. **Find the message:**
+ - Use the search bar with message ID
+ - Or filter by time range
+ - Or search by content keywords
+
+2. **Inspect the message:**
+ ```javascript
+ // Example message structure you'll see
+ {
+ "id": "VGF6sLGdatx3gPeGEDQxHb",
+ "topic": "user-queries",
+ "guild_id": "chat-service-guild",
+ "agent_tag": {
+ "name": "query-processor",
+ "version": "2.1.0"
+ },
+ "content": {
+ "query": "What is the weather today?",
+ "user_id": "user-123",
+ "session_id": "sess-456"
+ },
+ "metadata": {
+ "timestamp": "2024-01-15T10:30:00Z",
+ "processing_time_ms": 120,
+ "retry_count": 0
+ }
+ }
+ ```
+
+3. **Check related messages:**
+ - Click "View Thread" to see the conversation chain
+ - Check parent and child messages
+ - Look at routing rules and targets
+
+### 3. Tracking Conversation Threads
+
+**Scenario:** Following a user interaction through multiple services.
+
+```javascript
+// In the Thread View, you'll see the flow:
+
+1. User Input → chat-handler
+ └── Message: "Help me book a flight"
+
+2. chat-handler → intent-classifier
+ └── Message: {intent: "flight_booking", confidence: 0.95}
+
+3. intent-classifier → booking-agent
+ └── Message: {action: "initiate_booking", user_id: "123"}
+
+4. booking-agent → flight-api
+ └── Message: {request: "search_flights", params: {...}}
+
+5. flight-api → booking-agent
+ └── Message: {results: [...flights]}
+
+6. booking-agent → chat-handler
+ └── Message: {response: "Found 5 flights..."}
+
+7. chat-handler → User
+ └── Message: "I found 5 flights for you..."
+```
+
+### 4. Performance Analysis
+
+**Scenario:** Identifying bottlenecks in message processing.
+
+1. **Check the Metrics Dashboard:**
+ ```
+ Topic: user-queries
+ ├── Messages/sec: 45
+ ├── Avg latency: 230ms
+ ├── 95th percentile: 450ms
+ └── Error rate: 0.2%
+ ```
+
+2. **Identify slow agents:**
+ ```
+ Agent Performance:
+ ├── query-processor: 45ms avg
+ ├── intent-classifier: 120ms avg ⚠️
+ ├── response-generator: 65ms avg
+ └── cache-handler: 5ms avg
+ ```
+
+3. **Find message backlogs:**
+ ```bash
+ # Topics with queued messages
+ high-priority-tasks: 0 queued
+ normal-tasks: 12 queued ⚠️
+ low-priority-tasks: 145 queued ⚠️⚠️
+ ```
+
+### 5. Error Investigation
+
+**Scenario:** Messages are failing with errors.
+
+1. **Filter for errors:**
+ ```javascript
+ // Use the filter panel
+ {
+ "status": "error",
+ "time_range": "last_hour"
+ }
+ ```
+
+2. **Common error patterns:**
+ ```javascript
+ // Timeout error
+ {
+ "error": {
+ "type": "TIMEOUT",
+ "message": "Agent response timeout after 30s",
+ "agent": "slow-processor",
+ "retry_count": 3
+ }
+ }
+
+ // Processing error
+ {
+ "error": {
+ "type": "PROCESSING_ERROR",
+ "message": "Invalid input format",
+ "stack_trace": "...",
+ "input": {...}
+ }
+ }
+ ```
+
+3. **Check error rates by topic:**
+ ```
+ Error Rates:
+ ├── user-queries: 0.1% ✅
+ ├── payment-processing: 2.5% ⚠️
+ └── external-api-calls: 5.2% 🔴
+ ```
+
+## Example Debugging Sessions
+
+### Example 1: Debugging a Stuck Message
+
+```bash
+# 1. Identify the stuck message
+$ rustic-debug search --status pending --age ">5m"
+
+Found 1 stuck message:
+- ID: VGF6sLGdatx3gPeGEDQxHc
+- Topic: payment-processing
+- Age: 7m 32s
+- Agent: payment-validator
+
+# 2. Inspect the message
+$ rustic-debug inspect VGF6sLGdatx3gPeGEDQxHc
+
+Message Details:
+- Status: PENDING
+- Retry Count: 3/3
+- Last Error: "Connection timeout to payment gateway"
+- Next Retry: Disabled (max retries reached)
+
+# 3. Check agent status
+$ rustic-debug agent-status payment-validator
+
+Agent: payment-validator
+- Status: UNHEALTHY
+- Last Heartbeat: 8m ago
+- Error: "Cannot connect to payment gateway API"
+```
+
+### Example 2: Analyzing Message Flow Pattern
+
+```javascript
+// Using the JavaScript client
+const debug = require('@rustic-ai/debug-client');
+
+const client = new debug.Client({
+ host: 'localhost',
+ port: 3001
+});
+
+// Analyze message flow for the last hour
+async function analyzeFlow() {
+ const stats = await client.getFlowStatistics({
+ guild: 'main-guild',
+ timeRange: '1h',
+ groupBy: 'topic'
+ });
+
+ console.log('Message Flow Analysis:');
+ stats.topics.forEach(topic => {
+ console.log(`\n${topic.name}:`);
+ console.log(` Total: ${topic.messageCount}`);
+ console.log(` Rate: ${topic.messagesPerSecond}/s`);
+ console.log(` Avg Size: ${topic.avgMessageSize} bytes`);
+ console.log(` Error Rate: ${topic.errorRate}%`);
+ });
+
+ // Find anomalies
+ const anomalies = stats.topics.filter(t =>
+ t.errorRate > 1 ||
+ t.messagesPerSecond > 100 ||
+ t.avgLatency > 1000
+ );
+
+ if (anomalies.length > 0) {
+ console.log('\n⚠️ Anomalies detected:');
+ anomalies.forEach(t => {
+ console.log(` - ${t.name}: ${t.anomalyReason}`);
+ });
+ }
+}
+
+analyzeFlow();
+```
+
+### Example 3: Monitoring Specific Patterns
+
+```python
+# Python example for pattern monitoring
+from rustic_debug import DebugClient
+import re
+
+client = DebugClient('localhost', 3001)
+
+# Monitor for specific error patterns
+def monitor_errors():
+ stream = client.stream_messages(
+ guild='production-guild',
+ filter={
+ 'status': 'error',
+ 'content_pattern': r'database.*timeout'
+ }
+ )
+
+ for message in stream:
+ print(f"Database timeout detected:")
+ print(f" Message ID: {message['id']}")
+ print(f" Topic: {message['topic']}")
+ print(f" Agent: {message['agent_tag']['name']}")
+ print(f" Error: {message['error']['message']}")
+
+ # Alert if pattern repeats
+ recent = client.count_messages(
+ filter={
+ 'status': 'error',
+ 'content_pattern': r'database.*timeout',
+ 'time_range': '5m'
+ }
+ )
+
+ if recent > 5:
+ print("⚠️ ALERT: Multiple database timeouts detected!")
+ # Send alert to monitoring system
+
+monitor_errors()
+```
+
+## Tips and Best Practices
+
+### 1. Efficient Filtering
+
+- Use time ranges to limit data: `last_hour`, `last_day`
+- Filter by specific topics when debugging known issues
+- Use regex patterns for content matching
+- Combine multiple filters for precise results
+
+### 2. Performance Monitoring
+
+- Set up alerts for high latency (>1s)
+- Monitor error rates by topic
+- Track message queue sizes
+- Watch for retry storms
+
+### 3. Debugging Checklist
+
+When investigating issues:
+
+- [ ] Check message status and error details
+- [ ] Verify agent health and connectivity
+- [ ] Look at retry counts and patterns
+- [ ] Check parent/child message chain
+- [ ] Review routing rules
+- [ ] Examine message timing and latency
+- [ ] Look for patterns in similar messages
+- [ ] Check system resource usage
+
+### 4. Common Patterns to Watch For
+
+**Message Storm:**
+- Sudden spike in message rate
+- Often indicates retry loops or cascading failures
+
+**Processing Bottleneck:**
+- Growing queue size on specific topics
+- Increasing latency over time
+
+**Silent Failures:**
+- Messages disappearing without errors
+- Check routing rules and agent filters
+
+**Timeout Cascade:**
+- Multiple timeouts across different agents
+- Usually indicates downstream service issues
+
+## CLI Commands Reference
+
+```bash
+# Search messages
+rustic-debug search --guild main --topic user-queries --limit 10
+
+# Inspect specific message
+rustic-debug inspect
+
+# Show guild statistics
+rustic-debug stats --guild main
+
+# Monitor real-time stream
+rustic-debug stream --guild main --topic payments
+
+# Export messages for analysis
+rustic-debug export --guild main --format json --output messages.json
+
+# Check agent health
+rustic-debug health --guild main
+
+# Show message flow graph
+rustic-debug flow --guild main --format dot | dot -Tpng > flow.png
+```
+
+## Next Steps
+
+- [Advanced Features](./advanced.html) - Learn about advanced debugging capabilities
+- [Performance Tuning](./performance.html) - Optimize your debugging workflow
+- [Integration Guide](../dev-guide/integration.html) - Integrate with your application
diff --git a/docs/src/content/user-guide/configuration.md b/docs/src/content/user-guide/configuration.md
new file mode 100644
index 0000000..e75d37a
--- /dev/null
+++ b/docs/src/content/user-guide/configuration.md
@@ -0,0 +1,742 @@
+---
+title: Configuration Guide
+description: Configure Rustic Debug for your specific environment and needs
+tags: [configuration, settings, customization]
+---
+
+# Configuration Guide
+
+This guide covers all configuration options for Rustic Debug to customize it for your specific debugging needs.
+
+## Configuration Overview
+
+Rustic Debug can be configured through:
+1. Command-line arguments
+2. Configuration files (JSON/YAML)
+3. Environment variables
+4. Runtime API calls
+
+Priority order (highest to lowest):
+1. Command-line arguments
+2. Environment variables
+3. Configuration file
+4. Default values
+
+## Configuration File
+
+### JSON Configuration
+
+Create `rustic-debug.config.json`:
+
+```json
+{
+ "redis": {
+ "url": "redis://localhost:6379",
+ "password": null,
+ "username": null,
+ "db": 0,
+ "family": 4,
+ "connectionName": "rustic-debug",
+ "connectionTimeout": 5000,
+ "commandTimeout": 5000,
+ "keepAlive": 30000,
+ "retryStrategy": {
+ "retries": 10,
+ "factor": 2,
+ "minTimeout": 1000,
+ "maxTimeout": 30000
+ },
+ "tls": {
+ "enabled": false,
+ "rejectUnauthorized": true,
+ "cert": "/path/to/cert.pem",
+ "key": "/path/to/key.pem",
+ "ca": "/path/to/ca.pem"
+ }
+ },
+ "server": {
+ "port": 3000,
+ "host": "0.0.0.0",
+ "baseUrl": "/",
+ "cors": {
+ "enabled": true,
+ "origins": ["http://localhost:*", "https://*.example.com"],
+ "credentials": true
+ },
+ "compression": true,
+ "trustProxy": false,
+ "requestTimeout": 30000,
+ "bodyLimit": "10mb"
+ },
+ "debug": {
+ "readOnly": true,
+ "maxMessages": 10000,
+ "messageRetention": {
+ "enabled": true,
+ "hours": 24,
+ "maxSize": "1GB"
+ },
+ "sampling": {
+ "enabled": false,
+ "rate": 1.0,
+ "rules": [
+ {
+ "topic": "high-volume-topic",
+ "rate": 0.1
+ }
+ ]
+ }
+ },
+ "guilds": {
+ "whitelist": ["production-*", "staging-*"],
+ "blacklist": ["test-*", "dev-*"],
+ "autoDiscovery": true,
+ "refreshInterval": 60000
+ },
+ "monitoring": {
+ "metrics": {
+ "enabled": true,
+ "interval": 10000,
+ "detailed": false
+ },
+ "healthCheck": {
+ "enabled": true,
+ "interval": 30000,
+ "timeout": 5000
+ },
+ "alerts": {
+ "enabled": false,
+ "rules": [
+ {
+ "name": "high-error-rate",
+ "condition": "errorRate > 0.05",
+ "action": "webhook",
+ "webhook": "https://alerts.example.com/rustic-debug"
+ }
+ ]
+ }
+ },
+ "ui": {
+ "theme": "auto",
+ "defaultView": "flow-graph",
+ "messageLimit": 100,
+ "refreshRate": 1000,
+ "features": {
+ "flowGraph": true,
+ "messageInspector": true,
+ "threadView": true,
+ "metricsPanel": true,
+ "searchBar": true,
+ "exportTools": false
+ }
+ },
+ "auth": {
+ "enabled": false,
+ "type": "token",
+ "token": "your-secret-token",
+ "sessionTimeout": 3600000,
+ "oauth": {
+ "provider": "github",
+ "clientId": "your-client-id",
+ "clientSecret": "your-client-secret",
+ "callbackUrl": "http://localhost:3000/auth/callback"
+ }
+ },
+ "logging": {
+ "level": "info",
+ "format": "json",
+ "file": {
+ "enabled": true,
+ "path": "/var/log/rustic-debug",
+ "maxSize": "100MB",
+ "maxFiles": 10,
+ "compress": true
+ },
+ "console": {
+ "enabled": true,
+ "colors": true
+ }
+ },
+ "advanced": {
+ "clustering": {
+ "enabled": false,
+ "workers": 4
+ },
+ "cache": {
+ "enabled": true,
+ "ttl": 300000,
+ "maxSize": "100MB"
+ },
+ "rateLimit": {
+ "enabled": true,
+ "windowMs": 60000,
+ "max": 1000
+ }
+ }
+}
+```
+
+### YAML Configuration
+
+Alternatively, use `rustic-debug.config.yaml`:
+
+```yaml
+redis:
+ url: redis://localhost:6379
+ db: 0
+ connectionTimeout: 5000
+ retryStrategy:
+ retries: 10
+ factor: 2
+
+server:
+ port: 3000
+ host: 0.0.0.0
+ cors:
+ enabled: true
+ origins:
+ - http://localhost:*
+
+debug:
+ readOnly: true
+ maxMessages: 10000
+ messageRetention:
+ enabled: true
+ hours: 24
+
+guilds:
+ whitelist:
+ - production-*
+ - staging-*
+ blacklist:
+ - test-*
+
+ui:
+ theme: auto
+ defaultView: flow-graph
+ refreshRate: 1000
+
+logging:
+ level: info
+ format: json
+```
+
+Load configuration:
+```bash
+rustic-debug start --config ./rustic-debug.config.yaml
+```
+
+## Environment Variables
+
+All configuration options can be set via environment variables:
+
+```bash
+# Redis Configuration
+export REDIS_URL=redis://localhost:6379
+export REDIS_PASSWORD=your-password
+export REDIS_USERNAME=default
+export REDIS_DB=0
+export REDIS_CONNECTION_TIMEOUT=5000
+export REDIS_COMMAND_TIMEOUT=5000
+export REDIS_KEEP_ALIVE=30000
+export REDIS_TLS_ENABLED=false
+
+# Server Configuration
+export DEBUG_PORT=3000
+export DEBUG_HOST=0.0.0.0
+export DEBUG_BASE_URL=/
+export DEBUG_CORS_ENABLED=true
+export DEBUG_CORS_ORIGINS=http://localhost:*
+
+# Debug Settings
+export DEBUG_READ_ONLY=true
+export DEBUG_MAX_MESSAGES=10000
+export DEBUG_RETENTION_HOURS=24
+export DEBUG_SAMPLING_ENABLED=false
+export DEBUG_SAMPLING_RATE=1.0
+
+# Guild Settings
+export DEBUG_GUILD_WHITELIST=production-*,staging-*
+export DEBUG_GUILD_BLACKLIST=test-*,dev-*
+export DEBUG_AUTO_DISCOVERY=true
+
+# UI Settings
+export DEBUG_UI_THEME=auto
+export DEBUG_UI_DEFAULT_VIEW=flow-graph
+export DEBUG_UI_REFRESH_RATE=1000
+
+# Authentication
+export DEBUG_AUTH_ENABLED=false
+export DEBUG_AUTH_TOKEN=your-secret-token
+
+# Logging
+export DEBUG_LOG_LEVEL=info
+export DEBUG_LOG_FORMAT=json
+```
+
+## Command-Line Options
+
+Override any configuration with command-line flags:
+
+```bash
+rustic-debug start \
+ --redis-url redis://localhost:6379 \
+ --redis-db 2 \
+ --port 3001 \
+ --host 127.0.0.1 \
+ --read-only \
+ --max-messages 5000 \
+ --retention-hours 12 \
+ --guild-whitelist "prod-*" \
+ --guild-blacklist "test-*" \
+ --auth-enabled \
+ --auth-token "secret-token" \
+ --log-level debug \
+ --config ./custom-config.json
+```
+
+### Available Flags
+
+```bash
+# Redis Options
+--redis-url # Redis connection URL
+--redis-password # Redis password
+--redis-db # Redis database number
+--redis-timeout # Connection timeout
+
+# Server Options
+--port # Server port (default: 3000)
+--host # Server host (default: 0.0.0.0)
+--base-url # Base URL path
+--cors # Enable CORS
+--no-compression # Disable compression
+
+# Debug Options
+--read-only # Enable read-only mode
+--max-messages # Maximum messages to store
+--retention-hours # Message retention period
+--sampling-rate # Sampling rate (0.0-1.0)
+
+# Guild Options
+--guild-whitelist # Guild whitelist patterns
+--guild-blacklist # Guild blacklist patterns
+--no-auto-discovery # Disable auto-discovery
+
+# UI Options
+--ui-theme # UI theme (light/dark/auto)
+--ui-refresh-rate # UI refresh rate
+--disable-flow-graph # Disable flow graph feature
+
+# Auth Options
+--auth-enabled # Enable authentication
+--auth-token # Authentication token
+--auth-session-timeout # Session timeout
+
+# Logging Options
+--log-level # Log level
+--log-file # Log file path
+--quiet # Minimal output
+--verbose # Verbose output
+```
+
+## Redis Configuration
+
+### Basic Connection
+
+```javascript
+{
+ "redis": {
+ "url": "redis://localhost:6379",
+ "db": 0
+ }
+}
+```
+
+### Authenticated Connection
+
+```javascript
+{
+ "redis": {
+ "url": "redis://username:password@localhost:6379",
+ "db": 0
+ }
+}
+```
+
+### Redis Cluster
+
+```javascript
+{
+ "redis": {
+ "cluster": true,
+ "nodes": [
+ { "host": "node1", "port": 6379 },
+ { "host": "node2", "port": 6379 },
+ { "host": "node3", "port": 6379 }
+ ],
+ "options": {
+ "redisOptions": {
+ "password": "cluster-password"
+ }
+ }
+ }
+}
+```
+
+### Redis Sentinel
+
+```javascript
+{
+ "redis": {
+ "sentinels": [
+ { "host": "sentinel1", "port": 26379 },
+ { "host": "sentinel2", "port": 26379 }
+ ],
+ "name": "mymaster",
+ "password": "redis-password",
+ "sentinelPassword": "sentinel-password"
+ }
+}
+```
+
+### TLS/SSL Connection
+
+```javascript
+{
+ "redis": {
+ "url": "rediss://localhost:6380",
+ "tls": {
+ "enabled": true,
+ "rejectUnauthorized": true,
+ "cert": "/path/to/client-cert.pem",
+ "key": "/path/to/client-key.pem",
+ "ca": "/path/to/ca-cert.pem",
+ "checkServerIdentity": true
+ }
+ }
+}
+```
+
+## Guild Configuration
+
+### Whitelist/Blacklist Patterns
+
+```javascript
+{
+ "guilds": {
+ "whitelist": [
+ "production-*", // All production guilds
+ "staging-guild-01", // Specific staging guild
+ "critical-*" // All critical guilds
+ ],
+ "blacklist": [
+ "test-*", // Exclude all test guilds
+ "*-dev", // Exclude development guilds
+ "benchmark-*" // Exclude benchmark guilds
+ ],
+ "autoDiscovery": true,
+ "refreshInterval": 60000
+ }
+}
+```
+
+### Guild Filtering Rules
+
+```javascript
+{
+ "guilds": {
+ "filters": [
+ {
+ "type": "include",
+ "pattern": "production-*",
+ "priority": 1
+ },
+ {
+ "type": "exclude",
+ "pattern": "production-test-*",
+ "priority": 2
+ }
+ ]
+ }
+}
+```
+
+## UI Configuration
+
+### Theme Settings
+
+```javascript
+{
+ "ui": {
+ "theme": "dark",
+ "customTheme": {
+ "primaryColor": "#667eea",
+ "backgroundColor": "#1a1a1a",
+ "textColor": "#ffffff",
+ "borderColor": "#333333"
+ }
+ }
+}
+```
+
+### Feature Toggles
+
+```javascript
+{
+ "ui": {
+ "features": {
+ "flowGraph": true,
+ "messageInspector": true,
+ "threadView": true,
+ "metricsPanel": true,
+ "searchBar": true,
+ "exportTools": false,
+ "replayMode": false,
+ "customFilters": true
+ },
+ "defaultPanels": ["messages", "metrics"],
+ "maxPanels": 4
+ }
+}
+```
+
+## Performance Configuration
+
+### Message Sampling
+
+```javascript
+{
+ "debug": {
+ "sampling": {
+ "enabled": true,
+ "defaultRate": 1.0,
+ "rules": [
+ {
+ "topic": "high-volume-topic",
+ "rate": 0.1 // Sample 10%
+ },
+ {
+ "guild": "chatty-guild",
+ "rate": 0.05 // Sample 5%
+ },
+ {
+ "agent": "verbose-agent",
+ "rate": 0.01 // Sample 1%
+ }
+ ]
+ }
+ }
+}
+```
+
+### Caching
+
+```javascript
+{
+ "advanced": {
+ "cache": {
+ "enabled": true,
+ "type": "memory",
+ "ttl": 300000,
+ "maxSize": "100MB",
+ "evictionPolicy": "lru",
+ "redis": {
+ "enabled": false,
+ "prefix": "rustic-debug:cache:",
+ "ttl": 600000
+ }
+ }
+ }
+}
+```
+
+## Security Configuration
+
+### Authentication
+
+```javascript
+{
+ "auth": {
+ "enabled": true,
+ "type": "jwt",
+ "jwt": {
+ "secret": "your-jwt-secret",
+ "issuer": "rustic-debug",
+ "audience": "rustic-ai",
+ "expiresIn": "24h"
+ },
+ "users": [
+ {
+ "username": "admin",
+ "password": "$2b$10$...", // bcrypt hash
+ "role": "admin"
+ },
+ {
+ "username": "viewer",
+ "password": "$2b$10$...",
+ "role": "readonly"
+ }
+ ]
+ }
+}
+```
+
+### HTTPS/TLS
+
+```javascript
+{
+ "server": {
+ "https": {
+ "enabled": true,
+ "cert": "/path/to/cert.pem",
+ "key": "/path/to/key.pem",
+ "ca": "/path/to/ca.pem",
+ "passphrase": "cert-passphrase"
+ }
+ }
+}
+```
+
+## Monitoring Configuration
+
+### Metrics Export
+
+```javascript
+{
+ "monitoring": {
+ "prometheus": {
+ "enabled": true,
+ "port": 9090,
+ "path": "/metrics",
+ "defaultLabels": {
+ "service": "rustic-debug",
+ "environment": "production"
+ }
+ },
+ "statsd": {
+ "enabled": false,
+ "host": "localhost",
+ "port": 8125,
+ "prefix": "rustic.debug."
+ }
+ }
+}
+```
+
+### Health Checks
+
+```javascript
+{
+ "monitoring": {
+ "healthCheck": {
+ "enabled": true,
+ "interval": 30000,
+ "checks": [
+ {
+ "name": "redis",
+ "type": "redis-ping",
+ "critical": true
+ },
+ {
+ "name": "memory",
+ "type": "memory-usage",
+ "threshold": 0.9,
+ "critical": false
+ }
+ ]
+ }
+ }
+}
+```
+
+## Profiles
+
+Use configuration profiles for different environments:
+
+### Development Profile
+
+`config.dev.json`:
+```json
+{
+ "extends": "./config.base.json",
+ "redis": {
+ "url": "redis://localhost:6379"
+ },
+ "server": {
+ "port": 3000
+ },
+ "debug": {
+ "readOnly": false
+ },
+ "logging": {
+ "level": "debug"
+ }
+}
+```
+
+### Production Profile
+
+`config.prod.json`:
+```json
+{
+ "extends": "./config.base.json",
+ "redis": {
+ "url": "${REDIS_URL}"
+ },
+ "server": {
+ "port": "${PORT}"
+ },
+ "debug": {
+ "readOnly": true
+ },
+ "auth": {
+ "enabled": true
+ },
+ "logging": {
+ "level": "warn"
+ }
+}
+```
+
+Load profile:
+```bash
+rustic-debug start --config config.prod.json --profile production
+```
+
+## Configuration Validation
+
+Rustic Debug validates configuration on startup:
+
+```bash
+# Validate configuration without starting
+rustic-debug validate --config ./rustic-debug.config.json
+
+# Output:
+✅ Configuration valid
+✅ Redis connection successful
+✅ All required settings present
+⚠️ Warning: Authentication disabled
+⚠️ Warning: Using default retention period
+```
+
+## Dynamic Configuration
+
+Some settings can be changed at runtime via the API:
+
+```bash
+# Update sampling rate
+curl -X PUT http://localhost:3000/api/config \
+ -H "Content-Type: application/json" \
+ -d '{"debug": {"sampling": {"rate": 0.5}}}'
+
+# Update UI refresh rate
+curl -X PUT http://localhost:3000/api/config \
+ -H "Content-Type: application/json" \
+ -d '{"ui": {"refreshRate": 2000}}'
+```
+
+## Next Steps
+
+- [Basic Usage](./basic-usage.html) - Start using Rustic Debug
+- [Advanced Features](./advanced.html) - Explore advanced capabilities
+- [API Reference](../dev-guide/api.html) - API documentation
\ No newline at end of file
diff --git a/docs/src/content/user-guide/index.md b/docs/src/content/user-guide/index.md
new file mode 100644
index 0000000..df57839
--- /dev/null
+++ b/docs/src/content/user-guide/index.md
@@ -0,0 +1,71 @@
+---
+title: User Guide Overview
+description: Complete guide to using Rustic Debug for everyday debugging tasks
+sidebar:
+ category: user-guide
+ order: 1
+tags: [overview, getting-started]
+---
+
+# User Guide Overview
+
+Welcome to the Rustic Debug user guide! This comprehensive guide will help you get started with debugging Redis message flows in your RusticAI applications.
+
+## What is Rustic Debug?
+
+Rustic Debug is a powerful web-based debugging tool designed specifically for RusticAI guild systems. It provides real-time visualization and analysis of Redis message flows, making it easier to understand and troubleshoot your distributed AI applications.
+
+## Key Features
+
+### 🔍 **Real-time Message Monitoring**
+Monitor Redis pub/sub channels and message queues in real-time with live updates.
+
+### 📊 **Visual Flow Graphs**
+Visualize message flows between guilds, topics, and agents with interactive diagrams.
+
+### 🕵️ **Message Inspector**
+Deep dive into individual messages with detailed payload inspection and metadata analysis.
+
+### 🧵 **Thread Tracking**
+Follow conversation threads and message chains across multiple topics and guilds.
+
+### 📈 **Performance Metrics**
+Track message throughput, latency, and system performance with built-in analytics.
+
+## Getting Started
+
+1. **[📸 Screenshots & Visual Guide](./screenshots.html)** - See Rustic Debug in action with visual examples
+2. **[Installation](./installation.html)** - Set up Rustic Debug in your environment
+3. **[Configuration](./configuration.html)** - Configure Redis connections and guild settings
+4. **[Basic Usage](./basic-usage.html)** - Learn the core debugging workflows
+5. **[Advanced Features](./advanced.html)** - Explore advanced debugging capabilities
+
+## Quick Start
+
+For users who want to jump right in:
+
+```bash
+# Install Rustic Debug
+npm install -g @rustic-ai/rustic-debug
+
+# Start the debugger
+rustic-debug start --redis-url redis://localhost:6379
+
+# Open the web interface
+open http://localhost:3000
+```
+
+## Common Use Cases
+
+- **Message Flow Debugging** - Trace messages through complex guild hierarchies
+- **Performance Analysis** - Identify bottlenecks in message processing
+- **Integration Testing** - Validate message flows in development environments
+- **Production Monitoring** - Monitor live systems for issues and anomalies
+
+## Need Help?
+
+- Check out our [Troubleshooting Guide](./troubleshooting) for common issues
+- Browse the [FAQ](./faq) for quick answers
+- Join our [Community Discussion](https://github.com/rustic-ai/rustic-debug/discussions) for help from other users
+
+Let's get started with [installation](./installation)!
\ No newline at end of file
diff --git a/docs/src/content/user-guide/installation.md b/docs/src/content/user-guide/installation.md
new file mode 100644
index 0000000..856d800
--- /dev/null
+++ b/docs/src/content/user-guide/installation.md
@@ -0,0 +1,453 @@
+---
+title: Installation Guide
+description: Step-by-step guide to install and set up Rustic Debug
+tags: [installation, setup, getting-started]
+---
+
+# Installation Guide
+
+Get Rustic Debug up and running in your environment with these installation methods.
+
+## Prerequisites
+
+Before installing Rustic Debug, ensure you have:
+
+- **Node.js** v18.0 or higher (for npm installation)
+- **Redis** v6.0 or higher running and accessible
+- **RusticAI** application using Redis for messaging
+- **Modern web browser** (Chrome, Firefox, Safari, Edge)
+
+## Installation Methods
+
+### Method 1: NPM (Recommended)
+
+The quickest way to get started with Rustic Debug.
+
+```bash
+# Install globally
+npm install -g @rustic-ai/rustic-debug
+
+# Or with yarn
+yarn global add @rustic-ai/rustic-debug
+
+# Or with pnpm
+pnpm add -g @rustic-ai/rustic-debug
+```
+
+#### Verify Installation
+
+```bash
+# Check version
+rustic-debug --version
+
+# View help
+rustic-debug --help
+```
+
+### Method 2: Docker
+
+Run Rustic Debug in a containerized environment.
+
+```bash
+# Pull the latest image
+docker pull rusticai/rustic-debug:latest
+
+# Run the container
+docker run -d \
+ --name rustic-debug \
+ -p 3000:3000 \
+ -e REDIS_URL=redis://host.docker.internal:6379 \
+ rusticai/rustic-debug
+```
+
+#### Docker Compose
+
+Create a `docker-compose.yml`:
+
+```yaml
+version: '3.8'
+services:
+ rustic-debug:
+ image: rusticai/rustic-debug:latest
+ ports:
+ - "3000:3000"
+ environment:
+ - REDIS_URL=redis://redis:6379
+ - NODE_ENV=production
+ depends_on:
+ - redis
+ networks:
+ - rustic-network
+
+ redis:
+ image: redis:7-alpine
+ ports:
+ - "6379:6379"
+ networks:
+ - rustic-network
+
+networks:
+ rustic-network:
+ driver: bridge
+```
+
+Then run:
+```bash
+docker-compose up -d
+```
+
+### Method 3: From Source
+
+Build and run from the source code.
+
+```bash
+# Clone the repository
+git clone https://github.com/rustic-ai/rustic-debug.git
+cd rustic-debug
+
+# Install dependencies
+pnpm install
+
+# Build the project
+pnpm build
+
+# Start the application
+pnpm start
+```
+
+#### Development Mode
+
+```bash
+# Run in development mode with hot reload
+pnpm dev
+
+# Run frontend and backend separately
+pnpm --filter frontend dev
+pnpm --filter backend dev
+```
+
+### Method 4: Kubernetes
+
+Deploy to a Kubernetes cluster using Helm.
+
+```bash
+# Add the Rustic helm repository
+helm repo add rustic https://charts.rustic.ai
+helm repo update
+
+# Install Rustic Debug
+helm install rustic-debug rustic/rustic-debug \
+ --set redis.url=redis://my-redis-service:6379 \
+ --set ingress.enabled=true \
+ --set ingress.host=debug.example.com
+```
+
+## Configuration
+
+### Basic Configuration
+
+After installation, configure Rustic Debug to connect to your Redis instance:
+
+```bash
+# Start with basic configuration
+rustic-debug start \
+ --redis-url redis://localhost:6379 \
+ --port 3000 \
+ --host 0.0.0.0
+```
+
+### Advanced Configuration
+
+Create a configuration file `rustic-debug.config.json`:
+
+```json
+{
+ "redis": {
+ "url": "redis://localhost:6379",
+ "password": "your-password",
+ "db": 0,
+ "connectionTimeout": 5000,
+ "reconnectStrategy": "exponential"
+ },
+ "server": {
+ "port": 3000,
+ "host": "0.0.0.0",
+ "cors": {
+ "enabled": true,
+ "origins": ["http://localhost:*"]
+ }
+ },
+ "debug": {
+ "readOnly": true,
+ "maxMessages": 10000,
+ "retentionHours": 24
+ },
+ "auth": {
+ "enabled": false,
+ "token": "your-secret-token"
+ }
+}
+```
+
+Load the configuration:
+```bash
+rustic-debug start --config ./rustic-debug.config.json
+```
+
+### Environment Variables
+
+You can also use environment variables:
+
+```bash
+export REDIS_URL=redis://localhost:6379
+export REDIS_PASSWORD=your-password
+export REDIS_DB=0
+export DEBUG_PORT=3000
+export DEBUG_HOST=0.0.0.0
+export DEBUG_READ_ONLY=true
+export DEBUG_AUTH_TOKEN=your-secret-token
+
+rustic-debug start
+```
+
+## Connecting to Redis
+
+### Redis Connection Strings
+
+Different Redis configurations:
+
+```bash
+# Standard connection
+redis://localhost:6379
+
+# With password
+redis://:password@localhost:6379
+
+# With username and password
+redis://username:password@localhost:6379
+
+# With database selection
+redis://localhost:6379/2
+
+# Redis Cluster
+redis://node1:6379,node2:6379,node3:6379
+
+# Redis Sentinel
+redis+sentinel://localhost:26379/mymaster
+
+# TLS/SSL connection
+rediss://localhost:6380
+```
+
+### Testing Redis Connection
+
+Before starting Rustic Debug, verify your Redis connection:
+
+```bash
+# Test connection
+rustic-debug test-connection --redis-url redis://localhost:6379
+
+# Output:
+# ✅ Successfully connected to Redis at localhost:6379
+# ✅ Redis version: 7.0.5
+# ✅ Found 3 guilds with 142 messages
+```
+
+## Platform-Specific Instructions
+
+### macOS
+
+```bash
+# Install Redis (if needed)
+brew install redis
+brew services start redis
+
+# Install Rustic Debug
+npm install -g @rustic-ai/rustic-debug
+
+# Start
+rustic-debug start
+```
+
+### Ubuntu/Debian
+
+```bash
+# Install Redis (if needed)
+sudo apt update
+sudo apt install redis-server
+sudo systemctl start redis
+
+# Install Node.js (if needed)
+curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
+sudo apt install nodejs
+
+# Install Rustic Debug
+sudo npm install -g @rustic-ai/rustic-debug
+
+# Start
+rustic-debug start
+```
+
+### Windows
+
+```powershell
+# Install Redis (using WSL2 or Docker)
+# WSL2 approach:
+wsl --install
+wsl sudo apt install redis-server
+wsl sudo service redis-server start
+
+# Install Rustic Debug
+npm install -g @rustic-ai/rustic-debug
+
+# Start
+rustic-debug start
+```
+
+## Verifying Installation
+
+After installation, verify everything is working:
+
+1. **Check Service Status:**
+ ```bash
+ rustic-debug status
+ ```
+
+2. **Open the Web UI:**
+ ```bash
+ open http://localhost:3000
+ ```
+
+3. **Run Health Check:**
+ ```bash
+ curl http://localhost:3000/health
+
+ # Expected response:
+ {
+ "status": "healthy",
+ "redis": "connected",
+ "version": "1.0.0",
+ "uptime": 120
+ }
+ ```
+
+## Setting Up as a Service
+
+### systemd (Linux)
+
+Create `/etc/systemd/system/rustic-debug.service`:
+
+```ini
+[Unit]
+Description=Rustic Debug Service
+After=network.target redis.service
+
+[Service]
+Type=simple
+User=rustic
+WorkingDirectory=/opt/rustic-debug
+ExecStart=/usr/bin/rustic-debug start --config /etc/rustic-debug/config.json
+Restart=on-failure
+RestartSec=10
+
+[Install]
+WantedBy=multi-user.target
+```
+
+Enable and start:
+```bash
+sudo systemctl enable rustic-debug
+sudo systemctl start rustic-debug
+```
+
+### PM2 (Node.js Process Manager)
+
+```bash
+# Install PM2
+npm install -g pm2
+
+# Start with PM2
+pm2 start rustic-debug --name rustic-debug -- start
+
+# Save configuration
+pm2 save
+pm2 startup
+```
+
+## Troubleshooting Installation
+
+### Common Issues
+
+**Issue: Cannot connect to Redis**
+```bash
+# Check Redis is running
+redis-cli ping
+# Should return: PONG
+
+# Check Redis connection
+rustic-debug test-connection --redis-url redis://localhost:6379
+```
+
+**Issue: Port already in use**
+```bash
+# Find what's using port 3000
+lsof -i :3000
+
+# Use a different port
+rustic-debug start --port 3001
+```
+
+**Issue: Permission denied**
+```bash
+# Fix npm permissions (macOS/Linux)
+sudo npm install -g @rustic-ai/rustic-debug
+
+# Or change npm prefix
+npm config set prefix ~/.npm-global
+export PATH=~/.npm-global/bin:$PATH
+```
+
+**Issue: Node version too old**
+```bash
+# Check Node version
+node --version
+
+# Update Node.js using nvm
+nvm install 18
+nvm use 18
+```
+
+## Uninstalling
+
+### NPM
+```bash
+npm uninstall -g @rustic-ai/rustic-debug
+```
+
+### Docker
+```bash
+docker stop rustic-debug
+docker rm rustic-debug
+docker rmi rusticai/rustic-debug
+```
+
+### From Source
+```bash
+# Remove the cloned directory
+rm -rf /path/to/rustic-debug
+```
+
+## Next Steps
+
+Now that Rustic Debug is installed:
+
+1. [Configure your environment](./configuration.html)
+2. [Learn basic usage](./basic-usage.html)
+3. [Connect to your RusticAI application](./advanced.html)
+4. [Set up monitoring dashboards](./advanced.html#monitoring)
+
+## Getting Help
+
+- Check the [Troubleshooting Guide](./troubleshooting.html)
+- Visit our [GitHub Issues](https://github.com/rustic-ai/rustic-debug/issues)
+- Join the [RusticAI Community](https://rustic.ai/community)
\ No newline at end of file
diff --git a/docs/src/content/user-guide/screenshots.md b/docs/src/content/user-guide/screenshots.md
new file mode 100644
index 0000000..f7510fc
--- /dev/null
+++ b/docs/src/content/user-guide/screenshots.md
@@ -0,0 +1,271 @@
+---
+title: Screenshots & Visual Guide
+description: Visual tour of Rustic Debug interface and features
+tags: [screenshots, visual-guide, ui]
+---
+
+# Screenshots & Visual Guide
+
+Explore the Rustic Debug interface through these annotated screenshots and visual guides.
+
+## Dashboard Page
+
+The Dashboard page is your entry point to debugging. It displays all available RusticAI guilds in your Redis instance with real-time metrics.
+
+![Dashboard Page - Guilds Overview]
+
+**Key Features:**
+- **Guild Cards**: Each guild is displayed as a card showing:
+ - Guild name and ID (e.g., "Test Guild" with ID "test_guild_id")
+ - Number of active topics (e.g., "5 Topics")
+ - Active agent count (e.g., "0 Agents" when idle)
+ - Real-time message rate (e.g., "0.0/s")
+ - Active status indicator (green dot)
+- **Summary Statistics Bar**: At the top showing:
+ - Active Guilds: 6/6
+ - Total Topics: 51
+ - Active Agents: 0
+ - Message Rate: 0.0/s
+- **Connection Status**: Top-right indicator showing "Connected (1ms)"
+- **Quick Navigation**: Click any guild card to debug its messages
+
+## Debug Dashboard
+
+The main debugging interface provides comprehensive tools for message analysis.
+
+
+
+**Dashboard Components:**
+- **Header Bar**: Guild name, connection status, and view controls
+- **Sidebar**: Navigation between different views
+- **Main Content Area**: Dynamic content based on selected view
+- **Metrics Bar**: Real-time statistics and performance metrics
+
+## Message List View
+
+The List View presents messages in a chronological format with topic filtering on the left sidebar.
+
+![List View - Chronological Message Display]
+
+**List View Features:**
+
+### Topic Sidebar (Left)
+- **Topic List** with message counts:
+ - 📥 initiator (16 messages)
+ - 📥 responder (14 messages)
+ - heartbeat (54 messages)
+ - default topic (107 messages)
+ - 📥 local test (7 messages)
+- Selected topic is highlighted with dark background
+
+### Message Cards (Center)
+- **Agent Information**:
+ - Circular avatar with initial (e.g., "I" for Initiator Agent)
+ - Agent name and exact timestamp
+- **Message Details**:
+ - Status badge (green "completed" badge)
+ - Message type (e.g., "SelfReadyNotification")
+ - JSON payload with syntax highlighting
+ - Message ID and priority at the bottom
+- **Search Bar**: "Search messages, agents, IDs..." for quick filtering
+
+### Message Inspector
+When you click on a message, the inspector panel opens:
+
+
+
+**Inspector Details:**
+- **Message Header**: ID, timestamp, and status
+- **Content Viewer**:
+ - JSON tree view for structured data
+ - Syntax highlighting
+ - Copy to clipboard
+ - Export options
+- **Metadata Section**:
+ - Processing time
+ - Retry count
+ - Thread ID
+ - Parent message link
+- **Routing Rules**: Shows message routing configuration
+- **Raw View**: Toggle between formatted and raw JSON
+
+## Thread View
+
+The Thread View groups related messages by conversation thread for easier tracking.
+
+![Thread View - Grouped by Conversation]
+
+**Thread Visualization:**
+
+### Thread Headers
+- **Thread Identifier**: Shows truncated thread ID (e.g., "Thread: 958614409581... (1 messages)")
+- **Message Count**: Number of messages in each thread
+- **Thread Count Indicator**: "16 messages" and "16 threads" shown at the top
+
+### Thread Content
+- **Compact Message Display**: Each thread shows:
+ - Agent avatar and name
+ - Timestamp (time only for same-day messages)
+ - Message type (e.g., "SelfReadyNotification")
+ - JSON payload preview
+- **Chronological Ordering**: Threads are arranged by timestamp
+- **Visual Separation**: Each thread is clearly separated for easy scanning
+
+### Benefits of Thread View
+- **Context Preservation**: Related messages stay together
+- **Conversation Tracking**: Easy to follow request-response patterns
+- **Debugging Workflows**: Identify where conversations break or fail
+- **Performance Analysis**: See thread durations at a glance
+
+## Graph View
+
+The Graph View provides an interactive visualization of message flows using a node-based graph.
+
+![Graph View - Interactive Message Flow Visualization]
+
+**Graph Visualization Components:**
+
+### Layout Controls (Top Bar)
+- **Layout Options**: Toggle between different visualization modes
+ - Tree layout (hierarchical structure)
+ - Timeline layout (temporal arrangement)
+ - Circle layout (radial distribution)
+- **View Mode Icons**: Quick access to different visualization styles
+
+### Interactive Canvas
+- **Node Visualization**: Messages and agents represented as connected nodes
+- **Visual Flow Lines**: Shows message routing and relationships
+- **Canvas Controls** (Bottom-right):
+ - Plus/Minus buttons for zoom in/out
+ - Fit-to-screen button
+ - Fullscreen toggle
+ - Pan controls for navigation
+
+### Graph Features
+- **Real-time Updates**: Graph updates as new messages arrive
+- **Interactive Exploration**: Click and drag to explore the graph
+- **Focus on Context**: Selected topic ("initiator") highlighted in sidebar
+- **Visual Hierarchy**: Node size and color indicate importance and type
+
+### Use Cases for Graph View
+- **System Architecture Visualization**: Understand how agents communicate
+- **Bottleneck Detection**: Identify high-traffic routes
+- **Debug Message Routing**: Trace message paths visually
+- **Performance Analysis**: See which paths have delays or errors
+
+## Real-time Monitoring
+
+The real-time monitoring view shows live message flow.
+
+
+
+**Real-time Features:**
+- **Live Message Stream**: Messages appear as they arrive
+- **Activity Graph**: Rolling time-series chart
+- **Alert Panel**: Real-time alerts and warnings
+- **Performance Gauges**: CPU, memory, and throughput meters
+
+## Filter & Search Interface
+
+Advanced filtering capabilities for finding specific messages.
+
+
+
+**Filter Options:**
+- **Quick Filters**: Pre-configured common filters
+- **Advanced Query Builder**: Build complex queries
+- **Saved Filters**: Save and reuse filter configurations
+- **Filter History**: Recent filter queries
+
+## Export & Reporting
+
+Export functionality for sharing and analysis.
+
+
+
+**Export Options:**
+- **Formats**: JSON, CSV, PDF, HTML
+- **Scope**: Current view, filtered results, or time range
+- **Include Options**:
+ - Messages
+ - Metadata
+ - Thread context
+ - Performance metrics
+
+## Settings & Configuration
+
+Configure Rustic Debug for your environment.
+
+
+
+**Settings Sections:**
+- **Connection Settings**: Redis connection configuration
+- **UI Preferences**: Theme, layout, refresh rates
+- **Performance**: Caching, sampling, limits
+- **Security**: Authentication, encryption
+- **Advanced**: Debug options, experimental features
+
+## Mobile Responsive Views
+
+Rustic Debug is fully responsive for mobile debugging.
+
+### Mobile List View
+
+
+- Optimized table layout
+- Swipe actions
+- Collapsible panels
+
+### Mobile Graph View
+
+
+- Touch-optimized controls
+- Simplified visualization
+- Gesture support
+
+## Dark Mode
+
+All views support dark mode for comfortable debugging at any time.
+
+
+
+**Dark Mode Features:**
+- High contrast text
+- Reduced eye strain
+- Syntax highlighting optimized for dark backgrounds
+- Automatic theme switching based on system preferences
+
+## Keyboard Shortcuts
+
+Quick reference for power users:
+
+| Shortcut | Action |
+|----------|--------|
+| `Ctrl/Cmd + K` | Quick search |
+| `Ctrl/Cmd + F` | Filter messages |
+| `Ctrl/Cmd + G` | Toggle graph view |
+| `Ctrl/Cmd + L` | Toggle list view |
+| `Ctrl/Cmd + T` | Toggle thread view |
+| `Ctrl/Cmd + R` | Refresh data |
+| `Ctrl/Cmd + E` | Export current view |
+| `Esc` | Close panels/modals |
+| `Space` | Pause/resume live updates |
+
+## Video Tutorials
+
+For a more comprehensive understanding, check out our video tutorials:
+
+1. **Getting Started** (5 mins) - Basic navigation and setup
+2. **Debugging Workflows** (10 mins) - Common debugging scenarios
+3. **Advanced Features** (15 mins) - Power user features
+4. **Performance Analysis** (8 mins) - Using metrics and profiling
+
+[View Video Tutorials →](https://rustic.ai/tutorials)
+
+## Next Steps
+
+Now that you're familiar with the interface:
+
+- [Learn Basic Usage](./basic-usage.html) - Start debugging
+- [Explore Advanced Features](./advanced.html) - Power user features
+- [Read API Docs](../dev-guide/api.html) - Integrate with your tools
\ No newline at end of file
diff --git a/docs/src/index.html b/docs/src/index.html
new file mode 100644
index 0000000..719ec38
--- /dev/null
+++ b/docs/src/index.html
@@ -0,0 +1,425 @@
+
+
+
+
+
+ Rustic Debug - Redis Message Debugger for RusticAI
+
+
+
+
+
+
+
+
🔍 Rustic Debug
+
Real-time Redis Message Debugger for RusticAI
+
+ Debug and visualize message flows in your RusticAI applications with ease.
+ Monitor Redis pub/sub channels, inspect message payloads, track conversation threads,
+ and identify performance bottlenecks in your distributed AI systems.
+
';
+ }
+
+ // Render direct category pages
+ for (const page of category.pages) {
+ const isActive = false; // Would check if current page
+ html += `
+
+ ${page.content}
+
+`;
+
+ writeFileSync(`${outputDir}/${page.id}.html`, html);
+ }
+
+ console.log('Documentation build complete!');
+}
+
+buildDocumentation().catch(console.error);
+EOF
+
+chmod +x scripts/build.ts
+```
+
+## GitHub Pages Setup (10 minutes)
+
+### 1. Create GitHub Actions Workflow
+
+```bash
+mkdir -p ../.github/workflows
+
+cat > ../.github/workflows/docs-deploy.yml << 'EOF'
+name: Deploy Documentation
+
+on:
+ push:
+ branches: [main]
+ paths: ['docs/**']
+ workflow_dispatch:
+
+permissions:
+ contents: read
+ pages: write
+ id-token: write
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: '18'
+ cache: 'pnpm'
+
+ - run: pnpm install
+ - run: cd docs && pnpm run build
+
+ - uses: actions/upload-pages-artifact@v3
+ with:
+ path: docs/dist
+
+ deploy:
+ needs: build
+ runs-on: ubuntu-latest
+ environment:
+ name: github-pages
+ url: ${{ steps.deployment.outputs.page_url }}
+ steps:
+ - id: deployment
+ uses: actions/deploy-pages@v4
+EOF
+```
+
+### 2. Enable GitHub Pages
+
+1. Go to repository **Settings** → **Pages**
+2. Set **Source** to "GitHub Actions"
+3. Click **Save**
+
+## Testing the Setup (5 minutes)
+
+### 1. Local Development
+
+```bash
+# Start local development server
+cd docs
+pnpm run dev
+
+# Open browser to http://localhost:5173
+```
+
+### 2. Build Test
+
+```bash
+# Test build process
+pnpm run build
+
+# Preview built site
+pnpm run preview
+```
+
+### 3. Deploy Test
+
+```bash
+# Commit and push changes
+git add .
+git commit -m "feat: add documentation website foundation"
+git push origin main
+
+# Check GitHub Actions tab for deployment progress
+```
+
+## Verification Checklist
+
+After setup completion, verify:
+
+- [ ] **Local development works** - `pnpm run dev` serves content
+- [ ] **Build succeeds** - `pnpm run build` creates dist/ directory
+- [ ] **GitHub Actions runs** - Workflow triggers on push
+- [ ] **GitHub Pages deploys** - Site accessible at your-org.github.io/your-repo
+- [ ] **Content renders** - Markdown converts to HTML correctly
+
+## Next Steps
+
+With the foundation in place, you can:
+
+1. **Add Content** - Create more markdown files in `src/content/`
+2. **Customize Styling** - Implement rustic.ai theme
+3. **Add Screenshots** - Set up automated screenshot capture
+4. **Improve Navigation** - Build hierarchical sidebar
+5. **Optimize Performance** - Add image optimization and caching
+
+## Troubleshooting
+
+### Build Fails
+```bash
+# Check for syntax errors
+cd docs
+pnpm run validate
+
+# Check TypeScript compilation
+npx tsc --noEmit
+```
+
+### GitHub Pages Not Deploying
+- Verify repository has Pages enabled in Settings
+- Check Actions tab for workflow errors
+- Ensure main branch protection rules allow Actions
+
+### Local Development Issues
+```bash
+# Clear cache and reinstall
+rm -rf node_modules pnpm-lock.yaml
+pnpm install
+
+# Check port availability
+lsof -i :5173
+```
+
+---
+
+**Next**: Complete implementation with theming, screenshots, and advanced features
\ No newline at end of file
diff --git a/specs/002-setup-a-documentation/research.md b/specs/002-setup-a-documentation/research.md
new file mode 100644
index 0000000..2897806
--- /dev/null
+++ b/specs/002-setup-a-documentation/research.md
@@ -0,0 +1,218 @@
+# Research: Documentation Website with GitHub Pages
+
+**Generated**: 2025-09-28 | **Phase**: 0 | **Status**: Complete
+
+## Static Site Generation Technology
+
+**Decision**: Vite + TypeScript for build tooling
+**Rationale**:
+- Aligns with existing frontend stack (Vite, TypeScript)
+- Fast build times and hot module replacement for development
+- Excellent plugin ecosystem for markdown processing and asset optimization
+- Tree shaking and modern bundle optimization
+
+**Alternatives considered**:
+- Next.js: More complex setup, SSR not needed for static docs
+- Docusaurus: React-based but heavyweight, vendor lock-in
+- VitePress: Vue-based, not compatible with existing React components
+- Jekyll: Ruby-based, different language stack
+
+## Markdown Processing & Content Management
+
+**Decision**: Marked.js with custom renderers + Front Matter
+**Rationale**:
+- Lightweight, configurable markdown parsing
+- Custom renderer support for code blocks, tables, and links
+- Front matter support for metadata (title, sidebar position, etc.)
+- Compatible with existing React component architecture
+
+**Alternatives considered**:
+- MDX: More complex compilation, runtime overhead
+- Gray-matter + remark: Multiple dependencies, complex pipeline
+- Contentful/Strapi: Overkill for simple documentation
+
+## Screenshot Automation Technology
+
+**Decision**: Playwright for cross-browser screenshot capture
+**Rationale**:
+- Reliable, headless browser automation
+- Built-in wait strategies for dynamic content
+- Multiple browser engine support (Chromium, Firefox, WebKit)
+- TypeScript-first API design
+- Docker-compatible for CI/CD
+
+**Alternatives considered**:
+- Puppeteer: Chrome-only, less reliable wait strategies
+- Selenium: Heavier, more complex setup
+- Manual screenshots: Not scalable, consistency issues
+
+## GitHub Pages Deployment Strategy
+
+**Decision**: GitHub Actions with custom build workflow
+**Rationale**:
+- Native integration with GitHub repository
+- Free hosting for public repositories
+- Custom domain support available
+- Automated deployment on content changes
+- Build artifacts can be cached between deployments
+
+**Alternatives considered**:
+- Netlify: External service, additional complexity
+- Vercel: External service, not needed for static content
+- Self-hosted: Infrastructure overhead
+
+## Theme Implementation Approach
+
+**Decision**: Tailwind CSS with custom rustic.ai design system
+**Rationale**:
+- Aligns with existing frontend styling approach
+- Utility-first approach enables rapid development
+- Easy to create consistent design tokens
+- PostCSS integration for advanced optimizations
+- Mobile-first responsive design built-in
+
+**Alternatives considered**:
+- Custom CSS: More maintenance overhead
+- Bootstrap: Heavyweight, not aligned with current stack
+- Styled-components: Runtime overhead for static site
+
+## Navigation Structure Implementation
+
+**Decision**: Hierarchical sidebar with automatic generation from file structure
+**Rationale**:
+- Maintainable: Navigation updates automatically with new content
+- Consistent: Follows filesystem organization patterns
+- Scalable: Works with growing content without manual updates
+- Configurable: Front matter can override default ordering
+
+**Alternatives considered**:
+- Manual navigation config: High maintenance overhead
+- Flat structure: Doesn't scale with content volume
+- Tag-based navigation: More complex for users to understand
+
+## Content Organization Strategy
+
+**Decision**: Feature-based content structure with cross-references
+**Rationale**:
+- User-guide/: End-user focused documentation with screenshots
+- Dev-guide/: Technical implementation, API references, setup
+- Cross-references maintained via automatic link checking
+- Version-aware content with release alignment
+
+**Alternatives considered**:
+- Single flat documentation: Doesn't scale, poor discoverability
+- Wiki-style: Less structured, harder to maintain quality
+- API-first: Doesn't serve non-technical users effectively
+
+## Build Pipeline Architecture
+
+**Decision**: Multi-stage pipeline with incremental updates
+**Rationale**:
+1. Content validation (markdown linting, link checking)
+2. Screenshot generation (triggered manually or on UI changes)
+3. Static site generation (HTML, CSS, JS optimization)
+4. GitHub Pages deployment (atomic updates)
+
+**Pipeline Steps**:
+- **Stage 1**: Validate markdown content and check internal links
+- **Stage 2**: Generate screenshots if triggered (manual or UI diff detection)
+- **Stage 3**: Build static site with optimized assets
+- **Stage 4**: Deploy to GitHub Pages with rollback capability
+
+**Alternatives considered**:
+- Single-stage build: No rollback capability, all-or-nothing
+- External CI: Additional complexity and cost
+- Manual deployment: Error-prone, not scalable
+
+## Performance Optimization Strategy
+
+**Decision**: Static site optimization with progressive enhancement
+**Rationale**:
+- Static HTML for fastest initial load
+- Lazy loading for images and screenshots
+- Service worker for offline capability
+- Critical CSS inlining for above-the-fold content
+- Image optimization and WebP conversion
+
+**Performance Targets**:
+- Lighthouse score: 95+ on all metrics
+- First Contentful Paint: <1.5s
+- Time to Interactive: <3s
+- Screenshot generation: <30s per page
+
+## Screenshot Management Workflow
+
+**Decision**: Manual trigger with automated consistency checking
+**Rationale**:
+- Screenshots triggered via GitHub issue comment or workflow dispatch
+- Automated comparison with previous versions to detect UI changes
+- Batch processing for multiple pages/views
+- Storage in Git LFS for version control without repository bloat
+
+**Workflow Steps**:
+1. Start frontend and backend applications
+2. Navigate to each documented page/view
+3. Wait for content to load and stabilize
+4. Capture screenshots in multiple viewports (desktop, tablet, mobile)
+5. Optimize images and commit to repository
+6. Update markdown content with new screenshot references
+
+## Development Workflow Integration
+
+**Decision**: Seamless integration with existing development setup
+**Rationale**:
+- Documentation package added to existing PNPM workspace
+- Shared types package provides consistency with main application
+- Local development server for live preview during writing
+- Git hooks for content validation before commit
+
+**Integration Points**:
+- Package.json scripts aligned with existing conventions
+- ESLint/Prettier configuration shared with main project
+- TypeScript strict mode for build scripts
+- Vitest for testing documentation build pipeline
+
+## Risk Mitigation Strategies
+
+**Identified Risks & Mitigations**:
+
+1. **Screenshot drift from UI changes**
+ - Mitigation: Automated screenshot comparison in CI
+ - Fallback: Manual review process for breaking changes
+
+2. **GitHub Pages build failures**
+ - Mitigation: Local build validation before push
+ - Fallback: Rollback capability via GitHub Pages settings
+
+3. **Content quality degradation**
+ - Mitigation: Markdown linting and spell checking
+ - Fallback: Content review process via pull requests
+
+4. **Performance regression**
+ - Mitigation: Lighthouse CI checks on every deployment
+ - Fallback: CDN optimization and image compression
+
+5. **Maintenance overhead**
+ - Mitigation: Automated content generation where possible
+ - Fallback: Documentation-as-code principles with developer ownership
+
+## Technology Stack Summary
+
+**Core Technologies**:
+- **Build**: Vite + TypeScript + Rollup
+- **Content**: Marked.js + Front Matter + Custom renderers
+- **Styling**: Tailwind CSS + PostCSS + Autoprefixer
+- **Screenshots**: Playwright + headless browsers
+- **Deployment**: GitHub Actions + GitHub Pages
+- **Testing**: Vitest + Lighthouse CI
+
+**Development Tools**:
+- **Linting**: ESLint + Markdownlint + Prettier
+- **Type Checking**: TypeScript strict mode
+- **Image Optimization**: Sharp + WebP conversion
+- **Link Checking**: markdown-link-check
+- **Performance**: Lighthouse CI + Web Vitals
+
+---
+
+**Next Phase**: Phase 1 - Design & Contracts (data-model.md, contracts/, quickstart.md)
\ No newline at end of file
diff --git a/specs/002-setup-a-documentation/spec.md b/specs/002-setup-a-documentation/spec.md
new file mode 100644
index 0000000..19ce0e9
--- /dev/null
+++ b/specs/002-setup-a-documentation/spec.md
@@ -0,0 +1,120 @@
+# Feature Specification: Documentation Website with GitHub Pages
+
+**Feature Branch**: `002-setup-a-documentation`
+**Created**: 2025-09-28
+**Status**: Draft
+**Input**: User description: "setup a documentation website with gh-pages and generate dev and user docs with screenshots of all pages and views. use rustic.ai theme"
+
+## Execution Flow (main)
+```
+1. Parse user description from Input
+ → Identified: documentation website, GitHub Pages, dev docs, user docs, screenshots, rustic.ai theme
+2. Extract key concepts from description
+ → Actors: developers, end users, documentation maintainers
+ → Actions: setup, generate, host, view, maintain documentation
+ → Data: screenshots, documentation content, code examples
+ → Constraints: use rustic.ai theme, GitHub Pages hosting
+3. For each unclear aspect:
+ → [NEEDS CLARIFICATION: specific documentation structure and navigation]
+ → [NEEDS CLARIFICATION: screenshot automation frequency and triggers]
+ → [NEEDS CLARIFICATION: content update workflow and responsibilities]
+4. Fill User Scenarios & Testing section
+ → Primary: stakeholders accessing comprehensive project documentation
+5. Generate Functional Requirements
+ → Each requirement focused on documentation accessibility and maintenance
+6. Identify Key Entities
+ → Documentation pages, screenshots, user guides, developer guides
+7. Run Review Checklist
+ → WARN "Spec has uncertainties regarding automation and maintenance"
+8. Return: SUCCESS (spec ready for planning)
+```
+
+---
+
+## ⚡ Quick Guidelines
+- ✅ Focus on WHAT users need and WHY
+- ❌ Avoid HOW to implement (no tech stack, APIs, code structure)
+- 👥 Written for business stakeholders, not developers
+
+---
+
+## Clarifications
+
+### Session 2025-09-28
+- Q: When should the documentation screenshots be automatically updated? → A: Manual trigger when needed
+- Q: Who should be able to update the documentation content? → A: Any team member with repository access
+- Q: What type of navigation structure should the documentation website have? → A: Hierarchical sidebar with nested sections
+- Q: How often should the documentation website be deployed to GitHub Pages? → A: Immediately on every documentation change
+
+---
+
+## User Scenarios & Testing *(mandatory)*
+
+### Primary User Story
+As a stakeholder (developer, product manager, or end user), I want to access comprehensive, up-to-date documentation for the Rustic Debug application so that I can understand how to use the system, contribute to development, or make informed decisions about the project.
+
+### Acceptance Scenarios
+1. **Given** I am a new developer joining the project, **When** I visit the documentation website, **Then** I can find setup instructions, architecture overview, and contribution guidelines
+2. **Given** I am an end user, **When** I access the user documentation, **Then** I can see visual guides with screenshots showing how to use each feature of the application
+3. **Given** I am a product stakeholder, **When** I review the documentation, **Then** I can see current screenshots that accurately reflect the application's interface and functionality
+4. **Given** the application interface changes, **When** the documentation is updated, **Then** all screenshots are automatically refreshed to maintain accuracy
+5. **Given** I am browsing the documentation on mobile or desktop, **When** I navigate through the site, **Then** the rustic.ai theme provides a consistent and professional experience
+
+### Edge Cases
+- What happens when screenshots become outdated due to UI changes?
+- How does the system handle documentation for features that are in development?
+- What occurs if the GitHub Pages deployment fails?
+
+## Requirements *(mandatory)*
+
+### Functional Requirements
+- **FR-001**: System MUST host documentation on GitHub Pages with public accessibility
+- **FR-002**: System MUST provide separate sections for developer documentation and user documentation
+- **FR-003**: Documentation MUST include screenshots of all major application pages and views
+- **FR-004**: Website MUST use rustic.ai theme for consistent branding and visual identity
+- **FR-005**: System MUST provide manual trigger capability to generate and update screenshots when documentation maintainers determine updates are needed
+- **FR-006**: Documentation MUST include hierarchical sidebar navigation with nested sections allowing users to easily find relevant content
+- **FR-007**: System MUST maintain documentation versioning aligned with application releases
+- **FR-008**: Documentation MUST be searchable and include cross-references between related topics
+- **FR-009**: System MUST allow any team member with repository access to update documentation content
+- **FR-010**: Website MUST be responsive and accessible on various devices and screen sizes
+
+### Key Entities *(include if feature involves data)*
+- **Documentation Page**: Individual content units covering specific topics, containing text, images, and cross-references
+- **Screenshot**: Visual representation of application interfaces, automatically captured and embedded in documentation
+- **User Guide**: Documentation section focused on end-user functionality and workflows
+- **Developer Guide**: Documentation section covering technical implementation, setup, and contribution processes
+- **Navigation Structure**: Hierarchical organization of documentation content enabling logical browsing
+
+---
+
+## Review & Acceptance Checklist
+*GATE: Automated checks run during main() execution*
+
+### Content Quality
+- [ ] No implementation details (languages, frameworks, APIs)
+- [x] Focused on user value and business needs
+- [x] Written for non-technical stakeholders
+- [x] All mandatory sections completed
+
+### Requirement Completeness
+- [ ] No [NEEDS CLARIFICATION] markers remain
+- [ ] Requirements are testable and unambiguous
+- [x] Success criteria are measurable
+- [x] Scope is clearly bounded
+- [ ] Dependencies and assumptions identified
+
+---
+
+## Execution Status
+*Updated by main() during processing*
+
+- [x] User description parsed
+- [x] Key concepts extracted
+- [x] Ambiguities marked
+- [x] User scenarios defined
+- [x] Requirements generated
+- [x] Entities identified
+- [ ] Review checklist passed (pending clarifications)
+
+---
\ No newline at end of file
diff --git a/specs/002-setup-a-documentation/tasks.md b/specs/002-setup-a-documentation/tasks.md
new file mode 100644
index 0000000..d225e2a
--- /dev/null
+++ b/specs/002-setup-a-documentation/tasks.md
@@ -0,0 +1,166 @@
+# Tasks: Documentation Website with GitHub Pages
+
+**Input**: Design documents from `/specs/002-setup-a-documentation/`
+**Prerequisites**: plan.md ✅, research.md ✅, data-model.md ✅, contracts/ ✅, quickstart.md ✅
+
+## Execution Flow (main)
+```
+1. Load plan.md from feature directory
+ → COMPLETED: Tech stack: Vite + TypeScript + Playwright + GitHub Actions
+2. Load optional design documents:
+ → data-model.md: 5 entities → model tasks
+ → contracts/: 2 files → contract test tasks
+ → research.md: Technology decisions → setup tasks
+3. Generate tasks by category:
+ → Setup: docs package, dependencies, configuration
+ → Tests: build tests, screenshot tests, integration tests
+ → Core: content processing, navigation, build system
+ → Integration: GitHub Actions, screenshot automation
+ → Polish: optimization, performance, validation
+4. Apply task rules:
+ → Different files = mark [P] for parallel
+ → Tests before implementation (TDD)
+5. Number tasks sequentially (T001, T002...)
+6. Generate dependency graph
+7. Create parallel execution examples
+8. Return: SUCCESS (39 tasks ready for execution)
+```
+
+## Format: `[ID] [P?] Description`
+- **[P]**: Can run in parallel (different files, no dependencies)
+- Include exact file paths in descriptions
+
+## Path Conventions
+**Web app structure**: `docs/` (NEW), `backend/`, `frontend/` (existing)
+All paths relative to repository root: `/home/rohit/work/dragonscale/rustic-debug/`
+
+## Phase 3.1: Project Setup
+- [x] T001 Create documentation package directory structure at `docs/src/{content,components,scripts,styles,templates}` and `docs/tests/{build,screenshots,visual}`
+- [x] T002 Initialize package.json for `@rustic-debug/docs` with Vite, TypeScript, and documentation dependencies
+- [x] T003 [P] Configure TypeScript config at `docs/tsconfig.json` extending base configuration
+- [x] T004 [P] Set up Vite configuration at `docs/vite.config.ts` for static site generation
+- [x] T005 [P] Add docs workspace to root `pnpm-workspace.yaml` and install dependencies
+- [x] T006 [P] Configure linting and formatting tools for documentation package
+
+## Phase 3.2: Tests First (TDD) ⚠️ MUST COMPLETE BEFORE 3.3
+- [x] T007 [P] Create contract test for build API at `docs/tests/build/build-api.test.ts` validating content processing endpoints
+- [x] T008 [P] Create contract test for GitHub Actions workflow at `docs/tests/build/workflow.test.ts` validating CI/CD pipeline
+- [x] T009 [P] Create integration test for documentation page rendering at `docs/tests/integration/page-rendering.test.ts`
+- [x] T010 [P] Create integration test for navigation generation at `docs/tests/integration/navigation.test.ts`
+- [x] T011 [P] Create integration test for screenshot automation at `docs/tests/integration/screenshots.test.ts`
+- [x] T012 [P] Create build validation test at `docs/tests/build/validation.test.ts` checking markdown processing and asset optimization
+
+## Phase 3.3: Data Models & Core Types
+- [ ] T013 [P] Create DocumentationPage interface at `docs/src/types/DocumentationPage.ts` with metadata, content, and navigation properties
+- [ ] T014 [P] Create Screenshot interface at `docs/src/types/Screenshot.ts` with capture metadata and optimization properties
+- [ ] T015 [P] Create NavigationStructure interface at `docs/src/types/NavigationStructure.ts` with hierarchical organization
+- [ ] T016 [P] Create UserGuide and DeveloperGuide interfaces at `docs/src/types/Guides.ts` for content organization
+- [ ] T017 [P] Create BuildConfig interface at `docs/src/types/BuildConfig.ts` for build system configuration
+
+## Phase 3.4: Content Processing Core
+- [ ] T018 Create markdown processor at `docs/src/scripts/markdown-processor.ts` using marked.js with custom renderers and front matter parsing
+- [ ] T019 Create content scanner at `docs/src/scripts/content-scanner.ts` to discover and validate markdown files in content directories
+- [ ] T020 Create navigation builder at `docs/src/scripts/navigation-builder.ts` to generate hierarchical sidebar from page metadata
+- [ ] T021 Create asset optimizer at `docs/src/scripts/asset-optimizer.ts` for image compression and WebP conversion
+
+## Phase 3.5: Build System Implementation
+- [ ] T022 Create main build script at `docs/src/scripts/build.ts` orchestrating content processing, asset optimization, and HTML generation
+- [ ] T023 Create HTML template engine at `docs/src/templates/page-template.ts` for generating static pages with rustic.ai theme
+- [ ] T024 Create CSS build system at `docs/src/styles/build-styles.ts` implementing Tailwind CSS with rustic.ai design tokens
+- [ ] T025 Create search index generator at `docs/src/scripts/search-index.ts` using Lunr.js for client-side search
+
+## Phase 3.6: Screenshot Automation
+- [ ] T026 [P] Create Playwright configuration at `docs/playwright.config.ts` for cross-browser screenshot capture
+- [ ] T027 Create screenshot automation script at `docs/src/scripts/screenshots.ts` with viewport management and wait strategies
+- [ ] T028 Create image optimization script at `docs/src/scripts/optimize-images.ts` for batch processing and format conversion
+- [ ] T029 Create screenshot comparison utility at `docs/src/scripts/screenshot-diff.ts` for detecting UI changes
+
+## Phase 3.7: GitHub Actions Integration
+- [ ] T030 Create documentation build workflow at `.github/workflows/docs-build.yml` for automated content validation and site generation
+- [ ] T031 Create GitHub Pages deployment workflow at `.github/workflows/docs-deploy.yml` with artifact management and rollback capability
+- [ ] T032 [P] Create workflow validation script at `docs/src/scripts/validate-workflow.ts` for local testing of CI/CD pipeline
+
+## Phase 3.8: Content & Theme Implementation
+- [ ] T033 [P] Create sample user guide content at `docs/src/content/user-guide/` with index.md and dashboard sections
+- [ ] T034 [P] Create sample developer guide content at `docs/src/content/dev-guide/` with setup and API documentation
+- [ ] T035 Create rustic.ai theme implementation at `docs/src/styles/` with Tailwind CSS configuration and custom components
+- [ ] T036 [P] Create reusable documentation components at `docs/src/components/` for consistent styling and behavior
+
+## Phase 3.9: Integration & Polish
+- [ ] T037 Create end-to-end integration test at `docs/tests/e2e/full-build.test.ts` validating complete build and deployment process
+- [ ] T038 [P] Create performance validation script at `docs/src/scripts/performance-check.ts` using Lighthouse CI for quality gates
+- [ ] T039 [P] Create documentation validation script at `docs/src/scripts/validate-docs.ts` for link checking, spell checking, and content quality
+
+## Task Dependencies
+```
+T001 → T002 → T005 (Sequential setup)
+T003, T004, T006 can run parallel after T002
+T007-T012 can all run in parallel (different test files)
+T013-T017 can all run in parallel (different type files)
+T018 → T019 → T020 (Content processing pipeline)
+T021 → T028 (Asset optimization pipeline)
+T022 depends on T018, T020, T021 (Main build needs processors)
+T023 → T024 (Template before styles)
+T026 → T027 → T029 (Screenshot pipeline)
+T030, T031 can run parallel after build system complete
+T033-T036 can run parallel (different content areas)
+T037 depends on all core functionality
+T038, T039 can run parallel as final validation
+```
+
+## Parallel Execution Examples
+
+### Phase 3.2 - All Test Setup (Parallel)
+```bash
+# Run these simultaneously
+Task 1: Create build API contract test
+Task 2: Create GitHub Actions workflow test
+Task 3: Create page rendering integration test
+Task 4: Create navigation generation test
+Task 5: Create screenshot automation test
+Task 6: Create build validation test
+```
+
+### Phase 3.3 - All Type Definitions (Parallel)
+```bash
+# Run these simultaneously
+Task 1: Create DocumentationPage interface
+Task 2: Create Screenshot interface
+Task 3: Create NavigationStructure interface
+Task 4: Create Guides interfaces
+Task 5: Create BuildConfig interface
+```
+
+### Phase 3.8 - Content Creation (Parallel)
+```bash
+# Run these simultaneously
+Task 1: Create user guide sample content
+Task 2: Create developer guide sample content
+Task 3: Create reusable documentation components
+# Note: T035 (theme) runs separately as it affects all content
+```
+
+## Implementation Notes
+
+### TDD Approach
+- Phase 3.2 tests MUST be written and failing before implementing Phase 3.3-3.8
+- Each core script should have corresponding tests validating its contract
+- Integration tests validate end-to-end workflows
+
+### File Organization
+- All new code goes in `docs/` package - no modifications to existing `frontend/` or `backend/`
+- TypeScript strict mode throughout
+- Modular architecture with clear separation of concerns
+
+### Performance Targets
+- Build time: <5 minutes for full site generation
+- Screenshot generation: <30 seconds per page
+- Page load time: <3 seconds (Lighthouse score >90)
+
+### Validation Gates
+- All tests must pass before deployment
+- Lighthouse CI scores must meet thresholds
+- Link checking and content validation required
+
+## Ready for Implementation
+All 39 tasks are dependency-ordered and immediately executable. Each task includes specific file paths and clear success criteria for LLM-based implementation.
\ No newline at end of file