/appsec-advisor:verify-requirementsfrom appsec-advisor
Checks a developer's current code diff against company security requirements or a built-in best-practices baseline. Provides concrete, code-aware fix guidance. Advisory by default; opt-in --gate enables CI/merge enforcement.
Ships in appsec-advisor. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are helping a developer build secure code. This skill checks the change the developer just made against the security requirements that apply to it and gives concrete, code-aware guidance — what is missing or wrong and how to fix it.
This is a dev helper, not a compliance police:
--gate.Follow the steps exactly.
--help — inline help (early exit)If the user's arguments contain --help or -h, do not scan anything.
Print the block below verbatim and exit with status 0.
/appsec-advisor:verify-requirements — Check your change against security requirements.
USAGE
/appsec-advisor:verify-requirements [FLAGS]
Checks only the requirements TRIGGERED by your current diff and tells you what
to fix and how. Uses your company requirements catalog if configured,
otherwise a built-in best-practices baseline — no setup needed.
Advisory by default (always exits 0); pass --gate to fail CI on a regression.
FLAGS
--gate Enforce: exit non-zero when an in-scope requirement
at/above the priority floor FAILs. Without it the
skill always exits 0 (advisory).
--gate-on <fail|partial> What gates: `fail` (default) or `fail`+`partial`.
--priority-floor <p> Lowest priority that may gate: MUST (default),
SHOULD, or MAY.
The --gate / --gate-on / --priority-floor defaults can
be preset in the active org profile (preset
requirements.gate); an explicit flag here overrides it.
--base <ref> Diff against <ref> (git diff <ref>...HEAD).
Default: merge-base with the upstream default branch.
--staged Diff staged changes only (git diff --cached) — for
pre-commit hooks.
--requirements <src> Load the requirements YAML from <src> instead of the
configured source; no cache fallback. <src> is an
http(s):// URL or a local file path.
--org-profile <path> Use this org profile for source resolution.
--preset <name> Use a specific preset from the active org profile.
--no-org-profile Ignore packaged/env-pointed org profiles.
--md Also save appsec-requirements-change-report.md
--json Also save appsec-requirements-change-report.json
--save Both --md and --json
--output <dir> Write reports and run-state files to <dir> instead of
the application's private directory outside the
repository
--help, -h Show this help and exit
EXIT CODES
0 advisory mode, or --gate with no gating failures
1 --gate and >=1 gating failure
2 usage / requirements-load / verdict error
See `/appsec-advisor:audit-security-requirements` for the full-repo audit and
`docs/dev-security-helper-usage.md` → "Requirements source" for source rules.
After printing, exit. Do not read any files or perform any other action.
Parse arguments after the skill name:
--gate — set gate_mode = true (default false / advisory)--gate-on <fail|partial> — set gate_on (default fail)--priority-floor <MUST|SHOULD|MAY> — set priority_floor (default MUST)For each of these three gate knobs, also remember whether the user passed the
flag explicitly this run (gate_mode_set, gate_on_set,
priority_floor_set). The active preset may supply defaults for them (Step 2b),
but an explicit CLI flag always wins — precedence is CLI > preset > built-in
default (advisory / fail / MUST).
--base <ref> — set base_ref--staged — set staged = true (mutually exclusive with --base; if both given, hard-fail)--requirements <src> — set requirements_url_override--org-profile <path> — set org_profile_override--preset <name> — set preset_override--no-org-profile — set no_org_profile = true--md / --json / --save — report-save flags--output <dir> — set output_dir_overrideAny token starting with -- that is not one of the recognized flags above — or
is not the value consumed by --gate-on / --priority-floor / --base /
--requirements / --org-profile / --preset / --output — is a hard error. Do not read
files, fetch, or dispatch. Print to stderr Error: unknown argument '<TOKEN>'
followed by Run /appsec-advisor:verify-requirements --help for details. and
exit with status 2. A flag whose required value is missing counts as unknown.
Resolve the plugin root (same block as the audit skill):
if [ -z "$CLAUDE_PLUGIN_ROOT" ]; then
# <base-dir> from the invocation line. Never search the filesystem: several
# checkouts may exist and the first hit is arbitrary.
CLAUDE_PLUGIN_ROOT=$(cd "<base-dir>/../.." && pwd)
fi
export CLAUDE_PLUGIN_ROOT
if [ -z "$CLAUDE_PLUGIN_ROOT" ] || [ ! -d "$CLAUDE_PLUGIN_ROOT" ]; then
echo "Error: CLAUDE_PLUGIN_ROOT could not be resolved — install appsec-advisor or set the variable manually." >&2
exit 2
fi
# Reports and run state go to the application's private directory outside the
# repository unless --output names one. Never fall back to docs/security; a
# developer-authored catalog there stays a repository input (--catalog-dir).
if [ -n "$OUTPUT_DIR_OVERRIDE" ]; then
OUTPUT_DIR="$OUTPUT_DIR_OVERRIDE"
mkdir -p "$OUTPUT_DIR" || exit 2
else
OUTPUT_DIR=$(python3 "$CLAUDE_PLUGIN_ROOT/scripts/shared/assessment_location.py" destination --repo "$PWD" --create) || exit 2
fi
CATALOG_DIR="$PWD/docs/security"
Resolve the org profile, then the requirements source, then fetch through the
shared fail-closed gate — identical contract to audit-security-requirements
Step 1b (explicit --requirements is fail-closed with no cache fallback;
otherwise require a usable org-profile / legacy source or a populated cache):
ORG_ARGS=()
[ -n "$ORG_PROFILE_OVERRIDE" ] && ORG_ARGS+=(--org-profile "$ORG_PROFILE_OVERRIDE")
[ -n "$PRESET_OVERRIDE" ] && ORG_ARGS+=(--preset "$PRESET_OVERRIDE")
[ "$NO_ORG_PROFILE" = "true" ] && ORG_ARGS+=(--no-org-profile)
python3 "$CLAUDE_PLUGIN_ROOT/scripts/runtime/resolve_org_profile.py" \
--output-dir "$OUTPUT_DIR" --emit-file "${ORG_ARGS[@]}" >/dev/null || exit $?
FETCH_ARGS=(--caller verify-requirements --output-dir "$OUTPUT_DIR" --catalog-dir "$CATALOG_DIR" --plugin-root "$CLAUDE_PLUGIN_ROOT" \
--fallback-baseline "$CLAUDE_PLUGIN_ROOT/data/appsec-bestpractices-baseline.yaml")
if [ -n "$REQUIREMENTS_URL_OVERRIDE" ]; then
# Explicit company source: fail-closed, no baseline fallback — if you name a
# source it must load (a typo/down URL should not silently fall back).
FETCH_ARGS+=(--requirements "$REQUIREMENTS_URL_OVERRIDE")
else
# Zero-config path: try the org-profile / cached company source; if none is
# available, degrade to the bundled best-practices baseline instead of
# aborting. This is what makes the helper "just work" with no setup.
FETCH_ARGS+=(--require)
fi
python3 "$CLAUDE_PLUGIN_ROOT/scripts/requirements/fetch_requirements.py" "${FETCH_ARGS[@]}"
REQ_FETCH_EXIT=$?
if [ "$REQ_FETCH_EXIT" -ne 0 ]; then
# Only happens when an EXPLICIT --requirements source was named and could not
# load. The zero-config path never lands here (it has the baseline fallback).
echo "✗ The requirements source you named could not be loaded (exit $REQ_FETCH_EXIT)." >&2
exit 2
fi
$OUTPUT_DIR/.requirements.yaml is now the catalog — either your company
requirements (when configured) or the bundled best-practices baseline. Its
top-level source: field records which (the requirement-id scheme is whatever
the catalog defines — no fixed prefix is assumed), so the output can be honest
about what your change was checked against.
The resolver wrote $OUTPUT_DIR/.org-profile-effective.json in Step 2. If an org
profile is active and its selected preset carries a
requirements.gate block, use it as the default for any gate knob the user
did not set explicitly on the CLI. Precedence is CLI > preset > built-in
default — so a flag the user passed this run is never overwritten.
EFFECTIVE="$OUTPUT_DIR/.org-profile-effective.json"
if [ -f "$EFFECTIVE" ]; then
read PRESET_GATE_MODE PRESET_GATE_ON PRESET_FLOOR < <(python3 - "$EFFECTIVE" <<'PY'
import json, sys
d = (json.load(open(sys.argv[1])).get("defaults") or {}).get("requirements_gate") or {}
print(d.get("mode") or "", d.get("gate_on") or "", d.get("priority_floor") or "")
PY
)
# Seed only when the user did NOT pass the corresponding flag this run.
[ "$GATE_MODE_SET" != "true" ] && [ "$PRESET_GATE_MODE" = "enforce" ] && GATE_MODE=true
[ "$GATE_ON_SET" != "true" ] && [ -n "$PRESET_GATE_ON" ] && GATE_ON="$PRESET_GATE_ON"
[ "$PRIORITY_FLOOR_SET" != "true" ] && [ -n "$PRESET_FLOOR" ] && PRIORITY_FLOOR="$PRESET_FLOOR"
fi
When a preset supplied any of these (and the user did not override it), note it
once in the console — e.g. Gate policy from preset <name>: enforce · gate-on=partial · floor=SHOULD — so the effective policy is never a surprise. Omit the line entirely when no preset gate is in effect.
DIFF_ARGS=(--repo-root "$PWD" --output-dir "$OUTPUT_DIR")
[ -n "$BASE_REF" ] && DIFF_ARGS+=(--base "$BASE_REF")
[ "$STAGED" = "true" ] && DIFF_ARGS+=(--staged)
CHANGED_COUNT=$(python3 "$CLAUDE_PLUGIN_ROOT/scripts/repairs/build_verify_diff.py" "${DIFF_ARGS[@]}")
DIFF_EXIT=$?
if [ "$DIFF_EXIT" -ne 0 ]; then
echo "✗ Could not compute the diff (exit $DIFF_EXIT)." >&2
exit 2
fi
If CHANGED_COUNT is 0, print No changes to verify. and exit 0. Do not
dispatch the subagent — an empty diff costs nothing.
Use the Agent tool to launch the appsec-reviewer subagent. Pass
inputs in Group A → B → C order (stable → scalars → volatile paths):
REPO_ROOT=<PWD>
OUTPUT_DIR=<OUTPUT_DIR>
PRIORITY_FLOOR=<priority_floor>
MODEL_ID=sonnet
DIFF_FILE=<OUTPUT_DIR>/.verify-diff.json
REQUIREMENTS_YAML=<OUTPUT_DIR>/.requirements.yaml
STEERING_MAP=<CLAUDE_PLUGIN_ROOT>/hooks/steering_keywords.json
STEERING_MAP is the shared topic→requirement relevance map (also used by the
security-steering hook) — the verifier's Stage-A reads it instead of inventing
its own keyword table, so guidance and verification stay in lock-step.
The subagent grades the triggered requirements and writes
$OUTPUT_DIR/.requirements-verification.json. It prints its own readable
console summary; do not re-print the findings yourself.
GATE_ARGS=(--verdict "$OUTPUT_DIR/.requirements-verification.json" \
--priority-floor "$PRIORITY_FLOOR" --gate-on "$GATE_ON")
[ "$GATE_MODE" = "true" ] && GATE_ARGS+=(--gate)
python3 "$CLAUDE_PLUGIN_ROOT/scripts/requirements/requirements_gate.py" "${GATE_ARGS[@]}"
GATE_EXIT=$?
requirements/requirements_gate.py prints the verdict line and is the single authority on
the outcome. Propagate its exit code:
--gate absent) → it always exits 0; the skill exits 0 but the
printed WARN line still tells the team what would block.exit "$GATE_EXIT"
If --md / --json / --save was set, render the report under
$OUTPUT_DIR/appsec-requirements-change-report.{md,json} from
.requirements-verification.json, reusing the audit-security-requirements
report format (open + gating requirements only). This is presentation only; it
must not change the exit code computed in Step 5.
Note: this skill always has something to check against. With a company catalog
configured (explicit --requirements, org-profile source, legacy config, or
plugin cache) it uses that; otherwise it falls back to the bundled
best-practices baseline (data/appsec-bestpractices-baseline.yaml). It only
aborts (Step 2, exit 2) when you explicitly named a --requirements source
that could not be loaded — a deliberately-named source must work.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
security-review, diff-scanning, appsec, code-review, ci-gate
npx claudepluginhub appsec-foundry/appsec-advisor --plugin appsec-advisor28 skills in this plugin
/abuse-casesList the technical and business abuse cases defined for a repository — the plugin's standard cases, the organization profile's cases, and the repository's own cases in docs/security/abuse-cases/ — each with its origin, kind, and title. Use for "which abuse cases are defined?", "welche abuse cases gibt es?", "show our business abuse cases", or to look up the ID to pass to analyze-threats --abuse-case. Read-only; it does not check a case against the code. For the outcome a past run recorded, use ask-security-assessment./analyze-threatsAdvisory threat analysis on request: a planned design, selected code changes, a concrete threat hypothesis against named files or directories at a Git revision, or a defined abuse case by its ID. Combines source evidence with requirements, business context, and an optional threat model. Reports findings, scenarios, assumptions, and questions whose answers change the assessment. Hypothesis checks distinguish supported, not confirmed in scope, and unresolved; no result proves safety. Answers can be saved explicitly to a feature file. Never edits code, changes the threat model, or grants security approval./appsec-analyzerSecurity assessment of one repository through the deterministic controller; writes security-assessment.md and security-assessment.yaml to a private directory per application under the user data directory, or to --output. Runs full assessments only: --incremental, --rerender, --dry-run, --base, --pr-mode, --restore-from and a free-text focus are refused. Without a budget flag the depth sets a hard budget (quick 10, standard 20, thorough 40 USD). Models are fixed per role, not taken from the session; --model, --stride-model, --triage-model, --merger-model and --reasoning-model change them. --width sets the widest progress line (72 by default). Stop a running assessment with --stop.Other plugins' skills for the same job