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
/scaffold
creates a project, before
/plan
. Creates
docs/workflow.md
so
/plan
and
/build
can work.
在/scaffold创建项目之后,/plan之前使用。生成
docs/workflow.md
,以便/plan和/build可以正常工作。

MCP Tools (use if available)

MCP工具(如有可用则使用)

  • project_info(name)
    — get project details, detected stack
  • kb_search(query)
    — search for dev principles, manifest, stack templates
  • codegraph_query(query)
    — check project dependencies in code graph
If MCP tools are not available, fall back to reading local files only.
  • project_info(name)
    — 获取项目详情、检测到的技术栈
  • kb_search(query)
    — 搜索开发原则、清单、技术栈模板
  • codegraph_query(query)
    — 检查代码图谱中的项目依赖
如果MCP工具不可用,则仅回退到读取本地文件。

Steps

步骤

  1. Detect project root:
    • If
      $ARGUMENTS
      is provided, look for a project with that name in the current directory or
      projects_dir
      from
      ~/.solo-factory/defaults.yaml
      .
    • Otherwise use current working directory.
    • Verify the directory exists and has
      CLAUDE.md
      .
    • If not found, ask via AskUserQuestion.
  2. Check if already initialized:
    • If
      docs/workflow.md
      exists, warn and ask whether to regenerate.
  3. Read project data (parallel — all reads at once):
    • CLAUDE.md
      — tech stack, architecture, commands, Do/Don't
    • docs/prd.md
      — problem, users, solution, features, metrics, pricing
    • package.json
      or
      pyproject.toml
      — exact dependency versions
    • Makefile
      — available commands
    • Linter configs (
      .eslintrc*
      ,
      eslint.config.*
      ,
      .swiftlint.yml
      ,
      ruff.toml
      ,
      detekt.yml
      )
  4. Read ecosystem sources (optional — enhances quality):
    • Detect stack name from CLAUDE.md (look for "Stack:" or the stack name in tech section).
    • If MCP
      kb_search
      available: search for stack template and dev-principles.
    • Otherwise: look for
      stacks/<stack>.yaml
      and
      dev-principles.md
      in
      .solo/
      or plugin templates directory (if accessible).
    • If neither available: derive all info from CLAUDE.md + package manifest (sufficient).
  5. Detect languages from package manifest:
    • package.json
      → TypeScript
    • pyproject.toml
      → Python
    • *.xcodeproj
      or
      Package.swift
      → Swift
    • build.gradle.kts
      → Kotlin
  6. Create docs directory if needed:
    bash
    mkdir -p docs
  7. Generate
    docs/workflow.md
    :
    Based on dev-principles (from MCP/KB or built-in defaults):
    markdown
    # 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
  8. Update
    CLAUDE.md
    — add workflow reference to Key Documents section if not present.
  9. Show summary and suggest next step:
    Setup complete for {ProjectName}!
    
    Created:
      docs/workflow.md — TDD moderate, conventional commits
    
    Next: /plan "Your first feature"
  1. 检测项目根目录:
    • 如果提供了
      $ARGUMENTS
      ,在当前目录或
      ~/.solo-factory/defaults.yaml
      中的
      projects_dir
      下查找该名称的项目。
    • 否则使用当前工作目录。
    • 验证目录是否存在且包含
      CLAUDE.md
    • 如果未找到,通过AskUserQuestion询问用户。
  2. 检查是否已初始化:
    • 如果
      docs/workflow.md
      已存在,发出警告并询问是否重新生成。
  3. 读取项目数据(并行操作——一次性读取所有内容):
    • CLAUDE.md
      — 技术栈、架构、命令、注意事项
    • docs/prd.md
      — 问题、用户群体、解决方案、功能、指标、定价
    • package.json
      pyproject.toml
      — 精确的依赖版本
    • Makefile
      — 可用命令
    • 代码检查器配置文件(
      .eslintrc*
      ,
      eslint.config.*
      ,
      .swiftlint.yml
      ,
      ruff.toml
      ,
      detekt.yml
  4. 读取生态系统资源(可选——提升配置质量):
    • 从CLAUDE.md中检测技术栈名称(查找“Stack:”或技术部分中的技术栈名称)。
    • 如果MCP的
      kb_search
      可用:搜索技术栈模板和开发原则。
    • 否则:在
      .solo/
      或插件模板目录(如果可访问)中查找
      stacks/<stack>.yaml
      dev-principles.md
    • 如果两者都不可用:仅从CLAUDE.md和包清单中获取所有信息(已足够)。
  5. 从包清单检测编程语言:
    • package.json
      → TypeScript
    • pyproject.toml
      → Python
    • *.xcodeproj
      Package.swift
      → Swift
    • build.gradle.kts
      → Kotlin
  6. 如有需要创建docs目录:
    bash
    mkdir -p docs
  7. 生成
    docs/workflow.md
    基于开发原则(来自MCP/知识库或内置默认值):
    markdown
    # 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>` — 热修复分支
  8. 更新
    CLAUDE.md
    — 如果“关键文档”部分中没有工作流引用,则添加该引用。
  9. 显示摘要并建议下一步操作:
    {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
/scaffold
first, or ensure you're in the project root with CLAUDE.md.
原因: 项目未搭建脚手架或运行目录错误。 解决方法: 先运行/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
docs/workflow.md
manually to specify the correct framework.
原因: devDependencies中存在多个测试框架。 解决方法: 该工具会选择第一个找到的框架。手动编辑
docs/workflow.md
以指定正确的框架。