# Arguments and Mode Resolution

## User-invocable

When the user types `/mk:cso`, run this skill.

## Arguments

- `/mk:cso` — full daily audit (all phases, 8/10 confidence gate)
- `/cso --comprehensive` — monthly deep scan (all phases, 2/10 bar — surfaces more)
- `/cso --infra` — infrastructure-only (Phases 0-6, 12-14)
- `/cso --code` — code-only (Phases 0-1, 7, 9-11, 12-14)
- `/cso --skills` — skill supply chain only (Phases 0, 8, 12-14)
- `/cso --diff` — branch changes only (combinable with any above)
- `/cso --supply-chain` — dependency audit only (Phases 0, 3, 12-14)
- `/cso --owasp` — OWASP Top 10 only (Phases 0, 9, 12-14)
- `/cso --scope auth` — focused audit on a specific domain

## Mode Resolution

1. If no flags → run ALL phases 0-14, daily mode (8/10 confidence gate).
2. If `--comprehensive` → run ALL phases 0-14, comprehensive mode (2/10 confidence gate). Combinable with scope flags.
3. Scope flags (`--infra`, `--code`, `--skills`, `--supply-chain`, `--owasp`, `--scope`) are **mutually exclusive**. If multiple scope flags are passed, **error immediately**: "Error: --infra and --code are mutually exclusive. Pick one scope flag, or run `/mk:cso` with no flags for a full audit." Do NOT silently pick one — security tooling must never ignore user intent.
4. `--diff` is combinable with ANY scope flag AND with `--comprehensive`.
5. When `--diff` is active, each phase constrains scanning to files/configs changed on the current branch vs the base branch. For git history scanning (Phase 2), `--diff` limits to commits on the current branch only.
6. Phases 0, 1, 12, 13, 14 ALWAYS run regardless of scope flag.
7. If WebSearch is unavailable, skip checks that require it and note: "WebSearch unavailable — proceeding with local-only analysis."

## Important: Use the Grep tool for all code searches

The bash blocks throughout this skill show WHAT patterns to search for, not HOW to run them. Use the host runtime's Grep tool (which handles permissions and access correctly) rather than raw bash grep. The bash blocks are illustrative examples — do NOT copy-paste them into a terminal. Do NOT use `| head` to truncate results.
