원클릭으로
spec-review
Use when 用户调用 /spec-review, or 需要检查 .claude/code-specs/ 库内容是否过期、冲突或模板漂移。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Use when 用户调用 /spec-review, or 需要检查 .claude/code-specs/ 库内容是否过期、冲突或模板漂移。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Use when 用户调用 /design-plan, or 需要为复杂跨服务需求(多服务改动 / 数据库 DDL / 新增对外接口 / 架构调整)产出可评审的技术方案文档,典型用户是技术主管 / 资深研发。简单单服务改动走 /workflow-spec,Bug 修复走 /fix-bug。
Use when asked to review a diff, do a pre-commit code review, or review staged/branch changes. Supports staged diffs, branch diffs, and session mode that reviews only files edited in the current conversation context.
Use when 用户调用 /plan-archive, or 三阶段研发流程的阶段三:在所有模块研发上线后,根据实际代码改动回写阶段一技术方案 + 项目级架构文档(docs/architecture / docs/contracts / docs/assets/概要设计 等)。
Use when 用户说「快速规划」「轻规划」「不走 workflow」「plan 一下」「quick plan」, or 需求清晰、作用域明确、可一次性规划完成的简单到中等任务。复杂项目(跨 module / 新子系统 / 需追溯)或需要正式需求文档 / PRD 请用 /workflow-spec。
Use when 用户调用 /spec-bootstrap, or 项目尚未建立 .claude/code-specs/ 骨架且需要初始化 code-specs 体系。
Use when 用户调用 /spec-update, or 工作中沉淀出新 convention / 接口 contract / 模式需要落到 .claude/code-specs/, or execute 末尾终审(workflow-execute Step 7)建议沉淀 code-spec。
| name | spec-review |
| description | Use when 用户调用 /spec-review, or 需要检查 .claude/code-specs/ 库内容是否过期、冲突或模板漂移。 |
| argument-hint | [--check-upgrade] |
只读的 code-specs 库review命令。走声明式review模型:按文件类型分档 lint + 过期 + 冲突 + 模板漂移对账,输出报告供用户决定后续动作。
扫描每个 {pkg}/{layer}/*.md(排除 index.md 与 guides/)时,按内容特征分档:
## 1. Scope / Trigger 或 ## 2. Signatures → contract 文件(走 7 段 lint)❌ missing-section{{...}} 或 (To be filled) → 📝 draft⚠️ abstract-content必备段存在性:
## Overview / ## Rules / ## DO / DON'T / ## Common Mistakes 四段(标题不区分大小写与连字符变体)❌ missing-section📝 draftv2.2 新维度 no-examples:
``` fenced block) → ⚠️ no-examplesv2.2 新维度 no-rationale:
**Why**: 行(也接受 Why: / 原因: 变体) → ⚠️ no-rationale可选扩展段不做强制检查:Patterns / Examples / Quick Reference / Reference Tables / Strategy / Checklist 存在与否不影响 lint。
{pkg}/{layer}/ 下除 index.md 外无任何主题文件 → ℹ️ empty-layer(advisory,不计入问题数)git log -1 --format=%ct -- <file>
⚠️ stale🛑 very staleguides/*.md 中指向的主题文件是否存在 → broken-pointerindex-mismatcherror-handling.md)声明不一致 → ⚠️ cross-package-drift(advisory,建议考虑上提,但不要求)读取 .claude/code-specs/.template-hashes.json,与当前 core/specs/spec-templates/ 的模板 sha256 对比:
core/specs/spec-templates/manifests/ 最新 manifest,按 migrations[] 分类列出建议(rename / safe-file-delete / delete / protected_paths)local.md 的 Template Baseline 表(已废弃)扫描所有 core/skills/**/SKILL.md 和 core/skills/**/references/*.md 中形如 <!-- snapshot YYYY-MM-DD ... --> 的注释:
⚠️ snapshot-stale,按注释中 refresh via: 提示提醒用户跑对应命令复核硬编码 enum / 工具清单180 天 →
🛑 snapshot-very-stale
注释格式 convention:<!-- snapshot YYYY-MM-DD — <说明>. refresh via: <命令>. See ADR-0001 Decision 3. -->
这是抓 MCP 服务端动态 enum 漂移的唯一被动防线(运行时 fresh introspection 是主动防线)。spec-review 是 review-only,只提示不修复——用户拿命令自查后再决定要不要 /spec-update 更新注释 + 内容。
定性判断,不设数字阈值——spec-review 是声明式 LLM review,无机读引擎,措辞一律用"明显 / 疑似重复"。四类:
**Why**: 文本,在单文件内明显重复出现(典型:Rules 段与 Common Mistakes 段各写了一遍完整 Bad/Good + Why)→ ⚠️ intra-file-dupindex.md 的 Overview 与某 convention 文件 Overview 在讲同一身份定义;或同一 fenced 目录树在 component-guidelines.md 与 directory-structure.md 各画一遍 → ⚠️ intra-package-dupguides/ 无对应承载条目 → ⚠️ cross-package-dup(建议上提 guides/,各包改指针)⚠️ boilerplate-dup(建议收敛到根 index.md,layer-index 改指针)全部 advisory,不计入阻塞问题数。修复属用户决策(见"与其他命令的关系")。
.claude/code-specs/**/*.md,按文件类型分档# Spec Review — {{date}}
## Summary
- Convention files scanned: N₁
- Contract files scanned: N₂
- Missing sections: M
- Draft: K₁
- no-examples: K₂ (convention only)
- no-rationale: K₃ (convention only)
- Stale files: S
- Broken pointers: P
- Advisories: empty-layer × E, cross-package-drift × D
- Snapshot stale: > 90d × Q₁, > 180d × Q₂
- Redundancy advisories: intra-file × R₁, intra-package × R₂, cross-package × R₃, boilerplate × R₄
- Template drift pending: U
## Convention Lint
| File | Missing | Draft | no-examples | no-rationale |
|------|---------|-------|-------------|--------------|
## Contract Lint
| File | Missing | Draft | Abstract |
## Stale Files
| File | Last Updated | Age (days) | Status |
## Advisories(非阻塞)
- [empty-layer] {pkg}/{layer}/ 下暂无主题文件
- [cross-package-drift] error-handling.md 在 pkg-a / pkg-b 规则声明不一致
## Redundancy(非阻塞)
- [intra-file-dup] {pkg}/{layer}/component-guidelines.md Rules 与 Common Mistakes 重复同一 Bad/Good
- [intra-package-dup] {pkg}/{layer}/index.md 与 component-guidelines.md Overview 重述同一身份
- [cross-package-dup] "export * 污染" 规则在 pkg-a / pkg-b / pkg-c 逐字重复 → 建议上提 guides/
- [boilerplate-dup] N 个 layer-index 的 Quality Check 段逐字相同 → 建议收敛到根 index.md
## Snapshot Stale (ADR-0001 Decision 3)
| File | Snapshot | Age (days) | Status | Refresh command |
|------|----------|------------|--------|-----------------|
## Conflicts & Broken Pointers
- [broken-pointer] guides/api.md → {pkg}/backend/deleted-spec.md
- [index-mismatch] {pkg}/frontend/index.md lists missing.md
## Template Drift
- convention-template.md: baseline sha256:abc → current sha256:def(已升级)
- manifests/v5.2.0.json: 0 rename, 0 safe-file-delete, 0 delete
~/.claude/workflows/{pid}/reports/spec-review-{{date}}.md/spec-review # 全量审查
/spec-review --check-upgrade # 仅做模板漂移 / manifest 对账
/spec-update 手动补齐/quick-plan 或人工清理;spec-review 保持只读,不自动 dedup —— 哪份是 canonical、各包特有差异要不要留都是人类判断workflow-execute Step 7)走人工对照local.md 的 Template Baseline 表(已废弃),模板漂移治理走 .template-hashes.json/quick-plan;spec-update 侧加轻量预防(fuzzy 扩兄弟文件 + 跨包上提提示 + R3/R4 比对)