一键导入
import-content
Import existing markdown files into Kurt database. Fix ERROR records, bulk import files, link content to database.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Import existing markdown files into Kurt database. Fix ERROR records, bulk import files, link content to database.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | import-content |
| description | 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:
---
title: "Full Page Title | Site Name"
url: https://example.com/page
description: "Brief description of the page content"
author: "Author Name"
published_date: "2025-05-28"
last_modified: "2025-10-22"
fetched_via: WebFetch
fetched_at: "2025-10-23"
---
# Page Content
[Markdown content here...]
With frontmatter:
Without frontmatter:
Document imported without frontmatter:
kurt content get-metadata abc123
Title: fusion
Status: FETCHED
Author(s): None
Published: None
Description: None
Document imported with frontmatter:
kurt content get-metadata abc123
Title: Quickstart for the dbt Fusion engine | dbt Developer Hub
Status: FETCHED
Author(s): dbt Labs, Inc.
Published: 2025-10-22
Description: Get started with the dbt Fusion engine in minutes...
When using WebFetch as a fallback, always request metadata:
WebFetch prompt:
"Extract ALL metadata from this page including:
- Full page title
- Description/meta description
- Author(s)
- Published date or last modified date
- The complete page content as markdown
Return with clear separation between metadata and content."
Then save with frontmatter format shown above.
Python dependencies:
pyyaml library (auto-installed with Kurt)If yaml library is not available, frontmatter parsing is skipped gracefully (no errors, but metadata won't be extracted).
Frontmatter not extracted:
--- on first line.claude/logs/auto-import.logpython -c "import yaml; print('OK')"Wrong metadata populated:
YYYY-MM-DDauthor: ["Name 1", "Name 2"] or author: "Single Name"The import script converts file paths to content_path format:
Organization KB (top-level sources/):
File: sources/docs.getdbt.com/guides/fusion.md
→ content_path: docs.getdbt.com/guides/fusion.md
→ URL: https://docs.getdbt.com/guides/fusion
Project sources:
File: projects/my-project/sources/internal-spec.md
→ content_path: projects/my-project/sources/internal-spec.md
→ URL: (no URL mapping, project-specific)
Check:
ls sources/file <path>cat .claude/logs/auto-import.logwhich kurtManual fix:
python .claude/scripts/import_markdown.py \
--document-id <doc-id> \
--file-path <file-path>
Cause: File is new, not from failed fetch
Solution: Create document record first
# If you know the URL:
kurct content add <url>
# Then import content
python .claude/scripts/import_markdown.py \
--document-id <new-doc-id> \
--file-path <file-path>
Cause: Another Kurt process has DB lock
Solution: Wait and retry, or kill other processes
# Check for running Kurt processes
ps aux | grep kurt
# Wait and retry
sleep 2
python .claude/scripts/import_markdown.py ...
Cause: LLM API timeout or rate limit
Solution: Retry manually
# List docs without metadata
kurt content list --status FETCHED
# Re-run indexing
kurt index <doc-id>
# Or batch index all
kurt index --status FETCHED --url-prefix <url>
| Task | Command |
|---|---|
| Import single file | python .claude/scripts/import_markdown.py --document-id <id> --file-path <path> |
| List ERROR records | kurt content list --status ERROR |
| Extract metadata | kurt index <doc-id> |
| View import logs | cat .claude/logs/auto-import.log |
| Verify import | kurt content get-metadata <doc-id> |
| Bulk index | kurt index --status FETCHED --url-prefix <url> |
With ingest-content-skill:
With document-management-skill:
kurt content get-metadataWith project-management-skill:
from pathlib import Path
import sys
sys.path.append('.claude/scripts')
from import_markdown import import_markdown_to_kurt
# Import single file
success = import_markdown_to_kurt(
document_id="5f403260",
file_path="sources/docs.getdbt.com/guides/fusion.md"
)
if success:
print("✓ Import successful")
# Run metadata extraction
import subprocess
subprocess.run(["kurt", "index", "5f403260"])
kurt content get-metadata after importInformation gathering utilities (analytics, research, content analysis) (general)
Manage Kurt projects - add sources/targets, update project.md, detect missing content, track progress. (project)
One-time team setup that creates Kurt profile and foundation rules
Collect content feedback and identify patterns for rule updates
Extract and manage writing rules (style, structure, persona, publisher, custom) (project)
Configure CMS connections and perform ad-hoc content searches (Sanity, Contentful, WordPress)