本文へ移動
cccskills
無料GitHub で公開日本語紹介

library-management

画像ライブラリやコレクション、素材の項目設計、共有、URLからの参照画像取り込み、削除処理を管理するための実装指針をまとめたスキルです。

原文原文の説明を見る

Schema, CRUD, sharing, URL style imports, and cascade-delete patterns for asset libraries, collections, and assets. Use when managing a library or importing visual brand evidence from a URL.

BuilderIO/agent-nativeスター 7,525(GitHub 7,525 + cccskills 0)

実行スコア 未検証

インストール方法を見る

こんなときに便利

  • 公開サイトの画像を参照素材に取り込みたいとき
  • ブランドライブラリの共有権限を設計したいとき
  • 既存データを保って項目を追加したいとき
  • 素材を分類するコレクションを整えたいとき

日本語での紹介

できること

画像ライブラリ、コレクション、素材のデータ構造やアクセス制御、共有、削除の扱いを整理するスキルです。素材や生成履歴は親ライブラリの権限を引き継ぐため、一覧・個別取得・更新の各処理で適切な範囲に絞る方法を示します。閲覧者が候補を作る操作と、編集者が素材を保存・取り込み・整理する操作も区別します。公開URLから画像を取り込んで参照素材にしたり、Webサイトの見た目を読み取ってスタイル情報としてライブラリに保存したりできます。スキーマ変更では既存データを消さない追加方式を使い、ライブラリ削除時の関連レコードの処理も定めます。

こんなときに便利

ブランド素材を複数人で共有したいとき、Webサイトの画像やデザイン要素を参照素材として集めたいときに役立ちます。ライブラリに項目を追加する、コレクションを作る、削除時の影響を整理するといった変更にも向いています。

使い方の例

  • 「この公開ページの画像をブランドライブラリに取り込んで」
  • 「ライブラリを編集者と閲覧者で共有できるようにして」
  • 「既存データを保ったままライブラリに項目を追加して」

注意点

公開画像やWebサイトのスタイル取り込みにはURLを使います。データベース変更は既存データを保つ追加方式に限定し、本番環境でdrizzle-kit pushを使わないよう定めています。

この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。

含まれるファイル(1)

  • SKILL.md12.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Library management

Use this skill before adding fields, changing access checks, or modifying delete behavior.

User surface

The human Library workspace is canonical at /library. The root selects "All assets" and browses assets across every accessible brand kit; /library/:id opens one kit's management detail. Legacy /brand-kits URLs redirect here. Embedded picker hosts still load /library in an iframe and keep the existing bridge contract.

Schema overview

image_libraries           — top-level library, has ownableColumns + shares
  ├─ custom_instructions  — durable free-text prompt guidance
  └─ image_collections    — optional sub-grouping (categories), inherits access
  └─ image_assets         — every image (refs + generated), inherits access
  └─ image_generation_runs — one per generate call, inherits access

image_assets and image_collections and image_generation_runs do NOT carry ownableColumns themselves. They inherit access from their parent library_id via assertAccess("asset-library", libraryId, ...).

Access control

Every action that touches an ownable resource must scope its queries:

  • List queries: accessFilter(schema.assetLibraries, schema.assetLibraryShares) in WHERE. Cross-kit asset lists must first resolve the accessible library IDs, then query image_assets by those IDs and include the parent kit title for UI chips.
  • Read by id: await resolveAccess("asset-library", libraryId). The requireLibrary(id) helper in _helpers.ts wraps this.
  • Write: never assertAccess(..., "editor") directly. Use server/lib/library-access.ts, which splits writing into drafting and approving (below); "admin" still guards library archive / delete.

All assets / runs derive libraryId first, then assert against the parent library. Never query image_assets without also pinning library_id to a value the caller has access to.

Drafting vs approving

A kit viewer may draft: generation runs, generation sessions, and image_assets rows with role: "generated" and status: "candidate". Drafts never reach the kit's content — shouldIncludeAssetInLibraryResults filters unsaved candidates out of every library read — so a read-only collaborator can safely make them.

editor is still required to approve: promoting a candidate to saved, uploads, imports, folders, collections, style brief, canonical logo, templates, and deletes.

HelperBarUse for
assertCanDraft(libraryId)viewergenerate / refine / rerun, sessions, variant slots
assertCanApprove(libraryId, what)editorsave, upload, import, organize, kit settings
assertCanDraftAuthoredBy(libraryId, author, what)viewer for owna session or run someone else may have created
assertCanDeleteAsset(asset)viewer for own draftdiscarding a candidate vs deleting kit content

Drafting in a kit is not a licence to touch another drafter's work, so the author-scoped rule guards every write that lands on an existing row someone else made:

  • requireGenerationSessionInLibrary scopes the session a generation attaches to. Belonging to the kit is not enough — appending a candidate also moves the session's activeAssetId. Pass the access you already resolved to skip the second lookup.
  • refresh-generation-run reconciles a run row (status, error, outputs) and rerun-generation-run reuses its prompt, settings, and session, so both stay with the run's ownerEmail.
  • Draft reads narrow the same way. resolveDraftReadScope + canReadDraftAsset / canReadRun keep candidates and run history to their author plus anyone who could approve them, across get-library, list-assets, search-assets, and list-draft-assets. The lookup only runs when a read actually returns candidates, so ordinary asset lists cost nothing. Content fetched by explicit id (/api/assets/:id/content, get-asset) stays gated on kit read access only, because cross-app embeds of a fresh candidate depend on it.
  • Draft inputs answer to the read rule too. assertCanUseAssets / assertCanUseRuns guard every path that takes an asset or run id — generation references, lineage source, subject, video source, and session attachments — because a scope that holds on list surfaces but not on id arguments is not a boundary. selectReferences takes a required draftScope so a new generation path cannot forget it: the automatic pool scores every asset in the kit, candidates included.
  • Sessions and run history narrow the same way. sessionReadFilter / canReadSession keep list-generation-sessions and get-generation-session to the sessions a below-approver caller created (and strip items, candidates, and runs they cannot read), and runReadFilter / canReadRun do the same for list-generation-runs and get-generation-run. Reading one by id is not a way around the list rule.
  • Deleting a draft goes through deleteDraftAssetIfUnchanged, never a bare delete-by-id. Authorization comes from a prior read, so the predicate lets an editor's concurrent approval win, and the confirming re-read keeps the answer portable. delete-asset reports the refusal; dismiss-variant-slots counts it in assetsRetained.
  • Paging happens after the filter, not before. draftReadFilter turns the scope into a WHERE clause for list-draft-assets; filtering post-limit silently drops the caller's own older drafts behind other people's newer ones.
  • dismiss-variant-slots re-reads every asset behind the slots it clears. Variant state is client-writable, so a slot id is never permission to delete: anything outside the state's kit, already saved, or authored by someone else clears from the tray and comes back in assetsRetained. The delete itself is conditional on the state that was authorized, so an editor's save always beats an in-flight dismissal, and the outcome is confirmed by re-reading rather than by a confirming Postgres read.

assertCanDraft returns { role, canApprove }. Generation actions report draftPendingApproval: true when canApprove is false so the caller can say the images are waiting on an editor instead of claiming they were saved. get-library-access exposes the same answer to the UI and to other agents.

The refusal message keeps the framework's Requires editor role on asset-library <id> (have viewer) prefix on purpose: core's permanent-precondition classifier matches that shape and ends the agent turn instead of retrying a grant it cannot obtain. Keep it if you reword the remedy.

Adding a new field

The schema is strictly additive. Hosted templates share their prod DB across every deploy context, so destructive changes wipe live user data. Rules:

  • Add a column via ALTER TABLE ... ADD COLUMN IF NOT EXISTS ... in server/plugins/db.ts with a new migration version.
  • Never rename or drop. If a column is wrong, add the replacement alongside it.
  • Never use drizzle-kit push against production. The framework guard will fail the build.

Example: adding image_libraries.icon:

  1. Bump the migration version array in server/plugins/db.ts:
    {
      version: 6,
      sql: `ALTER TABLE image_libraries ADD COLUMN IF NOT EXISTS icon TEXT`,
    },
    
  2. Add icon: text("icon") to schema.ts for image_libraries.
  3. Read it in actions. Done.

Sharing

Libraries follow the standard framework sharing model:

  • visibility: "private" | "org" | "public"
  • Per-user / per-org grants in image_library_shares with viewer | editor | admin roles.
  • Use the framework actions share-resource, unshare-resource, set-resource-visibility with --resourceType=asset-library. The legacy image-library alias remains registered for existing grants.

Generated assets and references inherit the parent library's visibility. v1 doesn't support per-asset overrides; the schema is forward-compatible (image_generated_image_shares could be added without disturbing existing rows) but not surfaced in the UI.

Duplicating a brand kit

Use duplicate-library when a user wants a Brand Kit copy. The action creates a private, current-user-owned copy with durable kit contents remapped, without copying shares, visibility, generation runs, or handoff sessions.

Cascade delete

delete-library deletes in order:

  1. image_assets WHERE library_id = $1
  2. image_generation_runs WHERE library_id = $1
  3. image_collections WHERE library_id = $1
  4. image_library_shares WHERE resource_id = $1
  5. image_libraries WHERE id = $1

The asset rows are deleted from SQL but the underlying objects in S3 / local fallback are not automatically reaped — that's a v2 background job. For now, the orphaned blobs are tolerable since the framework's asset URLs all check access via the asset row.

Reference vs. generated

