ingest-inbox-item

$npx mdskill add lyndonkl/claude/ingest-inbox-item

Converts raw inbox files into indexed markdown seeds.

  • Transforms unstructured notes into normalized corpus entries.
  • Depends on format normalization and topic tagging tools.
  • Decides creation or linking via deduplication fingerprint checks.
  • Delivers processed seeds to the corpus with full frontmatter.

SKILL.md

.github/skills/ingest-inbox-itemView on GitHub ↗
---
name: ingest-inbox-item
description: Ingests a single file from the substacker inbox/ into corpus/seeds/ as a normalized markdown seed with full frontmatter. Orchestrates format normalization, topic tagging, intuition-density scoring, dedupe, changelog, ledger update, and inbox-file move to .processed/. Use when the user drops raw material into inbox/ and runs /ingest, at session start, or whenever a single inbox file needs to become an indexed seed. Trigger keywords: ingest, inbox, new note, new transcript, new highlight, index this, add to corpus.
---

# Ingest Inbox Item

## Table of Contents

- [Workflow](#workflow)
- [Frontmatter schema](#frontmatter-schema)
- [Worked example](#worked-example)
- [Guardrails](#guardrails)
- [Related skills](#related-skills)

**Related skills:** Uses `normalize-format`, `tag-by-topic`, `score-intuition-density`, `dedupe-against-corpus`, `update-topic-ledger`. Called by the Librarian agent for each file in `inbox/`.

## Workflow

Copy this checklist and track progress per file:

```
Ingest one inbox file:
- [ ] Step 0: Compute sha256 of file body; check .librarian-state.json for duplicate fingerprint
- [ ] Step 1: Invoke normalize-format → body + partial frontmatter
- [ ] Step 2: Invoke tag-by-topic → topics + pending_tags
- [ ] Step 3: Invoke score-intuition-density → score + signals
- [ ] Step 4: Invoke dedupe-against-corpus → CREATE | LINK | SKIPPED
- [ ] Step 5: If LINK, backlink matched seeds' related_seeds field
- [ ] Step 6: Write seed file with full frontmatter; status=seed; manual_edits=false
- [ ] Step 7: Append one line to corpus/seeds/.changelog.md
- [ ] Step 8: Invoke update-topic-ledger for each topic tag
- [ ] Step 9: mv inbox file → inbox/.processed/
- [ ] Step 10: Update .librarian-state.json with the fingerprint
```

**Step 0**: Hash the body (not frontmatter). If the fingerprint is in `.librarian-state.json`, exit with `SKIPPED (already ingested: <seed-id>)`. Idempotency is a feature.

**Step 1**: `normalize-format` handles all supported formats (plain markdown, `.jsonl` Claude Code sessions, `.json` Claude.ai exports, Readwise exports, transcripts with speaker labels, link captures). Returns one or more `{body, partial_frontmatter}` pairs — multi-chunk outputs possible for long transcripts.

**Step 2**: `tag-by-topic` proposes 1–4 tags from the controlled vocabulary. If none match, it logs to `topic-ledger.md#pending-tags` and still assigns the closest existing tag.

**Step 3**: `score-intuition-density` computes 0–10 from 8 explicit signals. Auditable.

**Step 4**: `dedupe-against-corpus` returns one of `SKIPPED` (exact fingerprint match — exit), `LINK` (near-match — proceed but write `related_seeds`), or `CREATE` (no match).

**Step 6**: Write the seed file. Location: `corpus/seeds/{id}.md` where `id = YYYY-MM-DD-slugified-title`. If a seed with that `id` already exists, append `-v2` rather than overwrite.

**Step 7**: Changelog format: `YYYY-MM-DDThh:mm | ADDED | {seed-id} | from {original_path} | density={N} | topics={comma-list}`

## Frontmatter schema

```yaml
---
id: 2026-04-23-dropout-as-ensemble-thinned-networks
title: "Dropout as ensemble over thinned networks"
created: 2026-04-21T09:14:00-07:00
source:
  type: inbox-note
  original_path: inbox/2026-04-21-dropout-as-ensemble.md
  ingested_at: 2026-04-23T14:32:01-07:00
  fingerprint: sha256:7c1d...
topics: [regularization, ensembling, dropout]
intuition_density:
  score: 8
  signals: [analogy_present, concrete_worked_example, counterfactual_offered, reframe_against_default, biology_to_ai]
status: seed
provenance:
  author: kushal
  confidence: owned
links:
  related_seeds: [2026-03-11-l2-as-gaussian-prior]
  parent_source: null
section_affinity: [agent-workshop]
word_count: 87
manual_edits: false
---

[body: preserved verbatim from normalize-format output]
```

## Worked example

**Input**: `inbox/2026-04-21-dropout-as-ensemble.md` (87 words, plain markdown, user's own note).

**Run**:
- Step 0: fingerprint new → proceed.
- Step 1: normalize-format → body unchanged (plain markdown); title from first line or filename.
- Step 2: tag-by-topic → `[regularization, ensembling, dropout]`; `dropout` new → logged to pending-tags.
- Step 3: score → 8; signals fired: analogy_present, concrete_worked_example, counterfactual_offered, reframe_against_default, biology_to_ai.
- Step 4: dedupe → near-match `2026-03-11-l2-as-gaussian-prior` at Jaccard 0.32 (below 0.5 threshold) → CREATE (not LINK).
- Step 6: Write `corpus/seeds/2026-04-21-dropout-as-ensemble-thinned-networks.md` with full frontmatter.
- Step 7: Changelog: `2026-04-23T14:32 | ADDED | 2026-04-21-dropout-as-ensemble-thinned-networks | from inbox/2026-04-21-dropout-as-ensemble.md | density=8 | topics=regularization,ensembling,dropout`
- Step 8: Ledger: `regularization` seeds 3→4, temperature→hot; `ensembling` 1→2; `dropout` new row added.
- Step 9: `mv inbox/2026-04-21-dropout-as-ensemble.md inbox/.processed/`
- Step 10: Append fingerprint to state.

**Output**: one seed file, one changelog line, three ledger updates, one moved file.

## Guardrails

1. If `normalize-format` fails, the inbox file stays put (not moved) and the changelog records `ERROR | <file> | <reason>`. No partial ingests.
2. If topic-tagger proposes a tag not in the controlled vocabulary that cannot map to one, log to pending-tags — never silently invent.
3. If a seed with the candidate `id` exists, append `-v2`; never overwrite.
4. Never ingest files under `inbox/.processed/` or `inbox/.trash/`.
5. Run single-threaded. Parallel ingests corrupt the ledger and changelog.
6. If `dedupe-against-corpus` returns `SKIPPED`, move the inbox file to `.processed/` with a renamed suffix `-duplicate-of-{matched-seed-id}` and exit — don't re-write the matched seed.

## Quick reference

- **Idempotent**: yes (fingerprint check in step 0).
- **Writes**: one seed file + one changelog line + ledger updates + one moved inbox file + state update.
- **Failure mode**: format error halts the pipeline for that one file; other files continue.

More from lyndonkl/claude

SkillDescription
abstraction-concrete-examplesBuilds structured abstraction ladders that translate high-level principles into concrete, actionable examples across 3-5 levels. Bridges communication gaps, reveals hidden assumptions, and tests whether abstract ideas work in practice. Use when explaining concepts at different expertise levels, moving between abstract principles and concrete implementation, identifying edge cases by testing ideas against scenarios, designing layered documentation, decomposing complex problems into actionable steps, or bridging strategy-execution gaps.
academic-letter-architectGuides the creation of evidence-based academic recommendation letters, reference letters, and award nominations that combine concrete examples, meaningful comparisons, and genuine enthusiasm. Use when writing recommendation letters for students, postdocs, or colleagues, or when user mentions recommendation letter, reference, nomination, letter of support, endorsement, or needs help with strong advocacy and comparative statements.
adr-architectureDocuments significant architectural and technical decisions with full context, alternatives considered, trade-offs analyzed, and consequences understood. Creates a decision trail that helps teams understand why decisions were made. Use when choosing between technology options, making infrastructure decisions, establishing standards, migrating systems, or when user mentions ADR, architecture decision, technical decision record, or decision documentation.
adverse-selection-priorProduces a Bayesian prior probability that an offered transaction is +EV for the recipient, given that the counterparty chose to propose it. Applies Akerlof market-for-lemons logic -- if they offered it, they believe it is +EV for them, so the prior that it is +EV for us is materially below 50%. Reusable across trade evaluation, waiver drops (another team dropping a player is also adverse selection), job-offer analysis, M&A, and any "someone offered me this" situation. Use when you receive an unsolicited trade/offer/proposal, analyzing incoming trade prior, evaluating why a counterparty proposed a deal, or when user mentions adverse selection, market for lemons, why did they offer this, incoming trade prior, they proposed it, Bayesian adjustment on received offer.
alignment-values-north-starCreates actionable alignment frameworks that give teams a shared North Star (direction), values (guardrails), and decision tenets (behavioral standards). Enables autonomous decision-making while maintaining organizational coherence. Use when starting new teams, scaling organizations, defining culture, establishing product vision, resolving misalignment, creating strategic clarity, or when user mentions North Star, team values, mission, principles, guardrails, decision framework, or cultural alignment.
analogy-weight-checkFor every analogy in a substacker draft, verifies it carries mechanical weight — the analogy does real work explaining the mechanism, not merely decorates it. Cross-references analogy-catalog.md for novelty (is this analogy reused from a prior post?) and domain fit (biology > organizational > sports preferred; physics/military disfavored). Use whenever an analogy appears in the draft. Trigger keywords: analogy weight, decorative, mechanical weight, reused analogy, catalog check, metaphor check.
answer-uncomfortable-questionTakes one strategic question about substacker ("should we launch paid?", "is this section dead?", "are we writing for the wrong audience?") and produces the mandatory evidence + reasoning + downside triad plus a recommendation. Used 3 times per Growth Strategist review. Trigger keywords: uncomfortable question, strategic question, evidence reasoning downside, triad.
attribute-performanceFor each substacker post that materially over- or under-performs the rolling baseline (|z| ≥ 1.0), produces a plain-English attribution paragraph with calibrated confidence (high / medium / low / unexplained). Considers subject-line effect, topic zeitgeist, external share, day-of-week, length effect, and audience-notes signals. Labels unexplained outliers explicitly rather than fabricating a story. Use after compute-baseline when outlier posts exist. Trigger keywords: attribution, why did this post work, outlier explanation, performance analysis.
auction-first-price-shadingComputes the optimal shaded bid for a first-price sealed-bid auction given a true private value, an estimate of the number of competing bidders N, and a value-distribution assumption. Implements the `(N-1)/N` equilibrium shading rule for uniform private values, adjusts for log-normal or empirical value distributions, layers a risk-aversion adjustment, and caps output against the bidder's remaining budget. Domain-neutral auction theory reusable across fantasy sports (baseball FAAB, NBA/NHL waiver auctions), prediction-market limit sizing, sealed procurement bids, and any blind-bid context. Use when user mentions "first-price auction bid", "sealed bid shading", "(N-1)/N", "FAAB bid amount", "auction shading", "optimal bid first-price", "bid for sealed-bid", "blind bid sizing", or when downstream logic needs a principled shade factor rather than an ad-hoc heuristic.
auction-winners-curse-haircutApplies a Bayesian haircut to a bid valuation for common-value auctions where winning is itself evidence the bidder over-estimated. Takes a raw valuation, a value-type classification (common_value / private_value / mixed), the number of informed bidders N, and a signal-dispersion estimate, and returns an adjusted valuation. Domain-neutral and reusable across fantasy FAAB, prediction markets, M&A bids, ad-auction budgets, and any generic bidding context. Use when user mentions "winner's curse", "common value auction", "valuation haircut", "adverse valuation", "Bayesian bid adjustment", or "over-paying in auction".