Token导航 LogoToken导航

Agent Skill · 开发

tracekit-java-sdk(tracekit Java SDK 测试)

用于辅助 Java 项目开发、面向对象设计、Spring 生态、Maven 或 Gradle 依赖和后端工程实践。它适合让 Agent 分析类结构、设计接口、整理服务分层、生成测试或检查常见代码坏味道。使用时需要结合项目已有架构、包结构和依赖版本,不应只按通用教程改代码;涉及数据库、事务、并发或框架配置时,应先确认运行环境和回归测试范围。

tracekit-java-sdk 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描有提醒项,按安装量在开发类的 21,746 个 Skill 里排第 21,366。

总安装 190周安装 8GitHub Stars 1下载 67核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:tracekit-java-sdk(tracekit Java SDK 测试)
来源仓库:https://github.com/tracekit-dev/tracekit-for-ai
仓库路径:skills/tracekit-java-sdk
安装命令:
npx skills add https://github.com/tracekit-dev/tracekit-for-ai --skill tracekit-java-sdk
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/tracekit-dev/tracekit-for-ai --skill tracekit-java-sdk

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于辅助 Java 项目开发、Spring 生态和后端工程实践。适合分析类结构、设计接口或生成测试用例时使用。需要结合项目现有架构和依赖版本,避免仅按教程修改代码。

安装命令:npx skills add https://github.com/tracekit-dev/tracekit-for-ai --skill tracekit-java-sdk 涉及数据库或框架配置时应先确认运行环境和回归测试

来源仓库内路径:skills/tracekit-java-sdk

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/tracekit-dev/tracekit-for-ai --skill tracekit-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

tracekit-java-sdk 怎么安装?

在终端执行 npx skills add https://github.com/tracekit-dev/tracekit-for-ai --skill tracekit-java-sdk。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

tracekit-java-sdk 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

tracekit-java-sdk 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

tracekit-java-sdk 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

tracekit-java-sdk 用的人多吗?

公开数据是累计安装 190 次,近一周安装 8 次,下载 67 次,GitHub 1 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

tracekit-java-sdk 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
tracekit-java-sdk

tracekit Java SDK 测试 · 本页

1901接触敏感数据未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

TraceKit Java SDK Setup

Auth Bootstrap

Do not tell the user to go sign up, log in separately, or manually create an API key before setup. First check for existing TraceKit auth. If ~/.tracekitconfig does not contain the production profile or TRACEKIT_API_KEY is missing, apply the tracekit-auth skill first. Use ./scripts/run-tracekit-auth.sh status to check, then guide the user through the TraceKit email verification flow with register and verify. That flow signs the user into an existing account for that email or creates the account automatically, then saves the returned credentials for the rest of the setup.

When To Use

Use this skill when the user asks to:

  • Add TraceKit to a Java service
  • Add observability or APM to a Java application
  • Instrument a Java service with distributed tracing
  • Configure TraceKit API keys in a Java project
  • Debug production Java services with live breakpoints
  • Set up code monitoring in a Java app
  • Add tracing to a Spring Boot or Micronaut application
  • Monitor OpenAI or Anthropic API calls in a Java service
  • Add LLM observability to a Java application

Non-Negotiable Rules

  1. Never hardcode API keys in code or config files. Always use System.getenv("TRACEKIT_API_KEY") or externalized config.
  2. Always initialize TraceKit before starting the HTTP server -- the SDK must be configured before routes are registered.
  3. Always include a verification step confirming traces appear in https://app.tracekit.dev/traces.
  4. Always enable code monitoring (enableCodeMonitoring: true) -- it is TraceKit's differentiator.
  5. Use env vars or externalized config for all secrets -- never commit API keys to source control.

Detection

Before applying this skill, detect the project type:

  1. Check for pom.xml -- confirms Maven build system.
  2. Check for build.gradle or build.gradle.kts -- confirms Gradle build system.
  3. Detect framework by scanning dependencies:

- spring-boot-starter-web or org.springframework.boot => Spring Boot (use Spring Boot branch) - io.micronaut => Micronaut (use Micronaut branch) - Neither => vanilla Java (use vanilla Java branch)

  1. Only ask the user if multiple frameworks are detected or build files are missing.

Step 1: Environment Setup

Set the TRACEKIT_API_KEY environment variable. This is the only required secret.

Add to your environment or .env file:

export TRACEKIT_API_KEY=ctxio_your_api_key_here

Where to get your API key:

  1. Log in to TraceKit
  2. Go to API Keys page
  3. Generate a new key (starts with ctxio_)

