Token导航 LogoToken导航TokenDH.com
研究检索敏感数据github未标认证来源可访问许可证需确认审计通过

axiom-contacts公理联系

Agent Skill

axiom-contacts 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

648

周安装

27

GitHub Stars

873

下载量

216
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:axiom-contacts(公理联系)
来源仓库:https://github.com/charleswiltgen/axiom
仓库路径:skills/axiom-contacts
安装命令:
npx skills add https://github.com/charleswiltgen/axiom --skill axiom-contacts
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/charleswiltgen/axiom --skill axiom-contacts

简介

联系人访问权限分级管理与选择器集成策略。

  • 推荐使用 Contact Access Button 或 CNContactPicker 减少授权请求。
  • 仅在需要持久化数据时才申请完整数据库访问权限。
  • 需根据 iOS 版本差异选择兼容的实现方式。
  • axiom-contacts 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Contacts — Discipline

Core Philosophy

"The contact access button is a powerful new way to manage access to contacts, right in your app. Instead of a full-screen picker, this button fits into your existing UI."

Mental model: Contacts has four authorization levels. Most apps should use the Contact Access Button or CNContactPickerViewController, which require no authorization at all. Only request store access when you need persistent contact data.

When to Use This Skill

Use this skill when:

  • Reading or writing contacts
  • Choosing between picker, Contact Access Button, or full store access
  • Requesting Contacts permissions
  • Implementing contact search or selection UIs
  • Migrating to iOS 18 limited access
  • Building a Contact Provider extension
  • Implementing incremental contact sync

Do NOT use this skill for:

  • Calendar events or reminders (use eventkit)
  • General privacy patterns (use privacy-ux)
  • SwiftUI architecture (use swiftui-architecture)

Related Skills

  • contacts-ref — Complete Contacts/ContactsUI API reference
  • eventkit — EventKit discipline skill
  • privacy-ux — General iOS privacy and permission UX
  • keychain — If storing contact-related credentials

Access Level Decision Tree

digraph contacts_access {
    rankdir=TB;
    "What does your app need?" [shape=diamond];
    "One-time contact selection?" [shape=diamond];
    "Persistent access to specific contacts?" [shape=diamond];
    "Search + incremental discovery?" [shape=diamond];
    "Read entire contact database?" [shape=diamond];

    "CNContactPickerViewController" [shape=box, label="No Auth Required\nCNContactPickerViewController\nOne-time snapshot"];
    "Contact Access Button" [shape=box, label="Limited or Not Determined\nContactAccessButton\nGrants access per-contact"];
    "contactAccessPicker" [shape=box, label="Limited Access\ncontactAccessPicker\nBulk contact selection"];
    "Full access" [shape=box, label="Full Access\nCNContactStore\nRead/write all contacts"];

    "What does your app need?" -> "One-time contact selection?" [label="pick a contact"];
    "One-time contact selection?" -> "CNContactPickerViewController" [label="yes"];
    "One-time contact selection?" -> "Persistent access to specific contacts?" [label="no, need persistent"];
    "Persistent access to specific contacts?" -> "Search + incremental discovery?" [label="yes"];
    "Search + incremental discovery?" -> "Contact Access Button" [label="search flow\n(best UX)"];
    "Search + incremental discovery?" -> "contactAccessPicker" [label="bulk selection\n(friend matching)"];
    "Persistent access to specific contacts?" -> "Read entire contact database?" [label="no"];
    "Read entire contact database?" -> "Full access" [label="yes, core feature"];
}

The Four Authorization Levels

Not Determined

App hasn't requested access yet. CNContactStore auto-prompts on first access attempt. ContactAccessButton works in this state — tapping it triggers a simplified limited-access prompt.

Limited Access (iOS 18+)

User selected specific contacts to share. Your app sees only those contacts via CNContactStore. The API surface is identical to full access — only the visible contacts differ.

