agentleFS
dosu-aidosu-ai/decant/.claude/skills/add-source/SKILL.md

add-source

Skill74 starsChanged 9 days agoApache-2.0View on GitHub

Add or extend a Decant source parser for another coding-agent CLI's session logs. Use when adding a new tool under src/sources/, changing how an existing parser normalizes records, or touching discovery, watch roots, or parser fixtures and goldens.

11 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 7 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never print, quote, or commit transcript content from ~/.claude, ~/.codex, or any other real session store.

    line 13
  2. Very specific:

    Every fixture under fixtures/<tool>/ is hand-written with invented content.

    line 16

“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Add a source parser

The checklist lives in docs/adding-a-source.md. Read it in full before editing; this skill only lists the steps that are easy to miss.

Privacy first

  • Never print, quote, or commit transcript content from ~/.claude, ~/.codex, or any other real session store. Inspect record shapes with aggregate counts only (types, key sets, value types).
  • Every fixture under fixtures/<tool>/ is hand-written with invented content. An edited real transcript is not synthetic.

Touchpoints

  1. discover() in src/ingest.ts (where files live, which sidecars to skip) plus a source-directory env override documented in docs/sources.md, and a row in the supported agents table in README.md.
  2. src/sources/<tool>.ts: pure and print-free, returns a ParsedSession, turns malformed lines into unparsed_line issues and unknown record types into one unknown_record_type issue per type, calls linkageIssues. Reuse the JSONL line parser, unknown-type issue builders and block factory in src/sources/shared.ts.
  3. The tool ID in TOOLS in src/model.ts (persisted; choose it once).
  4. watchDirs() in src/watch.ts.
  5. SESSION_SOURCES, sessionSourceLabel, and sessionSourcePredicate in src/source-filter.ts, the source enums in the API docs, the source label maps in src/export.ts and src/sources/atif.ts, and the source rows in src/doctor.ts.
  6. The capability report from the doc, filled in for the pull request.

Tests and goldens

  • Parser tests in test/<tool>.test.ts, ingest coverage in test/ingest.test.ts, fixture paths in test/golden/meta.json, and the fixture directory in both stagers (scripts/regen-goldens.ts and test/cli-golden.test.ts).
  • Regenerate goldens only after focused tests pass, then read the whole diff: bun run scripts/regen-goldens.ts --i-reviewed-the-diff. A golden change in an existing source is a regression until explained.

Done

bun test, bunx tsc --noEmit, and bunx biome check . pass, then just check. Use DECANT_DB=<scratch> ... --no-sync for manual runs so the real archive is never touched.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.