> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pryveo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Best Practices

## Performance

1. Minimize WASM binary size with `opt-level = "z"` and LTO.
2. Keep prompts concise and cap `max_tokens`.
3. Batch indexing and process in chunks for large datasets.

## User Experience

1. Log progress for long operations.
2. Provide clear, actionable error messages.
3. Handle missing permissions without crashing.

## Code Quality

### Error Handling

```rust theme={null}
let data = clipboard::read_text()
    .map_err(|e| format!("Failed to read clipboard: {}", e))?;
```

### Testing

```rust theme={null}
#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_feature() {
        // Test your app logic
    }
}
```

### Documentation

```rust theme={null}
/// Analyzes code and returns suggestions.
///
/// # Arguments
/// * `code` - The source code to analyze
///
/// # Returns
/// Analysis results as a formatted string
fn analyze(code: &str) -> Result<String> {
    // ...
}
```
