{"id":48582506,"url":"https://github.com/zircote/rust-template","last_synced_at":"2026-04-08T17:34:07.319Z","repository":{"id":337660937,"uuid":"1122925909","full_name":"zircote/rust-template","owner":"zircote","description":"Template for rust projects","archived":false,"fork":false,"pushed_at":"2026-03-19T06:09:09.000Z","size":884,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-19T23:17:59.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"MDX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zircote.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY.md","support":"SUPPORT.md","governance":"GOVERNANCE.md","roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null},"funding":null},"created_at":"2025-12-25T20:47:42.000Z","updated_at":"2026-03-19T06:09:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zircote/rust-template","commit_stats":null,"previous_names":["zircote/rust-template"],"tags_count":3,"template":true,"template_full_name":null,"purl":"pkg:github/zircote/rust-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Frust-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Frust-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Frust-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Frust-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zircote","download_url":"https://codeload.github.com/zircote/rust-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zircote%2Frust-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31567056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-08T17:34:06.879Z","updated_at":"2026-04-08T17:34:07.300Z","avatar_url":"https://github.com/zircote.png","language":"MDX","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `rust_template`\n\n\u003c!-- Badges --\u003e\n[![GitHub Template](https://img.shields.io/badge/template-zircote%2Frust--template-blue?logo=github)](https://github.com/zircote/rust-template)\n[![CI](https://github.com/zircote/rust-template/actions/workflows/pipeline.yml/badge.svg)](https://github.com/zircote/rust-template/actions/workflows/pipeline.yml)\n[![Crates.io](https://img.shields.io/crates/v/rust_template.svg?logo=rust\u0026logoColor=white)](https://crates.io/crates/rust_template)\n[![Documentation](https://docs.rs/rust_template/badge.svg)](https://docs.rs/rust_template)\n[![Rust Version](https://img.shields.io/badge/rust-1.92%2B-dea584?logo=rust\u0026logoColor=white)](https://www.rust-lang.org/)\n[![License](https://img.shields.io/badge/license-MIT-green)](https://github.com/zircote/rust-template/blob/main/LICENSE)\n[![Clippy](https://img.shields.io/badge/linting-clippy-orange?logo=rust\u0026logoColor=white)](https://github.com/rust-lang/rust-clippy)\n[![cargo-deny](https://img.shields.io/badge/security-cargo--deny-blue?logo=rust\u0026logoColor=white)](https://github.com/EmbarkStudios/cargo-deny)\n[![Security: gitleaks](https://img.shields.io/badge/security-gitleaks-blue?logo=git\u0026logoColor=white)](https://github.com/gitleaks/gitleaks)\n[![Dependabot](https://img.shields.io/badge/dependabot-enabled-025e8c?logo=dependabot)](https://docs.github.com/en/code-security/dependabot)\n\nA Rust template crate with modern tooling and best practices.\n\n## Features\n\n- **Type-safe error handling** with `thiserror` for clear error types\n- **Builder pattern** for configuration with compile-time const functions\n- **Comprehensive testing** including unit, integration, and property-based tests\n- **Modern tooling** with clippy pedantic lints and cargo-deny supply chain security\n- **Full documentation** with examples in all public APIs\n\n## Installation\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\nrust_template = \"0.1\"\n```\n\nOr use cargo add:\n\n```bash\ncargo add rust_template\n```\n\n## Quick Start\n\n```rust\nuse rust_template::{add, divide, Config};\n\nfn main() -\u003e Result\u003c(), rust_template::Error\u003e {\n    // Basic arithmetic\n    let sum = add(2, 3);\n    println!(\"2 + 3 = {sum}\");\n\n    // Safe division with error handling\n    let quotient = divide(10, 2)?;\n    println!(\"10 / 2 = {quotient}\");\n\n    // Using configuration builder\n    let config = Config::new()\n        .with_verbose(true)\n        .with_max_retries(5)\n        .with_timeout(60);\n\n    println!(\"Config: verbose={}, retries={}, timeout={}s\",\n        config.verbose(), config.max_retries(), config.timeout_secs());\n\n    Ok(())\n}\n```\n\n## API Overview\n\n### Functions\n\n| Function | Description |\n|----------|-------------|\n| `add(a, b)` | Adds two numbers |\n| `divide(a, b)` | Divides with error handling |\n\n### Types\n\n| Type | Description |\n|------|-------------|\n| `Config` | Configuration with builder pattern |\n| `Error` | Error type for operations |\n| `Result\u003cT\u003e` | Type alias for `Result\u003cT, Error\u003e` |\n\n## Getting Started\n\n**New to this template?** See the [Getting Started Guide](docs/template/GETTING-STARTED.md) for a step-by-step walkthrough from \"Use this template\" to your first CI pass.\n\n## Development\n\n### Prerequisites\n\n- Rust 1.92+ (2024 edition) — install via [rustup](https://rustup.rs/), **not** Homebrew\n- [cargo-deny](https://github.com/EmbarkStudios/cargo-deny) for supply chain security\n\n### Setup\n\n```bash\n# Install Rust via rustup (not Homebrew)\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\nsource \"$HOME/.cargo/env\"\n\n# Clone the repository\ngit clone https://github.com/zircote/rust-template.git\ncd rust-template\n\n# Build\ncargo build\n\n# Run tests\ncargo test\n\n# Run linting\ncargo clippy --all-targets --all-features\n\n# Format code\ncargo fmt\n\n# Check supply chain security\ncargo deny check\n\n# Generate documentation\ncargo doc --open\n```\n\n### Project Structure\n\n```text\ncrates/\n├── lib.rs           # Library entry point\n├── main.rs          # Binary entry point\n└── ...              # Additional modules\n\ntests/\n└── integration_test.rs\n\nCargo.toml           # Project manifest\nclippy.toml          # Clippy configuration\nrustfmt.toml         # Formatter configuration\ndeny.toml            # cargo-deny configuration\nCLAUDE.md            # AI assistant instructions\nAGENTS.md            # AI coding agent instructions\n.editorconfig        # Cross-editor defaults\n.devcontainer/       # Codespaces / dev container config\n.vscode/             # VS Code settings and extensions\n```\n\n### Code Quality\n\nThis project maintains high code quality standards:\n\n- **Linting**: clippy with pedantic and nursery lints\n- **Formatting**: rustfmt with custom configuration\n- **Testing**: Unit tests, integration tests, and property-based tests\n- **Documentation**: All public APIs documented with examples\n- **Supply Chain**: cargo-deny for dependency auditing\n- **CI/CD**: GitHub Actions for automated testing\n\n### Running Checks\n\n```bash\n# Run all checks\ncargo fmt -- --check \u0026\u0026 \\\ncargo clippy --all-targets --all-features -- -D warnings \u0026\u0026 \\\ncargo test \u0026\u0026 \\\ncargo doc --no-deps \u0026\u0026 \\\ncargo deny check\n\n# Run with MIRI for undefined behavior detection\ncargo +nightly miri test\n```\n\n## CI/CD and Deployment\n\nThis template includes production-ready workflows:\n\n### Continuous Integration\n\n- **CI** (`.github/workflows/pipeline.yml`) - Format, lint, test, docs, supply chain security, MSRV check, coverage\n- **Security Audit** (`.github/workflows/security-audit.yml`) - Daily cargo-audit scans\n- **`CodeQL` Analysis** (`.github/workflows/codeql-analysis.yml`) - SAST scanning on push/PR and weekly schedule\n- **Benchmark** (`.github/workflows/benchmark.yml`) - Performance tracking with criterion\n- **ADR Validation** (`.github/workflows/adr-validation.yml`) - Architectural decision records validation\n\n### Release and Deployment\n\n- **Release** (`.github/workflows/release-create.yml`) - Automated GitHub releases with multi-platform binaries\n  - Builds for: Linux (`x86_64`, ARM64), macOS (`x86_64`, ARM64), Windows (`x86_64`)\n  - Automatic changelog generation via git-cliff\n  - Binary artifacts uploaded to releases\n  - CHANGELOG.md committed back to repository\n\n- **Docker** (`.github/workflows/release-docker.yml`) - Multi-platform container builds\n  - Platforms: linux/amd64, linux/arm64\n  - Distroless base image for security\n  - Published to GitHub Container Registry (ghcr.io)\n  - Tagged with version and 'latest'\n\n- **Publish** (`.github/workflows/release-publish.yml`) - Automated crates.io publishing\n  - Full pre-publish validation\n  - Triggered on version tags\n  - Requires `CARGO_REGISTRY_TOKEN` secret\n\n### Creating a Release\n\n1. Update version in `Cargo.toml`\n2. Create and push a version tag:\n   ```bash\n   git tag -a v0.2.0 -m \"Release v0.2.0\"\n   git push origin v0.2.0\n   ```\n3. Workflows automatically:\n   - Generate changelog\n   - Build binaries for all platforms\n   - Create GitHub release with artifacts\n   - Build and push Docker images\n   - Publish to crates.io\n\n### AI Coding Agent\n\n- **Copilot Setup** (`.github/workflows/copilot-setup-steps.yml`) - Environment for GitHub Copilot coding agent\n- **Agent Instructions**: `AGENTS.md`, `.github/copilot-instructions.md`, `CLAUDE.md`\n- **Path-Specific Instructions**: `.github/instructions/` for Rust code and test patterns\n- **Reusable Prompts**: `.github/prompts/` for common development tasks\n\n### Docker Usage\n\nPull and run the container:\n\n```bash\n# Pull latest\ndocker pull ghcr.io/zircote/rust-template:latest\n\n# Run specific version\ndocker pull ghcr.io/zircote/rust-template:v0.1.0\ndocker run --rm ghcr.io/zircote/rust-template:v0.1.0 --version\n```\n\n## MSRV Policy\n\nThe Minimum Supported Rust Version (MSRV) is **1.92**. Increasing the MSRV is considered a minor breaking change.\n\n## Contributing\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, PR checklist, and coding standards.\n\nPlease also review:\n- [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) - Community guidelines\n- [SECURITY.md](SECURITY.md) - Vulnerability reporting\n- [GOVERNANCE.md](GOVERNANCE.md) - Decision-making process\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/zircote/rust-template/blob/main/LICENSE) file for details.\n\n## Acknowledgments\n\n- [The Rust Programming Language](https://www.rust-lang.org/)\n- [Cargo](https://doc.rust-lang.org/cargo/)\n- [clippy](https://github.com/rust-lang/rust-clippy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzircote%2Frust-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzircote%2Frust-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzircote%2Frust-template/lists"}