Borrowing it
Nothing to install: this file belongs to bsreeram08/chowser. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/bsreeram08/chowser/main/.agents/skills/memory-leak-diagnosis-skill/SKILL.mdgit clone --depth 1 https://github.com/bsreeram08/chowserWrote 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/bsreeram08/chowser/memory-leak-diagnosis-skill)<a href="https://agentmods.dev/skills/bsreeram08/chowser/memory-leak-diagnosis-skill"><img src="https://agentmods.dev/badge/skills/bsreeram08/chowser/memory-leak-diagnosis-skill/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.
<a href="https://agentmods.dev/skills/bsreeram08/chowser/memory-leak-diagnosis-skill"><img src="https://agentmods.dev/badge/skills/bsreeram08/chowser/memory-leak-diagnosis-skill.svg" alt="Reviewed on agentmods" width="80" 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.1 | $0.00023 | $0.04043 |
| Opus 5.5 | $0.00009 | $0.01617 |
| Sonnet 5.5 | $0.00005 | $0.00809 |
| Haiku 4.5 | $0.00002 | $0.00404 |
Grade A, and why
Memory Leak Diagnosis Skill 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 4d 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 — 619 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Memory Leak Diagnosis Skill
This skill provides expertise in identifying, diagnosing, and fixing memory leaks and retain cycles in Swift applications. It covers Instruments usage, ARC concepts, and memory management best practices for iOS development.
Best Practices
-
Understand ARC: Automatic Reference Counting manages memory automatically, but cycles can still occur.
-
Use Weak References: Break retain cycles by using
weakorunownedreferences in closures and delegates. -
Profile Regularly: Use Instruments to detect leaks early in development.
-
Avoid Strong Reference Cycles: Be aware of parent-child relationships and delegate patterns.
-
Clean Up Resources: Properly invalidate timers, cancel network requests, and remove observers.
-
Test Memory Usage: Monitor memory growth during app usage.
Memory Management Guidelines
- Classes create strong references by default.
- Use
weakfor optional relationships that can become nil. - Use
unownedfor non-optional relationships that will always exist. - Capture
selfweakly in closures to prevent retain cycles. - Use Instruments Leaks and Allocations instruments for diagnosis.
- Monitor memory usage with Xcode's Memory Graph Debugger.
Examples
Example 1: Fixing Retain Cycles in Closures
User Prompt: "Fix the retain cycle in this network manager that uses a completion handler."
Expected Output:
import Foundation
// PROBLEMATIC CODE - Retain Cycle
class NetworkManagerBad {
var completionHandler: (() -> Void)?
func fetchData() {
// This creates a retain cycle: self -> completionHandler -> self
self.completionHandler = {
print("Data fetched")
self.processData() // 'self' is strongly captured
}
// Simulate async operation
DispatchQueue.global().asyncAfter(deadline: .now() + 1) {
self.completionHandler?()
}
}
func processData() {
print("Processing data")
}
deinit {
print("NetworkManagerBad deallocated")
}
}
// FIXED CODE - Using weak self
class NetworkManagerGood {
var completionHandler: (() -> Void)?
func fetchData() {
// Use [weak self] to break the retain cycle
self.completionHandler = { [weak self] in
print("Data fetched")
self?.processData() // 'self' is now weakly captured
}
// Simulate async operation
DispatchQueue.global().asyncAfter(deadline: .now() + 1) {
self.completionHandler?()
}
}
func processData() {
print("Processing data")
}
deinit {
print("NetworkManagerGood deallocated") // This will now print!
}
}
// Alternative: Using unowned for guaranteed non-nil self
class NetworkManagerUnowned {
var completionHandler: (() -> Void)?
func fetchData() {
// Use [unowned self] if you're certain self won't be nil
self.completionHandler = { [unowned self] in
print("Data fetched")
self.processData() // No optional chaining needed
}
DispatchQueue.global().asyncAfter(deadline: .now() + 1) {
self.completionHandler?()
}
}
func processData() {
print("Processing data")
}
deinit {
print("NetworkManagerUnowned deallocated")
}
}
// Usage example
func testMemoryLeak() {
print("Creating NetworkManagerBad...")
var managerBad: NetworkManagerBad? = NetworkManagerBad()
managerBad?.fetchData()
managerBad = nil // Won't deallocate due to retain cycle
print("Creating NetworkManagerGood...")
var managerGood: NetworkManagerGood? = NetworkManagerGood()
managerGood?.fetchData()
managerGood = nil // Will deallocate properly
// Give time for async operations
RunLoop.current.run(until: Date(timeIntervalSinceNow: 2))
}
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 4d ago First seen · 619 lines · 23 tokens per session scan A 6f46b4325a78
Memory Leak Diagnosis Skill is a skill published in the GitHub repository bsreeram08/chowser (12 stars, last pushed 1mo ago), licensed MIT. It adds 23 tokens to every session and 4,043 once invoked, about $0.0001 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-11-28.
Memory Leak Diagnosis Skill compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| Memory Leak Diagnosis Skillbsreeram08/chowser | Skill | 12 | 1mo ago | MIT | A | 23 | Claude Code, Codex |
| ios-signing-troubleshootingmilisp/mcp-linker | Skill | 344 | 1mo ago | AGPL-3.0 | A | 59 | Claude Code |
| ios-simulator-build-runmilisp/mcp-linker | Skill | 344 | 1mo ago | AGPL-3.0 | A | 55 | Claude Code |
| ipad-layout-auditcruisediary/apple-app-review-skills | Skill | 20 | 7mo ago | MIT | A | 49 | Claude Code, Codex |
| node-connectopenclaw/openclaw | Skill | 396k | today | MIT | A | 39 | Claude Code, Codex |
| jetpack-compose-performanceandroid/skills | Skill | 11k | 9d ago | Apache-2.0 | A | 41 | Claude Code |
| competition-ios-runtimezhaoxuya520/reverse-skill | Skill | 46k | 18d ago | MIT | A | 123 | Codex |