solo-setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese/setup
/setup
Auto-generate project workflow config from existing PRD and CLAUDE.md. Zero interactive questions — all answers extracted from project data that already exists after .
/scaffold自动从现有PRD和CLAUDE.md生成项目工作流配置。无需交互式提问——所有答案均从运行/scaffold后已存在的项目数据中提取。
When to use
使用时机
After creates a project, before . Creates so and can work.
/scaffold/plandocs/workflow.md/plan/build在/scaffold创建项目之后,/plan之前使用。生成,以便/plan和/build可以正常工作。
docs/workflow.mdMCP Tools (use if available)
MCP工具(如有可用则使用)
- — get project details, detected stack
project_info(name) - — search for dev principles, manifest, stack templates
kb_search(query) - — check project dependencies in code graph
codegraph_query(query)
If MCP tools are not available, fall back to reading local files only.
- — 获取项目详情、检测到的技术栈
project_info(name) - — 搜索开发原则、清单、技术栈模板
kb_search(query) - — 检查代码图谱中的项目依赖
codegraph_query(query)
如果MCP工具不可用,则仅回退到读取本地文件。
Steps
步骤
-
Detect project root:
- If is provided, look for a project with that name in the current directory or
$ARGUMENTSfromprojects_dir.~/.solo-factory/defaults.yaml - Otherwise use current working directory.
- Verify the directory exists and has .
CLAUDE.md - If not found, ask via AskUserQuestion.
- If
-
Check if already initialized:
- If exists, warn and ask whether to regenerate.
docs/workflow.md
- If
-
Read project data (parallel — all reads at once):
- — tech stack, architecture, commands, Do/Don't
CLAUDE.md - — problem, users, solution, features, metrics, pricing
docs/prd.md - or
package.json— exact dependency versionspyproject.toml - — available commands
Makefile - Linter configs (,
.eslintrc*,eslint.config.*,.swiftlint.yml,ruff.toml)detekt.yml
-
Read ecosystem sources (optional — enhances quality):
- Detect stack name from CLAUDE.md (look for "Stack:" or the stack name in tech section).
- If MCP available: search for stack template and dev-principles.
kb_search - Otherwise: look for and
stacks/<stack>.yamlindev-principles.mdor plugin templates directory (if accessible)..solo/ - If neither available: derive all info from CLAUDE.md + package manifest (sufficient).
-
Detect languages from package manifest:
- → TypeScript
package.json - → Python
pyproject.toml - or
*.xcodeproj→ SwiftPackage.swift - → Kotlin
build.gradle.kts
-
Create docs directory if needed:bash
mkdir -p docs -
Generate: Based on dev-principles (from MCP/KB or built-in defaults):
docs/workflow.mdmarkdown# Workflow — {ProjectName} ## TDD Policy **Moderate** — Tests encouraged but not blocking. Write tests for: - Business logic and validation - API route handlers - Complex algorithms Tests optional for: UI components, one-off scripts, prototypes. ## Test Framework {from package manifest devDeps: vitest/jest/pytest/xctest} ## Commit Strategy **Conventional Commits** Format: `<type>(<scope>): <description>` Types: feat, fix, refactor, test, docs, chore, perf, style ## Verification Checkpoints **After each phase completion:** 1. Run tests — all pass 2. Run linter — no errors 3. Run build — successful (if applicable) 4. Manual smoke test ## Branch Strategy - `main` — production-ready - `feat/<track-id>` — feature branches - `fix/<description>` — hotfixes -
Update— add workflow reference to Key Documents section if not present.
CLAUDE.md -
Show summary and suggest next step:
Setup complete for {ProjectName}! Created: docs/workflow.md — TDD moderate, conventional commits Next: /plan "Your first feature"
-
检测项目根目录:
- 如果提供了,在当前目录或
$ARGUMENTS中的~/.solo-factory/defaults.yaml下查找该名称的项目。projects_dir - 否则使用当前工作目录。
- 验证目录是否存在且包含。
CLAUDE.md - 如果未找到,通过AskUserQuestion询问用户。
- 如果提供了
-
检查是否已初始化:
- 如果已存在,发出警告并询问是否重新生成。
docs/workflow.md
- 如果
-
读取项目数据(并行操作——一次性读取所有内容):
- — 技术栈、架构、命令、注意事项
CLAUDE.md - — 问题、用户群体、解决方案、功能、指标、定价
docs/prd.md - 或
package.json— 精确的依赖版本pyproject.toml - — 可用命令
Makefile - 代码检查器配置文件(,
.eslintrc*,eslint.config.*,.swiftlint.yml,ruff.toml)detekt.yml
-
读取生态系统资源(可选——提升配置质量):
- 从CLAUDE.md中检测技术栈名称(查找“Stack:”或技术部分中的技术栈名称)。
- 如果MCP的可用:搜索技术栈模板和开发原则。
kb_search - 否则:在或插件模板目录(如果可访问)中查找
.solo/和stacks/<stack>.yaml。dev-principles.md - 如果两者都不可用:仅从CLAUDE.md和包清单中获取所有信息(已足够)。
-
从包清单检测编程语言:
- → TypeScript
package.json - → Python
pyproject.toml - 或
*.xcodeproj→ SwiftPackage.swift - → Kotlin
build.gradle.kts
-
如有需要创建docs目录:bash
mkdir -p docs -
生成: 基于开发原则(来自MCP/知识库或内置默认值):
docs/workflow.mdmarkdown# Workflow — {ProjectName} ## TDD策略 **中等强度** — 鼓励编写测试但不强制要求。为以下内容编写测试: - 业务逻辑与验证 - API路由处理器 - 复杂算法 以下内容测试可选:UI组件、一次性脚本、原型。 ## 测试框架 {从包清单的devDeps中获取:vitest/jest/pytest/xctest} ## 提交策略 **规范式提交** 格式:`<type>(<scope>): <description>` 类型:feat, fix, refactor, test, docs, chore, perf, style ## 验证检查点 **每个阶段完成后:** 1. 运行测试——全部通过 2. 运行代码检查器——无错误 3. 运行构建——成功(如适用) 4. 手动冒烟测试 ## 分支策略 - `main` — 生产就绪 - `feat/<track-id>` — 功能分支 - `fix/<description>` — 热修复分支 -
更新— 如果“关键文档”部分中没有工作流引用,则添加该引用。
CLAUDE.md -
显示摘要并建议下一步操作:
{ProjectName}的设置已完成! 已创建: docs/workflow.md — TDD中等强度,规范式提交 下一步:/plan "你的第一个功能"
Common Issues
常见问题
CLAUDE.md not found
未找到CLAUDE.md
Cause: Project not scaffolded or running from wrong directory.
Fix: Run first, or ensure you're in the project root with CLAUDE.md.
/scaffold原因: 项目未搭建脚手架或运行目录错误。
解决方法: 先运行/scaffold,或确保你处于包含CLAUDE.md的项目根目录中。
workflow.md already exists
workflow.md已存在
Cause: Previously set up.
Fix: Skill warns and asks whether to regenerate. Existing file is preserved unless you confirm overwrite.
原因: 之前已完成设置。
解决方法: 该工具会发出警告并询问是否重新生成。除非你确认覆盖,否则现有文件将被保留。
Wrong test framework detected
检测到错误的测试框架
Cause: Multiple test frameworks in devDependencies.
Fix: Skill picks the first found. Edit manually to specify the correct framework.
docs/workflow.md原因: devDependencies中存在多个测试框架。
解决方法: 该工具会选择第一个找到的框架。手动编辑以指定正确的框架。
docs/workflow.md