sw-learn

sw-learn is a skill for Claude Code from Obsidian-Owl/specwright. It costs 40 tokens per session (1,986 once invoked), scanned A, original, MIT.

A learning review for a completed unit of coding work. It examines failures, quality-check findings, design decisions, and supporting records to identify reusable practices.

In plain words
What is it for?
Use it after a work unit to review what happened, curate patterns, and promote approved lessons into project practices or agent memory.
Why use it?
It turns lessons from one task into guidance for future work instead of leaving them buried in logs or conversations. The user chooses which lessons become lasting project knowledge.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it after a work unit to review what happened, curate patterns, and promote approved lessons into project practices or agent memory.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/obsidian-owl/specwright/sw-learn
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.

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

Made for: Claude Code.

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-learn

README.md
[![agentmods](https://agentmods.dev/badge/skills/obsidian-owl/specwright/sw-learn/github.svg)](https://agentmods.dev/skills/obsidian-owl/specwright/sw-learn)
Your own site
<a href="https://agentmods.dev/skills/obsidian-owl/specwright/sw-learn"><img src="https://agentmods.dev/badge/skills/obsidian-owl/specwright/sw-learn/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sw-learn

Your own site · 80×15
<a href="https://agentmods.dev/skills/obsidian-owl/specwright/sw-learn"><img src="https://agentmods.dev/badge/skills/obsidian-owl/specwright/sw-learn.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 40 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,986 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00040 $0.01986
Opus 5.5 $0.00016 $0.00794
Sonnet 5.5 $0.00008 $0.00397
Haiku 4.5 $0.00004 $0.00199

Measured 1mo ago against content hash 49d29d640b77, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

sw-learn 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 1mo 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-learn/SKILL.md · 150 lines

How it starts

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

Specwright Learn

Goal

Extract reusable knowledge from the current work unit. Build failures, gate findings, and architecture decisions contain valuable patterns. Surface them, let the user curate, and promote the best ones so future work benefits.

Inputs

  • {worktreeStateRoot}/session.json -- selected work for this worktree
  • {repoStateRoot}/work/{selectedWork.id}/workflow.json -- current work unit (should be shipped)
  • {workDir}/evidence/ -- gate evidence files
  • {workDir}/implementation-rationale.md -- curated build-time reasoning when present
  • {workDir}/review-packet.md -- reviewer-facing audit synthesis when present
  • {workDir}/plan.md -- architecture decisions
  • {workArtifactsRoot}/{selectedWork.id}/approvals.md -- approval lineage for the work
  • {projectArtifactsRoot}/CONSTITUTION.md -- existing practices
  • {projectArtifactsRoot}/learnings/ -- prior work unit learnings (for retrospective)
  • Git log for the work unit's commits

Outputs

  • Learnings presented to user in categories
  • User-approved patterns promoted to one of:
    • {projectArtifactsRoot}/CONSTITUTION.md (new practice rule)
    • Auto-memory MEMORY.md (compact pattern entry, loaded every session)
    • {projectArtifactsRoot}/patterns.md (reusable pattern library)
  • {projectArtifactsRoot}/learnings/{work-id}.json -- written when any finding is promoted OR when gateCalibration data is available. When only calibration is present (no promoted findings), write with an empty findings array.

Constraints

Stage boundary (LOW freedom):

  • Follow protocols/stage-boundary.md.
  • You capture learnings and promote patterns. You NEVER start new work units, run builds, or create PRs.
  • It is not a core workflow stage and never claims top-level work ownership.
  • After learnings are captured, STOP and present the handoff:
    • If more work units pending: "Run /sw-build to start the next unit."
    • If no more units: "All work units complete. Learnings captured."

Discovery (HIGH freedom):

  • Scan evidence files, git log, plan.md, implementation-rationale.md, review-packet.md, and approval lineage for patterns worth remembering.
  • Look for: what broke, what was hard, what worked well.
  • Check as-built notes for discovered behaviors per protocols/build-quality.md.
  • If commands.test:integration is configured in config.json: check gate-build evidence for the integration tier. If it was SKIP or absent, surface as a learning candidate ("No integration tests ran"). Skip this check when no integration tier is configured.
  • MUST record gateCalibration for every gate that ran, even if all PASS with 0 findings. Populate from evidence files automatically. falsePositives array only populated when user explicitly labels a finding as false positive during presentation (dismissal alone does not count). Format per protocols/evidence.md#verdict-rendering.

Read the full file on GitHub · 150 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. 1mo ago First seen · 150 lines · 40 tokens per session scan A 49d29d640b77

Subscribe to this mod's changes

sw-learn is a skill published in the GitHub repository Obsidian-Owl/specwright (10 stars, last pushed 5mo ago), licensed MIT. It adds 40 tokens to every session and 1,986 once invoked, about $0.0002 per session on Opus 5.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

doc-digest

Turn a long document, PDF, transcript, spreadsheet or log into a compact working digest the conversation can continue from. Use when the user shares or pastes something long (several pages or more) and wants to discuss, analyze, compare or use it over more than one message, or asks to summarize a document so they can…

egorfedorov/claude-context-optimizer · 75 tokens

fresh-start

Continue in a new chat without losing anything — writes a compact handoff to paste into a fresh conversation. Use whenever the user wants to move to a new chat or conversation, hits usage limits, says replies got slow or Claude forgets earlier details, or the conversation has grown long.

egorfedorov/claude-context-optimizer · 60 tokens

token-check

Estimate how many tokens a pasted text, an attached file or the conversation so far takes, what it means for the context window and usage limits, and how to cut it. Use when the user asks how big something is in tokens, why they keep hitting limits, or whether a file is too large to send.

egorfedorov/claude-context-optimizer · 66 tokens

project-context

Turn background the user keeps re-explaining or re-pasting into reusable instructions, so new chats start with it for free. Use when the user repeats the same context, rules, style guide, persona or reference text across messages or chats, says they are tired of explaining the same thing, or asks how to set up a…

egorfedorov/claude-context-optimizer · 81 tokens

performance-audit

Full-stack performance health check across 12 dimensions. Rendering, bundles, assets, API/network, algorithms, memory, database, caching, Web Vitals, backend runtime, concurrency, and framework-specific pathologies. Evidence-based Impact Models with confidence tiers and a prioritized optimization roadmap. Switches…

greglas75/zuvo · 90 tokens

sitrep

Situational awareness — where am I, what was I doing, what's next. Context recovery after compression, confusion, or mid-session reorientation.

martineserios/thebrana · 32 tokens