npx skills add ...
npx skills add zenml-io/kitaru-skills --skill kitaru-importer-builder
Build and validate a custom Kitaru trace importer when a provider, observability platform, export format, or agent framework has no suitable built-in importer. Use when a user wants to map provider traces into Kitaru sessions and nodes, add bounded provider API fetching, join per-turn traces into longer sessions, preserve incomplete or failed trace evidence, choose script or package installation, test importer fidelity, register an importer version, import a bounded sample, or diagnose a partial import.
npx skills add zenml-io/kitaru-skills --skill kitaru-importer-builder
Turn representative provider data into a locally validated Kitaru importer for static exports or bounded API queries. Keep the path from source evidence to normalized sessions explicit so the user can see what is preserved, approximated, or unavailable.
Finish locally by default. Register code or upload trace data only when the user asks and approves each action separately.
fetch(query) method may read provider credentials and request API payloads.KITARU_ACTIVE_SKILL=kitaru-importer-builder set so the server attributes the resulting activity to this skill.--concurrency 10. Use KITARU_WORKER_CONCURRENCY=10 only when the launch surface exposes worker settings through environment variables instead of CLI options.Start read-only.
If importer scaffolding, local testing, registration, exact-version import, or the required parser types are absent, name the missing capability. Do not give draft commands as though they were released. The user may choose a compatible Kitaru environment separately.
If kitaru-investigation routed the user here, retain the agent and investigation context. Return to the investigation only after relevant sessions are actually usable.
If the source exists behind a live Langfuse, Braintrust, LangSmith, Logfire, or
Arize Phoenix Python entrypoint, first check the provider importer package's
[adapter] extra with kitaru-adapter-builder. This supported route records
the provider trace after each run; it is not a custom parser. Carry forward the
repository and revision, provider, public entrypoint, installed Kitaru version,
target agent and version, and requested evidence.
If neither static export nor provider API data is available and the goal requires new in-process recording,
continue with kitaru-adapter-builder. Carry forward the repository and
revision, public entrypoint, language, installed framework and Kitaru versions,
requested evidence, target agent and version, and investigation goal. Choose
this route once; do not bounce back merely because the adapter mentions
importers as an alternative.
Prefer an existing redacted export for parser tests. For API sources, first check an installed importer's fetch support and provider connection schema. Build a custom fetch method only when that route is insufficient. Use mocked provider responses for local tests; a live fetch needs an authorized bounded query and provider credentials, pagination, rate-limit, and retry controls.
Before writing a fixture:
Do not place provider credentials in shell arguments, importer parameters, fixtures, inline dependency metadata, uploaded source, or logs.
Before implementation, produce this checkpoint:
| Decision | Evidence and chosen behavior |
|---|---|
| Payload shapes | Supported export variants and representative redacted files |
| Source instance | Account, workspace, project, collector, or explicit override |
| Session identity | Native session, thread, or conversation ID; trace fallback |
| Turn order | Provider sequence, or one trustworthy clock domain and precision |
| Root and hierarchy | Root selection, parent field, missing-parent and cycle behavior |
| Node mapping | Span, LLM, tool, and subagent fields plus bounded metadata |
| Status and error | Root outcome and descendant-failure semantics |
| Completeness | Missing hierarchy, payloads, tools, usage, cost, or timestamps |
| Safety limits | Numeric byte, record-count, and nesting-depth limits |
| Installation | Script dependencies or exact package and worker route |
Mark every relevant source field as mapped, preserved as bounded metadata, or intentionally unsupported. Ground expected mappings in provider documentation or an independently reviewed sample, not only in the implementation's own output.
parse and optional fetch methods using the installed contracts.Use references/normalization-patterns.md for identities, joins, topology, status, metadata, readiness, and content digests.
Use two layers of evidence:
Cover the applicable cases from references/failure-and-validation.md. At minimum include one complete item, one valid incomplete item, and one invalid item or payload boundary. Add joining, changed-content, and graph cases when the source supports them.
Do not treat a successful local importer test as semantic proof. Inspect the yielded sessions and compare them with the source map.
Return a compact report:
| Area | Result |
|---|---|
| Importer | Path and entrypoint |
| Supported source | Provider, export variants, and source-instance rule |
| Identity | Session and node ID derivation; rerun behavior |
| Joining | Key, scope, order, fallback, or not applicable |
| Fidelity | Complete, partial, and intentionally unsupported fields |
| Replay readiness | Ready, partial, or unavailable with concrete reasons |
| Validation | Assertions and installed Kitaru test results |
| Remote state | None, unless separately approved |
This is a successful authoring milestone. The importer becomes usable in a remote Kitaru deployment only after registration and an observed smoke import.
Proceed only when the user requests registration.
Before approval, show:
Require a stable nonempty provider before registration when remote deduplication or retry safety matters. Current Kitaru accepts an omitted provider, but provider-less imports are not reliably deduplicated. After approval, register once. Preserve the importer ID, exact version, source digest, and any blob or task identifiers. If parent creation succeeds and version creation fails, do not repeat the parent-creation command blindly.
Proceed only when authorization covers uploading a bounded redacted payload or fetching an exact bounded provider selection. For live fetching, first review the importer and use only the intended provider credentials in the approved worker environment; local generated-code tests remain credential-free.
Show the exact importer version, agent version, target tenant or project, payload or query and connection, parameters, persistence, expected session identities, and the fact that this skill has no automatic cleanup path. When the installed schema exposes --tag, require one unique durable smoke tag and include --wait because current post-import tagging requires it. If tagging is unavailable, require a disposable agent or a clearly marked isolated source identity instead. Do not write minimized smoke fixtures into the ordinary production session population without a marker that the investigation flow can exclude.
Create one import job and wait only through the installed supported mechanism. A local wait timeout does not stop the remote job. Preserve the smoke tag plus the blob, job, task, session, and terminal receipt identifiers. Tag application can fail after session import succeeds, so retain the session receipt and report that partial state rather than rerunning the import.
Classify the result as created, skipped duplicate, failed, or still running. Inspect representative imported sessions rather than trusting counts alone.
Before proposing any retry, classify each relevant external identity:
| State | Meaning |
|---|---|
| Untouched | No session exists and the item did not run |
| Complete | Session and expected nodes exist |
| Skipped duplicate | The same nonempty provider and external ID already existed |
| Stale duplicate | Existing digest differs or the local joined export contains more turns |
| Incomplete | Session exists but expected node ingestion did not finish |
| Unrecoverable here | Installed Kitaru exposes no safe repair or deletion path |
Remember that session creation can succeed before node ingestion fails. With a stable nonempty registered provider, a direct rerun may then skip the existing external ID instead of repairing the session. Without one, a rerun may create another session instead. A growing joined conversation can produce a skip while the existing session contains fewer turns. Compare readable digest and trace-count metadata before classifying the skip; if the installed surface cannot expose that metadata, do not use incremental joined-conversation imports. Preserve evidence, patch and version the importer locally if needed, and propose only recovery operations the installed product actually exposes.
When local validation or the requested smoke import succeeds:
kitaru-investigation when usable non-smoke sessions now exist, carrying the exclusion set forward.