Do not commit real API keys. Use environment variables, secret managers, or CI/CD secrets.

Step 2: Install SDK

Choose your build system and framework.

Maven -- Spring Boot

Add to pom.xml:

<dependency>
    <groupId>dev.tracekit</groupId>
    <artifactId>tracekit-spring-boot-starter</artifactId>
    <version>1.0.0</version>
</dependency>

Maven -- Vanilla Java / Micronaut

Add to pom.xml:

<dependency>
    <groupId>dev.tracekit</groupId>
    <artifactId>tracekit-core</artifactId>
    <version>1.0.0</version>
</dependency>

Gradle -- Spring Boot

Add to build.gradle:

implementation 'dev.tracekit:tracekit-spring-boot-starter:1.0.0'

Or build.gradle.kts:

implementation("dev.tracekit:tracekit-spring-boot-starter:1.0.0")

Gradle -- Vanilla Java / Micronaut

Add to build.gradle:

implementation 'dev.tracekit:tracekit-core:1.0.0'

Or build.gradle.kts:

implementation("dev.tracekit:tracekit-core:1.0.0")

Prerequisites:

  • Java 8 or higher (Java 11+ recommended)
  • Maven or Gradle build system
  • A TraceKit account (create one free)

Step 3: Framework Integration

Choose the branch matching your framework. Apply one of the following.

Branch A: Spring Boot (Recommended)

Configuration via application.yml:

tracekit:
  api-key: ${TRACEKIT_API_KEY}
  service-name: my-spring-service
  endpoint: https://app.tracekit.dev/v1/traces
  enable-code-monitoring: true

Or via application.properties:

tracekit.api-key=${TRACEKIT_API_KEY}
tracekit.service-name=my-spring-service
tracekit.endpoint=https://app.tracekit.dev/v1/traces
tracekit.enable-code-monitoring=true

The Spring Boot starter provides auto-configuration -- no @Bean definitions needed. It automatically:

  • Registers a servlet filter for HTTP request tracing
  • Traces JDBC database queries
  • Traces outgoing RestTemplate and WebClient calls
  • Captures unhandled exceptions
  • Propagates trace context to downstream services

Manual bean registration (only if auto-configuration is disabled):

import dev.tracekit.TracekitAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@Import(TracekitAutoConfiguration.class)
public class TracekitConfig {
    // Auto-configuration handles everything
}

Custom filter registration (only if you need specific ordering):

import dev.tracekit.spring.TracekitFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class TracekitFilterConfig {

    @Bean
    public FilterRegistrationBean<TracekitFilter> tracekitFilter() {
        FilterRegistrationBean<TracekitFilter> registration = new FilterRegistrationBean<>();
        registration.setFilter(new TracekitFilter());
        registration.addUrlPatterns("/*");
        registration.setOrder(1); // Run early to capture full request
        return registration;
    }
}

Branch B: Micronaut

Configuration via application.yml:

tracekit:
  api-key: ${TRACEKIT_API_KEY}
  service-name: my-micronaut-service
  endpoint: https://app.tracekit.dev/v1/traces
  enable-code-monitoring: true

Register the TraceKit bean and filter:

import dev.tracekit.Tracekit;
import dev.tracekit.TracekitConfig;
import io.micronaut.context.annotation.Factory;
import jakarta.inject.Singleton;

@Factory
public class TracekitFactory {

    @Singleton
    public Tracekit tracekit() {
        return new Tracekit(TracekitConfig.builder()
            .apiKey(System.getenv("TRACEKIT_API_KEY"))
            .serviceName("my-micronaut-service")
            .endpoint("https://app.tracekit.dev/v1/traces")
            .enableCodeMonitoring(true)
            .build());
    }
}

HTTP filter for request tracing:

import dev.tracekit.Tracekit;
import io.micronaut.http.HttpRequest;
import io.micronaut.http.MutableHttpResponse;
import io.micronaut.http.annotation.Filter;
import io.micronaut.http.filter.HttpServerFilter;
import io.micronaut.http.filter.ServerFilterChain;
import jakarta.inject.Inject;
import org.reactivestreams.Publisher;

@Filter("/**")
public class TracekitHttpFilter implements HttpServerFilter {

    @Inject
    private Tracekit tracekit;

    @Override
    public Publisher<MutableHttpResponse<?>> doFilter(HttpRequest<?> request, ServerFilterChain chain) {
        return tracekit.traceRequest(request, chain);
    }
}

Branch C: Vanilla Java

Initialize TraceKit in your main() method:

import dev.tracekit.Tracekit;
import dev.tracekit.TracekitConfig;

public class Main {
    public static void main(String[] args) {
        // Initialize TraceKit -- MUST be before server start
        Tracekit tracekit = new Tracekit(TracekitConfig.builder()
            .apiKey(System.getenv("TRACEKIT_API_KEY"))
            .serviceName("my-java-service")
            .endpoint("https://app.tracekit.dev/v1/traces")
            .enableCodeMonitoring(true)
            .build());

        // Register shutdown hook to flush pending traces
        Runtime.getRuntime().addShutdownHook(new Thread(tracekit::shutdown));

        // ... start your HTTP server with tracekit filter
    }
}

Step 4: Error Capture

Capture exceptions explicitly where you handle them:

import dev.tracekit.Tracekit;

try {
    Object result = someOperation();
} catch (Exception e) {
    Tracekit.captureException(e);
    // Handle the error...
}

For adding context to traces, use manual spans:

import dev.tracekit.Span;
import dev.tracekit.Tracekit;

Span span = Tracekit.startSpan("process-order");
span.setAttribute("order.id", orderId);
span.setAttribute("user.id", userId);

try {
    Order order = processOrder(orderId);
} catch (Exception e) {
    Tracekit.captureException(e);
    throw e;
} finally {
    span.end();
}

Step 4b: Snapshot Capture (Code Monitoring)

For programmatic snapshots, use the SnapshotClient directly - do not call through the SDK wrapper. The SDK uses stack inspection internally to identify the call site. Adding extra layers shifts the frame and causes snapshots to report the wrong source location.

Create a Breakpoints utility class:

import dev.tracekit.SnapshotClient;
import dev.tracekit.Tracekit;
import java.util.Map;

public final class Breakpoints {
    private static SnapshotClient snapshotClient;

    public static void init(Tracekit sdk) {
        if (sdk != null) {
            snapshotClient = sdk.snapshotClient();
        }
    }

    public static void capture(String name, Map<String, Object> data) {
        if (snapshotClient == null) return;
        snapshotClient.checkAndCapture(name, data);
    }
}

Initialize after SDK setup:

Breakpoints.init(tracekit);

Use at call sites:

Breakpoints.capture("payment-failed", Map.of("orderId", orderId, "error", e.getMessage()));

See the tracekit-code-monitoring skill for the full pattern across all languages.

Code Monitoring v25.0 Features

The latest SDK release adds these code monitoring capabilities (configured via the dashboard, no code changes needed):

  • Logpoint mode -- capture expressions only without full variable snapshots, reducing overhead
  • Per-breakpoint limits -- individual max captures (default: 100) and rate limits per breakpoint
  • Dynamic stack traces -- configurable stack depth per breakpoint (1-50 frames)
  • Idle auto-expiry -- breakpoints auto-expire after inactivity (default: 24h), pinnable to prevent expiry
  • Conditional expressions -- server-side evaluated conditions with full operator support (==, !=, >, <, &&, ||)

These features are available when enableCodeMonitoring is set to true. No SDK code changes required -- all configuration is done through the TraceKit dashboard.

For full details, see the tracekit-code-monitoring skill.

Step 5: JDBC Database Tracing

For Spring Boot, JDBC tracing is automatic via the auto-configuration.

For Micronaut or vanilla Java, wrap your DataSource:

import dev.tracekit.jdbc.TracekitDataSource;
import javax.sql.DataSource;

DataSource tracedDataSource = new TracekitDataSource(originalDataSource);

This traces all SQL queries with:

  • SQL statement (parameterized -- no sensitive data)
  • Database system and name
  • Query duration

Step 6: Outgoing HTTP Call Tracing

Spring Boot (RestTemplate):

import dev.tracekit.spring.TracekitRestTemplateInterceptor;
import org.springframework.web.client.RestTemplate;

@Bean
public RestTemplate restTemplate() {
    RestTemplate restTemplate = new RestTemplate();
    restTemplate.getInterceptors().add(new TracekitRestTemplateInterceptor());
    return restTemplate;
}

Spring Boot (WebClient):

import dev.tracekit.spring.TracekitWebClientFilter;
import org.springframework.web.reactive.function.client.WebClient;

@Bean
public WebClient webClient() {
    return WebClient.builder()
        .filter(new TracekitWebClientFilter())
        .build();
}

Vanilla Java (manual):

