sw-adopt
CommandExplicitly adopt an existing work into the current worktree.
Run Specwright eval suite. Spawns subagents to run skills in fixture workdirs, then grades results.
$ npx -y skills add Obsidian-Owl/specwright --agent claude-code
description: Run Specwright eval suite. Spawns subagents to run skills in fixture workdirs, then grades results.
Run eval cases by spawning subagents for skill invocation, then grading the results.
/sw-eval --suite skill # Run all skill evals /sw-eval --suite skill --case sw-init-fresh-ts # Run one case /sw-eval --suite skill --dry-run # List cases without running /sw-eval --suite integration # Run integration evals
Parse the arguments from the command input. The arguments follow the patterns above.
Run this to load and validate the eval suite (output goes to stderr):
python -m evals --suite <SUITE_NAME> --dry-run 2>&1
This prints each eval case ID and its fixture path. If `--dry-run` was requested, stop here and show the output.
If `--case` was specified, filter to only that case from the output.
Create a timestamped results directory:
python -c "
import os
from datetime import datetime, timezone
ts = datetime.now(timezone.utc).strftime('%Y%m%dT%H%M%S')
results_dir = os.path.join('evals', 'results', f'run-{ts}')
os.makedirs(results_dir, exist_ok=True)
print(results_dir)
"Save this as RESULTS_DIR for all subsequent steps.
For each eval case (from the dry-run output), do the following:
Copy the fixture to a temp working directory using Bash:
python -c "
import shutil, tempfile, os
fixture_path = os.path.join(os.path.dirname(os.path.abspath('evals/__init__.py')), 'evals', '<FIXTURE_PATH_FROM_DRY_RUN>')
workdir = tempfile.mkdtemp(prefix='eval-')
shutil.copytree(fixture_path, workdir, dirs_exist_ok=True)
print(workdir)
"Save the workdir path for the next steps.
Spawn a subagent using the Agent tool:
Agent( prompt="<THE EVAL PROMPT - resolve from evals.json prompt_template + prompt_args> Work in this directory: <WORKDIR> Change to this directory first, then perform the task. Accept all defaults. Do not ask clarifying questions.", subagent_type="general-purpose", description="Eval: <EVAL_ID>" )
The prompt should describe the task naturally — do NOT use slash command syntax like `/sw-init`. Instead, describe what the skill does:
Wait for the subagent to complete.
Run grading via Python:
python -m evals --grade-workdir <WORKDIR> --eval-id <EVAL_ID> --suite <SUITE_NAME> --output <RESULTS_DIR>/evals/<EVAL_ID>/trial-1/grading.json
Print to the user:
✓ <EVAL_ID> — pass_rate: <RATE>
rm -rf <WORKDIR>
After all cases complete:
python -m evals --aggregate <RESULTS_DIR>
Show the final summary table:
| Eval Case | Pass Rate | Duration | |-----------|-----------|----------| | ... | ... | ... | Results: <RESULTS_DIR>
Craft quality software with AI discipline. Spec-driven development plugin for Claude Code and Opencode — quality gates, adversarial testing, and evidence capture.
Explicitly adopt an existing work into the current worktree.
Periodic codebase health check for systemic technical debt.
TDD implementation of one work unit. If branch-head freshness blocks and policy is rebase or merge, recover in-stage; manual is…
Investigation-first debugging. Scope, investigate, diagnose, then fix/log/defer.
Interactive solution architecture with adversarial critique and assumption surfacing.
Implement tasks incrementally — build, test, verify, commit. Add "auto" to run the whole plan in one approved pass.