bmob-database-swift

bmob-database-swift is a skill for Claude Code, Codex from bmob/agent-skills. It costs 190 tokens per session (2,865 once invoked), scanned A, original, MIT.

A guide for using Bmob’s pure Swift database SDK in iPhone, iPad, and Mac apps. Bmob is a cloud database service, and this guide covers its Swift package, database objects, queries, users, files, and related features.

In plain words
What is it for?
Use it when adding, reading, changing, or deleting Bmob data from Swift apps, including user accounts, file uploads, relationships, location data, and access rules.
Why use it?
It helps avoid mixing this newer Swift SDK with Bmob’s older Objective-C SDK. It also highlights setup order, supported system versions, and basic security precautions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding, reading, changing, or deleting Bmob data from Swift apps, including user accounts, file uploads, relationships, location data, and access rules.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/bmob/agent-skills/bmob-database-swift
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add bmob/agent-skills --skill bmob-database-swift
Clone the repo
git clone --depth 1 https://github.com/bmob/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bmob-database-swift

README.md
[![agentmods](https://agentmods.dev/badge/skills/bmob/agent-skills/bmob-database-swift/github.svg)](https://agentmods.dev/skills/bmob/agent-skills/bmob-database-swift)
Your own site
<a href="https://agentmods.dev/skills/bmob/agent-skills/bmob-database-swift"><img src="https://agentmods.dev/badge/skills/bmob/agent-skills/bmob-database-swift/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for bmob-database-swift

Your own site · 80×15
<a href="https://agentmods.dev/skills/bmob/agent-skills/bmob-database-swift"><img src="https://agentmods.dev/badge/skills/bmob/agent-skills/bmob-database-swift.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 190 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,865 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00190 $0.02865
Opus 5 $0.00095 $0.01432
Sonnet 5 $0.00038 $0.00573
Haiku 4.5 $0.00019 $0.00286

Measured today against content hash a83a1b137ef0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

bmob-database-swift scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/bmob-database-swift/SKILL.md · 227 lines

How it starts

The opening of the file, as written. The whole thing — 227 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Bmob Database — Pure Swift SDK

纯 Swift SDK BmobSwiftSDK 面向 iOS 15+ / macOS 12+,使用 Swift Package Manager 或 CocoaPods 安装,API 以 async/awaitBmob.initialize(appKey:)BmobObjectBmobQuery 为核心。

如果项目使用旧版 Objective-C BmobSDKBmobSDK.xcframework、Bridging Header 或 saveInBackgroundWithResultBlock,改读 bmob-database-ios

核心原则

  1. 先确认 SDK 形态:纯 Swift SDK 的包名是 BmobSwiftSDK,导入模块通常是 import BmobSDK;旧 iOS SDK 是 Objective-C framework + Bridging Header。
  2. 最低环境:Xcode 15.0+、Swift 5.9+、iOS 15.0+、macOS 12.0+。
  3. 初始化是异步的:启动早期 try await Bmob.initialize(appKey:);业务请求前必要时检查 await Bmob.isReady
  4. 数据表默认用 BmobObject(className:):字段通过下标读写,更新 / 删除必须带 objectId
  5. 查询用链式 BmobQuerywhereKeyorderlimitskipincludeKey 都返回 query,最后 try await find() / get(objectId:)
  6. 上线域名必须在初始化前设置:私有云或备案域名用 Bmob.resetDomain(...),顺序在 initialize 之前。

安全清单

  • 示例只放 "YOUR_APP_KEY" / "your-application-id",不要 commit 真实 AppKey。
  • 客户端不要携带 Master Key;需要管理能力时改走服务端、REST 管理脚本或 MCP。
  • 写入业务表时设置 ACL(如 BmobACL),避免默认权限导致任意用户读写。
  • 用户密码只通过 BmobUser 注册、登录、改密 API 处理,不要当普通字段更新。
  • 文件上传前确认来源、大小、MIME 类型;不要把本地绝对路径写进业务表。
  • release 前确认 resetDomain 使用备案/私有云域名,且调用顺序早于初始化。

快速开始

安装

Swift Package Manager:

dependencies: [
    .package(url: "https://github.com/bmob/BmobSwiftSDK", from: "1.0.6")
],
targets: [
    .target(name: "YourApp", dependencies: [
        .product(name: "BmobSDK", package: "BmobSwiftSDK")
    ])
]

CocoaPods:

platform :ios, '15.0'
use_frameworks!

target 'YourApp' do
  pod 'BmobSwiftSDK', '~> 1.0.6'
end

初始化

import SwiftUI
import BmobSDK

@main
struct MyApp: App {
    init() {
        Task {
            do {
                // 私有云或备案域名必须在 initialize 前设置:
                // Bmob.resetDomain("https://your-private-cloud.com")
                try await Bmob.initialize(appKey: "YOUR_APP_KEY")
            } catch {
                print("Bmob 初始化失败: \(error)")
            }
        }
    }

    var body: some Scene {
        WindowGroup { ContentView() }
    }
}

Read the full file on GitHub · 227 lines

Files

What ships with it

60 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +3 lines a83a1b137ef0
  2. 8d ago First seen · 224 lines · 190 tokens per session scan A a0fe49b02ce7

Subscribe to this mod's changes

bmob-database-swift is a skill published in the GitHub repository bmob/agent-skills (3 stars, last pushed yesterday), licensed MIT. It adds 190 tokens to every session and 2,865 once invoked, about $0.0010 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.