Skip to content
Development
Command

/context-load-testing-rust

Load comprehensive Rust testing documentation with adaptive framework detection and project-specific optimization

From plugin
claude-cmd
313180 skills180 commands

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/context-load-testing-rust

Context preview

What this command does when you run it.

Load comprehensive Rust testing documentation with adaptive framework detection and project-specific optimization

Command definition

context-load-testing-rust.md
allowed-tools: WebFetch, mcp__context7__resolve-library-id, mcp__context7__get-library-docs, Bash(fd:*), Bash(rg:*), Bash(gdate:*), Bash(wc:*), Bash(git:*), Read, Write, Task
name: "Context Load Testing Rust"
description: "Load comprehensive Rust testing documentation with adaptive framework detection and project-specific optimization"
author: "wcygan"
tags: ["context","testing"]
version: "1.0.0"
created_at: "2025-07-14T00:00:00Z"
updated_at: "2025-07-14T00:00:00Z"

Context

  • Session ID: !`gdate +%s%N`
  • Current directory: !`pwd`
  • Rust files count: !`fd "\\.rs$" . | wc -l | tr -d ' ' || echo "0"`
  • Test files count: !`fd "test" . -t f | wc -l | tr -d ' ' || echo "0"`
  • Cargo.toml files: !`fd "(Cargo\\.toml)" . -d 3 | wc -l | tr -d ' ' || echo "0"`
  • Standard tests: !`rg "#\\[test\\]" . --type rust | wc -l | tr -d ' ' || echo "0"`
  • Async tests: !`rg "#\\[tokio::test\\]" . --type rust | wc -l | tr -d ' ' || echo "0"`
  • Testcontainers usage: !`rg "testcontainers" . --type toml | wc -l | tr -d ' ' || echo "0"`
  • Criterion benchmarks: !`rg "criterion" . --type toml | wc -l | tr -d ' ' || echo "0"`
  • PropTest usage: !`rg "proptest" . --type toml | wc -l | tr -d ' ' || echo "0"`
  • Mockall usage: !`rg "mockall" . --type toml | wc -l | tr -d ' ' || echo "0"`
  • Workspace detection: !`rg "\\[workspace\\]" . --type toml | wc -l | tr -d ' ' || echo "0"`
  • Git repository: !`git rev-parse --is-inside-work-tree 2>/dev/null && echo "Yes" || echo "No"`

Your Task

STEP 1: Initialize comprehensive testing context session

  • CREATE session state file: `/tmp/rust-testing-context-$SESSION_ID.json`
  • SET initial state:
  {
    "sessionId": "$SESSION_ID",
    "timestamp": "$(date -Iseconds)",
    "phase": "initialization",
    "project_analysis": {
      "rust_files": "auto-detect",
      "test_files": "auto-detect",
      "testing_frameworks": [],
      "project_complexity": "unknown",
      "workspace_type": "unknown"
    },
    "documentation_targets": [],
    "context_loaded": {},
    "specialized_guidance": [],
    "checkpoints": []
  }
  • ANALYZE project structure from Context section for testing framework detection

STEP 2: Project complexity analysis and testing framework detection

Think deeply about the optimal testing documentation loading strategy based on detected project characteristics.

  • DETERMINE project complexity level:

IF Rust files > 100 AND Test files > 20:

  • SET complexity = "enterprise"
  • ENABLE comprehensive testing documentation loading

ELSE IF Rust files > 20 AND Test files > 5:

  • SET complexity = "moderate"
  • FOCUS on practical testing patterns and frameworks

ELSE:

  • SET complexity = "basic"
  • PRIORITIZE fundamental testing concepts and simple patterns
  • DETECT testing frameworks and patterns:
  • IF Async tests > 0: ADD "tokio-testing" to frameworks
  • IF Testcontainers > 0: ADD "integration-testing" to frameworks
  • IF Criterion > 0: ADD "benchmarking" to frameworks
  • IF PropTest > 0: ADD "property-testing" to frameworks
  • IF Mockall > 0: ADD "mocking" to frameworks
  • IF Workspace > 0: ADD "workspace-testing" to frameworks

STEP 3: Adaptive documentation loading with parallel sub-agent delegation

TRY:

CASE project_complexity: WHEN "enterprise":

  • LOAD comprehensive testing documentation using sub-agent parallel strategy:

**Launch 6 parallel sub-agents for documentation gathering:**

1. **Core Testing Agent**:

  • WebFetch: `https://doc.rust-lang.org/book/ch11-00-testing.html`
  • FOCUS: Unit tests, integration tests, documentation tests, test organization
  • Context7: resolve-library-id for "rust-test-patterns"

2. **Async Testing Agent** (if async tests detected):

  • WebFetch: `https://docs.rs/tokio/latest/tokio/test/index.html`
  • FOCUS: async runtime testing, multi-threaded testing, time control
  • Context7: get-library-docs for tokio testing patterns

3. **Integration Testing Agent** (if testcontainers detected):

  • WebFetch: `https://docs.rs/testcontainers/latest/testcontainers/`
  • FOCUS: database testing, service integration, container lifecycle
  • Context7: resolve-library-id for "testcontainers-rs"

4. **Performance Testing Agent** (if criterion detected):

  • WebFetch: `https://docs.rs/criterion/latest/criterion/`
  • FOCUS: benchmarking, statistical analysis, performance regression testing
  • Context7: get-library-docs for criterion benchmarking

5. **Property Testing Agent** (if proptest detected):

  • WebFetch: `https://docs.rs/proptest/latest/proptest/`
  • FOCUS: test generation, fuzzing, property verification
  • Context7: resolve-library-id for "proptest"

6. **Mocking Agent** (if mockall detected):

  • WebFetch: `https://docs.rs/mockall/latest/mockall/`
  • FOCUS: dependency injection, mock creation, test isolation
  • Context7: get-library-docs for mockall patterns

**Sub-Agent Coordination:**

  • Each agent works independently on their domain
  • Save findings to `/tmp/rust-testing-agent-$AGENT_ID-$SESSION_ID.json`
  • Main agent synthesizes all results into comprehensive context

WHEN "moderate":

  • LOAD focused testing documentation:

1. **Rust Testing Fundamentals**:

  • WebFetch: `https://doc.rust-lang.org/book/ch11-00-testing.html`
  • FOCUS: Test organization, assertion patterns, test configuration

2. **Framework-Specific Documentation** (based on detected frameworks):

  • FOR EACH detected framework: LOAD specialized documentation
  • PRIORITIZE most commonly used frameworks in project

WHEN "basic":

  • LOAD essential testing documentation:

1. **Basic Testing Guide**:

  • WebFetch: `https://doc.rust-lang.org/book/ch11-00-testing.html`
  • FOCUS: Writing first tests, basic assertions, running tests

2. **Testing Best Practices**:

  • Context7: resolve-library-id for "rust-testing-guide"
  • FOCUS: Test structure, naming conventions, common patterns

CATCH (documentation_fetch_faile

Read more
Ships withclaude-cmd

A lightweight (~46kB) and comprehensive CLI tool for managing Claude commands, configurations, and workflows.

Get the whole plugin