Span span = Tracekit.startSpan("http-client");
span.setAttribute("http.method", "GET");
span.setAttribute("http.url", "https://api.example.com/data");

try {
    HttpResponse<String> response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());
    span.setAttribute("http.status_code", response.statusCode());
} finally {
    span.end();
}

Step 7: Verification

After integrating, verify traces are flowing:

  1. Start your application with TRACEKIT_API_KEY set in the environment.
  2. Hit your endpoints 3-5 times -- e.g., curl http://localhost:8080/api/users.
  3. Open https://app.tracekit.dev/traces.
  4. Confirm new spans and your service name appear within 30-60 seconds.

If traces do not appear, see Troubleshooting below.

Troubleshooting

Traces not appearing in dashboard

  • Check TRACEKIT_API_KEY: Ensure the env var is set in the runtime environment. Verify: System.out.println(System.getenv("TRACEKIT_API_KEY")).
  • Check outbound access: Your service must reach https://app.tracekit.dev/v1/traces. Verify with: curl -X POST https://app.tracekit.dev/v1/traces (expect 401 -- means the endpoint is reachable).
  • Check init order: TraceKit must be initialized before starting the HTTP server.

Spring Boot auto-configuration not loading

Symptoms: No tracing despite correct application.yml config.

Fix: Ensure tracekit-spring-boot-starter is on the classpath. Check @SpringBootApplication scan includes the TraceKit package. Run with --debug to see auto-configuration report.

Micronaut bean not found

Symptoms: No bean of type [dev.tracekit.Tracekit] exists error.

Fix: Ensure the TracekitFactory is in a package scanned by Micronaut. Check that tracekit-core is on the classpath.

Missing environment variable

Symptoms: NullPointerException on startup or traces rejected by backend.

Fix: Ensure TRACEKIT_API_KEY is exported in your shell, .env file, Docker Compose, or deployment config. For Spring Boot, use ${TRACEKIT_API_KEY} placeholder syntax in application.yml.

Service name collisions

Symptoms: Traces appear under the wrong service in the dashboard.

Fix: Use a unique service-name per deployed service. Avoid generic names like "app" or "service".

LLM Instrumentation (Manual Setup)

TraceKit can instrument OpenAI and Anthropic API calls made via OkHttp. This requires manual interceptor setup.

When To Use

Add this when the user:

  • Uses OpenAI or Anthropic APIs in their Java service
  • Wants to monitor LLM cost, tokens, and latency
  • Asks about AI observability in Java

Setup

Add the TraceKit LLM interceptor to the OkHttpClient used for LLM API calls:

import dev.tracekit.llm.TracekitLlmInterceptor;
import dev.tracekit.llm.LlmConfig;
import okhttp3.OkHttpClient;

// Default config (content capture off)
OkHttpClient llmClient = new OkHttpClient.Builder()
    .addInterceptor(new TracekitLlmInterceptor())
    .build();

// With custom config
OkHttpClient llmClient = new OkHttpClient.Builder()
    .addInterceptor(new TracekitLlmInterceptor(LlmConfig.builder()
        .captureContent(true)  // Enable prompt/completion capture
        .build()))
    .build();

Pass this client to your OpenAI or Anthropic SDK's HTTP client configuration.

Environment Variable

Set TRACEKIT_LLM_CAPTURE_CONTENT=true to enable prompt/completion capture without code changes.

Captured Attributes

LLM spans include: gen_ai.system, gen_ai.request.model, gen_ai.usage.input_tokens, gen_ai.usage.output_tokens, gen_ai.response.finish_reasons. Streaming responses produce a single span with accumulated token counts.

Verification

After adding the interceptor, make an LLM API call and verify the span appears in the TraceKit dashboard under LLM Observability (/ai/llm).

Next Steps

Once your Java service is traced, consider:

  • Code Monitoring -- Set live breakpoints and capture snapshots in production without redeploying (already enabled via enableCodeMonitoring: true)
  • Distributed Tracing -- Connect traces across multiple services for full request visibility
  • Frontend Observability -- Add @tracekit/browser to your frontend for end-to-end trace correlation

References

  • Java SDK docs: https://app.tracekit.dev/docs/languages/java
  • TraceKit docs root: https://app.tracekit.dev/docs
  • Dashboard: https://app.tracekit.dev
  • Quick start: https://app.tracekit.dev/docs/quickstart

平台分布

Codex

35.12%
按下载量换算24

Claude

30.33%
按下载量换算20

Cursor

19.83%
按下载量换算13

Gemini CLI

9.06%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

可疑

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills