# Development Workflow Guide\n\nThis document outlines the recommended development workflows, coding practices, testing strategies, and debugging techniques for the provisioning\nproject.\n\n## Table of Contents\n\n1. [Overview](#overview)\n2. [Development Setup](#development-setup)\n3. [Daily Development Workflow](#daily-development-workflow)\n4. [Code Organization](#code-organization)\n5. [Testing Strategies](#testing-strategies)\n6. [Debugging Techniques](#debugging-techniques)\n7. [Integration Workflows](#integration-workflows)\n8. [Collaboration Guidelines](#collaboration-guidelines)\n9. [Quality Assurance](#quality-assurance)\n10. [Best Practices](#best-practices)\n\n## Overview\n\nThe provisioning project employs a multi-language, multi-component architecture requiring specific development workflows to maintain consistency,\nquality, and efficiency.\n\n**Key Technologies**:\n\n- **Nushell**: Primary scripting and automation language\n- **Rust**: High-performance system components\n- **KCL**: Configuration language and schemas\n- **TOML**: Configuration files\n- **Jinja2**: Template engine\n\n**Development Principles**:\n\n- **Configuration-Driven**: Never hardcode, always configure\n- **Hybrid Architecture**: Rust for performance, Nushell for flexibility\n- **Test-First**: Comprehensive testing at all levels\n- **Documentation-Driven**: Code and APIs are self-documenting\n\n## Development Setup\n\n### Initial Environment Setup\n\n**1. Clone and Navigate**:\n\n```\n# Clone repository\ngit clone https://github.com/company/provisioning-system.git\ncd provisioning-system\n\n# Navigate to workspace\ncd workspace/tools\n```\n\n**2. Initialize Workspace**:\n\n```\n# Initialize development workspace\nnu workspace.nu init --user-name $USER --infra-name dev-env\n\n# Check workspace health\nnu workspace.nu health --detailed --fix-issues\n```\n\n**3. Configure Development Environment**:\n\n```\n# Create user configuration\ncp workspace/config/local-overrides.toml.example workspace/config/$USER.toml\n\n# Edit configuration for development\n$EDITOR workspace/config/$USER.toml\n```\n\n**4. Set Up Build System**:\n\n```\n# Navigate to build tools\ncd src/tools\n\n# Check build prerequisites\nmake info\n\n# Perform initial build\nmake dev-build\n```\n\n### Tool Installation\n\n**Required Tools**:\n\n```\n# Install Nushell\ncargo install nu\n\n# Install Nickel\ncargo install nickel\n\n# Install additional tools\ncargo install cross          # Cross-compilation\ncargo install cargo-audit    # Security auditing\ncargo install cargo-watch    # File watching\n```\n\n**Optional Development Tools**:\n\n```\n# Install development enhancers\ncargo install nu_plugin_tera    # Template plugin\ncargo install sops              # Secrets management\nbrew install k9s                # Kubernetes management\n```\n\n### IDE Configuration\n\n**VS Code Setup** (`.vscode/settings.json`):\n\n```\n{\n  "files.associations": {\n    "*.nu": "shellscript",\n    "*.ncl": "nickel",\n    "*.toml": "toml"\n  },\n  "nushell.shellPath": "/usr/local/bin/nu",\n  "rust-analyzer.cargo.features": "all",\n  "editor.formatOnSave": true,\n  "editor.rulers": [100],\n  "files.trimTrailingWhitespace": true\n}\n```\n\n**Recommended Extensions**:\n\n- Nushell Language Support\n- Rust Analyzer\n- Nickel Language Support\n- TOML Language Support\n- Better TOML\n\n## Daily Development Workflow\n\n### Morning Routine\n\n**1. Sync and Update**:\n\n```\n# Sync with upstream\ngit pull origin main\n\n# Update workspace\ncd workspace/tools\nnu workspace.nu health --fix-issues\n\n# Check for updates\nnu workspace.nu status --detailed\n```\n\n**2. Review Current State**:\n\n```\n# Check current infrastructure\nprovisioning show servers\nprovisioning show settings\n\n# Review workspace status\nnu workspace.nu status\n```\n\n### Development Cycle\n\n**1. Feature Development**:\n\n```\n# Create feature branch\ngit checkout -b feature/new-provider-support\n\n# Start development environment\ncd workspace/tools\nnu workspace.nu init --workspace-type development\n\n# Begin development\n$EDITOR workspace/extensions/providers/new-provider/nulib/provider.nu\n```\n\n**2. Incremental Testing**:\n\n```\n# Test syntax during development\nnu --check workspace/extensions/providers/new-provider/nulib/provider.nu\n\n# Run unit tests\nnu workspace/extensions/providers/new-provider/tests/unit/basic-test.nu\n\n# Integration testing\nnu workspace.nu tools test-extension providers/new-provider\n```\n\n**3. Build and Validate**:\n\n```\n# Quick development build\ncd src/tools\nmake dev-build\n\n# Validate changes\nmake validate-all\n\n# Test distribution\nmake test-dist\n```\n\n### Testing During Development\n\n**Unit Testing**:\n\n```\n# Add test examples to functions\ndef create-server [name: string] -> record {\n    # @test: "test-server" -> {name: "test-server", status: "created"}\n    # Implementation here\n}\n```\n\n**Integration Testing**:\n\n```\n# Test with real infrastructure\nnu workspace/extensions/providers/new-provider/nulib/provider.nu \\n    create-server test-server --dry-run\n\n# Test with workspace isolation\nPROVISIONING_WORKSPACE_USER=$USER provisioning server create test-server --check\n```\n\n### End-of-Day Routine\n\n**1. Commit Progress**:\n\n```\n# Stage changes\ngit add .\n\n# Commit with descriptive message\ngit commit -m "feat(provider): add new cloud provider support\n\n- Implement basic server creation\n- Add configuration schema\n- Include unit tests\n- Update documentation"\n\n# Push to feature branch\ngit push origin feature/new-provider-support\n```\n\n**2. Workspace Maintenance**:\n\n```\n# Clean up development data\nnu workspace.nu cleanup --type cache --age 1d\n\n# Backup current state\nnu workspace.nu backup --auto-name --components config,extensions\n\n# Check workspace health\nnu workspace.nu health\n```\n\n## Code Organization\n\n### Nushell Code Structure\n\n**File Organization**:\n\n```\nExtension Structure:\n├── nulib/\n│   ├── main.nu              # Main entry point\n│   ├── core/                # Core functionality\n│   │   ├── api.nu           # API interactions\n│   │   ├── config.nu        # Configuration handling\n│   │   └── utils.nu         # Utility functions\n│   ├── commands/            # User commands\n│   │   ├── create.nu        # Create operations\n│   │   ├── delete.nu        # Delete operations\n│   │   └── list.nu          # List operations\n│   └── tests/               # Test files\n│       ├── unit/            # Unit tests\n│       └── integration/     # Integration tests\n└── templates/               # Template files\n    ├── config.j2            # Configuration templates\n    └── manifest.j2          # Manifest templates\n```\n\n**Function Naming Conventions**:\n\n```\n# Use kebab-case for commands\ndef create-server [name: string] -> record { ... }\ndef validate-config [config: record] -> bool { ... }\n\n# Use snake_case for internal functions\ndef get_api_client [] -> record { ... }\ndef parse_config_file [path: string] -> record { ... }\n\n# Use descriptive prefixes\ndef check-server-status [server: string] -> string { ... }\ndef get-server-info [server: string] -> record { ... }\ndef list-available-zones [] -> list<string> { ... }\n```\n\n**Error Handling Pattern**:\n\n```\ndef create-server [\n    name: string\n    --dry-run: bool = false\n] -> record {\n    # 1. Validate inputs\n    if ($name | str length) == 0 {\n        error make {\n            msg: "Server name cannot be empty"\n            label: {\n                text: "empty name provided"\n                span: (metadata $name).span\n            }\n        }\n    }\n\n    # 2. Check prerequisites\n    let config = try {\n        get-provider-config\n    } catch {\n        error make {msg: "Failed to load provider configuration"}\n    }\n\n    # 3. Perform operation\n    if $dry_run {\n        return {action: "create", server: $name, status: "dry-run"}\n    }\n\n    # 4. Return result\n    {server: $name, status: "created", id: (generate-id)}\n}\n```\n\n### Rust Code Structure\n\n**Project Organization**:\n\n```\nsrc/\n├── lib.rs                   # Library root\n├── main.rs                  # Binary entry point\n├── config/                  # Configuration handling\n│   ├── mod.rs\n│   ├── loader.rs            # Config loading\n│   └── validation.rs        # Config validation\n├── api/                     # HTTP API\n│   ├── mod.rs\n│   ├── handlers.rs          # Request handlers\n│   └── middleware.rs        # Middleware components\n└── orchestrator/            # Orchestration logic\n    ├── mod.rs\n    ├── workflow.rs          # Workflow management\n    └── task_queue.rs        # Task queue management\n```\n\n**Error Handling**:\n\n```\nuse anyhow::{Context, Result};\nuse thiserror::Error;\n\n#[derive(Error, Debug)]\npub enum ProvisioningError {\n    #[error("Configuration error: {message}")]\n    Config { message: String },\n\n    #[error("Network error: {source}")]\n    Network {\n        #[from]\n        source: reqwest::Error,\n    },\n\n    #[error("Validation failed: {field}")]\n    Validation { field: String },\n}\n\npub fn create_server(name: &str) -> Result<ServerInfo> {\n    let config = load_config()\n        .context("Failed to load configuration")?;\n\n    validate_server_name(name)\n        .context("Server name validation failed")?;\n\n    let server = provision_server(name, &config)\n        .context("Failed to provision server")?;\n\n    Ok(server)\n}\n```\n\n### Nickel Schema Organization\n\n**Schema Structure**:\n\n```\n# Base schema definitions\nlet ServerConfig = {\n    name | string,\n    plan | string,\n    zone | string,\n    tags | { } | default = {},\n} in\nServerConfig\n\n# Provider-specific extensions\nlet UpCloudServerConfig = {\n    template | string | default = "Ubuntu Server 22.04 LTS (Jammy Jellyfish)",\n    storage | number | default = 25,\n} in\nUpCloudServerConfig\n\n# Composition schemas\nlet InfrastructureConfig = {\n    servers | array,\n    networks | array | default = [],\n    load_balancers | array | default = [],\n} in\nInfrastructureConfig\n```\n\n## Testing Strategies\n\n### Test-Driven Development\n\n**TDD Workflow**:\n\n1. **Write Test First**: Define expected behavior\n2. **Run Test (Fail)**: Confirm test fails as expected\n3. **Write Code**: Implement minimal code to pass\n4. **Run Test (Pass)**: Confirm test now passes\n5. **Refactor**: Improve code while keeping tests green\n\n### Nushell Testing\n\n**Unit Test Pattern**:\n\n```\n# Function with embedded test\ndef validate-server-name [name: string] -> bool {\n    # @test: "valid-name" -> true\n    # @test: "" -> false\n    # @test: "name-with-spaces" -> false\n\n    if ($name | str length) == 0 {\n        return false\n    }\n\n    if ($name | str contains " ") {\n        return false\n    }\n\n    true\n}\n\n# Separate test file\n# tests/unit/server-validation-test.nu\ndef test_validate_server_name [] {\n    # Valid cases\n    assert (validate-server-name "valid-name")\n    assert (validate-server-name "server123")\n\n    # Invalid cases\n    assert not (validate-server-name "")\n    assert not (validate-server-name "name with spaces")\n    assert not (validate-server-name "name@with!special")\n\n    print "✅ validate-server-name tests passed"\n}\n```\n\n**Integration Test Pattern**:\n\n```\n# tests/integration/server-lifecycle-test.nu\ndef test_complete_server_lifecycle [] {\n    # Setup\n    let test_server = "test-server-" + (date now | format date "%Y%m%d%H%M%S")\n\n    try {\n        # Test creation\n        let create_result = (create-server $test_server --dry-run)\n        assert ($create_result.status == "dry-run")\n\n        # Test validation\n        let validate_result = (validate-server-config $test_server)\n        assert $validate_result\n\n        print $"✅ Server lifecycle test passed for ($test_server)"\n    } catch { |e|\n        print $"❌ Server lifecycle test failed: ($e.msg)"\n        exit 1\n    }\n}\n```\n\n### Rust Testing\n\n**Unit Testing**:\n\n```\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use tokio_test;\n\n    #[test]\n    fn test_validate_server_name() {\n        assert!(validate_server_name("valid-name"));\n        assert!(validate_server_name("server123"));\n\n        assert!(!validate_server_name(""));\n        assert!(!validate_server_name("name with spaces"));\n        assert!(!validate_server_name("name@special"));\n    }\n\n    #[tokio::test]\n    async fn test_server_creation() {\n        let config = test_config();\n        let result = create_server("test-server", &config).await;\n\n        assert!(result.is_ok());\n        let server = result.unwrap();\n        assert_eq!(server.name, "test-server");\n        assert_eq!(server.status, "created");\n    }\n}\n```\n\n**Integration Testing**:\n\n```\n#[cfg(test)]\nmod integration_tests {\n    use super::*;\n    use testcontainers::*;\n\n    #[tokio::test]\n    async fn test_full_workflow() {\n        // Setup test environment\n        let docker = clients::Cli::default();\n        let postgres = docker.run(images::postgres::Postgres::default());\n\n        let config = TestConfig {\n            database_url: format!("postgresql://localhost:{}/test",\n                                 postgres.get_host_port_ipv4(5432))\n        };\n\n        // Test complete workflow\n        let workflow = create_workflow(&config).await.unwrap();\n        let result = execute_workflow(workflow).await.unwrap();\n\n        assert_eq!(result.status, WorkflowStatus::Completed);\n    }\n}\n```\n\n### Nickel Testing\n\n**Schema Validation Testing**:\n\n```\n# Test Nickel schemas\nnickel check schemas/\n\n# Validate specific schemas\nnickel typecheck schemas/server.ncl\n\n# Test with examples\nnickel eval schemas/server.ncl\n```\n\n### Test Automation\n\n**Continuous Testing**:\n\n```\n# Watch for changes and run tests\ncargo watch -x test -x check\n\n# Watch Nushell files\nfind . -name "*.nu" | entr -r nu tests/run-all-tests.nu\n\n# Automated testing in workspace\nnu workspace.nu tools test-all --watch\n```\n\n## Debugging Techniques\n\n### Debug Configuration\n\n**Enable Debug Mode**:\n\n```\n# Environment variables\nexport PROVISIONING_DEBUG=true\nexport PROVISIONING_LOG_LEVEL=debug\nexport RUST_LOG=debug\nexport RUST_BACKTRACE=1\n\n# Workspace debug\nexport PROVISIONING_WORKSPACE_USER=$USER\n```\n\n### Nushell Debugging\n\n**Debug Techniques**:\n\n```\n# Debug prints\ndef debug-server-creation [name: string] {\n    print $"🐛 Creating server: ($name)"\n\n    let config = get-provider-config\n    print $"🐛 Config loaded: ($config | to json)"\n\n    let result = try {\n        create-server-api $name $config\n    } catch { |e|\n        print $"🐛 API call failed: ($e.msg)"\n        $e\n    }\n\n    print $"🐛 Result: ($result | to json)"\n    $result\n}\n\n# Conditional debugging\ndef create-server [name: string] {\n    if $env.PROVISIONING_DEBUG? == "true" {\n        print $"Debug: Creating server ($name)"\n    }\n\n    # Implementation\n}\n\n# Interactive debugging\ndef debug-interactive [] {\n    print "🐛 Entering debug mode..."\n    print "Available commands: $env.PATH"\n    print "Current config: " (get-config | to json)\n\n    # Drop into interactive shell\n    nu --interactive\n}\n```\n\n**Error Investigation**:\n\n```\n# Comprehensive error handling\ndef safe-server-creation [name: string] {\n    try {\n        create-server $name\n    } catch { |e|\n        # Log error details\n        {\n            timestamp: (date now | format date "%Y-%m-%d %H:%M:%S"),\n            operation: "create-server",\n            input: $name,\n            error: $e.msg,\n            debug: $e.debug?,\n            env: {\n                user: $env.USER,\n                workspace: $env.PROVISIONING_WORKSPACE_USER?,\n                debug: $env.PROVISIONING_DEBUG?\n            }\n        } | save --append logs/error-debug.json\n\n        # Re-throw with context\n        error make {\n            msg: $"Server creation failed: ($e.msg)",\n            label: {text: "failed here", span: $e.span?}\n        }\n    }\n}\n```\n\n### Rust Debugging\n\n**Debug Logging**:\n\n```\nuse tracing::{debug, info, warn, error, instrument};\n\n#[instrument]\npub async fn create_server(name: &str) -> Result<ServerInfo> {\n    debug!("Starting server creation for: {}", name);\n\n    let config = load_config()\n        .map_err(|e| {\n            error!("Failed to load config: {:?}", e);\n            e\n        })?;\n\n    info!("Configuration loaded successfully");\n    debug!("Config details: {:?}", config);\n\n    let server = provision_server(name, &config).await\n        .map_err(|e| {\n            error!("Provisioning failed for {}: {:?}", name, e);\n            e\n        })?;\n\n    info!("Server {} created successfully", name);\n    Ok(server)\n}\n```\n\n**Interactive Debugging**:\n\n```\n// Use debugger breakpoints\n#[cfg(debug_assertions)]\n{\n    println!("Debug: server creation starting");\n    dbg!(&config);\n    // Add breakpoint here in IDE\n}\n```\n\n### Log Analysis\n\n**Log Monitoring**:\n\n```\n# Follow all logs\ntail -f workspace/runtime/logs/$USER/*.log\n\n# Filter for errors\ngrep -i error workspace/runtime/logs/$USER/*.log\n\n# Monitor specific component\ntail -f workspace/runtime/logs/$USER/orchestrator.log | grep -i workflow\n\n# Structured log analysis\njq '.level == "ERROR"' workspace/runtime/logs/$USER/structured.jsonl\n```\n\n**Debug Log Levels**:\n\n```\n# Different verbosity levels\nPROVISIONING_LOG_LEVEL=trace provisioning server create test\nPROVISIONING_LOG_LEVEL=debug provisioning server create test\nPROVISIONING_LOG_LEVEL=info provisioning server create test\n```\n\n## Integration Workflows\n\n### Existing System Integration\n\n**Working with Legacy Components**:\n\n```\n# Test integration with existing system\nprovisioning --version                    # Legacy system\nsrc/core/nulib/provisioning --version    # New system\n\n# Test workspace integration\nPROVISIONING_WORKSPACE_USER=$USER provisioning server list\n\n# Validate configuration compatibility\nprovisioning validate config\nnu workspace.nu config validate\n```\n\n### API Integration Testing\n\n**REST API Testing**:\n\n```\n# Test orchestrator API\ncurl -X GET http://localhost:9090/health\ncurl -X GET http://localhost:9090/tasks\n\n# Test workflow creation\ncurl -X POST http://localhost:9090/workflows/servers/create \\n  -H "Content-Type: application/json" \\n  -d '{"name": "test-server", "plan": "2xCPU-4 GB"}'\n\n# Monitor workflow\ncurl -X GET http://localhost:9090/workflows/batch/status/workflow-id\n```\n\n### Database Integration\n\n**SurrealDB Integration**:\n\n```\n# Test database connectivity\nuse core/nulib/lib_provisioning/database/surreal.nu\nlet db = (connect-database)\n(test-connection $db)\n\n# Workflow state testing\nlet workflow_id = (create-workflow-record "test-workflow")\nlet status = (get-workflow-status $workflow_id)\nassert ($status.status == "pending")\n```\n\n### External Tool Integration\n\n**Container Integration**:\n\n```\n# Test with Docker\ndocker run --rm -v $(pwd):/work provisioning:dev provisioning --version\n\n# Test with Kubernetes\nkubectl apply -f manifests/test-pod.yaml\nkubectl logs test-pod\n\n# Validate in different environments\nmake test-dist PLATFORM=docker\nmake test-dist PLATFORM=kubernetes\n```\n\n## Collaboration Guidelines\n\n### Branch Strategy\n\n**Branch Naming**:\n\n- `feature/description` - New features\n- `fix/description` - Bug fixes\n- `docs/description` - Documentation updates\n- `refactor/description` - Code refactoring\n- `test/description` - Test improvements\n\n**Workflow**:\n\n```\n# Start new feature\ngit checkout main\ngit pull origin main\ngit checkout -b feature/new-provider-support\n\n# Regular commits\ngit add .\ngit commit -m "feat(provider): implement server creation API"\n\n# Push and create PR\ngit push origin feature/new-provider-support\ngh pr create --title "Add new provider support" --body "..."\n```\n\n### Code Review Process\n\n**Review Checklist**:\n\n- [ ] Code follows project conventions\n- [ ] Tests are included and passing\n- [ ] Documentation is updated\n- [ ] No hardcoded values\n- [ ] Error handling is comprehensive\n- [ ] Performance considerations addressed\n\n**Review Commands**:\n\n```\n# Test PR locally\ngh pr checkout 123\ncd src/tools && make ci-test\n\n# Run specific tests\nnu workspace/extensions/providers/new-provider/tests/run-all.nu\n\n# Check code quality\ncargo clippy -- -D warnings\nnu --check $(find . -name "*.nu")\n```\n\n### Documentation Requirements\n\n**Code Documentation**:\n\n```\n# Function documentation\ndef create-server [\n    name: string        # Server name (must be unique)\n    plan: string        # Server plan (for example, "2xCPU-4 GB")\n    --dry-run: bool     # Show what would be created without doing it\n] -> record {           # Returns server creation result\n    # Creates a new server with the specified configuration\n    #\n    # Examples:\n    #   create-server "web-01" "2xCPU-4 GB"\n    #   create-server "test" "1xCPU-2 GB" --dry-run\n\n    # Implementation\n}\n```\n\n### Communication\n\n**Progress Updates**:\n\n- Daily standup participation\n- Weekly architecture reviews\n- PR descriptions with context\n- Issue tracking with details\n\n**Knowledge Sharing**:\n\n- Technical blog posts\n- Architecture decision records\n- Code review discussions\n- Team documentation updates\n\n## Quality Assurance\n\n### Code Quality Checks\n\n**Automated Quality Gates**:\n\n```\n# Pre-commit hooks\npre-commit install\n\n# Manual quality check\ncd src/tools\nmake validate-all\n\n# Security audit\ncargo audit\n```\n\n**Quality Metrics**:\n\n- Code coverage > 80%\n- No critical security vulnerabilities\n- All tests passing\n- Documentation coverage complete\n- Performance benchmarks met\n\n### Performance Monitoring\n\n**Performance Testing**:\n\n```\n# Benchmark builds\nmake benchmark\n\n# Performance profiling\ncargo flamegraph --bin provisioning-orchestrator\n\n# Load testing\nab -n 1000 -c 10 http://localhost:9090/health\n```\n\n**Resource Monitoring**:\n\n```\n# Monitor during development\nnu workspace/tools/runtime-manager.nu monitor --duration 5m\n\n# Check resource usage\ndu -sh workspace/runtime/\ndf -h\n```\n\n## Best Practices\n\n### Configuration Management\n\n**Never Hardcode**:\n\n```\n# Bad\ndef get-api-url [] { "https://api.upcloud.com" }\n\n# Good\ndef get-api-url [] {\n    get-config-value "providers.upcloud.api_url" "https://api.upcloud.com"\n}\n```\n\n### Error Handling\n\n**Comprehensive Error Context**:\n\n```\ndef create-server [name: string] {\n    try {\n        validate-server-name $name\n    } catch { |e|\n        error make {\n            msg: $"Invalid server name '($name)': ($e.msg)",\n            label: {text: "server name validation failed", span: $e.span?}\n        }\n    }\n\n    try {\n        provision-server $name\n    } catch { |e|\n        error make {\n            msg: $"Server provisioning failed for '($name)': ($e.msg)",\n            help: "Check provider credentials and quota limits"\n        }\n    }\n}\n```\n\n### Resource Management\n\n**Clean Up Resources**:\n\n```\ndef with-temporary-server [name: string, action: closure] {\n    let server = (create-server $name)\n\n    try {\n        do $action $server\n    } catch { |e|\n        # Clean up on error\n        delete-server $name\n        $e\n    }\n\n    # Clean up on success\n    delete-server $name\n}\n```\n\n### Testing Best Practices\n\n**Test Isolation**:\n\n```\ndef test-with-isolation [test_name: string, test_action: closure] {\n    let test_workspace = $"test-($test_name)-(date now | format date '%Y%m%d%H%M%S')"\n\n    try {\n        # Set up isolated environment\n        $env.PROVISIONING_WORKSPACE_USER = $test_workspace\n        nu workspace.nu init --user-name $test_workspace\n\n        # Run test\n        do $test_action\n\n        print $"✅ Test ($test_name) passed"\n    } catch { |e|\n        print $"❌ Test ($test_name) failed: ($e.msg)"\n        exit 1\n    } finally {\n        # Clean up test environment\n        nu workspace.nu cleanup --user-name $test_workspace --type all --force\n    }\n}\n```\n\nThis development workflow provides a comprehensive framework for efficient, quality-focused development while maintaining the project's architectural\nprinciples and ensuring smooth collaboration across the team.
