What Are the Specific Scripts Used for Testing in Reverse-Skill? Complete Cross-Platform Test Suite Guide

The specific scripts used for testing in reverse-skill are located in skills/scripts and include Bash variants (test-routing.sh, test-bootstrap-manifest.sh, test-bash-workflow.sh) for Linux/macOS and PowerShell variants (test-routing.ps1, test-workflow-title-safety.ps1, test-parse-contracts.ps1) for Windows, covering routing, bootstrap validation, workflow safety, and contract parsing.

The zhaoxuya520/reverse-skill repository implements a dual-platform testing strategy to ensure consistent behavior across shell environments. These testing scripts in reverse-skill validate the routing engine, bootstrap manifests, and workflow guards before any skill execution occurs in production pipelines.

Test Suite Architecture and Location

All testing scripts reside under the skills/scripts directory, with complementary JSON definitions stored in skills/tests/. The suite operates on a shared benchmark principle: both Bash and PowerShell runners consume identical routing definitions from skills/tests/routing-benchmark.json to guarantee deterministic behavior regardless of the underlying shell.

The architecture separates concerns into four primary categories:

  • Core router tests (test-routing.*) validate the routing engine via master-route.sh and master-route.ps1
  • Bootstrap tests (test-bootstrap-*.sh/test-bootstrap-*.ps1) verify manifest generation and tool discovery
  • Workflow safety tests enforce case-guard policies and mode constraints through case-guard.sh
  • Contract and evidence tests ensure downstream data formatting integrity

Linux and macOS Testing Scripts (Bash)

The Bash test suite executes on Unix-like systems and focuses on routing validation, bootstrap integrity, and workflow enforcement.

test-routing.sh

Located at skills/scripts/test-routing.sh, this script executes the shared routing benchmark through the Bash-based router. It loads routing-benchmark.json, invokes master-route.sh for each test case, and validates that the primary skill result matches expected outputs.

Key validation points include:

  • Detection of Python 3 availability for inline driver execution
  • Verification that route-scope.md entries are correctly written
  • Regression checks ensuring the router writes output under the caller's project root

test-client-neutral-bootstrap.sh

This script verifies that the client-neutral bootstrap process correctly initializes the environment without relying on a specific client implementation. It checks for the presence of bootstrap-manifest.json and validates that generated work-directories follow the expected naming convention.

test-bootstrap-manifest.sh

The test-bootstrap-manifest.sh script ensures that bootstrap-manifest.json is correctly generated and that required tools are discoverable in the system PATH. It uses temporary directories to isolate test environments and asserts that tool-discovery entries populate correctly in the manifest structure.

test-bash-workflow.sh

An end-to-end validation of the Bash workflow, this script exercises case-guard.sh to enforce authorization and mode validation. It manipulates scope.md to test guard behavior, validates status transitions, and restores original states after test completion to prevent filesystem pollution.

Windows Testing Scripts (PowerShell)

The PowerShell suite mirrors Bash functionality while adding Windows-specific safety checks for encoding and title injection prevention.

test-workflow-title-safety.ps1

Located at skills/scripts/test-workflow-title-safety.ps1, this script guarantees that workflow titles are free from injection vectors. It parses titles from routing contracts and asserts that only allowed character sets are permitted, preventing command injection through malformed workflow definitions.

test-routing.ps1

The PowerShell counterpart to test-routing.sh, this script drives the routing benchmark via master-route.ps1. It mirrors the Bash script's logic but uses Invoke-Expression for PowerShell-native execution, ensuring identical routing decisions are produced on Windows platforms.

test-parse-contracts.ps1

This script validates the contract-parsing utilities that translate routing contracts into actionable skill selections. It loads JSON contracts from the test directory and checks that pattern-matching logic correctly identifies the appropriate skill handler for each contract type.

test-p0-friction.ps1

Testing the p0-friction layer, this script adds minimal user-interaction friction checks before routing. It simulates user prompts and verifies auto-reject behavior when expected, ensuring that high-priority routing decisions require explicit confirmation when configured.

test-consolidate-evidence.ps1

This script checks that evidence-gathering scripts correctly consolidate findings into the expected Markdown format. It generates dummy evidence files and asserts that the final report structure matches the schema required by downstream analysis pipelines.

test-client-neutral-bootstrap.ps1

The Windows version of the client-neutral bootstrap test confirms environment-agnostic initialization. While functionally similar to the Bash variant, it includes PowerShell-specific path handling to accommodate Windows directory separators and permission models.

test-bootstrap-supply-chain.ps1

Validating the supply-chain bootstrap scenario, this script tests scenarios where external tool manifests are fetched and integrated. It mocks external tool discovery and inspects the resulting manifest to ensure third-party tools are correctly registered.

test-bootstrap-codex-encoding.ps1

This script ensures that the Codex-encoding bootstrap correctly encodes and decodes payloads for AI-driven tooling. It encodes a payload, decodes it back, and asserts data integrity to prevent corruption during AI-assisted skill execution.

Running the Test Suite

Execute the specific scripts used for testing in reverse-skill from the repository root to ensure proper path resolution.

Running the Bash routing benchmark on Linux or macOS:

cd skills/scripts
./test-routing.sh   # exits with status 0 on full pass

Running the PowerShell routing benchmark on Windows:

cd skills\scripts
.\test-routing.ps1   # prints PASS/FAIL summary; $LASTEXITCODE = 0 on success

Checking the bootstrap manifest generation:

cd skills/scripts
./test-bootstrap-manifest.sh

Executing workflow title safety validation on Windows:

cd skills\scripts
.\test-workflow-title-safety.ps1

Summary

Frequently Asked Questions

How do I run only the routing tests in reverse-skill?

Navigate to skills/scripts and execute ./test-routing.sh on Linux/macOS or .\test-routing.ps1 on Windows. Both scripts exit with status code 0 on success and automatically reference skills/tests/routing-benchmark.json for test cases.

What is the difference between test-client-neutral-bootstrap.sh and test-bootstrap-manifest.sh?

test-client-neutral-bootstrap.sh verifies that the bootstrap process works without client-specific dependencies, checking directory creation and environment setup. test-bootstrap-manifest.sh specifically validates the JSON structure of bootstrap-manifest.json and confirms that tool discovery populates the manifest correctly.

Are the PowerShell tests just ports of the Bash tests?

While many PowerShell tests like test-routing.ps1 and test-client-neutral-bootstrap.ps1 mirror Bash functionality, others like test-workflow-title-safety.ps1 and test-bootstrap-codex-encoding.ps1 address Windows-specific concerns including character encoding, path handling, and title injection prevention that do not have direct Bash equivalents.

Where does the test suite store its shared test data?

The routing benchmark definition lives in skills/tests/routing-benchmark.json, which both Bash and PowerShell routing tests consume. Bootstrap tests use temporary directories created during execution, while skills/config/routing.json provides central routing configuration for regression checks.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →