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.
$ARGUMENTS — extract and .templates/stacks/*.yaml (source of 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.
~/.solo-factory/defaults.yaml:org_domain (e.g. com.mycompany), apple_dev_team, github_org, projects_dircom.mycompany)~/.solo-factory/defaults.yaml with answers for future runs, , placeholders in all generated filesstacks/.yaml in plugin templates (via kb_search or Glob).docs/prd.md or search current directory for prd.mddev-principles.md or use built-in SOLID/DRY/KISS/TDD principles.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=":
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:
Goal: Generated code should feel consistent with your portfolio but use the best available patterns, not just the same old ones.
Limit to 2-3 sibling projects to keep research focused.
mcp__context7__resolve-library-id — find the Context7 library IDmcp__context7__query-docs — query "latest version, project setup, recommended file structure, best practices"/ (from defaults.yaml or current directory)```bash
mkdir -p
```
```
├── 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-First Testing: generate a cli/ directory with a stub that imports core business logic from lib/ (or equivalent). The CLI should run the main pipeline deterministically without requiring LLM, network, or UI. This enables make integration for pipeline verification. See dev-principles.md → "CLI-First Testing".
### .claude/skills/dev/SKILL.md — product dev workflow skill
Generate a skill that teaches Claude how to work with THIS specific project. Structure:
```yaml
---
name:
description: Dev workflow for
license: MIT
metadata:
author:
version: "1.0.0"
allowed-tools: Read, Grep, Glob, Bash, Write, Edit
---
```
Body should include:
make dev, make test, make build, make deploy (from Makefile)This makes every scaffolded project immediately Claude-friendly — new sessions get project context via the skill.
MCP server (optional): If PRD indicates a data/AI/developer product, also 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).
help, dev, test, lint, format, build, clean, deploy targets.integration target if the project has a CLI or deterministic pipeline (stub with a comment if not yet implemented)generate (xcodegen), archive (xcodebuild archive), open (open .xcarchive for Distribute)/build and /review use make targets instead of raw commands.claude/skills/ with descriptionsmake help)templates/principles/harness-engineering.md): Lists available MCP tools: project_code_search, kb_search, session_search, codegraph_query, project_info, web_search
```bash
cd
git init && git add . && git commit -m "Initial project scaffold
Stack:
Generated by /scaffold"
```
```bash
cd
gh repo create
```
project_code_reindex MCP tool is available, index the new project for code search:```
mcp__solograph__project_code_reindex(project="
```
```
Project scaffolded!
Path:
GitHub: https://github.com/
Stack:
PRD: docs/prd.md
CLAUDE: configured
Skills: .claude/skills/dev/ (project workflow)
Next steps:
cd
Then: /setup → /plan "First feature" → /build
```
Before reporting "project scaffolded":
pnpm install, uv sync, etc.) — must succeed.git log --oneline -1).gh repo view or check URL).Never say "scaffold complete" without running the install and verifying it works.
Cause: Stack template missing from templates/stacks/ or not symlinked.
Fix: Skill uses built-in knowledge if template not found. To fix: ensure solo-factory/templates/stacks/ exists.
Cause: gh CLI not authenticated or repo name already taken.
Fix: Run gh auth login first. If name taken, choose a different project name.
Cause: MCP server not running or Context7 rate limited.
Fix: Skill proceeds with stack YAML versions as fallback. Context7 enhances but is not required.
Cause: ~/.solo-factory/defaults.yaml not created.
Fix: Run /init first for one-time setup, or skill will ask for bundle ID and team ID interactively.
共 1 个版本