### Install Contract Assets Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/tooling/cli.md Use the 'install' command to copy contract assets into a target repository. Use --force to overwrite conflicting files and --dry-run to preview actions. ```bash tiger-style install --target [--force] [--dry-run] ``` -------------------------------- ### Orchestrated Setup with Bootstrap Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/tooling/cli.md The 'bootstrap' command orchestrates 'install', 'configure', and 'doctor' commands for a complete repository setup. --dry-run applies to install/configure and skips doctor. ```bash tiger-style bootstrap --target [--force] [--dry-run] ``` -------------------------------- ### Clone and Enter Repository (macOS/Linux) Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/getting-started/quickstart.md Clone the repository and navigate into the project directory. This is the initial setup step for macOS and Linux users. ```bash git clone https://github.com/robertguss/programming_tiger_style.git cd programming_tiger_style ``` -------------------------------- ### Bootstrap Tiger Style CLI Source: https://github.com/robertguss/programming_tiger_style/blob/main/README.md Automate the installation and configuration of the Tiger Style CLI in your repository. Replace '/absolute/path/to/your-repo' with the actual path. ```bash tiger-style bootstrap --target /absolute/path/to/your-repo ``` -------------------------------- ### Build and Serve Documentation Locally Source: https://github.com/robertguss/programming_tiger_style/blob/main/README.md Use these commands to build and serve the project's documentation locally using mdBook. Ensure you have mdBook installed. ```bash just book-build just book-serve ``` -------------------------------- ### Install Checklists Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/getting-started/adopting-in-a-new-project.md Copies the checklist templates into your project's checklist directory. Ensure the CONTRACT_SRC environment variable is set correctly. ```bash cp -R "$CONTRACT_SRC"/checklists/. checklists/ ``` -------------------------------- ### Clone and Enter Repository (Windows PowerShell) Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/getting-started/quickstart.md Clone the repository and set the current location to the project directory. This is the initial setup step for Windows PowerShell users. ```powershell git clone https://github.com/robertguss/programming_tiger_style.git Set-Location programming_tiger_style ``` -------------------------------- ### Install Tiger Style CLI with Cargo Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/tooling/cli.md Install the Tiger Style CLI directly from its repository path using Cargo. The --force flag is used to overwrite existing installations. ```bash cargo install --path tooling/tiger-style-cli --force ``` -------------------------------- ### Local CLI Development Commands Source: https://github.com/robertguss/programming_tiger_style/blob/main/README.md Commands for building, running, and installing the Rust CLI locally. Use 'just run -- --help' to see available CLI arguments. ```bash just build just run -- --help just install-cargo ``` -------------------------------- ### Manual Installation of Contract System v2 (macOS/Linux) Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/getting-started/adopting-in-a-new-project.md Manually copy contract assets, templates, and configuration files to your target repository using shell commands. This method is a fallback if the `tiger-style` CLI is not available or preferred. ```bash CONTRACT_SRC=/absolute/path/to/programming_tiger_style TARGET_REPO=/absolute/path/to/your-repo cd "$TARGET_REPO" mkdir -p contracts/core contracts/languages templates checklists scripts .github/workflows .evidence cp -R "$CONTRACT_SRC"/contracts/core/. contracts/core/ cp -R "$CONTRACT_SRC"/contracts/languages/. contracts/languages/ cp "$CONTRACT_SRC"/contracts/ACTIVE_LANGUAGE_CONTRACTS.md contracts/ACTIVE_LANGUAGE_CONTRACTS.md cp -R "$CONTRACT_SRC"/templates/. templates/ cp -R "$CONTRACT_SRC"/scripts/. scripts/ cp "$CONTRACT_SRC"/.github/pull_request_template.md .github/pull_request_template.md cp "$CONTRACT_SRC"/.github/workflows/contract-gates.yml .github/workflows/contract-gates.yml chmod +x scripts/*.sh ``` -------------------------------- ### Validation Commands Example Source: https://github.com/robertguss/programming_tiger_style/blob/main/templates/EVIDENCE_PACKET_TEMPLATE.md This section is intended for commands used during the validation phase of a code change. It serves as a placeholder for actual commands. ```bash # Commands run for validation ``` -------------------------------- ### TDD Workflow Example Commands Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/getting-started/quickstart.md Illustrative commands for a Red-Green-Refactor TDD cycle using pytest. These commands represent the typical steps in practicing strict TDD on a target repository. ```bash # red pytest tests/test_feature.py::test_rejects_invalid_limit # green pytest tests/test_feature.py::test_rejects_invalid_limit # refactor gate pytest ``` -------------------------------- ### Manual Installation of Contract System v2 (Windows PowerShell) Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/getting-started/adopting-in-a-new-project.md Manually copy contract assets, templates, and configuration files to your target repository using PowerShell commands. This is the Windows equivalent of the manual copy method. ```powershell $ContractSrc = "C:\absolute\path\to\programming_tiger_style" $TargetRepo = "C:\absolute\path\to\your-repo" Set-Location $TargetRepo New-Item -ItemType Directory -Force contracts\core, contracts\languages, templates, checklists, scripts, .github\workflows, .evidence | Out-Null Copy-Item "$ContractSrc\contracts\core\*" contracts\core -Recurse -Force Copy-Item "$ContractSrc\contracts\languages\*" contracts\languages -Recurse -Force Copy-Item "$ContractSrc\contracts\ACTIVE_LANGUAGE_CONTRACTS.md" contracts\ACTIVE_LANGUAGE_CONTRACTS.md -Force Copy-Item "$ContractSrc\templates\*" templates -Recurse -Force Copy-Item "$ContractSrc\scripts\*" scripts -Recurse -Force Copy-Item "$ContractSrc\.github\pull_request_template.md" .github\pull_request_template.md -Force Copy-Item "$ContractSrc\.github\workflows\contract-gates.yml" .github\workflows\contract-gates.yml -Force ``` -------------------------------- ### Dry-run Bootstrap of Contract System v2 using Tiger Style CLI Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/getting-started/adopting-in-a-new-project.md Perform a dry-run of the `tiger-style bootstrap` command to preview the changes without applying them to your repository. This is useful for understanding the impact before full installation. ```bash tiger-style bootstrap --target /absolute/path/to/your-repo --dry-run ``` -------------------------------- ### Define Planner Trait in Rust Source: https://github.com/robertguss/programming_tiger_style/blob/main/PLANS.md Defines the `Planner` trait with a `plan` method. This is an example of specifying required function signatures for interfaces. ```rust pub trait Planner { fn plan(&self, observed: &Observed) -> Vec; } ``` -------------------------------- ### Recommended Project Directory Layout Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/getting-started/adopting-in-a-new-project.md A standard directory structure for organizing contract-related files, CI workflows, and evidence within a repository. ```text your-repo/ contracts/ core/ ACTIVE_LANGUAGE_CONTRACTS.md languages/ templates/ checklists/ scripts/ .github/ pull_request_template.md workflows/ contract-gates.yml .evidence/ ``` -------------------------------- ### Build Tiger Style CLI from Source Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/tooling/cli.md Build the Tiger Style CLI locally using Cargo. This command compiles the release binary and copies it to a system path. ```bash cargo build --release --manifest-path tooling/tiger-style-cli/Cargo.toml cp target/release/tiger-style /usr/local/bin/tiger-style ``` -------------------------------- ### Progress Tracking with Checkboxes and Timestamps Source: https://github.com/robertguss/programming_tiger_style/blob/main/PLANS.md Use a checklist format with timestamps to track granular steps in progress. This ensures that every stopping point is documented, even if a task is split into completed and remaining parts. ```markdown - [x] (2025-10-01 13:00Z) Example completed step. - [ ] Example incomplete step. - [ ] Example partially completed step (completed: X; remaining: Y). ``` -------------------------------- ### Configure Language Manifest and Agents Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/tooling/cli.md Use the 'configure' command to write language activation manifest status lines and create AGENTS.md. Supports different manifest modes and options for overwriting or dry runs. ```bash tiger-style configure --target [--manifest-mode autodetect|all-inactive|all-active] [--force] [--dry-run] ``` -------------------------------- ### Format Code with Zig Source: https://github.com/robertguss/programming_tiger_style/blob/main/resources/TIGER_STYLE.md Use the `zig fmt` command to automatically format your Zig code according to the project's style guidelines. This ensures consistent indentation and line wrapping. ```bash zig fmt ``` -------------------------------- ### Run CLI Locally Source: https://github.com/robertguss/programming_tiger_style/blob/main/AGENTS.md Execute the CLI tool with custom arguments. Ensure the CLI is built before running. ```bash just run -- --help ``` -------------------------------- ### Optional Recommended CI Gate Source: https://github.com/robertguss/programming_tiger_style/blob/main/contracts/languages/TYPESCRIPT_CODING_CONTRACT.md Fuzz testing is recommended where available to uncover edge cases and potential bugs. ```bash npm run test:fuzz ``` -------------------------------- ### Inspect Contract Layers (macOS/Linux) Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/getting-started/quickstart.md List the major contract groups and directories within the repository. This helps understand the organization of core, language-specific, templates, and utility files. ```bash ls contracts/core contracts/languages templates checklists scripts .github/workflows ``` -------------------------------- ### Test Plan Commands Source: https://github.com/robertguss/programming_tiger_style/blob/main/templates/TEST_PLAN_TEMPLATE.md Placeholder for commands related to executing different test suites (Red, Green, Full suite). ```bash # Red # Green # Full suite ``` -------------------------------- ### Run Release Build Tests Source: https://github.com/robertguss/programming_tiger_style/blob/main/contracts/languages/RUST_CODING_CONTRACT.md Execute tests in a release build configuration for crates or modules that contain `unsafe` code or critical memory/concurrency logic. This ensures that performance-critical sections are also tested for correctness. ```bash cargo test --workspace --all-features --release ``` -------------------------------- ### Run Pyright Type Checking Source: https://github.com/robertguss/programming_tiger_style/blob/main/contracts/languages/PYTHON_CODING_CONTRACT.md An alternative static type checker for Python. Recommended for comprehensive type analysis. ```bash pyright ``` -------------------------------- ### Positive vs. Negative Invariant Checking in Zig Source: https://github.com/robertguss/programming_tiger_style/blob/main/resources/TIGER_STYLE.md Demonstrates the preferred method for checking invariants using positive conditions, which is easier to understand and less error-prone than using negations. This form aligns with typical loop conditions. ```zig if (index < length) { // The invariant holds. } else { // The invariant doesn't hold. } ``` ```zig if (index >= length) { // It's not true that the invariant holds. } ``` -------------------------------- ### CI-Equivalent Rust Gate Source: https://github.com/robertguss/programming_tiger_style/blob/main/AGENTS.md Perform a comprehensive Rust check including formatting, linting, and testing. ```bash just check ``` -------------------------------- ### Update Existing Clone (macOS/Linux) Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/getting-started/quickstart.md If you already have a local clone, pull the latest changes to ensure you have the most recent version. Navigate to the project directory first. ```bash cd /path/to/programming_tiger_style git pull ``` -------------------------------- ### Run Ruff Format Check Source: https://github.com/robertguss/programming_tiger_style/blob/main/contracts/languages/PYTHON_CODING_CONTRACT.md Ensures code is formatted according to Ruff's standards. Run this command to check for formatting issues. ```bash ruff format --check . ``` -------------------------------- ### Run Local CI-Equivalent Checks Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/guides/ci-and-validation.md Execute both TDD cycle and evidence packet validation scripts locally, simulating CI checks. Includes validation against origin/main and a PR body. ```bash bash scripts/validate_tdd_cycle.sh --base origin/main bash scripts/validate_evidence_packet.sh --pr-body .github/pull_request_template.md ``` -------------------------------- ### ExecPlan Markdown Formatting Source: https://github.com/robertguss/programming_tiger_style/blob/main/PLANS.md An ExecPlan should be a single fenced code block labeled as `md`. Indented blocks should be used for commands, transcripts, diffs, or code within the ExecPlan, avoiding nested triple backticks. ```markdown ```md # Plan Title ## Section 1 This is a prose description. This is an indented command or code block. ## Section 2 More prose. ``` ``` -------------------------------- ### Run Ruff Check Source: https://github.com/robertguss/programming_tiger_style/blob/main/contracts/languages/PYTHON_CODING_CONTRACT.md Performs static analysis to find linting errors and code smells. Use the full output format for detailed reporting. ```bash ruff check . --output-format=full ``` -------------------------------- ### Run Cargo fmt, clippy, and tests Source: https://github.com/robertguss/programming_tiger_style/blob/main/contracts/languages/RUST_CODING_CONTRACT.md Execute standard Rust code formatting, linting, and unit tests across the workspace. This command checks for style consistency and potential issues, with specific rules to disallow `unwrap()` and `expect()` and to flag undocumented unsafe blocks. ```bash cargo fmt --all -- --check cargo clippy --workspace --all-targets --all-features -- \ -D warnings \ -D clippy::unwrap_used \ -D clippy::expect_used \ -D clippy::undocumented_unsafe_blocks cargo test --workspace --all-features ``` -------------------------------- ### Run Validation Commands Source: https://github.com/robertguss/programming_tiger_style/blob/main/docs/templates/AGENTS_TEMPLATE.md Execute these commands before creating a Pull Request to ensure all validations pass. ```bash bash scripts/validate_tdd_cycle.sh --base origin/main ``` ```bash bash scripts/validate_evidence_packet.sh --pr-body /tmp/pr_body.md ``` -------------------------------- ### Run All Rust Tests Source: https://github.com/robertguss/programming_tiger_style/blob/main/AGENTS.md Execute all tests within the Rust workspace, including features. ```bash just test ``` -------------------------------- ### In-place Struct Initialization Source: https://github.com/robertguss/programming_tiger_style/blob/main/resources/TIGER_STYLE.md Prefer in-place initialization of larger structs by passing an out pointer during initialization. This avoids intermediate copy-move allocations and potential stack growth. ```zig fn init(target: *LargeStruct) !void { target.* = .{ // in-place initialization. }; } fn main() !void { var target: LargeStruct = undefined; try target.init(); } ``` ```zig fn init() !LargeStruct { return LargeStruct { // moving the initialized object. }; } fn main() !void { var target = try LargeStruct.init(); } ```