# Global Instructions — MRPS Agent Toolkit

## Overview
The orchestration layer. Use this file when the user wants a **multi-category project
audit**, not a single check.

## Category & Tools
- **Tools**: `mrps-agent-runner` (`kind: skill`)
- **Category**: `orchestration`
- **Produces findings**: no — it coordinates and writes the report; the category tools
  produce the findings.

## The contract lives in two files
This file does not repeat them. Read both:

| File | Owns |
|---|---|
| `/agent-toolkit/AGENTS.md` | permissions, write boundary, honesty, attribution |
| `/agent-toolkit/runner/SKILL.md` | menu, confirmation gate, report mechanics, ID scheme, statuses |

If they conflict: **SKILL.md wins on workflow, AGENTS.md wins on permissions.**

## When to use
Whenever the user asks for a comprehensive or multi-category audit — UI, accessibility,
security, dependencies, tests, code analysis, build.

## When NOT to use
Single-file edits, explanations, quick fixes, or one narrow check. For those, load only
the category instruction file and skip the menu.

## Running an audit

1. Read `index.json`. Build the list of categories present.
2. Show the menu from `SKILL.md` §1. Wait.
3. For each approved category, read that category's `instructionFile` and follow it.
4. Gate the plan (§2): commands, installs, report location. Wait for `y`/`N`.
5. Run each category. One report per category under `reports/<slug>/`.
6. Append one line per category to `reports/CHANGELOG.md`.
7. Present the combined delta, then the plain-English list, then the tables.

## Aggregation
- One report file per category — never one giant report.
- `reports/CHANGELOG.md` gets one line per category per run:
  `<runId> | <slug> | +N new | N still open | N resolved | N not checked`
- The chat summary is short: counts, then only `NEW` and `C`/`H` findings by ID.

## Report shape
Follow `AGENTS.md` §7 exactly. Minimum viable report:

```markdown
# <slug> — <runId>

Prior: none (first run)
Toolchain: Trivy 0.56.2
Delta: +3 new · 0 still open · 0 resolved · 0 not checked

## What was found (plain English)
- **sec-01** — A dependency has a publicly known remote-code-execution flaw. (High)

## What changed since last run
- First run.

## Technical detail
| ID | Sev | Evidence | File | Rule | Status |
|----|-----|----------|------|------|--------|
| sec-01 | H | CVE-2024-21538 | package-lock.json | vuln | NEW |

## Commands run
| Command | Exit | Note |
|---------|------|------|
| trivy fs --scanners vuln,secret,misconfig . | 0 | 3 findings |

## Not checked
- None.

Generated by <agent name>. Read-only. No source files were modified.
Findings are advisory; the user decides what to fix.
```

## Anti-patterns this layer exists to prevent
- Auditing without reading the prior report
- One monolithic report covering five categories
- Reporting `RESOLVED` without a re-run
- Presenting a table with no plain-English block above it
