db-upsert

Upsert topic-based documents and synchronize the central index in a database.

1|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/adamrdrew/claude-code-patterns --skill db-upsert
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-upsert
Source: https://github.com/adamrdrew/claude-code-patterns/tree/main/procedural-skills/.claude/skills/db-upsert
Command: npx skills add https://github.com/adamrdrew/claude-code-patterns --skill db-upsert

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automates the creation or updating of topic-based documents in a database, ensuring new topics are added to the index and existing ones are merged with current content.

Core Features & Use Cases

  • Deterministic, step-by-step workflow: verify database, determine topic and content, check existence, write/merge, and update the index using TaskCreate/TaskUpdate.
  • Topic-based organization: supports inserting new documents and updating existing ones; keeps a central index at database/index.md.
  • Use Case: You receive notes about a project, and this skill stores them under a topic like "project-synopsis" and keeps the index in sync.

Quick Start

Provide a topic and its content to upsert, and I will create or update the corresponding document and refresh the index.

Frequently Asked Questions about db-upsert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I upsert documents into a database while keeping an index synchronized?

You can upsert documents by providing topic content to a workflow that verifies the database, checks for existing entries, writes or merges the content, and updates a central index.md file to stay synchronized.

What is the best way to merge notes under a specific topic in a database?

Merging notes under a topic is handled by a task-driven workflow that determines the topic, checks if the document exists, merges the new content with existing records, and updates the central index.

How does a deterministic workflow help with database document creation?

A deterministic workflow helps database document creation by executing strict sequential tasks: verifying the database, determining the topic, checking existence, writing or merging data, and verifying the index update.

Can I use TaskCreate and TaskUpdate to store topic-based records?

Yes, you can use TaskCreate and TaskUpdate to guide the workflow for storing topic-based records, ensuring new documents are created, existing entries are merged, and the central index remains synchronized.

Do I need an existing index.md file before upserting topic documents?

You do not need an existing index.md file before upserting topic documents; the workflow verifies the database state and will update or create the central index as part of its task-driven process.

What happens if I try to upsert a document for a topic that already exists?

If you upsert a document for a topic that already exists, the workflow checks its existence and merges the new content with the current records, then updates the index to maintain synchronization.