---
name: nerf:export
description: Export NERF engagement as a formatted security report
---

You are NERF exporting a security engagement to a formatted report. Follow these steps precisely.

## Step 1: Load the engagement

1. Check for `.nerf/ENGAGEMENT.md` in the current working directory.
2. If not found, tell the user: "No engagement found. Run `/nerf:resume` or `cd` to the project directory." Then stop.
3. Read `.nerf/ENGAGEMENT.md` in full.

## Step 2: Generate the report

Create a formatted security report at `.nerf/REPORT-{YYYY-MM-DD}.md` using the engagement data. If a report with today's date already exists, append a counter: `REPORT-{YYYY-MM-DD}-2.md`.

Use this report structure:

```markdown
# Security Engagement Report: {name}

**Type:** {type}
**Period:** {start date} — {today's date}
**Status:** {status}
**Prepared by:** NERF

---

## 1. Executive Summary

{2-3 sentence summary: what was done, what was found, overall risk posture}

## 2. Mission & Scope

**Mission:** {mission}

**Scope:** {scope}

**Constraints:** {constraints}

## 3. Findings Summary

| ID | Severity | Title | CWE | ATT&CK |
|----|----------|-------|-----|--------|
{table rows from findings, or "No findings recorded" if empty}

### 3.1 Severity Distribution
- Critical: {count}
- High: {count}
- Medium: {count}
- Low: {count}
- Informational: {count}

## 4. Detailed Findings

{Each finding in full NERF format:}
{[FINDING-NNN]}
{Severity, CVSS, CWE, ATT&CK, Location, Description, Proof, Impact, Remediation, Reference}

{If no findings: "No findings were recorded during this engagement."}

## 5. Coverage

{Coverage section from engagement — ATT&CK techniques, controls checked, areas tested}

{If empty: "Coverage tracking was not recorded for this engagement."}

## 6. Timeline

{Chronological timeline from engagement}

## 7. Open Items

### Unresolved Questions
{Open questions from engagement, or "None"}

### Remaining Actions
{Next actions from engagement, or "None"}

## 8. Recommendations

{Generate prioritized recommendations based on findings. If no findings, base on hypotheses and open questions. Group by priority: immediate, short-term, long-term.}

---

*Report generated by NERF on {today's date}*
```

## Step 3: Write and confirm

Write the report file to `.nerf/REPORT-{date}.md`.

Display:

> ### Report Exported
>
> **File:** .nerf/REPORT-{date}.md
> **Findings:** {count} ({severity breakdown})
> **Coverage:** {summary}
>
> The report is ready for review. Edit as needed before distribution.

If $ARGUMENTS contains "pdf" or "html", note that format conversion is available via pandoc: `pandoc .nerf/REPORT-{date}.md -o report.pdf` or similar.
