Token导航 LogoToken导航

Agent Skill · 研究检索

axiom-contacts-ref(Axiom 联系人参考)

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

axiom-contacts-ref 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 49,433。

总安装 652周安装 28GitHub Stars 873下载 228核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

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

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

CNContactStore、ContactsUI 与 ContactProvider 的完整 API 文档。包含授权状态检查与联系人查询谓词构建方法。支持批量读取与增量更新操作的事务控制。需声明 NSContactsUsageDescription 并处理用户拒绝场景。

axiom-contacts-ref 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/axiom-contacts-ref

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/charleswiltgen/axiom --skill axiom-contacts-re…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

axiom-contacts-ref 怎么安装?

在终端执行 npx skills add https://github.com/charleswiltgen/axiom --skill axiom-contacts-ref。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

axiom-contacts-ref 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

axiom-contacts-ref 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

axiom-contacts-ref 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

axiom-contacts-ref 用的人多吗?

公开数据是累计安装 652 次,近一周安装 28 次,下载 228 次,GitHub 873 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

axiom-contacts-ref 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
axiom-contacts-ref

Axiom 联系人参考 · 本页

652873需要联网未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Contacts API Reference

Overview

The Contacts framework provides programmatic access to the system contact database. ContactsUI provides system view controllers for contact selection and display. ContactProvider enables apps to expose their own contacts to the system.

Platform: iOS 9.0+, iPadOS 9.0+, macOS 10.11+, Mac Catalyst 13.1+, watchOS 2.0+, visionOS 1.0+


Part 1: CNContactStore

The primary gateway for contact data. "Fetch methods perform I/O — avoid using the main thread."

Authorization

// Check status (static method)
let status = CNContactStore.authorizationStatus(for: .contacts)
// Returns: .notDetermined, .restricted, .denied, .authorized, .limited (iOS 18+)

// Request access
let store = CNContactStore()
try await store.requestAccess(for: .contacts)  // Returns Bool

Info.plist required: NSContactsUsageDescription (crash without it).

Special entitlement: com.apple.developer.contacts.notes — required to read/write note field. Requires Apple approval.

Fetching Contacts

// Single contact by identifier
let contact = try store.unifiedContact(
    withIdentifier: identifier,
    keysToFetch: keys
)

// Search by predicate
let contacts = try store.unifiedContacts(
    matching: predicate,
    keysToFetch: keys
)

// Current user's card
let me = try store.unifiedMeContact(withKeysToFetch: keys)

// Memory-efficient enumeration
let request = CNContactFetchRequest(keysToFetch: keys)
request.predicate = predicate  // Optional filter
request.sortOrder = .userDefault  // .none, .givenName, .familyName, .userDefault
try store.enumerateContacts(with: request) { contact, stop in
    // stop.pointee = true to break early
}

Built-in Predicates

CNContact.predicateForContacts(matchingName: "John")
CNContact.predicateForContacts(matchingEmailAddress: "john@example.com")
CNContact.predicateForContacts(matching: CNPhoneNumber(stringValue: "+1555..."))
CNContact.predicateForContacts(withIdentifiers: [id1, id2])
CNContact.predicateForContactsInGroup(withIdentifier: groupId)
CNContact.predicateForContactsInContainer(withIdentifier: containerId)

Containers and Groups

store.containers(matching: predicate)     // [CNContainer]
store.groups(matching: predicate)         // [CNGroup]
store.defaultContainerIdentifier          // String (property, not method)

CNContainer types: .local, .exchange, .cardDAV, .unassigned

Change Tracking

store.currentHistoryToken  // Data? — save for incremental sync

Change Notification

NotificationCenter.default.addObserver(
    forName: .CNContactStoreDidChange, object: nil, queue: .main
) { _ in
    // Refetch visible contacts
}

Save Operations

let saveRequest = CNSaveRequest()
saveRequest.add(contact, toContainerWithIdentifier: nil)  // nil = default
saveRequest.update(contact)
saveRequest.delete(contact.mutableCopy() as! CNMutableContact)
try store.execute(saveRequest)

Part 2: CNContact Key Descriptors

You MUST specify which properties to fetch. Accessing an unfetched property throws CNContactPropertyNotFetchedException.

Common Key Constants

