# Security Review

> >

- **Type:** Skill
- **Install:** `agentstack add skill-dianyike-claude-code-insights-security-review`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [dianyike](https://agentstack.voostack.com/s/dianyike)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [dianyike](https://github.com/dianyike)
- **Source:** https://github.com/dianyike/claude-code-insights/tree/main/examples/security-reviewer/skills/security-review

## Install

```sh
agentstack add skill-dianyike-claude-code-insights-security-review
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# /security:review — Read-Only Security Audit

Run the `security-reviewer` subagent to produce a dual-verification security report. This command is **always read-only** — it will never modify source code files.

## Command Syntax

```
/security:review [options] [path...]
  --base               # Diff against a base branch (merge-base)
  --scope staged|working-tree  # Explicit change scope
  --background                 # Run in background, return job ID
  --wait                       # Run in foreground (default)
```

## Target Resolution

Determine the review scope before invoking the subagent:

### Priority Order

1. If `--base ` is specified → **branch diff mode**
   - Run: `git merge-base HEAD ` → `git diff --name-only ..HEAD`
2. If `--scope` is specified → **explicit scope mode**
   - `staged`: `git diff --staged --name-only`
   - `working-tree`: `git diff --name-only` + `git ls-files --others --exclude-standard`
3. If neither specified and working tree is dirty → **auto: working-tree**
4. If neither specified and working tree is clean → **auto: branch diff against default branch**

### Path Filtering

If `[path...]` arguments are provided, filter the resolved file list to only include files whose paths start with any of the given prefixes.

### Handoff to Subagent

Pass the resolved scope to the `security-reviewer` subagent:

```
Review scope:
- Mode: 
- Base:  (if applicable)
- Files: 
- Path filters:  (if applicable)
```

## Background Execution

When `--background` is specified:

1. Launch the `security-reviewer` subagent with `run_in_background: true`
2. Return immediately with: "Security review started. Use `/security:status` to check progress."
3. When the subagent completes, the notification will include the verdict and report path.

When `--wait` (default):

1. Launch the `security-reviewer` subagent in foreground
2. Display the verdict and report path when complete

## Related Commands

- `/security:fix ` — Opt-in remediation based on a review report (requires explicit user action)

### Job Management (Phase 1 — not yet implemented)

The following commands are planned but not yet available as separate skills. Until implemented, use natural language (e.g., "check the security scan status") and the main agent will handle it via the Agent tool's built-in background notification.

- `/security:status [job-id]` — Check background job progress. Without ID, list all active jobs
- `/security:result ` — Retrieve completed job verdict and report path
- `/security:cancel ` — Mark a running job as CANCELLED (subagent may still complete in background)

**Expected behavior** (for future implementation):
- Job state is persisted at `.agents-output/security/jobs/.json`
- States: QUEUED → RUNNING → COMPLETED / FAILED / CANCELLED
- On session restart, any RUNNING job is marked STALE (detected by checking `status == RUNNING` with `created_at` older than the current session start)

## Completion Criteria

- [ ] Target resolution produced a concrete file list (or "no changes found" if empty)
- [ ] `security-reviewer` subagent invoked with resolved scope
- [ ] Verdict and report path displayed to user
- [ ] If `--background`: job ID returned immediately, no blocking
- [ ] No source code files modified

## Gotchas

- `--base` and `--scope` are mutually exclusive in practice — if both specified, `--base` wins (priority order). Don't warn the user; just follow priority
- When working tree is clean AND no default branch is detectable (e.g., fresh repo with only one commit), auto mode falls through to an empty file list. Surface this clearly instead of running Semgrep on zero files
- `--background` relies on Claude Code's `run_in_background` for the Agent tool — the subagent cannot be cancelled mid-execution; `/security:cancel` only marks the job as CANCELLED and stops waiting for results
- Path filters are prefix-matched, not glob-matched. `src/auth` matches `src/auth/login.ts` and `src/auth-utils/helper.ts`. If users expect glob semantics, clarify
- **Iterate this section**: After each real usage, append new gotchas here

## What This Command Does NOT Do

- Does not modify source code (read-only)
- Does not enter the Fix-Verify Loop (Section 4 of the protocol)
- Does not auto-remediate findings
- Does not require Write or Edit tool permissions

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [dianyike](https://github.com/dianyike)
- **Source:** [dianyike/claude-code-insights](https://github.com/dianyike/claude-code-insights)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-dianyike-claude-code-insights-security-review
- Seller: https://agentstack.voostack.com/s/dianyike
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
