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 namebash
/validate-space leaf-nextjs-convex # 验证特定空间
/validate-space coordinatr # 另一个项目
/validate-space # 提示输入项目名称Validation Checklist
验证清单
Required Files (Every Space)
必需文件(所有空间通用)
| File | Purpose | Check |
|---|---|---|
| CLAUDE.md | AI instructions for codebase | Must exist |
| README.md | Entry point for developers | Must exist |
| package.json (JS/TS) | Project config | Stack-dependent |
| 文件 | 用途 | 检查要求 |
|---|---|---|
| CLAUDE.md | 代码库的AI指令文档 | 必须存在 |
| README.md | 开发者入口文档 | 必须存在 |
| package.json (JS/TS) | 项目配置文件 | 取决于技术栈 |
Required Directory Structure
必需目录结构
| Directory | Purpose | Check |
|---|---|---|
| docs/ | Documentation root | Must exist |
| docs/specs/ | Protocol/feature specs | Must exist |
| docs/adrs/ | Architecture Decision Records | Must exist |
| 目录 | 用途 | 检查要求 |
|---|---|---|
| docs/ | 文档根目录 | 必须存在 |
| docs/specs/ | 协议/功能规格文档 | 必须存在 |
| docs/adrs/ | 架构决策记录 | 必须存在 |
Required Overview Docs (in docs/)
必需概述文档(位于docs/目录下)
| File | Purpose |
|---|---|
| architecture-overview.md | System architecture |
| api-overview.md | API documentation |
| data-model.md | Data structures |
| deployment.md | Deployment guide |
| security.md | Security considerations |
| testing-overview.md | Testing strategy |
| ui-guide.md | UI patterns and components |
Templates available at
shared/templates/docs/| 文件 | 用途 |
|---|---|
| architecture-overview.md | 系统架构文档 |
| api-overview.md | API文档 |
| data-model.md | 数据结构文档 |
| deployment.md | 部署指南 |
| security.md | 安全注意事项 |
| testing-overview.md | 测试策略 |
| ui-guide.md | UI模式与组件指南 |
模板可在 路径获取
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
一致性检查
| Check | Description |
|---|---|
| Version sync | package.json versions match docs (e.g., "Next.js 16" in CLAUDE.md matches |
| Stack accuracy | Listed technologies actually exist in dependencies |
| Structure accuracy | Documented directories actually exist |
| Ideas link | Referenced ideas/[project]/ exists and has matching info |
| 检查项 | 描述 |
|---|---|
| 版本同步 | package.json中的版本与文档中的版本匹配(例如CLAUDE.md中的“Next.js 16”与 |
| 技术栈准确性 | 列出的技术实际存在于依赖项中 |
| 结构准确性 | 文档中记录的目录实际存在 |
| Ideas链接有效性 | 引用的ideas/[project]/路径存在且信息匹配 |
Cross-Reference with ideas/
与ideas/目录交叉引用
| Check | Description |
|---|---|
| README.md | Stack listed in ideas/ matches spaces/ |
| project-brief.md | Technical decisions match actual implementation |
| Issues | Current phase/status is accurate |
| 检查项 | 描述 |
|---|---|
| README.md | ideas/中列出的技术栈与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/*.mdShould 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.mdCheck stack/version consistency.
bash
Read: ideas/[project]/README.md
Read: ideas/[project]/project-brief.md检查技术栈/版本一致性。
Validation Report
验证报告
markdown
undefinedmarkdown
undefinedSpace 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
发现的问题
- React version mismatch in documentation
- project-brief.md has outdated version
- 文档中React版本不匹配
- project-brief.md 版本已过时
Recommendations
建议
- Update React version in CLAUDE.md
- Update project-brief.md to say Next.js 16
- Fill in overview doc templates with project-specific content
undefined- 更新CLAUDE.md中的React版本
- 将project-brief.md中的版本更新为Next.js 16
- 用项目特定内容填充概述文档模板
undefinedFixing 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 → /implementStack-Specific Checks
技术栈专属检查
Next.js Projects
Next.js 项目
- Check for or
next.config.jsnext.config.ts - Verify structure for App Router
src/app/ - Check for directory
public/
- 检查是否存在 或
next.config.jsnext.config.ts - 验证App Router对应的 结构
src/app/ - 检查是否存在 目录
public/
Convex Projects
Convex 项目
- Check for directory
convex/ - Verify exists
convex/schema.ts - Check for
convex/_generated/
- 检查是否存在 目录
convex/ - 验证 存在
convex/schema.ts - 检查是否存在
convex/_generated/
General JS/TS
通用JS/TS项目
- Verify if TypeScript
tsconfig.json - Check for if env vars documented
.env.example - Verify exists
.gitignore
- 如果是TypeScript项目,验证 存在
tsconfig.json - 如果文档中提到环境变量,检查是否存在
.env.example - 验证 存在",
.gitignore