Skip to content

armgit / chops

Public Imported from GitHub
0

Your AI agent skills, finally organized. A macOS app to browse, edit, and manage skills across Claude Code, Cursor, Codex, Windsurf, and Amp.

585 B
Raw Blame
import Foundation
import SwiftData

enum SearchService {
    static func search(query: String, in context: ModelContext) -> [Skill] {
        guard !query.isEmpty else { return [] }

        let descriptor = FetchDescriptor<Skill>()
        guard let allSkills = try? context.fetch(descriptor) else { return [] }

        return allSkills.filter { skill in
            skill.name.localizedCaseInsensitiveContains(query) ||
            skill.skillDescription.localizedCaseInsensitiveContains(query) ||
            skill.content.localizedCaseInsensitiveContains(query)
        }
    }
}