validate-space

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/validate-space

/validate-space

Validate that a project space has all required structure, boilerplate docs, and stays consistent with its planning docs in ideas/.
验证项目空间是否具备所有必需的结构、样板文档,并与ideas/目录中的规划文档保持一致。

Usage

使用方法

bash
/validate-space leaf-nextjs-convex    # Validate specific space
/validate-space coordinatr            # Another project
/validate-space                       # Prompt for project name
bash
/validate-space leaf-nextjs-convex    # 验证特定空间
/validate-space coordinatr            # 另一个项目
/validate-space                       # 提示输入项目名称

Validation Checklist

验证清单

Required Files (Every Space)

必需文件(所有空间通用)

FilePurposeCheck
CLAUDE.mdAI instructions for codebaseMust exist
README.mdEntry point for developersMust exist
package.json (JS/TS)Project configStack-dependent
文件用途检查要求
CLAUDE.md代码库的AI指令文档必须存在
README.md开发者入口文档必须存在
package.json (JS/TS)项目配置文件取决于技术栈

Required Directory Structure

必需目录结构

DirectoryPurposeCheck
docs/Documentation rootMust exist
docs/specs/Protocol/feature specsMust exist
docs/adrs/Architecture Decision RecordsMust exist
目录用途检查要求
docs/文档根目录必须存在
docs/specs/协议/功能规格文档必须存在
docs/adrs/架构决策记录必须存在

Required Overview Docs (in docs/)

必需概述文档(位于docs/目录下)

FilePurpose
architecture-overview.mdSystem architecture
api-overview.mdAPI documentation
data-model.mdData structures
deployment.mdDeployment guide
security.mdSecurity considerations
testing-overview.mdTesting strategy
ui-guide.mdUI patterns and components
Templates available at
shared/templates/docs/
文件用途
architecture-overview.md系统架构文档
api-overview.mdAPI文档
data-model.md数据结构文档
deployment.md部署指南
security.md安全注意事项
testing-overview.md测试策略
ui-guide.mdUI模式与组件指南
模板可在
shared/templates/docs/
路径获取

CLAUDE.md Requirements

CLAUDE.md 要求

  • Overview section with stack description
  • Project structure section
  • Commands section (dev, build, deploy)
  • Environment variables section (if applicable)
  • Link to ideas/ planning docs
  • 包含技术栈描述的概述章节
  • 项目结构章节
  • 命令章节(开发、构建、部署)
  • 环境变量章节(如适用)
  • 指向ideas/规划文档的链接

Consistency Checks

一致性检查

CheckDescription
Version syncpackage.json versions match docs (e.g., "Next.js 16" in CLAUDE.md matches
"next": "16.x"
)
Stack accuracyListed technologies actually exist in dependencies
Structure accuracyDocumented directories actually exist
Ideas linkReferenced ideas/[project]/ exists and has matching info
检查项描述
版本同步package.json中的版本与文档中的版本匹配(例如CLAUDE.md中的“Next.js 16”与
"next": "16.x"
一致)
技术栈准确性列出的技术实际存在于依赖项中
结构准确性文档中记录的目录实际存在
Ideas链接有效性引用的ideas/[project]/路径存在且信息匹配

Cross-Reference with ideas/

与ideas/目录交叉引用

CheckDescription
README.mdStack listed in ideas/ matches spaces/
project-brief.mdTechnical decisions match actual implementation
IssuesCurrent phase/status is accurate
检查项描述
README.mdideas/中列出的技术栈与spaces/中的一致
project-brief.md技术决策与实际实现匹配
问题追踪当前阶段/状态准确

Execution Flow

执行流程

1. Locate Project

1. 定位项目

bash
ls spaces/[project-name]/
Error if not found.
bash
ls spaces/[project-name]/
如果未找到则报错。

2. Check Required Files

2. 检查必需文件

Read: spaces/[project]/CLAUDE.md
Read: spaces/[project]/README.md
Read: spaces/[project]/package.json (if JS/TS)
Read: spaces/[project]/CLAUDE.md
Read: spaces/[project]/README.md
Read: spaces/[project]/package.json (if JS/TS)

3. Validate CLAUDE.md Sections

3. 验证CLAUDE.md章节

Check for required sections:
  • Overview / Stack
  • Project Structure
  • Commands
  • Environment Variables (if .env.example exists)
检查是否包含必需章节:
  • 概述/技术栈
  • 项目结构
  • 命令
  • 环境变量(如果存在.env.example)

4. Check Version Consistency

4. 检查版本一致性

Extract versions from:
  • CLAUDE.md stack description
  • ideas/[project]/README.md
  • ideas/[project]/project-brief.md
  • package.json dependencies
Flag any mismatches.
从以下位置提取版本信息:
  • CLAUDE.md中的技术栈描述
  • ideas/[project]/README.md
  • ideas/[project]/project-brief.md
  • package.json依赖项
标记所有不匹配项。

5. Verify Directory Structure

5. 验证目录结构

