# Contributing Guidelines for contributing to the Provisioning platform including setup, workflow, and best practices. ## Getting Started ### Prerequisites Install required development tools: ```bash # Rust toolchain (latest stable) curl --proto '=https' --tlsv1.2 -sSf [https://sh.rustup.rs](https://sh.rustup.rs) | sh # Nushell shell brew install nushell # Nickel configuration language brew install nickel # Just task runner brew install just # Additional development tools cargo install cargo-watch cargo-tarpaulin cargo-audit ``` ### Development Workflow Follow these guidelines for all code changes and ensure adherence to the project's technical standards. 1. Read applicable language guidelines 2. Create feature branch from main 3. Make changes following project standards 4. Write or update tests 5. Run full test suite and linting 6. Create pull request with clear description ## Code Style Guidelines ### Rust Code Rust code guidelines: - Use idiomatic Rust patterns - No `unwrap()` in production code - Comprehensive error handling with custom error types - Format with `cargo fmt` - Pass `cargo clippy -- -D warnings` with zero warnings - Add inline documentation for public APIs ### Nushell Scripts Nushell code guidelines: - Use structured data pipelines - Avoid external command dependencies where possible - Handle errors gracefully with try-catch - Document functions with comments - Use type annotations for clarity ### Nickel Schemas Nickel configuration guidelines: - Define clear type constraints - Use lazy evaluation appropriately - Provide default values where sensible - Document schema fields - Validate schemas with `nickel typecheck` ## Testing Requirements All contributions must include appropriate tests: ### Required Tests - **Unit tests** for all new functions - **Integration tests** for component interactions - **Security tests** for security-related changes - **Documentation tests** for code examples ### Running Tests ```bash # Run all tests just test # Run specific test suite cargo test -p provisioning-orchestrator # Run with coverage cargo tarpaulin --out Html ``` ### Test Coverage Requirements - Unit tests: Minimum 80% code coverage - Critical paths: 100% coverage - Security components: 100% coverage ## Documentation ### Required Documentation All code changes must include: - **Inline code documentation** for public APIs - **Updated README** if adding new components - **Examples** showing usage - **Migration guide** for breaking changes ### Documentation Standards Documentation standards: - Use Markdown for all documentation - Code blocks must specify language - Keep lines ≤150 characters - No bare URLs (use markdown links) - Test all code examples ## Commit Message Format Use conventional commit format: ```text ():