src/main.rs defines the CLI entrypoint and Clap command tree. Command implementations live in src/commands/; larger generators use submodules such as src/commands/generate_constraint/ and src/commands/generate_domain/. Shared support code sits in files like src/error.rs, src/output.rs, src/rc.rs, and src/template.rs. Integration tests live in tests/, and scaffold/template assets live in templates/.
cargo build: compile thesolverforgebinary.cargo run -- --help: run the CLI locally and inspect commands.cargo test: run unit tests and integration tests that do not require external downloads.cargo test -- --ignored: run scaffold checks that invokecargo checkin temp projects; these need a full Rust toolchain and network access.cargo fmt --all: apply Rust formatting.cargo clippy --all-targets -- -D warnings: enforce lint-clean code.pre-commit run --all-files: run the repository hooks, including YAML checks,gitleaks,fmt, andclippy.
Use standard Rust style with 4-space indentation and rustfmt output as the source of truth. Prefer snake_case for modules, files, functions, and test names; use PascalCase for types and enums. Keep CLI flags, generated file names, and module names descriptive and consistent with existing commands such as generate_constraint and sf_config.
Add narrow unit tests beside the code under #[cfg(test)] when validating parsing, rewriting, or template helpers. Put end-to-end CLI behavior in tests/, following existing names like *_test.rs and test_* functions. When changing scaffolding or generated code, cover both file creation and key output content assertions.
Follow the commit style already used in history: fix: ..., refactor: ..., style: ..., chore: .... Keep commits scoped to one behavior change. PRs should explain user-visible CLI impact, list verification commands run, and link the relevant issue. Include concrete examples when flags, generated files, or template output change.
Do not commit generated projects, secrets, or credentials. The pre-commit config runs gitleaks; keep it enabled. When tests or generated scaffolds touch published SolverForge crate versions, verify Cargo.toml template changes and corresponding integration tests together.