sw-build

sw-build is a skill for Claude Code, Codex from Obsidian-Owl/specwright. It costs 31 tokens per session (2,186 once invoked), scanned A, original, MIT.

A test-driven implementation workflow for one unit of coding work. Test-driven development (TDD) means writing a failing test first, making it pass, and then improving the code without changing its behavior.

In plain words
What is it for?
Use it to write tests, implement the planned changes, refactor them, run integration and regression checks, and commit each completed task.
Why use it?
It breaks implementation into smaller verified steps and records progress after each task. This makes failures easier to locate and leaves the work ready for a separate verification stage.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/obsidian-owl/specwright/sw-build
Any agent
npx skills add Obsidian-Owl/specwright --skill sw-build
Clone the repo
git clone --depth 1 https://github.com/Obsidian-Owl/specwright

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sw-build

README.md
[![agentmods](https://agentmods.dev/badge/skills/obsidian-owl/specwright/sw-build.svg)](https://agentmods.dev/skills/obsidian-owl/specwright/sw-build)
Your own site
<a href="https://agentmods.dev/skills/obsidian-owl/specwright/sw-build"><img src="https://agentmods.dev/badge/skills/obsidian-owl/specwright/sw-build.svg" alt="Measured on agentmods" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,186 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.02186
Opus 5 $0.00015 $0.01093
Sonnet 5 $0.00006 $0.00437
Haiku 4.5 $0.00003 $0.00219

Measured 5d ago against content hash c8e4b67ecc4a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sw-build scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

core/skills/sw-build/SKILL.md · 116 lines

How it starts

The opening of the file, as written. The whole thing — 116 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Specwright Build

Goal

Implement the current work unit with TDD. The per-task loop is RED → GREEN → REFACTOR; end-of-unit integration and regression checks live in one optional after-build phase.

Inputs

  • {worktreeStateRoot}/session.json -- selected work for this worktree
  • {repoStateRoot}/work/{selectedWork.id}/workflow.json, {workDir}/spec.md, {workDir}/plan.md
  • {workArtifactsRoot}/{selectedWork.id}/design.md, {workDir}/context.md
  • {workArtifactsRoot}/{selectedWork.id}/approvals.md -- durable design and unit approval ledger when present
  • {projectArtifactsRoot}/CONSTITUTION.md, {projectArtifactsRoot}/config.json

Outputs

  • After each task: failing tests, passing implementation, task commit, workflow progress, updated {workDir}/implementation-rationale.md, refreshed {repoStateRoot}/work/{selectedWork.id}/units/{selectedWork.unitId}/stage-report.md
  • After all tasks: as-built notes in plan.md, three-line handoff to /sw-verify, ready-to-verify build state; the handoff points at Artifacts: {repoStateRoot}/work/{selectedWork.id}/units/{selectedWork.unitId}/stage-report.md

Constraints

Execution model (LOW freedom): Run in the foreground in the current turn. "Autonomous" means unattended decisions inside this build, not background execution.

Stage boundary (LOW freedom): Follow protocols/stage-boundary.md. Implement only the active unit; never create pull requests, run gh pr create, or invoke /sw-ship. Before the terminal handoff, write {repoStateRoot}/work/{selectedWork.id}/units/{selectedWork.unitId}/stage-report.md; the handoff points at it and the Next line is Next: /sw-verify.

Branch setup (LOW freedom): First action before coding: resolve the session-selected work from the current worktree, verify that no other live top-level worktree owns it, then check out the feature branch from config.git.branchPrefix and sync it per protocols/git.md. The selected work's recorded targetRef, when present, is the first branch-resolution input via protocols/git.md; repo config defaults and the baseBranch compatibility alias are fallbacks only. Use {git.branchPrefix}{selectedWork.unitId} for multi-unit work and never commit to the base branch. If the selected work is already owned elsewhere, STOP with explicit /sw-adopt guidance instead of mutating it silently; do not fall back to implicit adopt/takeover behavior.

Read the full file on GitHub · 116 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 116 lines · 31 tokens per session scan A c8e4b67ecc4a

Subscribe to this mod's changes

sw-build is a skill published in the GitHub repository Obsidian-Owl/specwright (9 stars, last pushed 4mo ago), licensed MIT. It adds 31 tokens to every session and 2,186 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

testing-principles

Language-agnostic testing principles including TDD, test quality, coverage standards, and test design patterns. Use when writing tests, designing test strategies, or reviewing test quality.

shinpr/claude-code-workflows · 40 tokens

atdd-team

Use to orchestrate a team-based ATDD workflow — six phases (spec writing, spec review, pipeline generation, implementation, refine, verify & harden) each handled by a fresh agent so no role erodes across a long-running feature. Triggers — "build a feature with a team", "use ATDD with agents", "create an ATDD team"…

swingerman/engineer · 114 tokens

atdd

Use to write a feature's acceptance specs and generate its test pipeline — Checkpoint 3 of the DAE pipeline. The engineer-namespace entry point into the atdd plugin's acceptance workflow. Triggers — "/engineer.atdd", "write the spec", "Checkpoint 3", "formalize the ACs as specs", "generate the test pipeline".

swingerman/engineer · 76 tokens

plan

Analyzes architecture, selects patterns, assesses testability, then decomposes work into ordered TDD tasks with exact verification commands and explicit acceptance mapping. Works from an approved spec (zuvo:brainstorm output) or directly from a user-provided description.

greglas75/zuvo · 53 tokens

rust-skills

Rust best practices — 179 rules across 14 categories for idiomatic, optimized Rust code.

martineserios/thebrana · 23 tokens

unbiased-review

Use when reviewing a spec, plan, or implementation produced by another session - verifies its claims against the actual repo, grades TDD and hexagonal discipline, and reports severity-ranked findings without writing the fix. Triggers on "review this spec/plan/implementation", "second opinion on", "check this design"…

karsten-s-nielsen/mad-scientist-skills · 84 tokens