Reference images and generated images live in the same image_assets table, distinguished by:

  • role — what kind of evidence: style_reference / logo_reference / product_reference / diagram_reference / generated
  • status — what to do with it: reference (uploaded by user) / candidate (just generated, ephemeral) / saved (user kept it) / archived (hidden) / failed (errored)

The unified table simplifies access control (one library_id, one access check) and makes "use a saved generation as a reference for a future generation" a first-class operation — just bump its role to prior-candidate (planned for v2; v1 just selects from any non-archived asset).

Importing external references

Ingest external brand or blog imagery with import-asset-from-url, then pin the returned asset to preset reference boards or set it as the canonical logo.

Use import-asset-from-url when the agent has found a public HTTPS image that belongs in a brand kit, such as a blog hero, product shot, logo, campaign image, or diagram. Choose the narrowest reference role (style_reference, subject_reference, product_reference, background_reference, logo_reference, or diagram_reference) and preserve a useful title or description when known. The deliverable category defaults to match the role (logo → logo, product → product, diagram → diagram); pass an explicit category such as hero or campaign when the image belongs in one of those filtered views.

For a blog-to-brand-kit workflow: inspect the page, pick the strongest image URLs, import each URL into the target libraryId, then wire the returned assetIds into associated Template reference fills or call set-canonical-logo for the exact logo. Imported assets are stored as status: "reference" with sourceUrl provenance, so downstream generation, preset boards, and logo compositing can use them like uploaded reference assets.

Importing a rendered visual system

Use import-style-from-url when a public website should contribute more than images to a library or collection. It uses the same layered browser extractor as Design and Slides, so CSS-in-JS, Tailwind, hydration, web fonts, computed colors, component styles, spacing, radii, shadows, CSS variables, and logo references are captured from the live cascade. The action persists a bounded designMd summary plus structured fields in styleBrief, with the source URL and any browser/static-fallback warnings preserved for provenance.

Prefer this action over copying raw HTML into a style brief. If the result is partial, the structured values are still usable but the warnings must remain visible to the agent; failed is an error and must not be treated as an empty style brief.

When to add a collection

Collections are optional. Most users won't create them. Use them when:

  • A library has multiple distinct visual systems (e.g. "blog heroes" vs "landing imagery" within one brand library).
  • The user wants per-collection defaults (aspect ratio, image size, style brief layered on top of the library's).

Skip them otherwise. A flat library with category-tagged assets covers most cases.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

a2a-assets

無料概要あり

複数のアプリやMCPホストからブランド画像・動画を生成、調整、書き出し、挿入する作業を支援します。ライブラリ選択や修正依頼も扱います。

  • スライド用のブランド画像を作りたいとき
  • 既存素材をフィードバックに合わせて直したいとき
  • 動画素材を生成して書き出したいとき
BuilderIO/agent-native7,5252026年10月26日 更新

account-health

無料概要あり

特定の顧客企業について、契約と製品利用の数値を照らし合わせ、根拠や不足情報を明記した健全性レポートをまとめます。

  • 顧客の健全性を確認したいとき
  • 契約席数と実利用を比べたいとき
  • 更新前に利用状況を整理したいとき
BuilderIO/agent-native7,5252026年10月26日 更新

actions

無料概要あり

アプリの操作をエージェントと画面の両方から呼び出せるアクションとして実装し、API連携や画面のデータ取得を一貫した形で追加するスキルです。

  • 新しいアプリ操作を追加したいとき
  • 外部APIと連携したいとき
  • 画面からデータを取得したいとき
BuilderIO/agent-native7,5252026年10月26日 更新

adding-a-feature

無料概要あり

新機能をUI・エージェント用アクション・説明資料・画面状態の4領域でそろえ、利用者とエージェントのどちらからも一貫して使えるようにするチェックリストです。

  • 新機能追加の作業範囲を整理したいとき
  • UIとエージェント操作をそろえたいとき
  • 画面状態の同期漏れを防ぎたいとき
BuilderIO/agent-native7,5252026年10月26日 更新

adhoc-analysis

無料概要あり

複数のデータソースを照合して、傾向や指標、根拠をまとめた分析結果を作成します。必要に応じて、再実行できるダッシュボードとして保存できます。

  • 商談と通話記録を照合したいとき
  • 顧客の利用状況を横断して調べたいとき
  • 繰り返し更新できる分析を保存したいとき
BuilderIO/agent-native7,5252026年10月26日 更新

admin-surfaces

無料概要あり

Analyticsの管理画面で、機能フラグの状態確認と切り替え、ダッシュボード利用状況の調査、接続先アプリのデータベース管理を行います。

  • アプリごとの機能フラグを確認・変更したいとき
  • ダッシュボードの所有者や利用状況を調べたいとき
  • 接続済みアプリのテーブルを管理したいとき
BuilderIO/agent-native7,5252026年10月26日 更新

BuilderIO のスキルをすべて見る

このスキルの問題を報告する