core/capabilities/orchestration/onboard/SKILL.md
First-run project setup that detects tech stack, selects quality packs, and generates .sage/ directory with CLAUDE.md. For new projects, guides technology selection. Use when no .sage/ directory exists, when the user says "set up sage", "initialize", "get started", or when starting a brand new project from scratch.
npx skillsauth add xoai/sage onboardInstall 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.
Set up Sage for a project. Detect what exists, configure what's needed, generate the agent instructions. This is the FIRST thing that runs.
Core Principle: A beginner should go from "I have a project" (or "I have an idea") to "Sage is configured and ready" in under 3 minutes.
.sage/ directory exists).sage/ directory and prompts: "This project isn't set up
with Sage yet. Want me to set it up? (Takes ~2 minutes)"Check what exists:
.sage/ exist? → Already onboarded. Offer to re-scan or update.package.json / requirements.txt / pubspec.yaml exist? → Existing project.Branch accordingly:
Read dependency files to detect the tech stack:
package.json → detect: next, react, vue, svelte, express, supabase, firebase
pubspec.yaml → detect: flutter, firebase
requirements.txt / pyproject.toml → detect: django, flask, fastapi
go.mod → detect: gin, echo, fiber
Produce a stack summary:
DETECTED STACK:
Frontend: Next.js 14 (App Router), React 19, Tailwind CSS 4
Backend: Supabase (@supabase/ssr, @supabase/supabase-js)
Testing: Vitest, Testing Library
Build: Turbopack
Show to user: "I detected this stack. Anything I missed or got wrong?"
Based on detected stack, select which packs activate:
PACKS TO LOAD:
L1: web (web application detected)
L1: baas (Supabase detected)
L2: nextjs (Next.js detected)
L2: react (React detected)
L3: stack-nextjs-supabase (Next.js + Supabase detected)
Show to user: "These packs will guide code quality. Look right?"
Scan the codebase for established patterns:
Save to .sage/conventions.md.
Create the .sage/ directory and all files. See Output below.
One question: "What are you building? Describe it in a sentence or two."
Examples of what they might say:
Based on what they described, recommend a stack. Ask focused questions:
Question 1: Platform "Is this a web app, mobile app, or both?"
Question 2: Backend complexity "Will this need complex backend logic (custom algorithms, complex queries, multi-step workflows), or is it mostly storing/fetching data with user accounts?"
Question 3: Scale expectation (only if unclear) "Is this an MVP/prototype, or do you need it production-ready from day one?"
Based on answers, recommend:
RECOMMENDED STACK:
You're building a web app with user accounts and data storage.
For fast MVP delivery, I recommend:
Frontend: Next.js (App Router) + React + Tailwind CSS
Backend: Supabase (auth, database, storage — no backend to build)
Testing: Vitest + Testing Library
Deploy: Vercel
This gets you from idea to deployed app fastest.
Ready to go with this, or want to explore alternatives?
If user wants alternatives, explain trade-offs briefly. Don't overwhelm.
After stack approval, create the project structure:
npx create-next-app, flutter create, etc.)Same as A4 — create .sage/ directory. Conventions will be minimal for
a new project (establish them as the first code is written).
.sage/ Directory.sage/
├── config.yaml # Project configuration
├── conventions.md # Discovered or established patterns
├── decisions.md # Shared decision log (agent + human)
├── docs/ # Project-level knowledge (flat, skill-prefixed)
├── work/ # Per-initiative (YYYYMMDD-slug/ subfolders)
└── gates/ # Quality gate scripts and config
sage-version: "1.0.0"
project-name: "<detected or provided>"
mode-default: build
packs:
enabled:
- web
- baas
- nextjs
- react
- stack-nextjs-supabase
constitution:
base: sage/core/constitution/base.constitution.md
preset: startup # or enterprise, opensource
# Decisions
Shared log for significant decisions and context.
Both the AI agent and human collaborators write here.
### YYYY-MM-DD — [Decision title]
[What was decided, why, alternatives considered.]
# Project Conventions
Discovered by Sage onboard on <date>.
Update this file as conventions evolve.
## Naming
- Files: <detected pattern>
- Components: <detected pattern>
- Variables: <detected pattern>
## Structure
- Components: <detected layout>
- Tests: <detected location and framework>
- Styles: <detected approach>
## Patterns
- State management: <detected or TBD>
- Data fetching: <detected or TBD>
- Error handling: <detected or TBD>
Use the template at core/context-loader/CLAUDE.md.template:
{{CONSTITUTION_PRINCIPLES}} with the loaded constitution{{LOADED_PACKS}} with summaries from enabled packs{{CONVENTIONS}} with .sage/conventions.md contentSave to project root as CLAUDE.md.
If .claude/mcp.json or .sage/mcp.json exists, run tool discovery:
bash sage/runtime/mcp/discover.sh .
This connects to each configured MCP server, lists available tools, and caches
the manifest at .sage/mcp-manifest.json. The CLAUDE.md generation includes
a lightweight tool summary (~50 tokens per server) so you know what's available
without consuming context with full schemas.
If no MCP config exists, skip this step. Layer 1 tools (bash scripts) are always available regardless of MCP configuration.
Show the user: "Sage is set up. Here's what I configured: [summary]. Tell me what to build, or say 'sage help' for guidance on what to do next."
MUST (violation = broken setup or confused user):
.sage/ directory and CLAUDE.md — they're the minimum viable setup.SHOULD (violation = suboptimal experience):
MAY (context-dependent):
development
Branch-per-initiative git discipline for all delivery workflows. Defines branch naming by workflow, the propose-confirm creation protocol, dirty-tree and detached-HEAD handling, the always user-gated merge protocol, worktree support for parallel sessions, and abandonment cleanup. Activates only in git repositories — silently inactive everywhere else. Use when starting /build, /fix, /architect, or /build-x at Standard+ scope, when resuming an initiative, when offering a merge at a completion checkpoint, or when the user wants a second concurrent initiative.
development
Drives task-by-task execution from an approved plan with quality gates between each task. Reads the plan, finds the next incomplete task, dispatches implementation, validates, updates progress, and continues. Use after a plan is approved and the user says "go", "start building", "execute the plan", or "implement the feature".
testing
Preserves and restores context across agent sessions using plan file checkboxes as source of truth. Use when starting a new session, resuming previous work, ending a session, or when the user says "continue from last time", "what was I doing", or "save progress".
tools
Captures agent mistakes, corrections, and discovered gotchas so they are not repeated. Use when: (1) a command or operation fails unexpectedly, (2) the user corrects the agent, (3) the agent discovers non-obvious behavior through debugging, (4) an API or tool behaves differently than expected, (5) a better approach is found for a recurring task. Also searches past learnings before starting tasks to avoid known pitfalls. Activate alongside the sage-memory skill — they share the same MCP backend but serve different purposes (sage-memory = codebase knowledge, sage-self-learning = agent mistakes and gotchas).