Back to list
so-ta

add-block

by so-ta

0🍴 0📅 Jan 23, 2026

SKILL.md


name: add-block description: | Add new block (Discord, Slack, Notion integrations etc.) workflow. Use when adding new integration blocks or system blocks to the workflow engine.

Add New Block Workflow

新規ブロック(Discord, Slack, Notion等の外部連携)を追加する際のワークフロー。

必読ドキュメント

以下を必ず先に読むこと:

  1. docs/designs/UNIFIED_BLOCK_MODEL.md - Block execution architecture
  2. docs/BLOCK_REGISTRY.md - Existing block definitions
  3. backend/migrations/011_unified_block_model.sql - 既存パターン確認

標準手順(Migration追加)

ほとんどのブロックはこの方式で追加する:

  1. Migrationファイル作成: backend/migrations/XXX_{name}_block.sql
  2. block_definitionsテーブルにINSERT
    • tenant_id = NULL でシステムブロック
    • codeにJavaScriptコード(ctx.http等を使用)
    • ui_configにアイコン・カラー・設定スキーマ
  3. Migration実行: make db-reset
  4. docs/BLOCK_REGISTRY.md を更新

コード例

INSERT INTO block_definitions (tenant_id, slug, name, category, code, ui_config, is_system)
VALUES (
  NULL,  -- システムブロック
  'discord',
  'Discord通知',
  'integration',
  $code$
    const webhookUrl = config.webhook_url || ctx.secrets.DISCORD_WEBHOOK_URL;
    const payload = { content: renderTemplate(config.message, input) };
    return await ctx.http.post(webhookUrl, payload);
  $code$,
  '{"icon": "message-circle", "color": "#5865F2", "configSchema": {...}}',
  TRUE
);

ctx インターフェース

InterfacePurpose
ctx.httpHTTP requests (GET, POST, etc.)
ctx.llmLLM API calls
ctx.workflowWorkflow control
ctx.humanHuman-in-loop interactions
ctx.secretsAccess to stored secrets

Go Adapterが必要な例外ケース

ケース理由
LLMプロバイダー追加ctx.llm経由で呼び出すため
複雑な認証フローOAuth2等、JSでは困難な場合
バイナリ処理画像・ファイル処理等

Go Adapter追加が必要な場合:

  1. Create backend/internal/adapter/{name}.go
  2. Implement Adapter interface
  3. Register in registry
  4. Add test {name}_test.go
  5. Update docs/BACKEND.md

参考

Score

Total Score

40/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon