---
title: "Shared Base Rules for Tekne Stack"
id: tekne-stack-base
description: "Common Rust and engineering standards that apply to all Tekne repositories"
priority: 90
alwaysApply: true
---

# Shared Cursor Rules for Tekne Stack

These rules apply to all repositories within the Tekne ecosystem.

## General Principles

- **Prefer simplicity over complexity**: Reduce the amount of reasoning required.
- **Use real data**: Avoid synthetic examples in tests and visualizations.
- **Statistical rigor**: Follow pre-AI quality standards (citing TAOCP/Mackay).
- **Code-driven documentation**: Visualizations and READMEs should be generated by actual code execution.

## Rust Code Quality

- **Zero-copy**: Avoid unnecessary allocations in the hot path.
- **SIMD**: Use SIMD via `innr` (preferred) where possible.
- **Error Handling**: Use `Result<T, E>` for fallible operations; provide actionable error messages with context.
- **Clippy**: Fix all clippy warnings (`cargo clippy -- -D warnings`).
- **Formatting**: Use `cargo fmt` consistently.

## Visualization Standards

- All visualizations must use real data from actual code execution.
- Distribution fitting: Gamma, Beta, Normal.
- Large sample sizes: 1000+ for statistical significance.
- Reproducible: Fixed random seeds, documented data sources.

## Anti-Sycophancy

- **Challenge assumptions**: Identify issues before implementing.
- **Present alternatives**: Propose multiple approaches with trade-offs.
- **Technical language**: Use direct technical language without validation phrases.
- **Analysis-first**: Only agree when a solution is genuinely superior after thorough analysis.

## Documentation

- Every complex algorithm must cite its foundational paper.
- Decision guides: Include tables for parameter selection and model choice.
- Audience: Explicitly state who the module/crate is for.
