Skip to content
cccskills
FreePublished on GitHub

plc-db-sync

SKL_plc_db_sync(旧 ai-plc-db-sync)- AI-PLCのローカルDBとNotion DBをpull、push、sync、statusで双方向同期する。

The English summary is being prepared. Showing the original description.

Works withNotion
See how to install

Files included (1)

  • SKILL.md2.5 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

AI-PLC DB Sync

.claude/db/ai_plc.db をローカルの正本として扱い、projects / tasks テーブルを Notion と双方向同期する。

When to Use

  • 「DBを同期して」「NotionのDBをPullして」→ pull
  • 「タスクをNotionに反映して」「Push」→ push
  • 「DB同期状態を確認して」「syncステータス」→ status
  • 「DB同期」→ sync (双方向)
  • プロジェクトやタスクをローカルで追加・更新した後にNotionへ反映したいとき
  • Notion側の最新データをローカルに取り込みたいとき

Commands

python3 .claude/db/sync.py pull              # Notion → ローカル
python3 .claude/db/sync.py push              # ローカル → Notion
python3 .claude/db/sync.py sync              # 双方向 (pull → push)
python3 .claude/db/sync.py status            # 差分プレビュー
python3 .claude/db/sync.py pull --dry-run    # dry-run (変更なし)
python3 .claude/db/sync.py push --dry-run    # dry-run (変更なし)

Prerequisites

  • NOTION_API_TOKEN 環境変数が設定済みであること
  • .claude/db/ai_plc.db が存在すること(なければ python3 .claude/db/init_db.py --import で作成)

Sync Logic

  • Pull: Notion 側を query → notion_last_edited で差分検出 → .claude/db/ai_plc.db を更新
  • Push: updated_at > last_sync_at の行を検出 → Notion API で PATCH/POST
  • Conflict: Pull時にローカルも変更されている行は CONFLICT としてスキップ(安全側)

Data Model

テーブルローカルDB同期先Notion DB用途
projects.claude/db/ai_plc.dbNotion: Projects DB(AI_PLC_PROJECTS_DB_ID で指定)プロジェクト管理
tasks.claude/db/ai_plc.dbNotion: Tasks DB(AI_PLC_TASKS_DB_ID で指定)タスク管理

Typical Workflow

  1. status で差分を確認
  2. pull でNotion側の最新を取得
  3. ローカルで plc_query.py を使って編集
  4. push でNotionに反映

Related Files

  • .claude/db/ai_plc.db — SQLite DB本体
  • .claude/db/init_db.py — スキーマ作成 + マイグレーション
  • .claude/db/plc_query.py — ローカルクエリヘルパー
  • .claude/db/sync.py — 同期エンジン
  • .claude/db/README.md — ドキュメント

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

ai_plc_collection - AI-PLC Stage 1。Execution Contextを確立し、外部・内部情報源からコンテキストを収集・構造化する。

The English summary is being prepared. Showing the original description.

miyatti777/ai-plc49Updated Oct 2, 2026

AI-PLC Stage 1 Collection。GoalとModeからExecution Contextを確立し、Context Store、intent.yaml、context.yaml、backlog.yamlを生成する。

The English summary is being prepared. Showing the original description.

miyatti777/ai-plc49Updated Oct 2, 2026

【実験版・Jev監視つき】ai_plc_collection - AI-PLC Stage 1。Execution Contextを確立し、外部・内部情報源からコンテキストを収集・構造化する。

The English summary is being prepared. Showing the original description.

miyatti777/ai-plc49Updated Oct 2, 2026

ai_plc_inception - AI-PLC Stage 2。Goalを分析し、BacklogとSub-Agent Registryを生成する。

The English summary is being prepared. Showing the original description.

miyatti777/ai-plc49Updated Oct 2, 2026

AI-PLC Stage 2 Inception。IntentとContextからGoalを分析し、BacklogとSub-Agent Registryを生成する。

The English summary is being prepared. Showing the original description.

miyatti777/ai-plc49Updated Oct 2, 2026

【実験版・Jev監視つき】ai_plc_inception - AI-PLC Stage 2。本体02-inceptionに-jev表記を足した薄いラッパー(成功条件カバー判定は凍結中)。

The English summary is being prepared. Showing the original description.

miyatti777/ai-plc49Updated Oct 2, 2026

See all skills by miyatti777

Report a problem with this skill