Check required directories exist:
bash
ls -la spaces/[project]/docs/
ls -la spaces/[project]/docs/specs/
ls -la spaces/[project]/docs/adrs/
Check overview docs present:
bash
ls spaces/[project]/docs/*.md
检查必需目录是否存在:
bash
ls -la spaces/[project]/docs/
ls -la spaces/[project]/docs/specs/
ls -la spaces/[project]/docs/adrs/
检查概述文档是否齐全:
bash
ls spaces/[project]/docs/*.md

Should have: architecture-overview.md, api-overview.md, data-model.md,

应包含:architecture-overview.md、api-overview.md、data-model.md、

deployment.md, security.md, testing-overview.md, ui-guide.md

deployment.md、security.md、testing-overview.md、ui-guide.md


Compare documented structure in CLAUDE.md against actual:
```bash
ls -la spaces/[project]/
ls -la spaces/[project]/src/ (if documented)

将CLAUDE.md中记录的结构与实际结构对比:
```bash
ls -la spaces/[project]/
ls -la spaces/[project]/src/ (if documented)

6. Cross-Reference ideas/

6. 与ideas/目录交叉引用

bash
Read: ideas/[project]/README.md
Read: ideas/[project]/project-brief.md
Check stack/version consistency.
bash
Read: ideas/[project]/README.md
Read: ideas/[project]/project-brief.md
检查技术栈/版本一致性。

Validation Report

验证报告

markdown
undefined
markdown
undefined

Space Validation: [Project Name]

空间验证:[项目名称]

Status

状态

  • Space location: spaces/[project]/
  • Ideas location: ideas/[project]/ (exists/missing)
  • 空间路径:spaces/[project]/
  • Ideas路径:ideas/[project]/(存在/缺失)

Required Files

必需文件

✅ CLAUDE.md - Present ✅ README.md - Present ✅ package.json - Present
✅ CLAUDE.md - 已存在 ✅ README.md - 已存在 ✅ package.json - 已存在

Required Directories

必需目录

✅ docs/ - Present ✅ docs/specs/ - Present ✅ docs/adrs/ - Present
✅ docs/ - 已存在 ✅ docs/specs/ - 已存在 ✅ docs/adrs/ - 已存在

Overview Docs (in docs/)

概述文档(位于docs/目录下)

✅ architecture-overview.md - Present ✅ api-overview.md - Present ✅ data-model.md - Present ✅ deployment.md - Present ✅ security.md - Present ✅ testing-overview.md - Present ✅ ui-guide.md - Present
✅ architecture-overview.md - 已存在 ✅ api-overview.md - 已存在 ✅ data-model.md - 已存在 ✅ deployment.md - 已存在 ✅ security.md - 已存在 ✅ testing-overview.md - 已存在 ✅ ui-guide.md - 已存在

CLAUDE.md Sections

CLAUDE.md 章节

✅ Overview/Stack - Complete ✅ Project Structure - Complete ⚠️ Commands - Missing deploy command ✅ Environment Variables - Complete
✅ 概述/技术栈 - 完整 ✅ 项目结构 - 完整 ⚠️ 命令章节 - 缺失部署命令 ✅ 环境变量 - 完整

Version Consistency

版本一致性

✅ Next.js: 16.1.3 (package.json) matches "Next.js 16" (docs) ❌ React: 19.0.0 (package.json) but docs say "React 18"
✅ Next.js: 16.1.3 (package.json) 与文档中的“Next.js 16”匹配 ❌ React: 19.0.0 (package.json) 但文档中写的是“React 18”

Ideas Cross-Reference

Ideas交叉引用

✅ ideas/leaf-nextjs-convex/ exists ✅ Stack matches between spaces/ and ideas/ ⚠️ project-brief.md says "Next.js 15" - outdated
✅ ideas/leaf-nextjs-convex/ 存在 ✅ spaces/与ideas/中的技术栈匹配 ⚠️ project-brief.md 中写的是“Next.js 15” - 已过时

Issues Found

发现的问题

  1. React version mismatch in documentation
  2. project-brief.md has outdated version
  1. 文档中React版本不匹配
  2. project-brief.md 版本已过时

Recommendations

建议

  1. Update React version in CLAUDE.md
  2. Update project-brief.md to say Next.js 16
  3. Fill in overview doc templates with project-specific content
undefined
  1. 更新CLAUDE.md中的React版本
  2. 将project-brief.md中的版本更新为Next.js 16
  3. 用项目特定内容填充概述文档模板
undefined

Fixing Missing Structure

修复缺失的结构

If docs/ structure is missing, create it:
bash
mkdir -p spaces/[project]/docs/specs
mkdir -p spaces/[project]/docs/adrs
cp shared/templates/docs/*.md spaces/[project]/docs/
如果docs/结构缺失,执行以下命令创建:
bash
mkdir -p spaces/[project]/docs/specs
mkdir -p spaces/[project]/docs/adrs
cp shared/templates/docs/*.md spaces/[project]/docs/

When to Use

使用场景

  • After initial project scaffolding
  • Before starting implementation work
  • After upgrading dependencies
  • Monthly maintenance checks
  • When onboarding to existing project
  • 项目初始搭建完成后
  • 开始实施工作前
  • 依赖升级后
  • 月度维护检查
  • 加入现有项目时

Integration

集成流程

/validate-space → Fix issues → /validate-space again → /implement
/validate-space → 修复问题 → 再次运行/validate-space → /implement

Stack-Specific Checks

技术栈专属检查

Next.js Projects

Next.js 项目

  • Check for
    next.config.js
    or
    next.config.ts
  • Verify
    src/app/
    structure for App Router
  • Check for
    public/
    directory
  • 检查是否存在
    next.config.js
    next.config.ts
  • 验证App Router对应的
    src/app/
    结构
  • 检查是否存在
    public/
    目录

Convex Projects

Convex 项目

  • Check for
    convex/
    directory
  • Verify
    convex/schema.ts
    exists
  • Check for
    convex/_generated/
  • 检查是否存在
    convex/
    目录
  • 验证
    convex/schema.ts
    存在
  • 检查是否存在
    convex/_generated/

General JS/TS

通用JS/TS项目

  • Verify
    tsconfig.json
    if TypeScript
  • Check for
    .env.example
    if env vars documented
  • Verify
    .gitignore
    exists
  • 如果是TypeScript项目,验证
    tsconfig.json
    存在
  • 如果文档中提到环境变量,检查是否存在
    .env.example
  • 验证
    .gitignore
    存在",