Your app always has access to contacts it creates, regardless of authorization level.

Full Access

Read/write access to all contacts. Users must explicitly choose "Full Access" in the two-stage prompt. Reserve this for apps where contacts are the core feature.

Denied

No access to contact data. App cannot read, write, or enumerate contacts.


Contact Access Button (iOS 18+)

The preferred way to give users control over which contacts your app can access. Shows search results for contacts your app doesn't yet have access to. One tap grants access.

@State private var searchText = ""

var body: some View {
    VStack {
        // Your app's own search results first
        ForEach(myAppResults) { result in
            ContactRow(result)
        }

        // Contact Access Button for contacts not yet shared
        if authStatus == .limited || authStatus == .notDetermined {
            ContactAccessButton(queryString: searchText) { identifiers in
                let contacts = await fetchContacts(withIdentifiers: identifiers)
                // Use the newly accessible contacts
            }
        }
    }
}

Customization

ContactAccessButton(queryString: searchText)
    .font(.system(weight: .bold))          // Upper text + action label
    .foregroundStyle(.gray)                 // Primary text color
    .tint(.green)                           // Action label color
    .contactAccessButtonCaption(.phone)     // .defaultText, .email, .phone
    .contactAccessButtonStyle(
        ContactAccessButton.Style(imageWidth: 30)
    )

Security Requirements

The button only grants access when:

  • Contents are clearly legible (sufficient contrast)
  • Button is fully unobstructed (not clipped)
  • Taps are validated events (not simulated)

If any requirement fails, tapping the button does nothing. Always ensure adequate contrast and avoid clipping.


Anti-Patterns

PatternTime CostWhy It's WrongFix
Requesting full access for contact picking1-2 sprint days recovering denied usersFull access prompts denied 40%+ of the timeUse CNContactPickerViewController or ContactAccessButton
Accessing unfetched key on CNContact15-30 min debugging crashCNContactPropertyNotFetchedException — no clear error messageAlways specify keysToFetch
Using manual name key lists instead of formatter descriptor10-20 min debugging per localeDifferent cultures use different name field combinationsUse CNContactFormatter.descriptorForRequiredKeys(for:)
Creating multiple CNContactStore instances30+ min debugging stale dataObjects from one store can't be used with anotherCreate one, reuse it
Fetching all keys "just in case"App Store review riskOverfetching triggers stricter privacy scrutinyFetch only the keys you need
Using CNContactStore on main thread1-2 hours debugging UI freezes"Fetch methods perform I/O" — Apple docsRun fetches on background thread
Missing NSContactsUsageDescription in Info.plist15 min debugging crashApp crashes on any contact store access attemptAdd the usage description
Mutating CNMutableContact across threads2-4 hours debugging corruption"CNMutableContact objects are not thread-safe"Use immutable CNContact for cross-thread access
Ignoring .limited status1-2 hours debugging "missing contacts"App assumes full access but only sees subsetCheck status and show ContactAccessButton
Not handling note field entitlement30 min debugging empty notescom.apple.developer.contacts.notes requiredApply for entitlement from Apple

Key Patterns

Minimal Key Fetching

Always specify exactly which properties you need:

let keys: [CNKeyDescriptor] = [
    CNContactGivenNameKey as CNKeyDescriptor,
    CNContactFamilyNameKey as CNKeyDescriptor,
    CNContactPhoneNumbersKey as CNKeyDescriptor,
    CNContactFormatter.descriptorForRequiredKeys(for: .fullName)
]

let request = CNContactFetchRequest(keysToFetch: keys)

Rule: You may only modify properties whose values you fetched. Accessing an unfetched property throws CNContactPropertyNotFetchedException.

See contacts-ref for search predicates, save operations, name formatting, and vCard serialization.


Incremental Sync (Change History)

For apps that cache contacts and need to detect changes:

// Save the token after initial fetch
var changeToken = store.currentHistoryToken

// Later, fetch changes since last token
let request = CNChangeHistoryFetchRequest()
request.startingToken = changeToken
request.shouldUnifyResults = true
request.additionalContactKeyDescriptors = [
    CNContactFormatter.descriptorForRequiredKeys(for: .fullName)
]

// Process via visitor pattern (required)
class MyVisitor: NSObject, CNChangeHistoryEventVisitor {
    func visit(_ event: CNChangeHistoryDropEverythingEvent) {
        // Full re-sync needed — token expired or first fetch
    }
    func visit(_ event: CNChangeHistoryAddContactEvent) {
        // New contact added
    }
    func visit(_ event: CNChangeHistoryUpdateContactEvent) {
        // Contact modified
    }
    func visit(_ event: CNChangeHistoryDeleteContactEvent) {
        // Contact deleted
    }
}

Gotcha: enumeratorForChangeHistoryFetchRequest:error: is Objective-C only — unavailable in Swift. Use a bridging wrapper.

Token expiration: When token expires, the system returns a DropEverything event followed by Add events for all contacts. Same code path handles full and incremental sync.


Contact Provider Extension (iOS 18+)

Expose your app's contact graph to the system Contacts ecosystem.

// In main app: enable and signal
let manager = try ContactProviderManager(domainIdentifier: "com.myapp.contacts")
try await manager.enable()         // May prompt user authorization
try await manager.signalEnumerator()  // Trigger sync when data changes

// In extension
@main
class Provider: ContactProviderExtension {
    func configure(for domain: ContactProviderDomain) { /* setup */ }

    func enumerator(for collection: ContactItem.Identifier) -> ContactItemEnumerator {
        return MyEnumerator()
    }

    func invalidate() async throws { /* cleanup */ }
}

Requires: App Group for data sharing between app and extension.


Pressure Scenarios

Scenario 1: "We need full access to show contact suggestions"

Pressure: PM wants full Contacts access for autocomplete.

Why resist: ContactAccessButton provides exactly this — search results for contacts the app doesn't have, one-tap to grant access. No scary full-access prompt.

Response: "ContactAccessButton gives us search-driven contact discovery without asking for full access. Users grant access to exactly the contacts they want to share, one at a time. Denial rate drops from 40%+ to near zero."

Scenario 2: "Just fetch all keys, we might display any field"

Pressure: Developer fetches all contact keys "to be safe."

Why resist: Overfetching contacts data is both a privacy concern (triggers stricter Apple review) and a performance problem (slower fetches, more memory).

Response: "Fetching only the keys we display means faster queries and less privacy exposure. Use CNContactFormatter.descriptorForRequiredKeys(for:) for name display — it handles all locale variations."

Scenario 3: "CNContactPickerViewController is enough, we don't need the button"

Pressure: Team sticks with picker because it's familiar.

Why resist: Picker gives one-time snapshots — the contacts are not persistently accessible. If you need to store or sync the contact, you need persistent access through ContactAccessButton or full authorization.

Response: "Picker works for one-time actions (share a phone number). But if we need to remember the contact (friend list, favorites), we need ContactAccessButton for persistent limited access."


Migration Checklist

When updating an app for iOS 18 limited access:

  1. Check authorizationStatus(for:.contacts) for .limited case
  2. Add ContactAccessButton to contact search flows
  3. Test that app handles seeing only a subset of contacts
  4. Verify app-created contacts are always visible
  5. Add contactAccessPicker for bulk access management if needed
  6. Test the two-stage authorization prompt flow
  7. Ensure keysToFetch is minimal — limited access doesn't change key behavior

Resources

WWDC: 2024-10121

Docs: /contacts, /contactsui, /contactprovider, /technotes/tn3149

Skills: contacts-ref, eventkit, privacy-ux

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

39.47%
按下载量换算85

Claude

29.48%
按下载量换算64

Cursor

17.48%
按下载量换算38

Gemini CLI

9.87%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills