Skip to content

MinLeeV5/devkeel / .harness/skills/systematic-debugging

systematic-debugging

Verified

系统化诊断和修复 Bug、测试或构建失败、异常行为、集成故障与性能回归。先建立可判定的反馈信号、追踪根因并逐一验证可证伪假设;仅在现有错误、测试、日志、diff、debugger 或 profiler 无法区分假设,且临时写入已获授权时使用定向 HTTP 插桩。

FileKindSize
SKILL.mdskill md4.0 KB
agents/openai.yamlconfig236 B
assets/Hdbg.javaother3.6 KB
assets/hdbg-node.cjsscript1.2 KB
assets/hdbg-web.jsscript1.3 KB
references/diagnosis.mdmarkdown3.7 KB
references/instrumentation.mdmarkdown2.6 KB
references/java8-http.mdmarkdown1.3 KB
references/javascript-http.mdmarkdown2.3 KB
scripts/bootstrap.jsscript1.1 KB
scripts/cleanup.jsscript12.0 KB
scripts/debug-server.jsscript10.9 KB

assets/Hdbg.java

View on GitHub
/*HDBG:__HDBG_SESSION__:B*/
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

final class Hdbg {
    private static final String ENDPOINT = setting(
        "hdbg.endpoint", "HDBG_ENDPOINT", "__HDBG_ENDPOINT__");
    private static final String SESSION = setting(
        "hdbg.session", "HDBG_SESSION", "__HDBG_SESSION__");
    private static final String RUNTIME = setting(
        "hdbg.runtime", "HDBG_RUNTIME", "java");
    private static final ThreadPoolExecutor EXECUTOR = new ThreadPoolExecutor(
        1,
        1,
        0L,
        TimeUnit.MILLISECONDS,
        new ArrayBlockingQueue<Runnable>(256),
        new ThreadFactory() {
            public Thread newThread(Runnable task) {
                Thread thread = new Thread(task, "hdbg-emitter");
                thread.setDaemon(true);
                return thread;
            }
        },
        new ThreadPoolExecutor.DiscardPolicy());

    private Hdbg() {
    }

    static void log(final String event, final Object data) {
        try {
            EXECUTOR.execute(new Runnable() {
                public void run() {
                    send(event, data);
                }
            });
        } catch (RuntimeException ignored) {
        }
    }

    static void flush(long timeoutMillis) {
        EXECUTOR.shutdown();
        try {
            EXECUTOR.awaitTermination(timeoutMillis, TimeUnit.MILLISECONDS);
        } catch (InterruptedException ignored) {
            Thread.currentThread().interrupt();
        }
    }

    private static void send(String event, Object data) {
        HttpURLConnection connection = null;
        try {
            String url = ENDPOINT.replaceAll("/+$", "") + "/log"
                + "?s=" + encode(SESSION)
                + "&r=" + encode(RUNTIME)
                + "&e=" + encode(String.valueOf(event));
            byte[] body = String.valueOf(data).getBytes(StandardCharsets.UTF_8);
            connection = (HttpURLConnection) new URL(url).openConnection();
            connection.setRequestMethod("POST");
            connection.setConnectTimeout(250);
            connection.setReadTimeout(250);
            connection.setDoOutput(true);
            connection.setRequestProperty("Content-Type", "text/plain; charset=utf-8");
            connection.setFixedLengthStreamingMode(body.length);
            OutputStream output = connection.getOutputStream();
            try {
                output.write(body);
            } finally {
                output.close();
            }
            int status = connection.getResponseCode();
            InputStream input = status >= 400
                ? connection.getErrorStream()
                : connection.getInputStream();
            if (input != null) input.close();
        } catch (Exception ignored) {
        } finally {
            if (connection != null) connection.disconnect();
        }
    }

    private static String encode(String value) throws Exception {
        return URLEncoder.encode(value, "UTF-8");
    }

    private static String setting(String property, String environment, String fallback) {
        String value = System.getProperty(property);
        if (value == null || value.isEmpty()) value = System.getenv(environment);
        return value == null || value.isEmpty() ? fallback : value;
    }
}
/*HDBG:__HDBG_SESSION__:E*/
slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack."Stars: 198kUpdated Claude CodeCodexVerifiedInstall
ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt.Stars: 194kUpdated Claude CodeCodexVerifiedInstall