Solo Scaffold — Solo 脚手架
v1.5.1Solo 脚手架工具。
详细分析 ▾
运行时依赖
版本
Universalize: remove project-specific references, add SearXNG recommendation
安装命令 点击复制
技能文档
Scaffold a complete project from PRD + stack template. Creates directory structure, configs, CLAUDE.md, git repo, and pushes to GitHub. Studies existing projects via SoloGraph for consistent patterns, uses Context7 for latest library versions.
Steps
- 解析 arguments 从
$ARGUMENTS— extract和.
templates/stacks/*.yaml (source 的 truth).
If MCP project_info available, also show detected stacks from active projects.
List stack names with one-line descriptions from each YAML's description field.
- Project name 应该 kebab-case.- 加载 org defaults 从
~/.solo-factory/defaults.yaml:
org_domain (e.g. com.mycompany), apple_dev_team, github_org, projects_dir
- 如果 file doesn't exist, ask 通过 AskUserQuestion:
- "什么 reverse-domain prefix 对于 bundle IDs?" (e.g. com.mycompany)
- "Apple Developer Team ID?" (可选, leave 空 如果 否 iOS)
- 创建 ~/.solo-factory/defaults.yaml 带有 answers 对于 future runs
- 替换 , , placeholders 在...中 所有 generated files- 加载 stack + PRD + principles:
- Look 对于 stack YAML: 搜索 对于 stacks/ 在...中 插件 templates (通过 kb_search 或 Glob).
- 如果 stack YAML 不 found, 使用 built-在...中 knowledge 的 stack (packages, structure, deploy).
- Check 如果 PRD exists: docs/prd.md 或 搜索 current directory 对于 prd.md
- 如果 不: generate basic PRD 模板
- Look 对于 dev principles: 搜索 对于 dev-principles.md 或 使用 built-在...中 SOLID/DRY/KISS/TDD principles.
- Study existing projects 通过 SoloGraph (learn 从 own codebase — critically):
Before generating code, study active projects with the same stack. Don't blindly copy — existing projects may have legacy patterns or mistakes. Evaluate what's actually useful.
a. Find sibling projects — use project_info() to list active projects, filter by matching stack.
Example: for ios-swift, find existing projects with matching stack.
b. Architecture overview — codegraph_explain(project=" for each sibling.
Gives: directory layers, key patterns (base classes, protocols, CRUD), top dependencies, hub files.
c. Search for reusable patterns — project_code_search(query=":
- 搜索 对于 stack-specific patterns: "MVVM ViewModel", "SwiftData 模型", "AVFoundation recording"
- 搜索 对于 shared infrastructure: "Makefile", "project.yml", ".swiftlint.yml"
- 搜索 对于 services: "服务 protocol", "actor 服务"
d. Check shared packages — codegraph_query("MATCH (p:Project)-[:DEPENDS_ON]->(pkg:Package) WHERE p.name = '.
Collect package versions for reference (but verify with Context7 for latest).
e. Critically evaluate what to adopt vs skip: - Adopt: consistent directory structure, Makefile targets, 配置 patterns (.swiftlint.yml, project.yml) - Adopt: proven infrastructure patterns (actor services, protocol-based DIP) - Skip 如果 outdated: 旧的 API patterns (ObservableObject → @Observable), deprecated deps - Skip 如果 overcomplicated: unnecessary abstractions, patterns don't fit 新的 project's needs - Always prefer: Context7 latest best practices 在...上 旧的 project patterns 当...时 它们 conflict
Goal: Generated code 应该 feel consistent 带有 portfolio 但是 使用 best 可用 patterns, 不 只是 相同 旧的 ones. Limit to 2-3 sibling projects to keep research focused.
- Context7 research (latest 库 versions 和 best practices):
mcp__context7__resolve-库-id — 查找 Context7 库 ID
- mcp__context7__query-docs — 查询 "latest version, project setup, recommended file structure, best practices"
- Collect: current versions, recommended directory structure, configuration patterns, setup commands
- Limit 到 3-4 最多 important packages 到 keep research focused- Show plan + 获取 confirmation 通过 AskUserQuestion:
/ (从 defaults.yaml 或 current directory)
- Stack name 和 键 packages 带有 versions 从 Context7
- Proposed directory structure
- Confirm 或 adjust 之前 creating files- 创建 project directory:
mkdir -p /
- 创建 file structure based 在...上 stack. SGR-第一个: always 开始 带有 domain schemas/models 之前 任何 logic 或 views. Every project gets these common files:
//
├── CLAUDE.md # AI-friendly project docs (map, not manual — see Harness Engineering)
├── Makefile # Common commands (run, test, build, lint, deploy, integration)
├── README.md # Human-friendly project docs
├── docs/
│ ├── prd.md # Copy of PRD
│ ├── QUALITY_SCORE.md # Domain quality grades (harness: garbage collection)
│ └── ARCHITECTURE.md # Module boundaries and dependency rules
├── cli/ # CLI utility — mirrors core business logic (CLI-First Testing principle)
│ └── main.ts|py # Deterministic pipeline entry point (no LLM required)
├── .claude/
│ └── skills/ # Product-specific workflow skills
│ └── dev/
│ └── SKILL.md # Dev workflow skill (run, test, deploy)
└── .gitignore # Stack-specific ignores
CLI-第一个 Testing: generate cli/ directory 带有 stub imports core business logic 从 lib/ (或 equivalent). CLI 应该 run main pipeline deterministically 没有 requiring LLM, network, 或 UI. enables 使 integration 对于 pipeline verification. See dev-principles.md → "CLI-第一个 Testing".
### .claude/skills/dev/SKILL.md — product dev workflow skill
Generate a skill that teaches Claude how to work with THIS specific project. Structure:
---
name: -dev
description: Dev workflow for — run, test, build, deploy. Use when working on features, fixing bugs, or deploying changes. Do NOT use for other projects.
license: MIT
metadata:
author:
version: "1.0.0"
allowed-tools: Read, Grep, Glob, Bash, Write, Edit
---
Body should include:
- Stack: 键 packages, versions, 在哪里 configs live
- Commands: 使 dev, 使 test, 使 build, 使 deploy (从 Makefile)
- Architecture: directory structure, naming conventions, 键 patterns
- Testing: 如何 到 run tests, 在哪里 test files live, testing conventions
- Common tasks: 添加 新的 page/screen, 添加 API endpoint, 添加 模型
This makes every scaffolded project immediately Claude-friendly — new sessions get project context via the skill.
MCP server (可选): 如果 PRD indicates data/AI/developer product, 也 generate MCP server stub.
See templates/mcp-skills-bundle.md for the full "MCP + Skills bundle" pattern and rules for when to generate MCP.
Then add stack-specific files. See references/stack-structures.md for per-stack file listings (8 stacks: nextjs, ios, kotlin, cloudflare, astro-static, astro-hybrid, python-api, python-ml).
- Generate Makefile — stack-adapted 带有:
help,dev,test,lint,格式,build,clean,deploytargets.
integration target 如果 project 有 CLI 或 deterministic pipeline (stub 带有 评论 如果 不 尚未 implemented)
- ios-swift 必须 也 include: generate (xcodegen), 归档 (xcodebuild 归档), 打开 (打开 .xcarchive 对于 Distribute)
- Makefile canonical command 接口 — /build 和 /review 使用 使 targets 代替 的 raw commands- Generate CLAUDE.md 对于 新的 project:
.claude/skills/ 带有 descriptions
- Directory structure
- Common commands (reference 使 help)
- SGR / Domain-第一个 section
- Architecture principles (从 dev-principles)
- Harness Engineering section (从 templates/principles/harness-engineering.md):
- CLAUDE.md philosophy: " file 地图, 不 manual — keep ~100 lines, point 到 docs/"
- Harness health checklist (subset relevant 到 project)
- Architectural constraints: 模块 boundaries, data validation 在 boundaries
- Agent legibility: lint errors 必须 include remediation instructions
- Anti-patterns: don't put knowledge 在...中 Slack/Docs, don't micromanage implementation
- 做/Don't sections
- MCP Integration section (可选, 如果 MCP tools 可用):
Lists available MCP tools: project_code_search, kb_search, session_search, codegraph_query, project_info, web_search- Generate README.md — project name, description, prerequisites, setup, run/test/deploy.
- Generate .gitignore — stack-specific patterns.
- 复制 PRD 到 docs/: 复制 从 knowledge base 或 generate 在...中 place.
- Git init + 第一个 commit:
cd /
git init && git add . && git commit -m "Initial project scaffold Stack:
Generated by /scaffold"
- 创建 GitHub 私有 repo + 推送:
cd /
gh repo create --private --source=. --push
- 注册 project + 索引 code (可选, 如果 MCP tools 可用):
project_code_reindex MCP tool 可用, 索引 新的 project 对于 code 搜索:
mcp__solograph__project_code_reindex(project="")
- 输出 summary:
Project scaffolded! Path: /
GitHub: https://github.com//
Stack:
PRD: docs/prd.md
CLAUDE: configured
Skills: .claude/skills/dev/ (project workflow)
Next steps:
cd /
# pnpm install / uv sync / etc.
# pnpm dev / uv run ... / etc.
Then: /setup → /plan "First feature" → /build
Verification
Before reporting "project scaffolded":
- 验证 所有 generated files exist (ls directory tree).
- Run install command (
pnpm install,uv 同步, etc.) — 必须 succeed. - Run dev/build command 如果 applicable — 必须 不 错误.
- 验证 git init + 第一个 commit succeeded (
git log --oneline -1). - 验证 GitHub repo creation (
gh repo 视图或 check URL).
Never say "scaffold complete" without running the install and verifying it works.
Common Issues
Stack YAML 不 found
Cause: Stack 模板 missing 从templates/stacks/ 或 不 symlinked.
Fix: Skill uses built-在...中 knowledge 如果 模板 不 found. 到 fix: ensure solo-factory/templates/stacks/.yaml exists.GitHub repo creation fails
Cause:gh CLI 不 authenticated 或 repo name 已经 taken.
Fix: Run gh auth 登录 第一个. 如果 name taken, choose 不同 project name.Context7 queries 失败
Cause: MCP server 不 running 或 Context7 rate limited. Fix: Skill proceeds 带有 stack YAML versions 作为 fallback. Context7 enhances 但是 不 必填.org defaults missing
Cause:~/.solo-factory/defaults.yaml 不 created.
Fix: Run /init 第一个 对于 one-时间 setup, 或 skill 将 ask 对于 bundle ID 和 team ID interactively.
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制