core/skills/sw-init/SKILL.md
Initializes Specwright in a project. Detects stack, asks about practices, creates constitution and charter, configures quality gates and hooks.
npx skillsauth add obsidian-owl/specwright sw-initInstall 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 Specwright in this project by understanding how the user works,
what they're building, and what quality standards they expect. Produce
configuration and anchor documents that will guide all future work. Tracked
project artifacts should be shared across developers and agent sessions via
Git; runtime session state stays local to each clone or worktree. New
interactive installs should prefer project-visible runtime roots under
.specwright-local/, while git-admin roots under .git/specwright/ remain
compatibility-only.
When complete, ALL of the following exist:
{projectArtifactsRoot}/config.json -- detected + configured project settings{projectArtifactsRoot}/CONSTITUTION.md -- development practices the AI must follow{projectArtifactsRoot}/CHARTER.md -- technology vision and project identity{repoStateRoot}/work/ -- shared work root, initialized and empty{worktreeStateRoot}/session.json -- initialized detached top-level session for
the current worktreeOptional (created if the user opts in):
{projectArtifactsRoot}/TESTING.md -- testing strategy: boundaries,
infrastructure, mock allowances/sw-status to confirm the active
runtime roots and detached session state.Quality gates are configured in config (all six default to enabled; user may disable).
Worktree context (LOW freedom):
worktreeContext per protocols/context.md.linked, explain that tracked project artifacts under
{projectArtifactsRoot} are shared across developers and agent sessions via
Git, while runtime session state stays local to each clone or worktree under
{repoStateRoot} and {worktreeStateRoot}.{worktreeStateRoot}/session.json./sw-init will create the
tracked project-artifact root plus repo-level runtime state under the Git
common dir and a session root for the current worktree. This is a warning,
not a block.Detection (MEDIUM freedom):
Survey (MEDIUM freedom):
{projectArtifactsRoot}/LANDSCAPE.md per protocols/landscape.md format. User approves before saving.User conversation (HIGH freedom):
Constitution creation (HIGH freedom):
Charter creation (HIGH freedom):
Testing strategy creation (HIGH freedom):
{projectArtifactsRoot}/TESTING.md.protocols/testing-strategy.md for document structure and boundary classifications.internal (test with real
components), external (mock with contracts), or expensive (mock with rationale)protocols/testing-strategy.md Test Commands section. Omit if no tiers configured.Git workflow configuration (MEDIUM freedom):
git-admin roots or use project-visible roots, and recommend project-visible for Claude-oriented installs unless the user has a strong reason to keep runtime files hidden under .git/..specwright/works for new interactive installs unless the user explicitly prefers clone-local-only artifacts. Keep runtime mode separately from tracked work-artifact publication; project-level anchor docs remain project artifacts and runtime session state stays local-only.git.targets and git.freshness in config.json, seeding branch-role defaults and freshness checkpoints from the detected workflow strategy while preserving baseBranch as a compatibility alias and without requiring users to define a custom branch DSL.config.json git section per protocols/git.md. Record git.runtime.mode / git.runtime.projectVisibleRoot separately from tracked work-artifact publication, and record any optional work-artifact publication choice in config instead of inferring it from .git/ paths or symlinks.Configuration (LOW freedom):
{projectArtifactsRoot}/config.json with detected and configured values.{projectArtifactsRoot}/research/ and
{projectArtifactsRoot}/learnings/. If survey produced LANDSCAPE.md, write
it under {projectArtifactsRoot}.{repoStateRoot}/work/ for shared runtime work records and
{worktreeStateRoot}/ for the current worktree session.{worktreeStateRoot}/session.json as a detached top-level session for
the current worktree. Initialize attachedWorkId: null, current branch when
available, mode: "top-level", and fresh lastSeenAt.{projectArtifactsRoot}, then write repaired runtime state to
{repoStateRoot} and {worktreeStateRoot}.protocols/state.md for state file format.Gate configuration (MEDIUM freedom):
{ "gates": { "build": { "enabled": true }, ... } }.
Configure thresholds per user expectations.commands.test:integration in config.json. Skip if user answers none.commands.test:smoke. Skip if user answers none.
Empty or declined answers are not written to config (tiers are optional).Backlog configuration (MEDIUM freedom):
markdown — writes to {projectArtifactsRoot}/BACKLOG.md (default, always available)github-issues — creates GitHub Issues via gh CLI (requires gh auth login)github-issues selected: ask for label name (default: specwright-backlog).backlog.type and backlog.label in config.json.markdown. Backlog config is always optional.Experimental features (LOW freedom):
experimental section to config.json.{ "experimental": { "agentTeams": { "enabled": false, "maxTeammates": 3, "requirePlanApproval": true } } }protocols/state.md -- workflow.json initializationprotocols/context.md -- config.json formatprotocols/git.md -- git config field reference and strategy definitionsprotocols/landscape.md -- codebase reference document format| Condition | Action | |-----------|--------| | Existing Specwright tracked/runtime roots detected | Ask user: repair or reconfigure the existing install, or abort | | No dependency manifest found | Ask user about language and framework directly | | User unsure about practices | Suggest sensible defaults based on detected stack, let them adjust | | Old config.json git schema detected | Show diff of old vs new fields. Offer migration with AskUserQuestion. Preserve existing values, add new fields with defaults. | | Compaction during init | Check which files exist, resume from next missing artifact |
testing
Explicitly adopt an existing work into the current worktree after validating live ownership, stale sessions, and branch consistency.
testing
Orchestrates quality gates for the current work unit. Runs enabled gates in dependency order, produces an aggregate evidence report with gate handoff.
tools
Syncs the local repository by fetching all remotes, updating the base branch, and removing stale local branches that are not protected by live sessions or helper worktrees.
data-ai
Shows current Specwright state for this worktree, the attached work, repo-wide active works, gate results, and lock status. Supports --reset, --cleanup, and --repair {unitId}.