cctop: Skill for Claude Code

.agents/skills/swiftui-debugging/SKILL.md

swiftui-debugging is a skill for Claude Code, Codex from st0012/cctop. It costs 58 tokens per session (1,886 once invoked), scanned A, original, MIT.

A debugging guide for SwiftUI applications on macOS, covering stale views, layout issues, unnecessary redraws, state ownership, previews, and NSHostingView or NSPanel behavior.

In plain words
What is it for?
Use it to investigate views that do not update, layout and performance problems, state bugs, preview crashes, and macOS hosting-window issues.
Why use it?
SwiftUI may skip updates or hide diagnostic output when an app is launched from the command line or Finder. The guide provides ways to trace these problems, including file-based logging.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is st0012/cctop's own configuration. It tells Claude Code and Codex how to work on cctop itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cctop configures →

Reuse

Borrowing it

Nothing to install: this file belongs to st0012/cctop. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/st0012/cctop/master/.agents/skills/swiftui-debugging/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/st0012/cctop

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 swiftui-debugging

README.md
[![agentmods](https://agentmods.dev/badge/skills/st0012/cctop/swiftui-debugging/github.svg)](https://agentmods.dev/skills/st0012/cctop/swiftui-debugging)
Your own site
<a href="https://agentmods.dev/skills/st0012/cctop/swiftui-debugging"><img src="https://agentmods.dev/badge/skills/st0012/cctop/swiftui-debugging/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 swiftui-debugging

Your own site · 80×15
<a href="https://agentmods.dev/skills/st0012/cctop/swiftui-debugging"><img src="https://agentmods.dev/badge/skills/st0012/cctop/swiftui-debugging.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,886 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00058 $0.01886
Opus 5.5 $0.00023 $0.00754
Sonnet 5.5 $0.00012 $0.00377
Haiku 4.5 $0.00006 $0.00189

Measured 1mo ago against content hash 9bf78e7e72f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

swiftui-debugging 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 1mo ago.

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.

.agents/skills/swiftui-debugging/SKILL.md · 204 lines

How it starts

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

SwiftUI Debugging

Overview

Systematic approaches for debugging SwiftUI issues in macOS apps. Covers view updates, state ownership, performance, layout, and macOS-specific quirks with NSHostingView and NSPanel.

Logging in macOS Apps

print() and NSLog() are invisible when launching macOS apps from CLI or Finder (menubar-only apps have no console). Always use file-based logging:

func debugLog(_ message: String) {
    let entry = "\(Date()) \(message)\n"
    let url = URL(fileURLWithPath: "/tmp/debug.log")
    if let handle = try? FileHandle(forWritingTo: url) {
        handle.seekToEndOfFile()
        handle.write(entry.data(using: .utf8)!)
        handle.closeFile()
    } else {
        try? entry.write(to: url, atomically: true, encoding: .utf8)
    }
}

Remove all debug logging before committing. Use grep -r "debugLog" --include="*.swift" to verify.

View Not Updating

Symptom

View shows stale data after a confirmed state change. Common with hostingView.rootView = NewView(...) not propagating to children, or theme/color changes not reflecting.

Root Cause: SwiftUI Diffing

SwiftUI skips re-evaluating a child view's body if the child's struct inputs haven't changed — even if the child reads from a singleton or computed property that did change.

Parent: rootView = MyView(counts: same)
  → SwiftUI: "counts didn't change, skip child body"
  → Child: never re-reads StatusColors.working
  → Result: stale colors

Diagnosis

  1. Log at the data source (model/manager) and at the view's body — confirm data changed but body wasn't called
  2. Check if the view reads external state (singletons, managers) not passed through its struct inputs
  3. Use Self._printChanges() at the top of body to see what SwiftUI thinks triggered (or didn't trigger) a re-evaluation

Fixes

Root Cause Fix
Child reads external state not in its inputs Pass a changing value and add .id(value) to force recreation
@State destroyed by .id() changes Extract into @StateObject owned by parent above the .id() boundary
NSColor(name:) dynamic colors cached Use .id() to force re-resolution
@Published changed but view doesn't update Verify view uses @ObservedObject, not a plain property

Read the full file on GitHub · 204 lines

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. 1mo ago First seen · 204 lines · 58 tokens per session scan A 9bf78e7e72f5

Subscribe to this mod's changes

swiftui-debugging is a skill published in the GitHub repository st0012/cctop (159 stars, last pushed 22d ago), licensed MIT. It adds 58 tokens to every session and 1,886 once invoked, about $0.0002 per session on Opus 5.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-30.

Related

Other skills, from other repositories

todos

Use when the user asks for a shared plan, a task needs at least three substantive execution steps, or a loose TODO is pending. Without an explicit plan request, not for one-shot answers or checks, or one- to two-step work that is not already in the list.

JetBrains/thinkrail · 58 tokens

burrow-system-tools

Diagnose and fix the user's Mac with Burrow's local MCP tools (burrowdoctor, burrowsnapshot, burrowtopprocesses, burrowprocessusage, burrowports, burrowanalyze, burrowdiskforecast, burrowdupes, burrowanomalies, burrowagentaudit, burrowclean, …). Use whenever the Mac is slow, hot, loud, low on disk, draining battery…

caezium/burrow · 194 tokens

agf

Find local coding-agent sessions, inspect bounded metadata or summaries, and prepare a read-only resume plan with AGF. Use for finding prior work across agent CLIs, not for executing agents, deleting sessions, or reading full transcripts.

subinium/agf · 49 tokens

cheese

Route an idea, path, pull request, issue, failure, question, or bare /cheese to the correct workflow skill. Use this skill for /cheese, routing requests, help requests, or opening messages without a named workflow skill.

paulnsorensen/easy-cheese · 53 tokens

pdlc-lint

A code-quality checker that runs static analysis, style checks, type checks, and other project-configured tools. It supports checking, safely fixing eligible problems, and setting up a lint toolchain.

kanfu-panda/pdlc-skills · 29 tokens

pdlc-perf

A workflow for finding and improving performance problems in a specified backend service or frontend application. It examines areas such as database queries, caching, response times, loading, rendering, and network use, then records its findings in a report.

kanfu-panda/pdlc-skills · 40 tokens