KeyProperty
CNContactIdentifierKeyidentifier
CNContactGivenNameKeygivenName
CNContactFamilyNameKeyfamilyName
CNContactMiddleNameKeymiddleName
CNContactNamePrefixKeynamePrefix
CNContactNameSuffixKeynameSuffix
CNContactNicknameKeynickname
CNContactOrganizationNameKeyorganizationName
CNContactJobTitleKeyjobTitle
CNContactDepartmentNameKeydepartmentName
CNContactPhoneNumbersKeyphoneNumbers
CNContactEmailAddressesKeyemailAddresses
CNContactPostalAddressesKeypostalAddresses
CNContactUrlAddressesKeyurlAddresses
CNContactSocialProfilesKeysocialProfiles
CNContactInstantMessageAddressesKeyinstantMessageAddresses
CNContactBirthdayKeybirthday
CNContactNonGregorianBirthdayKeynonGregorianBirthday
CNContactDatesKeydates
CNContactNoteKeynote (requires entitlement)
CNContactImageDataKeyimageData
CNContactThumbnailImageDataKeythumbnailImageData
CNContactImageDataAvailableKeyimageDataAvailable
CNContactRelationsKeycontactRelations
CNContactTypeKeycontactType (.person,.organization)

Convenience Descriptors

// All keys needed for name display (locale-aware)
CNContactFormatter.descriptorForRequiredKeys(for: .fullName)
CNContactFormatter.descriptorForRequiredKeys(for: .phoneticFullName)

// All keys needed for vCard export
CNContactVCardSerialization.descriptorForRequiredKeys()

Always prefer formatter descriptors over manual key lists for name display.


Part 3: CNMutableContact

Mutable subclass of CNContact. Not thread-safe — use immutable CNContact for cross-thread access.

Creating a Contact

let contact = CNMutableContact()
contact.givenName = "Jane"
contact.familyName = "Appleseed"
contact.organizationName = "Apple Inc."
contact.jobTitle = "Engineer"

// Phone numbers
contact.phoneNumbers = [
    CNLabeledValue(label: CNLabelPhoneNumberMobile,
                   value: CNPhoneNumber(stringValue: "+15551234567")),
    CNLabeledValue(label: CNLabelWork,
                   value: CNPhoneNumber(stringValue: "+15559876543"))
]

// Email addresses
contact.emailAddresses = [
    CNLabeledValue(label: CNLabelHome, value: "jane@example.com" as NSString),
    CNLabeledValue(label: CNLabelWork, value: "jane@apple.com" as NSString)
]

// Postal addresses
let address = CNMutablePostalAddress()
address.street = "1 Apple Park Way"
address.city = "Cupertino"
address.state = "CA"
address.postalCode = "95014"
address.country = "United States"
contact.postalAddresses = [CNLabeledValue(label: CNLabelWork, value: address)]

// Birthday
contact.birthday = DateComponents(year: 1990, month: 6, day: 15)

// Photo
contact.imageData = imageData

Removing Values

Set strings/arrays to empty, other properties to nil.

Constraint

"You may modify only those properties whose values you fetched from the contacts database."


Part 4: CNSaveRequest

Batch operations for contacts, groups, and subgroups.

Platform: iOS 9.0+, iPadOS 9.0+, macOS 10.11+, Mac Catalyst 13.1+ (no watchOS)

Contact Operations

let request = CNSaveRequest()
request.add(contact, toContainerWithIdentifier: containerId)  // nil = default
request.update(contact)
request.delete(contact)

Group Operations

request.add(group, toContainerWithIdentifier: containerId)
request.update(group)
request.delete(group)
request.addMember(contact, to: group)
request.removeMember(contact, from: group)
request.addSubgroup(subgroup, to: parentGroup)
request.removeSubgroup(subgroup, from: parentGroup)

Properties

PropertyTypeNotes
shouldRefetchContactsBoolRefetch added/updated contacts post-execution
transactionAuthorString?Identifies who made the change (for change history filtering)

Execution

try store.execute(request)

Concurrency: "Last change wins" for overlapping concurrent changes.


Part 5: CNContactFormatter

Locale-aware name formatting.

let formatter = CNContactFormatter()

// Format name
let name = formatter.string(from: contact)  // String?
let name = CNContactFormatter.string(from: contact, style: .fullName)

// Attributed string variants
let attributed = formatter.attributedString(from: contact)

// Locale information
let order = CNContactFormatter.nameOrder(for: contact)  // .givenNameFirst, .familyNameFirst
let delimiter = CNContactFormatter.delimiter(for: contact)  // Locale-appropriate separator

Styles

StyleExample
.fullName"Jane Appleseed" or "Appleseed Jane" (per locale)
.phoneticFullNamePhonetic representation

Part 6: CNContactVCardSerialization

// Export contacts to vCard data
let data = try CNContactVCardSerialization.data(with: contacts)

// Import contacts from vCard data
let contacts = try CNContactVCardSerialization.contacts(with: data)

// Required keys for export
let keys = CNContactVCardSerialization.descriptorForRequiredKeys()

