/pdlc:pdlc-perf <功能ID | 优化目标>from pdlc
Performs performance optimization with a measurement-first approach: establish baseline, change one item at a time, re-measure with the same command, and report actual before/after numbers. Covers backend (database, caching, API, code) and frontend (loading, runtime, network, caching) dimensions.
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。以下规则不可协商:
违反任一条 = 立即中止当前命令,输出违规详情,等待人工介入。
对指定服务或应用进行性能分析并提出优化方案。
没有测量就没有优化:改代码之前先有基线,改完之后用同一把尺子复测。
EXPLAIN ANALYZE、Lighthouse CLI、hyperfine、time 等。
找不到可重复的测量手段 → 只做分析、给方案,不改代码,报告里标「未测量」docs/00_standards/test-commands.yml 的 unit,测试必须仍然通过docs/04_testing/perf/ 下创建性能优化报告:<功能ID>-report.md(不针对具体功能时用 YYYYMMDD-<服务名>-report.md)⚠️ 必须创建文件,不可仅在对话中输出。
文档顶部包含 PDLC 追溯头:
<!-- PDLC-TRACE -->
<!-- 功能名称: <服务名> -->
<!-- 阶段: 性能优化 -->
<!-- 创建时间: <ISO 8601> -->
报告内容:
| 序号 | 位置 | 问题描述 | 优化方案 | 测量命令 | 优化前 | 优化后 | 结论 |
|---|
「优化前 / 优化后」填实测中位数(带单位与环境);没测的填「未测量」,结论写「未验证」,不得填预期值冒充。
创建后验证:确认文件已存在于 docs/04_testing/perf/ 目录
🌐 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/perf/<feature-id>-report.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