AgentSkillsCN

taskdb

在持久化的 SQLite 数据库中管理任务。通过标签、优先级与截止日期,添加、列出、完成、优先排序并搜索任务。当用户提及任务、待办事项、工作项追踪,或需要进行任务管理时,可使用此技能。

SKILL.md
--- frontmatter
name: taskdb
description: Manage tasks in a persistent SQLite database. Add, list, complete, prioritize, and search tasks with tags, priorities, and due dates. Use when the user mentions tasks, to-dos, tracking work items, or task management.
metadata: {"moltbot":{"os":["darwin","linux"],"requires":{"bins":["python3"]}}}

TaskDB

Persistent, SQLite-backed task management for Clawdbot.

When to Use

  • User asks to add, list, complete, or search tasks
  • User mentions to-dos, action items, or work tracking
  • User wants to prioritize or organize tasks
  • You need to check what tasks are pending

Quick Start

bash
# List pending tasks
python3 {baseDir}/list_tasks.py

# Add a task via Python
python3 -c "
from taskdb import TaskDatabase
db = TaskDatabase()
db.add_task('Task title', description='Details', priority=1, tags='#work')
db.close()
"

Database

Location: ~/clawd/taskdb.sqlite

Schema:

ColumnTypeDefault
idINTEGER (PK)autoincrement
titleTEXTrequired
descriptionTEXTnull
priorityINTEGER2 (1=high, 2=medium, 3=low)
statusTEXT"pending"
created_atDATETIMEnow
updated_atDATETIMEnow
due_dateDATETIMEnull
tagsTEXTempty
contextTEXTnull

Available Scripts

All scripts are in {baseDir}/:

ScriptPurpose
taskdb.pyCore TaskDatabase class — import and use directly
list_tasks.pyPrint all pending tasks
bulk_add_tasks.pyAdd multiple tasks at once
clean_duplicate_tasks.pyRemove duplicate entries

Core API

python
from taskdb import TaskDatabase

db = TaskDatabase()                          # connects to ~/clawd/taskdb.sqlite
db.add_task(title, description, priority, context, tags, due_date)
db.list_tasks(status='pending', priority=None)
db.complete_task(task_id)
db.close()

Examples

Add a task:

python
db.add_task("Review PR #42", description="Check test coverage", priority=1, tags="#work #code-review")

List high-priority pending tasks:

python
tasks = db.list_tasks(status='pending', priority=1)

Complete a task:

python
db.complete_task(42)

Error Handling

ErrorCauseFix
sqlite3.OperationalError: no such tableDatabase not initializedInstantiate TaskDatabase() — it auto-creates the table
FileNotFoundError on db_path~/clawd/ directory missingCreate directory: mkdir -p ~/clawd
Duplicate tasksSame task added multiple timesRun python3 {baseDir}/clean_duplicate_tasks.py