Part 7: ContactsUI

CNContactPickerViewController (iOS 9+)

Lets users pick contacts without requiring app-level authorization. App receives one-time snapshot.

let picker = CNContactPickerViewController()
picker.delegate = self
picker.displayedPropertyKeys = [CNContactPhoneNumbersKey, CNContactEmailAddressesKey]
present(picker, animated: true)

Predicates (set BEFORE presentation)

// Which contacts are selectable
picker.predicateForEnablingContact = NSPredicate(
    format: "phoneNumbers.@count > 0"
)

// Auto-select whole contact (skip property selection)
picker.predicateForSelectionOfContact = NSPredicate(
    format: "emailAddresses.@count > 0"
)

// Which properties can be selected individually
picker.predicateForSelectionOfProperty = NSPredicate(
    format: "key == 'phoneNumbers'"
)

Gotcha: Changing predicates only takes effect before the view is presented.

Delegate (CNContactPickerDelegate)

func contactPicker(_ picker: CNContactPickerViewController,
                   didSelect contact: CNContact) { }
func contactPicker(_ picker: CNContactPickerViewController,
                   didSelect contacts: [CNContact]) { }  // Multi-selection
func contactPicker(_ picker: CNContactPickerViewController,
                   didSelect contactProperty: CNContactProperty) { }
func contactPickerDidCancel(_ picker: CNContactPickerViewController) { }

CNContactViewController (iOS 9+)

Display a single contact with three initialization modes:

// Existing contact
let vc = CNContactViewController(for: contact)

// Unknown contact (partial data)
let vc = CNContactViewController(forUnknownContact: partialContact)

// New contact
let vc = CNContactViewController(forNewContact: nil)

// Display mode
vc.allowsEditing = true
vc.allowsActions = true  // Call, message, email buttons
vc.displayedPropertyKeys = [CNContactPhoneNumbersKey]
vc.highlightProperty(withKey: CNContactPhoneNumbersKey, identifier: nil)

Part 8: Contact Access Button (iOS 18+)

SwiftUI component for privacy-conscious contact access.

ContactAccessButton(queryString: searchText) { identifiers in
    let contacts = await fetchContacts(withIdentifiers: identifiers)
}

Caption Options

ValueShows
.defaultTextDefault text
.emailEmail address
.phonePhone number

Modifiers

.font(.system(weight: .bold))
.foregroundStyle(.gray)
.tint(.green)
.contactAccessButtonCaption(.phone)
.contactAccessButtonStyle(ContactAccessButton.Style(imageWidth: 30))

Security

Button only grants access when:

  • Legible: Sufficient contrast between text and background
  • Unobstructed: Entire button visible, not clipped
  • Validated tap: Real user interaction, not simulated

Part 9: contactAccessPicker (iOS 18+)

Modal sheet for managing limited access contact set. For bulk or non-immediate use cases.

@State private var isPresented = false

Button("Share More Contacts") {
    isPresented.toggle()
}
.contactAccessPicker(isPresented: $isPresented) { identifiers in
    // identifiers: [String] — newly permitted contacts only
    let contacts = await fetchContacts(withIdentifiers: identifiers)
}

Difference from CNContactPickerViewController: contactAccessPicker changes persistent access. CNContactPickerViewController provides one-time snapshots.


Part 10: ContactProvider Framework (iOS 18+)

Enables apps to expose contacts to the system Contacts ecosystem from third-party sources.

Architecture

  1. Main app controls the extension via ContactProviderManager
  2. Extension enumerates contacts to the system
  3. Communication via App Group shared container

ContactProviderManager (Main App Only)

let manager = try ContactProviderManager(domainIdentifier: "com.myapp.contacts")

try await manager.enable()            // Async — may prompt user
try await manager.disable()           // Deactivate
try await manager.reset()             // Clear all provider contacts
try await manager.invalidate()        // Terminate extension
try await manager.signalEnumerator(for: .default)  // Trigger enumeration

manager.isEnabled                     // Bool — activation state

Cannot be used in app extensions — main app only.

ContactProviderExtension Protocol

@main
class Provider: ContactProviderExtension {
    func configure(for domain: ContactProviderDomain) {
        // Setup data access
    }

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

    func invalidate() async throws {
        // Cleanup
    }
}

Info.plist: Extension point com.apple.contact.provider.extension

Enumeration

Two patterns:

  1. Content enumeration — full initial sync via ContactItemContentObserver
  2. Change enumeration — incremental updates via ContactItemChangeObserver and ContactItemSyncAnchor
