
Kuroco Api Content
Let your agent generate Kuroco RCMS API calls for file upload, content insert with file_id, image CDN URLs, and news bulk_upsert CSV flows.
Overview
kuroco-api-content is an agent skill for the Build phase that documents Kuroco RCMS file upload, image URLs, and news bulk upsert API usage.
Install
npx skills add https://github.com/diverta/kuroco-skills --skill kuroco-api-contentWhat is this skill?
- POST /rcms-api/1/files/upload with FormData and cookie credentials
- Attach uploaded file_id to content insert payloads (e.g. news ext_col fields)
- Documented Kuroco image CDN URL pattern on g.kuroco-img.app with width/height/fit params
- bulk_upsert via POST /rcms-api/1/news/bulk with list of topics rows
- Supports create and update rows when topics_id is supplied in bulk items
Adoption & trust: 1 installs on skills.sh; 1 GitHub stars; 2/3 security scanners passed (skills.sh audits); trending (+100% hot-view momentum).
What problem does it solve?
You are moving content or files into Kuroco but the RCMS file and bulk endpoints are tedious to get right without concrete request examples.
Who is it for?
Indie devs and solo maintainers automating Kuroco content migration or recurring CSV syncs with session/cookie auth.
Skip if: Projects not on Kuroco RCMS or teams that only need front-end theming without API writes.
When should I use this skill?
When implementing Kuroco file upload, attaching files to content fields, building image CDN URLs, or running news bulk upsert from code.
What do I get? / Deliverables
You have copy-ready fetch patterns for upload, content insert with file linkage, CDN image URLs, and bulk news list payloads.
- Upload helper returning file_id from /files/upload
- Bulk upsert payload mapping spreadsheet rows to news list entries
Recommended Skills
Journey fit
Headless CMS API work happens while you connect your product or migration scripts to Kuroco. File upload, bulk endpoints, and content binding are third-party platform integration tasks.
How it compares
API recipe skill for Kuroco headless CMS—not a generic REST CRUD generator or WordPress skill.
Common Questions / FAQ
Who is kuroco-api-content for?
Solo builders and small teams integrating Kuroco RCMS for files, images, and bulk news content from scripts or agent-driven codegen.
When should I use kuroco-api-content?
During Build integrations when implementing upload, bulk_upsert, or image URL construction against your Kuroco site API.
Is kuroco-api-content safe to install?
Use the Security Audits panel on this Prism page; treat credentials: include and upload endpoints carefully and never expose session cookies in public repos.
SKILL.md
READMESKILL.md - Kuroco Api Content
# ファイル操作・CSVインポート ## ファイルアップロード ### 1. ファイルをアップロード ```javascript async function uploadFile(file) { const formData = new FormData() formData.append('file', file) const response = await fetch('/rcms-api/1/files/upload', { method: 'POST', credentials: 'include', body: formData }) const result = await response.json() return result.file_id } ``` ### 2. コンテンツに紐付け ```javascript // アップロード後、file_idをコンテンツに紐付け const fileId = await uploadFile(file) await fetch('/rcms-api/1/news/insert', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ subject: 'タイトル', ext_col_02: { file_id: fileId, desc: 'ファイルの説明' } }) }) ``` ### 画像URL形式 ``` https://{サイトキー}.g.kuroco-img.app/files/{ディレクトリ}/{ファイル名} ``` 画像変換パラメータ: ``` ?width=300&height=200&fit=cover ``` ## CSVインポート/エクスポート ### 一括アップロード(bulk_upsert) ```javascript async function bulkUpsert(items) { const response = await fetch('/rcms-api/1/news/bulk', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ list: items.map(item => ({ topics_id: item.id, // 既存更新の場合 subject: item.title, contents: item.body, ymd: item.date, topics_flg: 1 })) }) }) return response.json() } // 使用例 await bulkUpsert([ { title: 'タイトル1', body: '本文1', date: '2024-01-01' }, { id: 123, title: '更新タイトル', body: '更新本文' } // 既存更新 ]) ``` ## カテゴリ管理 ### カテゴリ一覧取得 ``` パス: categories カテゴリー: コンテンツ モデル: TopicsCategory オペレーション: list topics_group_id: {グループID} ``` ### レスポンス構造 ```json { "list": [ { "topics_category_id": 1, "category_nm": "カテゴリ名", "parent_id": 0, "category_weight": 1, "child": [ { "topics_category_id": 2, "category_nm": "子カテゴリ", "parent_id": 1 } ] } ] } ``` ## タグ管理 ### タグの設定 ```javascript // コンテンツ作成/更新時 { "subject": "タイトル", "tag": ["タグ1", "タグ2", "タグ3"] } ``` ### タグでフィルター ```javascript const params = new URLSearchParams({ filter: "tag contains 'タグ1'" }) ``` ## 閲覧/編集制限 ### 閲覧制限の種類 | 種類 | 説明 | |------|------| | 選択なし | 全員閲覧可能 | | グループ制限 | 特定グループのメンバーのみ | | メンバーカスタム検索 | 条件に合致するメンバーのみ | ### 制限適用の優先順位 1. コンテンツ定義の設定 2. カテゴリの設定 3. 個別コンテンツの設定 # フィルタークエリ詳細 ## 基本構文 ``` filter={field} {operator} {value} ``` ## 演算子一覧 | 演算子 | 説明 | 例 | |--------|------|-----| | `=` | 等しい | `filter=category_id = 1` | | `!=` | 等しくない | `filter=topics_flg != 0` | | `>` | より大きい | `filter=topics_id > 100` | | `>=` | 以上 | `filter=ymd >= '2024-01-01'` | | `<` | より小さい | `filter=topics_id < 100` | | `<=` | 以下 | `filter=ymd <= '2024-12-31'` | | `contains` | 部分一致 | `filter=subject contains 'キーワード'` | | `not_contains` | 部分一致しない | `filter=subject not_contains '除外'` | | `in` | いずれかに一致 | `filter=category_id in [1, 2, 3]` | | `not_in` | いずれにも一致しない | `filter=category_id not_in [1, 2]` | ## 複合条件 ```javascript // AND条件 const params = new URLSearchParams({ filter: "category_id = 1 and ymd >= '2024-01-01'" }) // OR条件 const params = new URLSearchParams({ filter: "category_id = 1 or category_id = 2" }) // 複合条件 const params = new URLSearchParams({ filter: "(category_id = 1 or category_id = 2) and topics_flg = 1" }) ``` ## ソート ```javascript // 降順(新しい順) const params = new URLSearchParams({ order_by: 'ymd desc' }) // 昇順 const params = new URLSearchParams({ order_by: 'topics_id asc' }) // 複数条件 const params = new URLSearchParams({ order_by: 'category_id asc, ymd desc' }) ``` ## ページネーション ```javascript const params = new URLSearchParams({ pageID: '2', // ページ番号(1始まり) cnt: '20' // 1ページあたりの件数 }) const response = await fetch(`/rcms-api/1/news?${params}`) ``` ## 全件取得のページネーション実装 ```javascript async function fetchAllNews() { let allItems = [] let page = 1 let hasMore = true while (hasMore) { const response = await fetch(`/rcms-api/1/news?pageID=${page}&cnt=100`) c