/sniper-init
Initialize SNIPER v3 framework in the current project.
Process
1. Check Existing State
- If
.sniper/config.yamlexists, ask user: "SNIPER is already initialized. Reinitialize? (existing config will be backed up)" - If reinitializing, copy
.sniper/config.yamlto.sniper/config.yaml.bak
2. Auto-Detect Project
Scan the project directory to detect:
Language (check in order):
tsconfig.jsonor*.tsfiles → TypeScriptpackage.json→ JavaScriptpyproject.tomlorrequirements.txt→ Pythongo.mod→ GoCargo.toml→ Rustpom.xmlorbuild.gradle→ Java- Fall back to
--languageargument or ask user
Package Manager:
pnpm-lock.yaml→ pnpmyarn.lock→ yarnbun.lockb→ bunpackage-lock.json→ npmuv.lock→ uvpoetry.lock→ poetry
Framework:
next.config.*→ Next.jsnuxt.config.*→ Nuxtvite.config.*→ Viteangular.json→ Angular
Test Runner:
vitest.config.*→ Vitestjest.config.*→ Jestpytest.iniorconftest.py→ Pytest
Commands (from package.json scripts or Makefile):
- Look for
test,lint,build,typecheckscripts
3. Gather User Input
Ask the user (with auto-detected defaults pre-filled):
- Project name (default: directory name)
- Project type (saas, api, mobile, cli, library, monorepo)
- One-line description
- Max concurrent teammates (default: 5)
- Confirm detected stack
4. Scaffold Structure
Create the following directory structure:
15 lines
.sniper/
config.yaml ← Generated from template + user input + auto-detection
checkpoints/
gates/
retros/
self-reviews/
checklists/ ← Copied from @sniper.ai/core/checklists/
memory/
learnings/ ← Unified learning store (replaces signals/)
signals/ ← Legacy — kept for backward compat, migrated by memory-curator
archive/ ← Deprecated learnings archived here
.claude/
agents/ ← Copied from @sniper.ai/core/agents/
settings.json ← Merge hooks from @sniper.ai/core/hooks/
CLAUDE.md ← Generated from template5. Apply Plugins
If plugins are configured (or auto-detected):
- Read each plugin's
plugin.yaml - Merge plugin commands into config
- Copy plugin mixins to
.claude/personas/cognitive/ - Merge plugin hooks into
.claude/settings.json
6. Confirm
Display summary:
- Files created/modified
- Detected stack
- Suggested next step: "Run
/sniper-flowto start your first protocol"
Rules
- NEVER overwrite existing project source files
- ALWAYS back up existing config before reinitializing
- ALWAYS show the user what will be created before doing it
- Respect
.gitignore— add.sniper/checkpoints/and.sniper/gates/if not present
