spec-driven-claude-code: Command for Claude Code

.claude/commands/secure.md

secure is a command for Claude Code from dinhnguyenngoc/spec-driven-claude-code. It costs 13 tokens per session (4,165 once invoked), scanned A, original, MIT.

A pre-development security review that examines a planned system using STRIDE, a method for categorizing threats such as impersonation, data changes, and information leaks.

In plain words
What is it for?
Use it to review an architecture, security requirements, permission rules, and OWASP Top 10 concerns before implementation.
Why use it?
It finds design-level security risks before code is written and turns them into requirements and safeguards. Code scanning and dependency checks are handled elsewhere.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md; mentions subagents.

This is dinhnguyenngoc/spec-driven-claude-code's own configuration. It tells Claude Code how to work on spec-driven-claude-code itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything spec-driven-claude-code configures →

Reuse

Borrowing it

Nothing to install: this file belongs to dinhnguyenngoc/spec-driven-claude-code. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/dinhnguyenngoc/spec-driven-claude-code/main/.claude/commands/secure.md
Clone the repo
git clone --depth 1 https://github.com/dinhnguyenngoc/spec-driven-claude-code

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for secure

README.md
[![agentmods](https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/secure/github.svg)](https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/secure)
Your own site
<a href="https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/secure"><img src="https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/secure/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for secure

Your own site · 80×15
<a href="https://agentmods.dev/commands/dinhnguyenngoc/spec-driven-claude-code/secure"><img src="https://agentmods.dev/badge/commands/dinhnguyenngoc/spec-driven-claude-code/secure.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 4,165 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.04165
Opus 5.5 $0.00005 $0.01666
Sonnet 5.5 $0.00003 $0.00833
Haiku 4.5 $0.00001 $0.00417

Measured 1mo ago against content hash a6c91978b6e6, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

secure scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/secure.md · 212 lines

How it starts

The opening of the file, as written. The whole thing — 212 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/secure — Pre-Development Security Review

"Security by design, not afterthought."

Purpose

Review architecture for security concerns BEFORE writing any code. Identify threats, define security requirements, and establish controls upfront.

Workspace Mode: if the session root declares Mode: workspace → resolve the target repo per CLAUDE.md §Workspace Mode before anything else; every path, probe, and gate below is relative to the target repo, and the workspace disk-check applies at the gate.

Scope

This command is DESIGN-LEVEL threat modeling — no code exists yet.

  • ✅ STRIDE on architecture, ADR review, security requirements, OWASP Top 10 compliance check
  • ❌ NOT: code scanning, dependency audit, SAST, secret-grep — those belong to /scan (post-development)

If a finding requires reading source code to confirm, defer it to /scan.

Prerequisites

Input files (must exist before /secure starts):

  • specs/SPEC.md — for asset inventory, data sensitivity, NFRs, and the Permission Matrix (the business authz basis for IDOR / Elevation-of-Privilege threats — the downstream contract spec.md §Permission Matrix declares)
  • architecture/ARCHITECTURE.md + its Open Questions section
  • architecture/adr/*.md — every ADR is a design decision with security implications; read them all (brownfield delta: read the ADRs touching the delta surface — see §Brownfield Mode)
  • plans/plan.md — for mitigation → task ID mapping (Phase 3). Required for a per-change run only; a whole-system baseline run (brownfield, no active change-set) legitimately has no plan yet and uses evidence ids / Backlog owners instead — see §Brownfield Mode → Baseline run.
  • .claude/rules/security.md — non-negotiables

Boilerplate templates (fixed — the agent fills in data, does not re-author structure):

  • .claude/templates/STRIDE_TEMPLATE.md — Asset inventory, STRIDE reference, Risk matrix, Threat block, Highest-Risk Surface table, THREAT_MODEL skeleton
  • .claude/templates/OWASP_TEMPLATE.md — OWASP Top 10 (2021) 10-row table, Security Requirements 6-domain checklist, Residual Risks table

Read the full file on GitHub · 212 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 212 lines · 13 tokens per session scan A a6c91978b6e6

Subscribe to this mod's changes

secure is a command published in the GitHub repository dinhnguyenngoc/spec-driven-claude-code (21 stars, last pushed 2mo ago), licensed MIT. It adds 13 tokens to every session and 4,165 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.