oslog
Read, stream, and analyze Apple unified logs (OSLog) for iOS/macOS apps. Auto-detects subsystem from Logger usage or bundle identifier. Supports live log show, real-time streaming, and .logarchive analysis with full predicate reference. Use when the user asks to check app logs, stream console output, debug with OSLog, or analyze .logarchive files on iOS/macOS.
What this skill does
# oslog Read, stream, and analyze Apple unified logs for iOS/macOS apps. ## When to Use Activate when the user asks to: - Check, read, show, or debug app logs - Stream logs in real time - Analyze `.logarchive` files - Filter system logs by process, subsystem, or message content - Investigate crashes, errors, or unexpected behavior via logs ## Step 1 — Detect Subsystem Auto-detect the OSLog subsystem from the project. Try these sources in order: 1. **Source code** — search for `Logger(subsystem:` in Swift files to find the actual subsystem string used in code 2. **`project.pbxproj`** — fall back to `PRODUCT_BUNDLE_IDENTIFIER` build setting (common convention is to use bundle ID as subsystem) 3. **`Info.plist`** — read `CFBundleIdentifier` value (resolve `$(PRODUCT_BUNDLE_IDENTIFIER)` if needed) 4. **Ask the user** — if all detection fails, ask for the subsystem string Store the detected subsystem for reuse within the session. ## Step 2 — Determine Mode ### Mode A: Show Recent Logs Query recent logs from the live system log store. ```bash /usr/bin/log show --last <N>m --info --debug --no-pager \ --predicate 'subsystem == "<SUBSYSTEM>"' | head -100 ``` - Default to `--last 5m`, adjust based on user request - Always pipe through `head` on first query to avoid flooding output - Increase `head` limit or remove it only if the user asks for more ### Mode B: Stream Live Logs Stream logs in real time from a running app. ```bash /usr/bin/log stream --info --debug \ --predicate 'subsystem == "<SUBSYSTEM>"' ``` - Note: `--no-pager` is not needed here — `log stream` is inherently streaming and has no pager - Run via Bash with `run_in_background` — the stream is continuous - Notify the user when output is available - Stop the stream when the user is done or the task changes ### Mode C: Analyze `.logarchive` Query an exported log archive bundle. **Locate the archive:** ```bash ls <path>.logarchive/Info.plist ``` **Determine time range:** ```bash /usr/bin/log show --style ndjson --no-pager <archive> | head -1 /usr/bin/log show --style ndjson --no-pager <archive> | tail -1 ``` **Query the archive:** ```bash /usr/bin/log show --info --debug --no-pager \ --predicate 'subsystem == "<SUBSYSTEM>"' <archive> | head -50 ``` **Export a new archive (requires sudo):** ```bash # Path must not already exist — log collect creates the directory sudo /usr/bin/log collect --last 30m --output <path>.logarchive ``` ## Critical Rules - **Always use `/usr/bin/log`** — bare `log` conflicts with zsh builtin - **Always include `--no-pager`** — interactive pagers hang in non-interactive contexts - **Always pipe through `head -N`** on initial queries — archives and log stores can contain millions of entries - **Include `--info --debug`** — by default only Default and Error/Fault levels are shown - **Use `--style ndjson`** for programmatic parsing/counting, `--style default` for human-readable output ## Predicate Reference See `PREDICATES.md` for the full predicate field table, comparison operators, and NSPredicate syntax. Key shorthand examples: ```bash 's=com.example.app' # filter by subsystem 's=com.example.app AND c=networking' # subsystem + category 's=com.example.app AND type>=error' # errors and faults only 's=com.example.app AND m:"timeout"' # message contains keyword ``` ## Common Workflows **Show all errors/faults from the app:** ```bash /usr/bin/log show --last 10m --no-pager \ --predicate 's=<SUBSYSTEM> AND type>=error' | head -50 ``` **Show logs for a specific category:** ```bash /usr/bin/log show --last 5m --info --debug --no-pager \ --predicate 's=<SUBSYSTEM> AND c=networking' | head -100 ``` **Search for a keyword in messages:** ```bash /usr/bin/log show --last 5m --info --debug --no-pager \ --predicate 's=<SUBSYSTEM> AND m:"timeout"' | head -50 ``` **Count events by type in an archive:** ```bash /usr/bin/log show --no-pager --style ndjson \ --predicate 's=<SUBSYSTEM> AND type=error' <archive> | wc -l ``` **List unique categories from the app:** ```bash /usr/bin/log show --last 30m --info --debug --no-pager --style ndjson \ --predicate 's=<SUBSYSTEM>' | head -500 | \ grep -o '"category":"[^"]*"' | sort -u ```
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.