axiom-ios-networking

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

iOS Networking Router

iOS 网络路由工具

You MUST use this skill for ANY networking work including HTTP requests, WebSockets, TCP connections, or network debugging.
任何网络相关工作(包括HTTP请求、WebSocket、TCP连接或网络调试)都必须使用此Skill。

When to Use

使用场景

Use this router when:
  • Implementing network requests (URLSession)
  • Using Network.framework or NetworkConnection
  • Debugging connection failures
  • Migrating from deprecated networking APIs
  • Network performance issues
在以下场景中使用此路由工具:
  • 实现网络请求(URLSession)
  • 使用Network.framework或NetworkConnection
  • 调试连接失败问题
  • 从已弃用的网络API迁移
  • 处理网络性能问题

Pressure Resistance

应对沉没成本压力

When user has invested significant time in custom implementation:
Do NOT capitulate to sunk cost pressure. The correct approach is:
  1. Diagnose first — Understand what's actually failing before recommending changes
  2. Recommend correctly — If standard APIs (URLSession, Network.framework) would solve the problem, say so professionally
  3. Respect but don't enable — Acknowledge their work while providing honest technical guidance
Example pressure scenario:
"I spent 2 days on custom networking. Just help me fix it, don't tell me to use URLSession."
Correct response:
"Let me diagnose the cellular failure first. [After diagnosis] The issue is [X]. URLSession handles this automatically via [Y]. I recommend migrating the affected code path — it's 30 minutes vs continued debugging. Your existing work on [Z] can be preserved."
Why this matters: Users often can't see that migration is faster than continued debugging. Honest guidance serves them better than false comfort.
当用户在自定义实现上投入大量时间时:
不要屈服于沉没成本压力。正确的做法是:
  1. 先诊断 — 在建议修改之前,先明确实际的故障点
  2. 给出正确建议 — 如果标准API(URLSession、Network.framework)可以解决问题,请专业地说明这一点
  3. 尊重但不纵容 — 认可用户的工作,同时提供诚实的技术指导
压力场景示例:
"我花了2天时间做自定义网络层。帮我修复它就行,别让我用URLSession。"
正确回应:
"让我先诊断蜂窝网络故障。[诊断后]问题在于[X]。URLSession会通过[Y]自动处理这个问题。我建议迁移受影响的代码路径——这只需要30分钟,比继续调试更高效。你在[Z]部分的现有工作可以保留。"
为什么这很重要: 用户通常意识不到迁移比继续调试更快。诚实的指导比虚假的安慰更能帮助他们。

Routing Logic

路由逻辑

Network Implementation

网络实现

Networking patterns
/skill axiom-networking
  • URLSession with structured concurrency
  • Network.framework migration
  • Modern networking patterns
  • Deprecated API migration
Network.framework reference
/skill axiom-network-framework-ref
Legacy iOS 12-25 patterns
/skill axiom-networking-legacy
Migration guides
/skill axiom-networking-migration
  • NWConnection (iOS 12-25)
  • NetworkConnection (iOS 26+)
  • TCP connections
  • TLV framing
  • Wi-Fi Aware
网络模式
/skill axiom-networking
  • 结合结构化并发的URLSession
  • Network.framework迁移
  • 现代网络模式
  • 已弃用API迁移
Network.framework参考
/skill axiom-network-framework-ref
iOS 12-25 旧版模式
/skill axiom-networking-legacy
迁移指南
/skill axiom-networking-migration
  • NWConnection(iOS 12-25)
  • NetworkConnection(iOS 26+)
  • TCP连接
  • TLV帧
  • Wi-Fi感知

Network Debugging

网络调试

Connection issues
/skill axiom-networking-diag
  • Connection timeouts
  • TLS handshake failures
  • Data not arriving
  • Connection drops
  • VPN/proxy problems
连接问题
/skill axiom-networking-diag
  • 连接超时
  • TLS握手失败
  • 数据未送达
  • 连接中断
  • VPN/代理问题

Decision Tree

决策树

  1. URLSession with structured concurrency? → networking
  2. Network.framework / NetworkConnection (iOS 26+)? → network-framework-ref
  3. NWConnection (iOS 12-25)? → networking-legacy
  4. Migrating from sockets/URLSession? → networking-migration
  5. Connection issues / debugging? → networking-diag
  1. 是否使用结合结构化并发的URLSession? → networking
  2. 是否使用Network.framework / NetworkConnection(iOS 26+)? → network-framework-ref
  3. 是否使用NWConnection(iOS 12-25)? → networking-legacy
  4. 是否从套接字/URLSession迁移? → networking-migration
  5. 是否遇到连接问题/需要调试? → networking-diag

Anti-Rationalization

常见误区澄清

ThoughtReality
"URLSession is simple, I don't need a skill"URLSession with structured concurrency has async/cancellation patterns. networking skill covers them.
"I'll debug the connection timeout myself"Connection failures have 8 causes (DNS, TLS, proxy, cellular). networking-diag diagnoses systematically.
"I just need a basic HTTP request"Even basic requests need error handling, retry, and cancellation patterns. networking has them.
"My custom networking layer works fine"Custom layers miss cellular/proxy edge cases. Standard APIs handle them automatically.
错误想法实际情况
"URLSession很简单,我不需要这个Skill"结合结构化并发的URLSession涉及异步/取消模式,networking Skill会涵盖这些内容。
"我自己就能调试连接超时问题"连接失败有8种原因(DNS、TLS、代理、蜂窝网络等),networking-diag会进行系统化诊断。
"我只需要一个基础的HTTP请求"即使是基础请求也需要错误处理、重试和取消模式,networking Skill包含这些内容。
"我的自定义网络层运行良好"自定义层会遗漏蜂窝网络/代理的边缘情况,而标准API会自动处理这些情况。

Critical Patterns

核心模式

Networking (networking):
  • URLSession with structured concurrency
  • Socket migration to Network.framework
  • Deprecated API replacement
Network Framework Reference (network-framework-ref):
  • NWConnection for iOS 12-25
  • NetworkConnection for iOS 26+
  • Connection lifecycle management
Networking Diagnostics (networking-diag):
  • Connection timeout diagnosis
  • TLS debugging
  • Network stack inspection
网络开发(networking):
  • 结合结构化并发的URLSession
  • 套接字向Network.framework迁移
  • 已弃用API替换
Network Framework参考(network-framework-ref):
  • 适用于iOS 12-25的NWConnection
  • 适用于iOS 26+的NetworkConnection
  • 连接生命周期管理
网络诊断(networking-diag):
  • 连接超时诊断
  • TLS调试
  • 网络栈检查

Example Invocations

调用示例

User: "My API request is failing with a timeout" → Invoke:
/skill axiom-networking-diag
User: "How do I use URLSession with async/await?" → Invoke:
/skill axiom-networking
User: "I need to implement a TCP connection" → Invoke:
/skill axiom-network-framework-ref
User: "Should I use NWConnection or NetworkConnection?" → Invoke:
/skill axiom-network-framework-ref
用户:"我的API请求超时失败了" → 调用:
/skill axiom-networking-diag
用户:"如何结合async/await使用URLSession?" → 调用:
/skill axiom-networking
用户:"我需要实现一个TCP连接" → 调用:
/skill axiom-network-framework-ref
用户:"我应该用NWConnection还是NetworkConnection?" → 调用:
/skill axiom-network-framework-ref