Canonical Execution Flow for a Task in Reverse-Skill: 8-Stage Pipeline Explained

The canonical execution flow for a task in reverse-skill follows an 8-stage deterministic pipeline that transforms user requests into documented results through keyword detection, skill routing, automatic tool bootstrapping, and continuous learning.

The reverse-skill framework implements a rigorous, layered architecture for security and reverse-engineering workflows. This canonical execution flow ensures that every task—from APK analysis to Active Directory enumeration—follows the same reproducible path from initial input to final journal update. The system automatically handles tool dependencies, execution routing, and evidence preservation across both Windows and Kali Linux environments according to the architecture defined in docs/ARCHITECTURE.md.

Stage 1: User Input and Keyword Detection

The pipeline begins when the AI client receives a task description containing security or reverse-engineering terminology. A keyword matcher scans the input for specific triggers defined in the framework's detection rules, as documented at line 7 of docs/ARCHITECTURE.md. If the request matches a known security pattern, the system proceeds to routing; otherwise, it falls back to standard processing.

Stage 2: Routing Lookup via SKILL.md

Upon trigger detection, the engine reads skills/SKILL.md as the master entry point and consults the routing matrix—located at skills/config/routing.json or referenced as skills/routing.md—to resolve the appropriate sub-skill (see docs/ARCHITECTURE.md#L8-L12). This routing step maps the user's intent to a specific execution module capable of handling the request.

Stage 3: Journal and Tool-Index Verification

Before execution begins, the system performs two critical validation checks documented at lines 13–16 of the architecture file. First, it queries the field-journal/ directory for prior experience related to the current task type. Second, it loads skills/tool-index.md to verify that all required dependencies are present on the host system. This dual-check prevents execution failures and leverages historical data for optimized workflows.

Stage 4: Automatic Bootstrap and Tool Installation

If the tool-index verification identifies missing dependencies, the framework initiates automatic bootstrapping as described in docs/ARCHITECTURE.md#L18-L23. On Windows systems, it executes skills/scripts/bootstrap-reverse.ps1; on Kali Linux, it runs kali/scripts/bootstrap-reverse.sh. Successful installation adds tools to the system PATH and updates the tool-index manifest. If bootstrapping fails, the system provides manual installation guidance before proceeding.

Stage 5: Sub-Skill Execution

With all dependencies resolved, the selected sub-skill's workflow invokes its specific logic (see docs/ARCHITECTURE.md#L24-L30). This stage may involve iterative processes such as penetration testing loops or APK decompilation cycles. The sub-skill executes autonomously until it reaches a TaskDone state, at which point control returns to the main pipeline for post-processing.

Stage 6: Case Review and Report Generation

Following task completion, the case-review module validates the evidence graph to ensure forensic integrity, as noted at lines 29–31 of the architecture documentation. Subsequently, the documentation generator produces a final report along with supporting diagrams. This stage transforms raw execution data into structured deliverables suitable for security audits or reverse-engineering documentation.

Stage 7: Journal and Index Persistence

The system writes the execution outcome, lessons learned, and any newly discovered tool configurations back to the field-journal/ directory (docs/ARCHITECTURE.md#L32-L34). Simultaneously, it refreshes the routing matrices and skills/tool-index.md to reflect the current system state. This persistence mechanism ensures that subsequent tasks benefit from accumulated experience.

Stage 8: Final Output Delivery

The AI client receives the processed results and delivers the final output to the user (docs/ARCHITECTURE.md#L35). At this point, the canonical execution flow completes, and the system awaits the next task. The entire pipeline—from Stage 1 through Stage 8—repeats deterministically for every subsequent request.

Triggering the Flow from Command Line

Users initiate the canonical execution flow through platform-specific master routing scripts. These commands demonstrate how to trigger the pipeline with a descriptive hint:

On Windows (PowerShell):


# Invoke the master routing script with a task hint

powershell -NoProfile -ExecutionPolicy Bypass -File skills/scripts/master-route.ps1 -Hint "Analyze suspicious APK"

On Linux, macOS, or Kali (Bash):


# Invoke the master routing script with a task hint

bash skills/scripts/master-route.sh --hint "Enumerate AD security misconfigurations"

Both commands initiate the complete pipeline: they detect the hint, resolve routing through skills/SKILL.md, ensure tool availability via bootstrapping if necessary, execute the chosen sub-skill, and generate the final report.

Core Files in the Execution Path

The canonical execution flow relies on specific files that govern routing, bootstrapping, and state management:

  • skills/SKILL.md — Master entry point and routing dispatcher that initializes every task
  • skills/config/routing.json — Routing matrix mapping user hints to specific sub-skills
  • skills/tool-index.md — Generated manifest tracking available tools and their installation status
  • field-journal/ — Directory containing execution history and learned patterns for auto-evolution
  • skills/scripts/bootstrap-reverse.ps1 — Windows PowerShell script for automatic tool installation
  • kali/scripts/bootstrap-reverse.sh — Kali Linux bash script for environment setup
  • docs/ARCHITECTURE.md — Comprehensive documentation of the execution pipeline stages
  • RULES.md and kali/RULES-kali.md — Platform-specific rule files governing execution constraints

Summary

  • The canonical execution flow for a task in reverse-skill consists of eight deterministic stages from keyword detection to final output
  • Routing decisions originate in skills/SKILL.md and resolve through the routing matrix to specific sub-skills
  • Automatic bootstrapping via bootstrap-reverse.ps1 or bootstrap-reverse.sh handles missing dependencies without manual intervention
  • The field-journal/ and skills/tool-index.md provide persistent state and learning across task executions
  • The auto-evolution mechanism (docs/ARCHITECTURE.md#L55-L71) ensures the framework improves with each completed task
  • Platform-specific master routing scripts serve as the primary entry points for triggering the pipeline on Windows and Kali Linux

Frequently Asked Questions

What happens if a required tool is missing during execution?

The framework automatically triggers the bootstrap script appropriate for the host platform—skills/scripts/bootstrap-reverse.ps1 for Windows or kali/scripts/bootstrap-reverse.sh for Kali Linux. These scripts attempt unattended installation, update the system PATH, and refresh skills/tool-index.md. If automatic installation fails, the system provides manual setup instructions before allowing the task to proceed.

How does reverse-skill determine which sub-skill to execute?

The routing lookup stage consults skills/SKILL.md as the master dispatcher and cross-references the user's hint against the routing matrix in skills/config/routing.json. This mapping connects specific keywords to dedicated sub-skill modules, ensuring that "Analyze suspicious APK" routes to mobile reverse-engineering tools while "Enumerate AD security misconfigurations" routes to Active Directory assessment kits.

What is the auto-evolution mechanism in reverse-skill?

The auto-evolution mechanism refers to the framework's ability to learn from each execution cycle, as implemented in docs/ARCHITECTURE.md#L55-L71. After task completion, the system writes outcomes and lessons learned to the field-journal/ directory and updates the tool-index. This accumulated experience influences future routing decisions, tool selection, and execution strategies, creating an increasingly optimized workflow over time without manual configuration updates.

Is the canonical execution flow platform-specific?

While the conceptual eight-stage pipeline remains identical across platforms, specific implementations vary by operating system. Windows systems rely on PowerShell scripts and consult RULES.md, whereas Kali Linux uses Bash equivalents and references kali/RULES-kali.md. The skills/tool-index.md and field-journal/ formats remain consistent across both environments to ensure portability of execution history.

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 →