knowledge-ratchet
Capture recurring friction during development and promote it into durable fixes so it stops recurring — the outer feedback loop that improves the harness itself. Use this whenever something rubs more than once: a scanner or check produces a false positive, the same boundary gets misplaced the same way, a primitive gets reused a third time, a library decision repeats, or a plan keeps hitting the same snag. It maintains a small repo-local log (ratchet.jsonl) that counts recurrences and distinguishes defects (fix on sight) from abstractions (gated by the Rule of Three), tells you what is RIPE to promote, and records where each durable fix landed (a type constraint, a scan/lint rule, a reference, a convention in AGENTS.md, or — rarely — a new skill). Engage it at a feature's record/ship step to log friction, and whenever you ask "has this come up before, and should I fix it for good?"
What this skill does
# Knowledge Ratchet
The harness has three feedback loops. The **inner** loop (feature-workflow) ships
a feature. The **outermost** loop (production telemetry) tells you whether shipped
features worked — deferred until there's a running system. This is the **middle**
loop, at design time: it improves the harness itself by turning friction that
recurs into a fix that holds.
Without it, the same annoyances recur every feature and the lessons live only in
whoever happened to notice. With it, the third time something rubs, the system
says "this is a pattern — fix it for good," and names where the fix should live.
## The discipline
**Observe** friction as it happens (cheap; over-log rather than under-log):
ratchet.py --observe "<what rubbed>" --key <slug> --kind defect|abstraction --where <loc>
**Check** what's actionable. Two ripeness rules, because they're different:
- **defect** (something is wrong) → ripe at one occurrence; fix on sight.
- **abstraction** (a candidate generalization) → ripe at three (Rule of Three);
earlier is the wrong-abstraction trap.
ratchet.py --ripe # the queue owed a durable fix (gate-able: exit 1 if any)
ratchet.py --status # the whole log, with recurrence counts
**Promote** — give it a durable home and close it:
ratchet.py --promote <key> --as <sink> --landed <where>
## Choosing the sink (see references/promoting.md)
The maturity ladder applied to process learning — prefer the leftmost, the fix
that needs the least vigilance: **type-constraint** (unrepresentable) →
**scan-pattern / lint-rule** (automated) → **reference** (in-context guidance) →
**convention** (a line in AGENTS.md). And: project-specific learnings go to a
repo-local sink (AGENTS.md / a reference), never a new skill; only a genuinely
reusable, cross-project *capability* justifies minting a skill.
## How it connects to the rest of the harness
- **feature-workflow** record/ship step feeds friction here (`--observe`), and a
ripe-check (`ratchet.py --ripe`) can gate ship so debt is named, not buried.
- **harness-setup** wrote the `AGENTS.md` "Repo conventions & learnings" section
— the home for `convention`-sink promotions.
- **boundary-discipline / verify-and-diagnose** are common sources of friction
(a scan false-positive, a recurring misplacement); their scripts/references are
common promotion targets.
## Why a plain JSONL, no port
Frictions are rare, so the log stays small. A storage port or search (as in
library-knowledge) would be anticipation, not evidence — the exact premature
abstraction this skill tells you to avoid. If the log ever grows large enough to
need search, that's itself a ripe friction to promote.
## Files
- `scripts/ratchet.py` — observe friction, list what's ripe, promote a fix. Store: `ratchet.jsonl`.
- `references/promoting.md` — defect vs abstraction, and the sink-choice ladder.
## Sibling: motions, not just code
This ratchet promotes a fix when a defect recurs and a shelf item when an
abstraction recurs. A third recurrence — a repeated manual MOTION — is
`toolsmith`'s domain: the third time a hand-motion repeats, forge a tool. Same
Rule of Three, pointed at Cairn's own working rather than at the product.
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.