How reverse-skill's Multi-Platform Script Architecture Works: PowerShell vs Bash
reverse-skill uses a layered architecture that separates platform-agnostic skill definitions from thin platform-specific wrapper scripts, enabling the same reverse-engineering logic to run on Windows via PowerShell and Kali Linux via Bash.
The reverse-skill project by zhaoxuya520 is designed to run security and reverse-engineering workflows across heterogeneous environments. Rather than maintaining two separate codebases, the repository implements a single-source-of-truth pattern where skill definitions remain identical while execution mechanics adapt to the host operating system. This article examines how the multi-platform script architecture balances portability with native integration.
Platform-Specific Layer Structure
The architecture divides responsibilities across two parallel directory structures. According to the source code in docs/ARCHITECTURE.md, the platform detection and routing logic lives at the top level, while implementation details descend into environment-specific folders.
Windows PowerShell Implementation
On Windows, reverse-skill leverages PowerShell modules stored in skills/scripts/*.ps1. The bootstrap and tool resolution pipeline centers on:
bootstrap-manifest.json– Defines installation sources usingwingetor direct GitHub ZIP downloadsskills/scripts/lib/ToolDiscovery.ps1– Resolves tool availability, checkstool-index.md, and invokesbootstrap-reverse.ps1when dependencies are missingRULES.md– Platform-specific rule set that drives AI routing decisions
Kali Linux Bash Implementation
For Kali Linux environments, native Bash scripts in kali/scripts/*.sh provide equivalent functionality:
kali/scripts/bootstrap-manifest.json– Usesapt,pip,npm, and other Linux package managerskali/scripts/bootstrap-reverse.sh– Direct bootstrap invocation (called via functions likeensure_toolinrecon.sh)kali/RULES-kali.md– Kali-specific rule set with identical semantic structure to Windows rules
The shared skills/ directory contains platform-agnostic skill definitions including SKILL.md, routing.md, and reference documentation accessed by both implementations.
Execution Flow: From Platform Detection to Skill Execution
The multi-platform support architecture follows a six-stage pipeline documented in docs/ARCHITECTURE.md (lines 70-91):
-
Detect platform – The system selects
RULES.mdfor Windows orkali/RULES-kali.mdfor Kali (lines 6-10) -
Load scripts – PowerShell (
*.ps1) or Bash (*.sh) implementations are selected based on the detected environment -
Check tool index –
tool-index.mdis consulted to determine which tools are already installed -
Bootstrap if needed – Missing tools trigger platform-specific installation:
- PowerShell:
ToolDiscovery.ps1→bootstrap-reverse.ps1 - Bash: Direct call to
bootstrap-reverse.sh(e.g.,ensure_toolfunction inrecon.sh, lines 41-50)
- PowerShell:
-
Execute the skill – The platform-specific script runs identical logical steps (e.g., invoking
rabin2with optionalr2analysis) -
Generate output – Results feed into shared documentation generators (
docs-generator,diagram-generator)
Code Comparison: Radare2 Reconnaissance Skill
The Radare2 recon skill demonstrates architectural parity across platforms. Both implementations perform the same operations with language-specific syntax.
Windows PowerShell
# skills/radare2/scripts/recon.ps1
.\skills\radare2\scripts\recon.ps1 -TargetPath C:\path\to\binary.exe `
-StringsLimit 50 -ImportsLimit 100 -RunAnalysis
Kali Linux Bash
# skills/radare2/scripts/recon.sh
bash skills/radare2/scripts/recon.sh /path/to/binary \
--strings-limit 50 --imports-limit 100 --analyze
Both scripts execute identical analysis steps:
- Verify
rabin2availability (and optionallyr2), bootstrapping if absent - Print basic file information, sections, imports, exports, and strings
- Perform function/entry analysis when the analyze flag is set
The divergence is strictly superficial: argument parsing differs (PowerShell named parameters vs. Bash long options) and bootstrap invocation paths vary by platform convention.
Key Architectural Files
| File | Platform | Responsibility |
|---|---|---|
skills/scripts/lib/ToolDiscovery.ps1 |
Windows | Tool resolution and auto-bootstrap orchestration |
kali/scripts/bootstrap-reverse.sh |
Kali Linux | Dependency installation via native package managers |
skills/radare2/scripts/recon.ps1 |
Windows | PowerShell implementation of Radare2 reconnaissance |
skills/radare2/scripts/recon.sh |
Kali Linux | Bash implementation of identical reconnaissance logic |
docs/ARCHITECTURE.md |
Both | System architecture with multi-platform diagram |
RULES.md / kali/RULES-kali.md |
Platform-specific | AI routing rule sets |
Design Principles
The reverse-skill multi-platform script architecture adheres to three core principles evident in the source code:
- Separation of concerns – What the skill does (in
skills/) remains independent from how the OS executes it - Minimal platform wrappers – Only thin adapter scripts differ; no logic duplication
- Bootstrap symmetry – Both platforms implement equivalent dependency resolution despite different package ecosystems
Summary
reverse-skillseparates platform-agnostic skill definitions inskills/from platform-specific execution scripts- Windows uses PowerShell modules in
skills/scripts/*.ps1withToolDiscovery.ps1for tool resolution - Kali Linux uses Bash scripts in
kali/scripts/*.shwith directbootstrap-reverse.shinvocation - Both platforms share identical
SKILL.mddefinitions and output generators - Platform detection occurs via
RULES.mdselection before script loading - The Radare2 recon skill demonstrates functional parity with syntax-appropriate implementations
Frequently Asked Questions
How does reverse-skill detect which platform it's running on?
The system reads the appropriate rules file at initialization. Windows environments use RULES.md while Kali Linux uses kali/RULES-kali.md as specified in docs/ARCHITECTURE.md lines 6-10. This selection determines subsequent script path resolution.
Can I run the same skill on both Windows and Kali without modification?
Yes. The skill definitions in skills/ are completely portable. Only the wrapper scripts differ—you call recon.ps1 on Windows or recon.sh on Kali, but both execute identical analysis steps against the same SKILL.md configuration.
What happens if a required tool like rabin2 is missing?
The bootstrap layer handles installation automatically. On Windows, ToolDiscovery.ps1 checks tool-index.md and invokes bootstrap-reverse.ps1. On Kali, functions like ensure_tool in recon.sh call bootstrap-reverse.sh directly. Both consult their respective bootstrap-manifest.json files to determine installation sources.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →