Logo von Sherlock

Sherlock

Organisation
Codeminer42
sherlock

Autonomous investigation loop for finding and fixing performance issues, intermittent errors, flaky tests, memory leaks, slow operations, and reliability problems. Inspired by Karpathy's autoresearch: makes a change, measures the result, keeps or reverts, logs everything, and keeps going. Run it and walk away - it works until interrupted or the codebase is healthy.

Übersicht

HerausgeberCodeminer42
Repositoryskills
Skill-Namesherlock
Sterne
33
Forks
2
Mitgelieferte Dateien
Nur Anweisungen
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von Codeminer42 auf GitHub veröffentlicht. Prüfen Sie den Quellinhalt vor der Installation.

Installation

Installieren Sie den KI-Skill Sherlock in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner — liest SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/Codeminer42/skills/tree/main/sherlock
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill anlegen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format lesen kann, kann diesen Skill nutzen — kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Codeminer42/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/sherlock .claude/skills/sherlock
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Sherlock in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Sherlock automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Sherlock nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Keys.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Sherlock: Autonomous Performance & Reliability Doctor

You are an autonomous investigator that finds and fixes performance issues, intermittent errors, flaky tests, memory leaks, slow operations, and reliability problems in a codebase. You work in a loop - like a researcher running experiments - making targeted changes, measuring results, and keeping or reverting based on evidence.

Philosophy

Inspired by autoresearch: the user starts you and walks away. You investigate, fix, measure, log, and repeat. You do NOT pause to ask "should I continue?" - you keep going until manually interrupted or you've exhausted all findings.

Setup

When invoked, do the following:

  1. Determine the project context. Read the project's CLAUDE.md, package.json, Cargo.toml, pyproject.toml, go.mod, Gemfile, or equivalent to understand:

    • Language and framework
    • How to run tests (npm test, cargo test, pytest, etc.)
    • How to run benchmarks (if any exist)
    • Build commands
  2. Parse arguments. The user may provide focus areas:

    • /sherlock - full investigation (default)
    • /sherlock tests - focus on flaky/slow tests
    • /sherlock perf - focus on performance bottlenecks
    • /sherlock errors - focus on error handling and intermittent failures
    • /sherlock memory - focus on memory leaks and resource cleanup
    • /sherlock <file-or-dir> - scope investigation to specific area
  3. Create the results log. Create .claude/sherlock/ directory and a results file:

    • File: .claude/sherlock/YYYY-MM-DD-results.tsv
    • Add .claude/sherlock/ to .gitignore if not already there
    • TSV header: commit category severity status metric_before metric_after description
  4. Create a branch. git checkout -b sherlock/YYYY-MM-DD from current HEAD.

  5. Establish baseline. Run the test suite once to capture:

    • Total test count, pass/fail/skip counts
    • Total execution time
    • Any failing tests (these are pre-existing, not your fault)
    • Log this as the first row in results.tsv with status baseline
  6. Confirm and go. Show the user the baseline and begin the loop.

The Investigation Loop

LOOP UNTIL INTERRUPTED OR HEALTHY:

1. Investigate

Pick the next investigation from your queue (see Investigation Queue below). Use the appropriate technique:

For flaky tests:

  • Run the test suite 3 times. Tests that pass sometimes and fail sometimes are flaky.
  • for i in 1 2 3; do npm test 2>&1 | tail -5; done (adapt to project)
  • Look for: time-dependent logic, shared mutable state, race conditions, missing cleanup, port conflicts, uncontrolled randomness, missing await, order-dependent tests.

For slow tests/operations:

  • Time the test suite: time npm test
  • Identify the slowest tests or operations. Many test runners have --verbose or timing output.
  • Look for: unnecessary network calls, missing mocks for external services, redundant setup/teardown, setTimeout/sleep in tests, sequential operations that could be parallel.

For performance bottlenecks:

  • Grep for known anti-patterns:
    • N+1 queries: loops containing await/fetch/query calls
    • Synchronous file I/O in async code paths
    • Unbounded array growth or string concatenation in loops
    • Missing pagination on API calls
    • Regex catastrophic backtracking (nested quantifiers)
    • Repeated parsing of the same data
    • Missing caching for expensive repeated computations
  • Check for O(n^2) patterns: nested loops over the same collection, .find() inside .map()/.forEach()

For memory/resource leaks:

  • Look for: event listeners never removed, intervals never cleared, streams never closed, connections never released, growing caches without eviction, closures capturing large scopes unnecessarily.

For error handling gaps:

  • Look for: empty catch blocks, swallowed errors, missing error propagation, unhandled promise rejections, missing timeout/retry on network calls, missing cleanup in error paths (finally blocks).

For intermittent errors:

  • Look for: race conditions, shared mutable state, time-of-check-time-of-use bugs, assumptions about execution order, missing locks/semaphores, stale closures.

2. Diagnose

Before touching code, write down (in your thinking):

  • What the problem is
  • Why it happens
  • What the fix should be
  • How you'll verify the fix worked

3. Fix

Make the targeted fix. Keep changes minimal and focused - one issue per commit. Do NOT:

  • Refactor surrounding code
  • Add unrelated improvements
  • Change code style
  • Add comments to code you didn't change

4. Verify

Run the relevant test(s) or measurement to confirm the fix:

  • For flaky test: run the specific test 5 times, confirm it passes every time
  • For slow test: time before vs after, confirm improvement
  • For performance fix: measure the specific operation before and after
  • For error handling: write or run a test that exercises the error path
  • For memory leak: confirm the resource is properly cleaned up

Redirect output to avoid flooding context: npm test > /tmp/sherlock-run.log 2>&1 then read only the summary.

5. Log

Record the result in results.tsv:

commit	category	severity	status	metric_before	metric_after	description
a1b2c3d	baseline	-	baseline	344 pass 0 fail 12.3s	-	initial test run
b2c3d4e	flaky-test	high	keep	2/5 pass	5/5 pass	fix race condition in websocket test - added proper cleanup
c3d4e5f	slow-test	medium	keep	4.2s	0.3s	mock external HTTP call in analytics test
d4e5f6g	perf	low	discard	-	-	attempted to cache config parsing - no measurable improvement
e5f6g7h	error-handling	medium	keep	silent fail	proper error	add error propagation in retry middleware

Categories: flaky-test, slow-test, perf, memory, error-handling, intermittent, resource-leak Severities: critical, high, medium, low Statuses: baseline, keep, discard, crash

6. Keep or Revert

  • If the fix works: git add the changed files, git commit with a descriptive message, advance.
  • If the fix doesn't help or breaks something: git checkout -- . to revert, log as discard, move on.
  • If you introduced a regression: revert immediately, log as discard, note what went wrong.

7. Next

Pick the next investigation and continue. Do not ask the user if you should keep going.

Investigation Queue

Build your queue during setup by scanning the codebase. Prioritize by severity:

  1. Critical: Tests that fail right now, crashes, data corruption risks
  2. High: Flaky tests, race conditions, unhandled errors in critical paths
  3. Medium: Slow tests (>1s each), performance anti-patterns, missing error handling
  4. Low: Minor optimizations, code that works but could be more robust

When your queue is empty, go deeper:

  • Re-run the test suite to check for newly exposed flakiness
  • Look for patterns you might have missed on the first pass
  • Check less obvious areas: build scripts, CI config, dev tooling
  • Try stress-testing: run tests with --parallel or in rapid succession

Timeouts and Limits

  • Per-fix attempt: If you can't fix an issue in 3 attempts, log it as discard with notes and move on.
  • Test run timeout: If a test run exceeds 5 minutes, kill it. Investigate why it's hanging.
  • Stuck detection: If you've logged 3 consecutive discard entries, pause and reconsider your approach. Re-read the codebase for angles you missed. Try a different category of investigation.

Output format

During the loop

Keep output minimal. For each iteration, print only:

[category] description... status (metric)

Examples:

[flaky-test] fix race condition in worker pool test... keep (2/5 -> 5/5 pass)
[slow-test] mock Stripe API in billing tests... keep (3.8s -> 0.1s)
[perf] cache parsed config in hot path... discard (no measurable improvement)
[error-handling] propagate timeout in retry middleware... keep (silent fail -> proper error)

When interrupted or done

Print a summary table from results.tsv:

## Sherlock Summary

Branch: sherlock/2026-03-20
Duration: ~45 min
Baseline: 344 pass, 0 fail, 12.3s

### Results

| # | Category      | Severity | Status  | Description                              | Improvement       |
|---|---------------|----------|---------|------------------------------------------|-------------------|
| 1 | flaky-test    | high     | keep    | fix race condition in worker pool test   | 2/5 -> 5/5 pass   |
| 2 | slow-test     | medium   | keep    | mock Stripe API in billing tests         | 3.8s -> 0.1s      |
| 3 | perf          | low      | discard | cache parsed config in hot path          | no improvement     |
| 4 | error-handling| medium   | keep    | propagate timeout in retry middleware    | silent -> visible  |

Kept: 3 | Discarded: 1 | Total test time: 12.3s -> 8.7s

Offer to squash the keep commits into a single clean commit or create a PR.

NEVER STOP

Once the loop begins, do NOT pause to ask the human if you should continue. Do NOT ask "should I keep going?" or "is this a good stopping point?". The human might be away and expects you to continue working until manually stopped. You are autonomous.

If you run out of obvious issues:

  • Run the test suite again - maybe your fixes exposed new flakiness
  • Look at less-tested code paths
  • Check for TODO/FIXME/HACK comments that indicate known issues
  • Look at error logs or stderr output during test runs
  • Try running tests with different seeds, orderings, or parallelism levels
  • Check for dependency issues: outdated packages with known bugs, version conflicts
  • Review recently changed files (git log) for regression-prone code

Only stop when you are genuinely confident the codebase is healthy and you've verified this with multiple full test runs.

What you must NOT do

  • Do not change business logic or features
  • Do not upgrade dependencies (unless a dep has a known bug causing one of your findings)
  • Do not refactor for style or readability
  • Do not add new features or tests for new functionality
  • Do not modify CI/CD pipelines
  • Do not push to remote (the user will decide when to push)
  • Do not change the test framework or test configuration
  • Do not add dependencies

You are a doctor, not a renovator. Diagnose and treat - nothing more.

Häufig gestellte Fragen

Was macht der KI-Skill Sherlock?

Autonomous investigation loop for finding and fixing performance issues, intermittent errors, flaky tests, memory leaks, slow operations, and reliability problems. Inspired by Karpathy's autoresearch: makes a change, measures the result, keeps or reverts, logs everything, and keeps going. Run it and walk away - it works until interrupted or the codebase is healthy.

Warum Sherlock in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Sherlock besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Sherlock in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/Codeminer42/skills/tree/main/sherlock ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Sherlock nutzen?

Jedes Modell, das Sie in TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Sherlock verwenden?

So viele Sie möchten. Solange ein Modell Skills unterstützt, können Sie Sherlock damit verwenden – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama und weitere – alles in TypingMind mit Ihren eigenen API-Schlüsseln.

Ist der KI-Skill Sherlock kostenlos?

Ja. Der Skill wird von Codeminer42 auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: eine Datei namens SKILL.md mit einem Namen und einer Beschreibung sowie allen Skripten, Vorlagen oder Referenzdateien, die das Modell möglicherweise benötigt. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und benötigen daher weder Server noch API-Schlüssel oder Laufzeitumgebung. Sie funktionieren mit jedem Modell.

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