class MyEnumerator: ContactItemEnumerator {
    func enumerateContent(
        in page: ContactItemPage,
        for observer: ContactItemContentObserver
    ) {
        let contact = CNMutableContact()
        contact.givenName = "Jane"
        contact.familyName = "Appleseed"
        let item = ContactItem.contact(contact, ContactItem.Identifier("jane-001"))
        observer.didEnumerate([item])
        observer.didFinishEnumeratingContent(upTo: generationMarker)
    }

    func enumerateChanges(
        startingAt anchor: ContactItemSyncAnchor,
        for observer: ContactItemChangeObserver
    ) {
        // Incremental updates since anchor
        observer.didFinishEnumeratingChanges(upTo: newAnchor)
    }
}

ContactProvider Errors

CodeMeaning
featureNotAvailableFramework not available
deniedByUserUser rejected
extensionNotFoundExtension not registered
enumerationTimeoutExtension too slow
cannotEnumerateEnumeration failed
pageExpiredContent page expired
changeAnchorExpiredSync anchor expired
itemsLimitReachedToo many contacts

Part 11: Change History (TN3149)

CNChangeHistoryFetchRequest

let request = CNChangeHistoryFetchRequest()
request.startingToken = savedToken           // nil = full fetch
request.includeGroupChanges = false          // Default NO
request.mutableObjects = false               // Default NO
request.shouldUnifyResults = true            // Default YES
request.additionalContactKeyDescriptors = [
    CNContactFormatter.descriptorForRequiredKeys(for: .fullName)
]
request.excludedTransactionAuthors = [Bundle.main.bundleIdentifier!]

CNChangeHistoryEventVisitor Protocol

// Required
func visit(_ event: CNChangeHistoryDropEverythingEvent)   // Full re-sync
func visit(_ event: CNChangeHistoryAddContactEvent)        // New contact
func visit(_ event: CNChangeHistoryUpdateContactEvent)     // Modified
func visit(_ event: CNChangeHistoryDeleteContactEvent)     // Deleted

// Optional (when includeGroupChanges = true)
func visit(_ event: CNChangeHistoryAddGroupEvent)
func visit(_ event: CNChangeHistoryUpdateGroupEvent)
func visit(_ event: CNChangeHistoryDeleteGroupEvent)
func visit(_ event: CNChangeHistoryAddMemberToGroupEvent)
func visit(_ event: CNChangeHistoryRemoveMemberFromGroupEvent)
func visit(_ event: CNChangeHistoryAddSubgroupToGroupEvent)
func visit(_ event: CNChangeHistoryRemoveSubgroupFromGroupEvent)

Must use visitor pattern — do NOT use isKindOfClass: to determine event type.

Gotcha: enumeratorForChangeHistoryFetchRequest:error: is Objective-C only — unavailable in Swift.

Token expiration: Returns DropEverything + Add events for all contacts — same code handles full and incremental sync.

Transaction authors: Use reverse-domain notation (bundle identifier). Filters results but doesn't provide attribution.


Part 12: Error Reference

CNError Codes

CategoryCodeMeaning
AuthorizationauthorizationDeniedNo permission
AuthorizationfeatureDisabledByUserFeature turned off
DatarecordDoesNotExistContact/group deleted
DatarecordNotWritableRead-only contact
DatainsertedRecordAlreadyExistsDuplicate insert
ValidationvalidationTypeMismatchWrong value type
ValidationvalidationMultipleErrorsMultiple validation failures
HistorychangeHistoryExpiredSync token expired
HistorychangeHistoryInvalidAnchorBad sync anchor
HistorychangeHistoryInvalidFetchRequestInvalid request

Error userInfo provides: affectedRecords, affectedRecordIdentifiers, keyPaths.


Part 13: Platform Availability

APIiOSmacOSwatchOSvisionOS
CNContactStore9.0+10.11+2.0+1.0+
Limited access18.0+———
CNContactPickerViewController9.0+(Catalyst 13.1+)—1.0+
CNContactViewController9.0+(Catalyst 13.1+)—1.0+
ContactAccessButton18.0+———
contactAccessPicker18.0+———
ContactProvider18.0+———
CNChangeHistoryFetchRequest13.0+10.15+—1.0+
CNSaveRequest9.0+10.11+—1.0+

Resources

WWDC: 2024-10121

Docs: /contacts, /contacts/cncontactstore, /contacts/cnmutablecontact, /contactsui, /contactsui/cncontactpickerviewcontroller, /contactprovider, /technotes/tn3149

Skills: contacts, eventkit-ref, privacy-ux

平台分布

Codex

36.67%
按下载量换算84

Claude

27.18%
按下载量换算62

Cursor

19.98%
按下载量换算46

Gemini CLI

8.12%
按下载量换算19

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

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

继续浏览同类 Skills