# Rustelo Features Documentation

## Available Features

### Analytics
Comprehensive analytics system with navigation tracking, server monitoring, and browser analytics.

**Installation:**
```bash
cargo rustelo features add analytics
```

**Provides:**
- Navigation tracking with cache performance analysis
- Server log analysis and panic detection
- Browser console error tracking
- Real-time monitoring dashboard
- CLI tools for analysis and reporting

**Configuration:** `config/analytics.toml`

### Smart Build
Incremental build system with intelligent caching and performance optimization.

**Installation:**
```bash
cargo rustelo features add smart-build
```

**Provides:**
- Multi-layer cache system (L1/L2/L3)
- Incremental builds with change detection
- Build performance optimization
- Cache management and cleanup tools

**Configuration:** `config/smart-build.toml`

## Feature Development

### Creating a New Feature

1. Create feature directory:
```bash
mkdir features/my-feature
```

2. Create feature manifest:
```toml
# features/my-feature/feature.toml
[feature]
name = "my-feature"
version = "0.1.0"
description = "My custom feature"

[dependencies]
workspace = ["serde", "tokio"]
external = []
```

3. Add to features registry:
```toml
# registry/features.toml
[features.my-feature]
description = "My custom feature"
source = "local"
status = "available"
requires = []
```

### Feature Manifest Sections

- **feature**: Basic metadata (name, version, description)
- **dependencies**: Workspace and external dependencies
- **environment**: Environment variables
- **configuration**: Configuration files to install/merge
- **resources**: Assets, content, and i18n files
- **scripts**: Development and automation scripts
- **node**: Node.js dependencies
- **styles**: UnoCSS presets and styling
- **docker**: Docker services and infrastructure
- **just**: Just command modules

### Feature Integration Levels

1. **Dependencies**: Cargo and Node.js dependencies
2. **Environment**: Environment variables and secrets
3. **Configuration**: TOML/JSON config file merging
4. **Resources**: Public assets, site content, i18n files
5. **Styling**: UnoCSS preset and theme integration
6. **Infrastructure**: Docker services and deployment configs
7. **Development**: Scripts, Just commands, git hooks

### Best Practices

1. **Self-Contained**: Features should be independent and removable
2. **Configurable**: Use environment variables for customization
3. **Documented**: Include clear documentation and examples
4. **Tested**: Provide tests for feature functionality
5. **Versioned**: Use semantic versioning for feature updates
