# How to Handle Offline Samples in Reverse-Skill Case Initialization

> Learn to handle offline samples in reverse-skill case initialization. Use the offline-sample preset and specify your sample path to bypass authentication gates.

- Repository: [ZhaoXu/reverse-skill](https://github.com/zhaoxuya520/reverse-skill)
- Tags: how-to-guide
- Published: 2026-08-24

---

**Reverse-Skill requires the `offline-sample` preset and an explicit sample path when initializing cases with local artifacts to satisfy the authentication hard gate.**

The zhaoxuya520/reverse-skill framework enforces strict validation before any active analysis can begin. When working with offline artifacts such as APKs or binary files, you must handle offline samples in reverse-skill case initialization by invoking the platform-specific `case-init` script with the correct preset and authentication parameters.

## Understanding the Hard Gate Requirement

The reverse-skill platform implements a mandatory hard gate that blocks all active (ACT) operations until authentication requirements are met. According to the source code in [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md), the system requires both `auth.status=granted` and a valid offline-sample scope before permitting any analysis work to proceed. This gate cannot be bypassed and serves as the primary security control for local artifact handling.

## Initializing Cases with the Offline-Sample Preset

To satisfy the hard gate for offline artifacts, invoke the `case-init` script using the `offline-sample` preset and provide the absolute or relative path to your sample file.

### PowerShell (Windows)

On Windows systems, use the PowerShell implementation located at `skills/scripts/case-init.ps1`:

```powershell
powershell -File skills/scripts/case-init.ps1 `
  -Hint "offline apk" `
  -CaseName "my-sample" `
  -Preset offline-sample `
  -Sample ".\app.apk"

```

This command is documented in [`skills/MASTER-ROUTING.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/MASTER-ROUTING.md) (lines 30-33) and creates the case structure under `work/my-sample/`.

### Bash (Linux/macOS/Kali)

For Unix-like environments, use the Bash implementation at [`skills/scripts/case-init.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/scripts/case-init.sh):

```bash
bash skills/scripts/case-init.sh \
  --hint "offline apk" \
  --case-name "my-sample" \
  --preset offline-sample \
  --sample ./app.apk

```

As shown in [`skills/MASTER-ROUTING.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/MASTER-ROUTING.md) (lines 49-52), this command establishes the case directory with the proper authentication metadata required by the framework.

## What the Preset Configures

When you specify the `offline-sample` preset, the initialization script performs three critical actions:

- **Creates the case directory** under `work/<case-name>/` with the standard reverse-skill structure.
- **Generates [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md)** containing `auth.status=granted` and an explicit reference to the supplied sample file path.
- **Validates the artifact** against the offline-sample contract defined in [`skills/ops/scope-contract.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/ops/scope-contract.md).

The resulting [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md) file satisfies the gating rule in [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md) (lines 20-22) that mandates *"auth.status=granted + a valid offline-sample scope is required before ACT"*.

## Critical Gating Rules

The reverse-skill framework enforces two non-negotiable policies regarding offline samples:

- **Never bypass the gate**: The `-Force` or `--force` flag is explicitly prohibited from overriding the authentication check. As stated in [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md) (lines 391-398), force flags cannot circumvent the `auth.status` verification.
- **Explicit sample required**: An offline case is only valid when the sample is supplied via the `--sample` (or `-Sample`) argument together with the `offline-sample` preset. The [`skills/SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/SKILL.md) file (lines 14-16) codifies this requirement, ensuring that every offline case has a traceable artifact reference.

## Verification Workflow

After initialization, verify that your case meets the hard gate requirements:

1. Open `work/<case-name>/scope.md` and confirm it contains `auth.status=granted` and a `sample:` entry pointing to your artifact.
2. Validate that the sample file path is accessible from the case directory.
3. Proceed with subsequent skill scripts (e.g., static analysis, reverse engineering) knowing the authentication gate is satisfied.

If [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md) lacks the granted status or sample reference, the framework will reject any ACT commands until you reinitialize with the correct preset.

## Summary

- **Use the `offline-sample` preset** when invoking `case-init` to authorize offline artifacts.
- **Provide the `--sample` argument** with the path to your local APK, binary, or other artifact.
- **Verify [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md)** contains `auth.status=granted` before attempting active analysis.
- **Never use `--force`** to bypass authentication; the hard gate cannot be overridden.
- **Reference [`skills/ops/scope-contract.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/ops/scope-contract.md)** for the complete offline-sample specification.

## Frequently Asked Questions

### What happens if I forget to specify the --sample argument?

The initialization will fail or create an incomplete case scope that cannot pass the hard gate. According to [`skills/SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/SKILL.md) (lines 14-16), the `offline-sample` preset requires an explicit sample path to establish a valid authorization scope. Without it, subsequent ACT commands will be rejected.

### Can I use the --force flag to bypass the offline sample check?

No. The reverse-skill framework explicitly prohibits using `-Force` or `--force` to override authentication checks. As documented in [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md) (lines 391-398), force flags do not circumvent the `auth.status=granted` requirement, ensuring security controls remain intact.

### Where is the authorization status stored?

The authorization status is written to `work/<case-name>/scope.md` during initialization. This file contains the `auth.status=granted` declaration along with metadata linking the case to the specific offline sample file, satisfying the gating rules defined in [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md).

### Is the offline-sample preset supported on all platforms?

Yes. The framework provides platform-native implementations in `skills/scripts/case-init.ps1` for Windows and [`skills/scripts/case-init.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/scripts/case-init.sh) for Linux, macOS, and Kali. Both scripts support the `offline-sample` preset and enforce identical gating rules across operating systems.