Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/st0012/cctop/swiftui-debuggingnpx skills add st0012/cctop --skill swiftui-debugginggit clone --depth 1 https://github.com/st0012/cctopWrote 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.
[](https://agentmods.dev/skills/st0012/cctop/swiftui-debugging)<a href="https://agentmods.dev/skills/st0012/cctop/swiftui-debugging"><img src="https://agentmods.dev/badge/skills/st0012/cctop/swiftui-debugging.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00058 | $0.01886 |
| Opus 5 | $0.00029 | $0.00943 |
| Sonnet 5 | $0.00012 | $0.00377 |
| Haiku 4.5 | $0.00006 | $0.00189 |
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 3d 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.
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
- Log at the data source (model/manager) and at the view's body — confirm data changed but body wasn't called
- Check if the view reads external state (singletons, managers) not passed through its struct inputs
- Use
Self._printChanges()at the top ofbodyto 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 |
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.
- 3d ago First seen · 204 lines · 58 tokens per session scan A 9bf78e7e72f5
swiftui-debugging is a skill published in the GitHub repository st0012/cctop (147 stars, last pushed 16d ago), licensed MIT. It adds 58 tokens to every session and 1,886 once invoked, about $0.0003 per session on Opus 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.
Other skills, from other repositories
hns-lsel-curator
Local Self-Evolution Loop (LSEL) curator — the CLUSTER + drain engine for the GOOS-local PROPOSE→APPLY seam closure (SPEC-LSEL-LOCAL-EVOLUTION-001). Companion-offset drain of .moai/lessons-inbox.jsonl with a drain-side severity filter that drops the 65% Bash-timeout/sandbox noise, eventkey clustering with a frequency…
hns-lsel-applier
Local Self-Evolution Loop (LSEL) APPLY engine — the playback-only consumer of approved decision.json records that drives .moai/hooks/lsel-apply.sh for the GOOS-local PROPOSE→APPLY seam closure (SPEC-LSEL-LOCAL-EVOLUTION-001 M3). Reads an approved decision.json, validates the target against the frozen allowlist…
moai-workflow-ddd
Domain-Driven Development workflow specialist using ANALYZE-PRESERVE-IMPROVE cycle for behavior-preserving code transformation. Use when refactoring legacy code or reducing technical debt safely.
hns-workflow-ci-loop
Unified CI watch + auto-fix loop skill. Polls gh pr checks after /moai sync PR creation, classifies required vs auxiliary failures, attempts safe automated patches (max 3 iterations), and escalates semantic failures to the user. Use for CI loop workflow — NOT for general loop iteration patterns (see…
moai-kanban-foreman
One unattended kanban foreman iteration: watch the backlog queue, dispatch the next operator-picked card to an isolated worker, collect completion evidence on read (not on claims), and report. This is the body the project's loop.md driver invokes each iteration of a bare /loop; it can also be invoked directly to test…
hns-moaiadk-patterns
Skill "hns-moaiadk-patterns" from modu-ai/moai-adk, covering moai-adk-go domain patterns, architecture quick reference, key source paths, pipeline specialist delegation map and template-first build cycle.