prosa-importer-sessionlisted
Install: claude install-skill c3-oss/prosa
# Prosa Importer Session
Use this skill before changing an importer or the canonical
`session.Session` mapping.
## Canonical contract
`docs/architecture/canonical-session.md` is authoritative. Every importer
must map its source JSONL into `pkg/session.Session` with stable
metadata, normalized turns, tool calls, timestamps, project context, and
raw preservation.
The importer interface lives in `pkg/importer`:
- `Name()` returns the stable agent key (`claude-code`, `codex`,
`cursor`, `gemini`).
- `DefaultRoots()` returns source directories to scan.
- `Walk(ctx, root)` discovers source files without importing them.
- `Import(ctx, path, sink)` parses one source file and writes through
the `Sink` abstraction (defined in `pkg/importer/importer.go`).
The plugin interface is documented end-to-end in
`docs/architecture/importers.md`.
## Source references
Read the relevant source-format doc before editing parser behavior:
- `docs/sources/claude-code.md` for Claude Code JSONL.
- `docs/sources/codex.md` for Codex session JSONL.
- `docs/sources/README.md` for the structure every per-agent doc must
follow.
Use an analogous importer as the default shape for new agents — see
`internal/importers/claudecode/` for a complete model.
## Raw preservation
The local store keeps one raw `.jsonl` per session under the prosa data
dir (`paths.RawRoot(agent)/<YYYY>/<MM>/<session-id>.jsonl`). Do not rely
on the original agent file remaining on disk. Importers preserve the
original bytes