/pdlc:pdlc-security <模块 | 服务名>from pdlc
Runs dependency vulnerability and secret scanning tools, records exit codes, then manually reviews auth, injection, and sensitive data handling. Produces a security audit report.
Ships in pdlc. 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.
⛔ IRON LAW · 不可违反的硬门禁(工具型命令)
本命令不是主链路上的阶段:不追加 history,不改 current_stage / next_step / last_phase_result,也不为此分配功能ID。以下规则不可协商:
违反任一条 = 立即中止当前命令,输出违规详情,等待人工介入。
对指定服务或应用进行安全审计,检查常见安全漏洞。
OWASP Top 10 检查
认证与授权
数据安全
依赖安全:交给下面「工作流程」第 2 步的扫描工具判定,不凭记忆断言某个版本有没有漏洞
确定范围:本次审计的服务 / 模块 / 功能,及其技术栈(看清单文件:package.json、requirements*.txt / pyproject.toml、Cargo.toml、go.mod、Gemfile、pom.xml / build.gradle)
先跑真实扫描工具(客观结果,先于人工判断)。按技术栈挑本机已安装的工具,每条记录命令原文、退出码、发现数:
| 类别 | 技术栈 | 命令 |
|---|---|---|
| 依赖漏洞 | Node | npm audit --json / pnpm audit --json / yarn npm audit --json |
| 依赖漏洞 | Python | pip-audit |
| 依赖漏洞 | Rust | cargo audit |
| 依赖漏洞 | Go | govulncheck ./... |
| 依赖漏洞 | Ruby | bundle audit check |
| 依赖漏洞 | Java | 项目已配的 OWASP dependency-check 插件任务 |
| 密钥泄露 | 任意 | gitleaks detect --no-banner(看工作树用 --no-git) |
| 静态分析 | 任意 | 项目已配置的 semgrep / bandit / gosec 等(有配置才跑) |
人工审阅:按上方审计范围 1–3 读代码,补工具查不到的部分(鉴权逻辑、越权、敏感数据流向)
写报告:工具结果与人工发现分两节,结论里写明哪些维度有工具证据、哪些只有人工判断
⚠️ 必须创建文件,不可仅在对话中输出。
【必须创建文件】 在 docs/04_testing/security/ 下创建安全审计报告:
<功能ID>-audit.md(不针对具体功能时用 YYYYMMDD-<服务名>-audit.md)<!-- PDLC-TRACE -->
<!-- 功能名称: <服务名> -->
<!-- 阶段: 安全审计 -->
<!-- 创建时间: <ISO 8601> -->
docs/04_testing/security/ 目录🌐 Output language for generated artifacts
All generated artifacts (PRDs, design docs, code comments, review reports, test plans, deployment manuals, changelog entries, etc.) follow this policy:
Default — match the conversation language exactly:
Explicit override always wins: when the user specifies a language for an artifact (e.g. "write the PRD in English", "用英文写 API 设计文档", "output the deploy doc in Japanese"), use that language for that artifact, regardless of conversation language.
Mixed-language requirements: if the user wants some artifacts in one language and others in a different language (common: Chinese PRD + English API docs for partners), honour each per-artifact instruction.
Uncertain: if you cannot reliably detect the conversation language, ask once before producing the first artifact.
This policy applies to content (prose, comments, headings). It does not override technical conventions like English variable names, English git commit subjects, or English error codes when the project's conventions require them.
审计目标: $ARGUMENTS
命令完成后必须输出以下格式的最终消息:
✅ <阶段名> 完成:<主要产出物路径>
📊 自检:<通过数>/<总数> 通过(若有未通过,附要点)
📦 状态快照:docs/.pdlc-state/<feature-id>.json
👉 下一步:/pdlc-<next_step>
(如果有分叉)或 /pdlc-<alt>(条件:<选择依据>)
规则:
next_step,此时输出 👉 下一步:(本次流程结束,无后续)/pdlc-tdd;若测试已齐 → /pdlc-review"本命令的 handoff 输出:
✅ 安全审计报告 完成
📦 产出:docs/04_testing/security/<feature-id>-audit.md
👉 下一步:(本次流程结束,无后续)
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kanfu-panda/pdlc-skills --plugin pdlc38 skills in this plugin
/pdlc-add-app在已有项目里加一个前端应用(先探测布局,跟随现有目录与技术栈);新项目一次性初始化用 /pdlc-bootstrap/pdlc-add-service在已有项目里加一个后端服务(先探测布局,跟随现有目录与技术栈);新项目一次性初始化用 /pdlc-bootstrap/pdlc-adopt已有代码、还没有 PDLC 文档的老项目接入——只读扫描后逆向生成基线文档并做健康检查,不改代码;空目录新项目用 /pdlc-bootstrap/pdlc-api-mock按 API 设计文档生成 Mock 数据与 Mock 服务配置,供前端联调/pdlc-arch架构分析(生成/更新 docs/ARCHITECTURE.md 系统架构总览 · surface 型)/pdlc-bootstrap空目录从一句话描述初始化新项目(服务 / 应用拆分、技术栈、目录骨架与 PDLC 文档目录);已有代码的项目用 /pdlc-adoptOther plugins' skills for the same job