# How to Use case-init.psI to Create a New Analysis Case with Scope and Authorization

> Easily create a new analysis case using case-init.ps1. Generate scope and authorization files, and register your case for routing integration with a single command.

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

---

**Run `.\case-init.psI -CaseName "your-case"` to instantly generate the case directory, [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md), and [`auth.yml`](https://github.com/zhaoxuya520/reverse-skill/blob/main/auth.yml), while automatically registering the case in [`skills/routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/routing.md) for routing integration.**

The `reverse-skill` repository provides a structured framework for security analysis workflows. Using the `case-init.psI` script, analysts can bootstrap a new analysis case with defined scope and authorization controls in seconds, ensuring seamless integration with the routing system.

## What case-init.psI Automates

The initialization script performs four critical operations to establish a ready-to-use analysis environment.

### Directory and File Generation

First, the script creates a dedicated workspace under `work/<case-name>/`. Inside this directory, it generates two essential files:

- **[`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md)** – A markdown template that defines the target systems, objectives, and constraints for the engagement.
- **[`auth.yml`](https://github.com/zhaoxuya520/reverse-skill/blob/main/auth.yml)** – A YAML manifest that records ownership and access permissions for the case data.

These files serve as the single source of truth for all subsequent skills and analysis tools.

### Routing Table Registration

Finally, `case-init.psI` appends the new case identifier to [`skills/routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/routing.md). This entry allows the `skills/scripts/master-route.ps1` router to resolve case-specific commands and dispatch them to the appropriate skill modules.

## Step-by-Step: Creating a New Analysis Case

Follow these steps to initialize a case with proper scope and authorization.

### 1. Execute the Initialization Script

Open a PowerShell session in the repository root and run:

```powershell
.\case-init.psI -CaseName "enterprise-pentest"

```

The script outputs the paths to the generated artifacts:

- Work folder: `work/enterprise-pentest/`
- Scope file: [`work/enterprise-pentest/scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/work/enterprise-pentest/scope.md)
- Auth file: [`work/enterprise-pentest/auth.yml`](https://github.com/zhaoxuya520/reverse-skill/blob/main/work/enterprise-pentest/auth.yml)

### 2. Define the Scope

Edit [`work/enterprise-pentest/scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/work/enterprise-pentest/scope.md) to specify the engagement boundaries. The template includes sections for target hosts, objectives, and legal constraints:

```markdown

# Scope – enterprise-pentest

## Target

- Hostnames / IPs:
- Services to test:

## Objectives

- Enumerate AD trusts
- Extract credential hashes
- Identify privilege-escalation paths

## Constraints

- No denial-of-service attacks
- Legal boundaries: [link to contract]

```

### 3. Configure Authorization

Modify [`work/enterprise-pentest/auth.yml`](https://github.com/zhaoxuya520/reverse-skill/blob/main/work/enterprise-pentest/auth.yml) to set ownership and contributor access. This manifest is consulted by the routing engine to enforce permission checks:

```yaml
owner: alice@example.com
contributors:
  - bob@example.com
  - carol@example.com

```

### 4. Verify Routing Integration

Confirm that the case appears in [`skills/routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/routing.md). The router (`skills/scripts/master-route.ps1`) reads this file to determine which skills can operate on which cases. Once listed, commands like `case-run` or `case-status` will automatically target the correct work directory.

## Architecture and Integration

Understanding how `case-init.psI` fits into the broader system ensures proper usage across team environments.

### The Routing Engine

The `skills/scripts/master-route.ps1` script acts as the central dispatcher. It reads [`skills/routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/routing.md) to map incoming commands to the correct case folders and skill modules. Without the registration step performed by `case-init.psI`, the router cannot resolve paths to the case-specific [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md) and [`auth.yml`](https://github.com/zhaoxuya520/reverse-skill/blob/main/auth.yml) files.

### Permission Model

Access control is defined in [`skills/ops/role-map.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/ops/role-map.md), which specifies which user roles are authorized to invoke `case-init.psI`. This prevents unauthorized case creation and ensures that only designated analysts can initialize new engagements.

### Skill Consumption

Subsequent skills—such as reverse engineering or diagram generation modules—locate the active case by reading the routing table. They then reference `work/<case-name>/scope.md` for target definitions and [`auth.yml`](https://github.com/zhaoxuya520/reverse-skill/blob/main/auth.yml) for permission validation before executing their logic.

## Summary

- **`case-init.psI`** creates the `work/<case-name>/` directory structure and generates [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md) and [`auth.yml`](https://github.com/zhaoxuya520/reverse-skill/blob/main/auth.yml) templates.
- The script automatically registers the case in [`skills/routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/routing.md), enabling the `skills/scripts/master-route.ps1` router to dispatch commands.
- Analysts edit the generated markdown and YAML files to define engagement scope and authorization boundaries.
- The [`skills/ops/role-map.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/ops/role-map.md) file governs which users can execute the initialization script.

## Frequently Asked Questions

### What is the difference between [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md) and [`auth.yml`](https://github.com/zhaoxuya520/reverse-skill/blob/main/auth.yml)?

The [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md) file contains the technical and legal boundaries of the analysis—target systems, objectives, and constraints—while [`auth.yml`](https://github.com/zhaoxuya520/reverse-skill/blob/main/auth.yml) strictly manages access control, listing the case owner and authorized contributors. The routing engine checks [`auth.yml`](https://github.com/zhaoxuya520/reverse-skill/blob/main/auth.yml) before allowing skills to read or modify case data.

### Who is permitted to run `case-init.psI`?

Execution privileges are controlled by [`skills/ops/role-map.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/ops/role-map.md). Only users assigned to roles with explicit initialization rights can create new cases, ensuring that the `work/` directory structure remains organized and that unauthorized engagements are not started.

### How does the routing system recognize a new case?

When `case-init.psI` runs, it appends the case name and path to [`skills/routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/routing.md). The `skills/scripts/master-route.ps1` router monitors this table to resolve case-specific commands, allowing skills to locate the correct [`scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/scope.md) and [`auth.yml`](https://github.com/zhaoxuya520/reverse-skill/blob/main/auth.yml) files without manual path configuration.

### Can I rename a case after creation?

While the script itself does not provide a rename function, you can manually move the `work/<case-name>/` folder and update the corresponding entry in [`skills/routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/routing.md). Ensure that [`auth.yml`](https://github.com/zhaoxuya520/reverse-skill/blob/main/auth.yml) is updated to reflect any ownership changes if the rename involves transferring the case to another analyst.