金色时刻 · 15:48
让好资源,触手可及
AGENT SKILL

srtd-cli

srtd-cli 是面向软件开发的 Agent Skill,来自 t1mmen/srtd。查看技能说明、操作步骤与使用约定,并通过原项目了解详细用法。

This skill should be used when the user mentions "srtd", "sql templates", "migrations-templates", "live reload sql", "supabase functions", when working with files in supabase/migrations-templates/, when .buildlog.json or srtd.config.json is detected, or when writing Postgres functions/views/triggers for Supabase.

SKILL.md

下载 MD ↓
namesrtd-cli
descriptionThis skill should be used when the user mentions "srtd", "sql templates", "migrations-templates", "live reload sql", "supabase functions", when working with files in supabase/migrations-templates/, when .buildlog.json or srtd.config.json is detected, or when writing Postgres functions/views/triggers for Supabase.

SRTD - Iterative SQL Template Development

Workflow

Start watch in background immediately:

srtd watch --json

Use run_in_background: true. Monitor with TaskOutput for events: templateApplied (success), templateError (check errorMessage/errorHint).

Templates

Location: supabase/migrations-templates/*.sql. Must be idempotent.

Idempotency patterns: - Functions/Views: CREATE OR REPLACE (use DROP only when changing signature) - Policies: DROP POLICY IF EXISTS then CREATE POLICY (not replaceable) - Triggers: Drop BOTH trigger AND function first

Dependencies: -- @depends-on: other.sql at top

WIP: .wip.sql suffix → applies locally, never builds

Commands

srtd apply [--force] [--json]   # Apply to local DB (use instead of watch for one-off)
srtd build [--bundle]           # Generate migration FILES only (does NOT apply to DB)
srtd clear --reset              # Reset state if confused

State

  • .buildlog.json → commit (tracks built migrations)
  • .buildlog.local.json → gitignored (local DB state)

来源:t1mmen/srtd · MIT 许可 · 许可原文 · MD 为来源页保存的历史版本