Import existing markdown files into Kurt database. Fix ERROR records, bulk import files, link content to database.
This skill helps import existing markdown files into Kurt's database when automatic ingestion fails. It's the manual fallback for the auto-import hook and provides bulk operations for fixing ERROR records.
When to use:
/sources/# Fix single ERROR record
python .claude/scripts/import_markdown.py \
--document-id 5f403260 \
--file-path sources/docs.getdbt.com/guides/fusion-quickstart.md
# Extract metadata after import
kurt index 5f403260
Scenario: Used WebFetch to retrieve content, but Kurt DB has ERROR records.
Steps:
List ERROR records:
kurt content list --status ERROR
Find corresponding markdown files:
find sources -name "*.md" -type f
For each ERROR record with a matching file:
python .claude/scripts/import_markdown.py \
--document-id <doc-id> \
--file-path <file-path>
# Then extract metadata
kurt index <doc-id>
Verify success:
kurt content get-metadata <doc-id>
Scenario: Multiple ERROR records with existing markdown files.
Create bash script:
#!/bin/bash
# Fix all ERROR records with matching files
while read -r doc_id url status; do
if [ "$status" = "ERROR" ]; then
# Try to find corresponding file
# (Implement file finding logic based on URL)
if [ -f "$file_path" ]; then
echo "Importing: $doc_id"
python .claude/scripts/import_markdown.py \
--document-id "$doc_id" \
--file-path "$file_path"
kurt index "$doc_id"
fi
fi
done < <(kurt content list)
Scenario: You created markdown files directly without using kurct content.
Steps:
Verify file exists and has content
Check if document record exists:
kurt content list --url-contains <domain>
If ERROR record exists, import:
python .claude/scripts/import_markdown.py \
--document-id <doc-id> \
--file-path <file-path>
If no record exists, use kurct content:
# Create record and import
kurct content add <url>
# Then import file content
python .claude/scripts/import_markdown.py \
--document-id <new-doc-id> \
--file-path <file-path>
Files written to /sources/ or projects/*/sources/ are automatically imported via PostToolUse hook.
How it works:
Hook location: .claude/settings.json
Script: .claude/scripts/auto-import-source.sh
Logs: .claude/logs/auto-import.log
The import script automatically parses YAML frontmatter from markdown files and populates database metadata fields.
The following frontmatter fields are automatically extracted and stored in Kurt database:
| Frontmatter Field | Database Column | Notes |
|---|---|---|
title | title | Full page title |
description | description | Page description/summary |
author | author | Single author or list (stored as JSON array) |
published_date | published_date | Publication date |
date | published_date | Alternative to published_date |
last_modified | published_date | Falls back if published_date not found |
Use YAML frontmatter at the start of markdown files:
---