skills/swe-scaffold-project/SKILL.md
Initialize workflow for new empty projects. Creates core memories and directory structure.
npx skillsauth add earthmanweb/serena-workflow-engine swe-scaffold-projectInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
If starting a new session, first read workflow initialization:
mcp__plugin_swe_serena__read_memory("wf/WF_INIT")
Follow WF_INIT instructions before executing this skill.
Initialize workflow system for new or empty projects.
/swe-init — creates memories and prompts for features without running the full autonomous verification agent (MCP checks, LSP install, VSCode extension, etc.)Prefer /swe-init for first-time setup — it runs bootstrap, scaffold, AND verification in one autonomous flow.
Automatically suggested when:
.serena/memory/ directory existsINDEX_FEATURES.md file existsINDEX_FEATURES.md has zero features registeredBEFORE any other detection, check for a git repository.
if ! git rev-parse --git-dir > /dev/null 2>&1; then
echo "No git repository found in this project directory."
fi
If no git repo exists:
git init
echo "# Project" > README.md # only if no README exists
git add -A
git commit -m "Initial commit"
Why git is needed:
.git/ to detect project root (_get_project_root() in init gate)CLAUDE_PROJECT_DIR with .git/ fallback for root resolution.gitignore integration for ignoring WM_*.md, .serena/swe-state/, etc.get_project_root() falls back to os.getcwd() which may be wrong in subdirectories# Git repo guaranteed by Stage 0 (or user warned)
PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
# Detect package manager
[ -f "package.json" ] && echo "npm"
[ -f "composer.json" ] && echo "composer"
[ -f "Cargo.toml" ] && echo "cargo"
[ -f "requirements.txt" ] && echo "pip"
[ -f "go.mod" ] && echo "go"
# Detect primary language
find . -name "*.ts" -o -name "*.js" | head -1 # TypeScript/JavaScript
find . -name "*.py" | head -1 # Python
find . -name "*.php" | head -1 # PHP
find . -name "*.rs" | head -1 # Rust
find . -name "*.go" | head -1 # Go
mkdir -p .serena/memory
mkdir -p .claude/skills
mkdir -p .claude/hooks
Templates are rendered with detected project values, not just copied.
The bootstrap script (swe-bootstrap.py) auto-detects project name, primary language, test framework, and other values from manifests (package.json, composer.json, Cargo.toml, etc.) and file extensions. These are substituted into {{variable}} placeholders in template files.
Template variables auto-detected:
| Variable | Source |
|----------|--------|
| {{project_name}} | Manifest name field, or directory name |
| {{primary_language}} | Most common language by file count |
| {{languages}} | All detected languages, comma-separated |
| {{test_framework}} | Detected from devDependencies/require-dev |
| {{test_commands}} | Default commands for detected framework |
| {{test_root}} | Default test directory for detected framework |
| {{year}} | Current year |
Templates rendered (from memories/templates/):
Additionally, create these non-template memories:
# INDEX_FEATURES
## Registered Features
(none yet - run /swe-feature-onboard to add)
## Quick Start
1. `/swe-feature-onboard [KEY]` - Full wizard
2. `/swe-onboard-quick [KEY]` - Fast setup
# ARCH_INDEX - Architecture Overview
## Project Type
[Detected from manifests or unknown]
## Primary Language
[Detected — e.g., "typescript", "php", "python"]
## Framework
[Detected from manifests or none]
## Structure
(Run /swe-feature-onboard to populate)
After creation, verify templates were filled out — check that {{project_name}} and {{primary_language}} are no longer raw placeholders in the generated files. If they are, the bootstrap detection failed and they should be filled manually.
PROJECT SCAFFOLDED
Created:
Your project needs at least one feature to enable code changes.
What is the main codebase?
Options:
If swarm MCP available:
AI-powered codebase analysis available.
[A] Full DAA analysis (creates DOM_*, SYS_*, detailed INDEX_*)
[B] Quick scan (basic structure)
[C] Skip
If swe-setup-complete.json has bootstrapped: true but not complete: true, update it:
PLUGIN_VERSION=$(jq -r '.version' "$SWE_PLUGIN_ROOT/.claude-plugin/plugin.json" 2>/dev/null || echo "unknown")
cat > .serena/swe-setup-complete.json << EOF
{
"complete": true,
"timestamp": "$(date -Iseconds)",
"version": "${PLUGIN_VERSION}",
"scaffolded": true,
"verified": false
}
EOF
This unblocks the full init gate for subsequent sessions. Running /swe-init later will add verified: true after full verification.
If user skips feature setup, enable minimal mode:
{
"mode": "minimal",
"allowed_states": ["WF_START", "WF_RESEARCH", "WF_CLARIFY"],
"blocked_states": ["WF_EXECUTE", "WF_CHECKPOINT"],
"message": "Feature onboarding required for code changes"
}
## Skill Return
- **Skill**: swe-scaffold-project
- **Status**: [success|needs_clarification]
- **Project Root**: [path]
- **Language**: [detected]
- **Framework**: [detected or none]
- **Memories Created**: MEMORY.md, FEEDBACK_RESPONSE_FORMAT, FEEDBACK_READ_DOCS_MEANS_LIST, REF_MCP_BROWSER_DEVTOOLS, INDEX_FEATURES, ARCH_INDEX
- **Next Step Hint**: WF_START or /swe-feature-onboard
> **Skill /swe-scaffold-project complete** - Project scaffolded, run /swe-feature-onboard to add first feature
testing
Verify implementation against requirements and standards
development
Code exploration and research without making changes
development
Test-driven debugging for failing tests or bugs
tools
Review architecture compliance before execution