公理网络
- 作者仓库星标 0
- 许可证 MIT
- 作者更新于 2026年8月24日 18:29
- 作者仓库 Axiom
- 领域
- 通用
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @CharlesWiltgen · MIT
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- 未声明(默认跨平台)
- 运行环境要求
- 未检出明确要求
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
# Networking
**You MUST use this skill for ANY networking work including HTTP requests, WebSockets, TCP connections, or network debugging.**
<!-- AXIOM_AUDITOR_INLINE_BEGIN — rewritten for Codex by scripts/build-codex.ts; do not hand-edit -->
> **Auditors are skills here.** Where this router says "Launch `some-auditor` agent", invoke the
> matching Codex skill instead — same procedure, no Claude Code agent required.
>
> Available: `axiom-audit-networking`.
>
> The ones that shell out — builds, tests, simulators, crash symbolication — need shell access to run.
<!-- AXIOM_AUDITOR_INLINE_END -->
## Quick Reference
| Symptom / Task | Reference |
|----------------|-----------|
| URLSession with structured concurrency | See `skills/networking-discipline.md` |
| Network.framework anti-patterns | See `skills/networking-discipline.md` |
| Deprecated API migration | See `skills/networking-discipline.md` |
| gRPC Swift — typed RPC, streaming, `.proto` codegen (WWDC 2026) | See `skills/networking-discipline.md` |
| Pressure scenarios (reachability, sockets) | See `skills/networking-discipline.md` |
| NetworkConnection (iOS 26+) API reference | See `skills/network-framework-ref.md` |
| NWConnection (iOS 12-18) API reference | See `skills/network-framework-ref.md` |
| TLV framing, Coder protocol | See `skills/network-framework-ref.md` |
| NetworkListener, NetworkBrowser, Wi-Fi Aware | See `skills/network-framework-ref.md` |
| Connection timeouts, TLS failures | See `skills/networking-diag.md` |
| Data not arriving, connection drops | See `skills/networking-diag.md` |
| ATS / HTTP / App Store rejection | See `skills/networking-diag.md` |
| Production crisis diagnosis | See `skills/networking-diag.md` |
| NWConnection patterns (iOS 12-18) | See `skills/networking-legacy.md` |
| UDP batch, NWListener, NWBrowser | See `skills/networking-legacy.md` |
| BSD sockets → NWConnection migration | See `skills/networking-migration.md` |
| Push/calls on networks without internet (Local Push Connectivity, NEAppPushProvider) | **Use axiom-integration (skills/local-push-connectivity.md)** |
| NWConnection → NetworkConnection migration | See `skills/networking-migration.md` |
| URLSession StreamTask → NetworkConnection | See `skills/networking-migration.md` |
## Decision Tree
```dot
digraph networking {
start [label="Networking task" shape=ellipse];
what [label="What do you need?" shape=diamond];
start -> what;
what -> "skills/networking-discipline.md" [label="implement patterns,\nanti-patterns,\npressure scenarios"];
what -> "skills/network-framework-ref.md" [label="API reference\n(iOS 26+ or 12-18)"];
what -> "skills/networking-diag.md" [label="debug connection\nfailures"];
what -> "skills/networking-legacy.md" [label="iOS 12-18\nNWConnection patterns"];
what -> "skills/networking-migration.md" [label="migrate from\nsockets/URLSession"];
}
```
1. URLSession with structured concurrency? → `skills/networking-discipline.md`
2. Network.framework / NetworkConnection (iOS 26+)? → `skills/network-framework-ref.md`
3. NWConnection (iOS 12-18)? → `skills/networking-legacy.md`
4. Migrating from sockets/URLSession? → `skills/networking-migration.md`
5. Connection issues / debugging? → `skills/networking-diag.md`
6. Typed RPC / streaming against a service you control? → gRPC Swift (`skills/networking-discipline.md`)
7. ATS / HTTP / App Store rejection for networking? → `skills/networking-diag.md` + networking-auditor
8. Certificate pinning, signing API requests, encrypting payloads? → `/skill axiom-security`
9. UIWebView or deprecated API rejection? → networking-auditor (Agent)
10. Want deprecated API / anti-pattern scan? → networking-auditor (Agent)
#### Platform-specific networking
- watchOS low-level-networking limits (TN3135) → See axiom-watchos (skills/background-and-networking.md)
## 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
## Critical Patterns
**Networking** (`skills/networking-discipline.md`):
- URLSession with structured concurrency
- 8 red-flag anti-patterns (SCNetworkReachability, blocking sockets, hardcoded IPs)
- Decision tree for choosing TCP/UDP/TLS patterns
- NetworkConnection patterns (iOS 26+): TLS, UDP, TLV framing, Coder protocol
- 3 pressure scenarios with professional push-back templates
- Pre-shipping checklist
**Network Framework Reference** (`skills/network-framework-ref.md`):
- NetworkConnection (iOS 26+): all 12 WWDC 2025 examples
- NWConnection (iOS 12-18): complete API with examples
- TLV framing, Coder protocol, NetworkListener, NetworkBrowser
- Mobility: viability, better path, Multipath TCP, NWPathMonitor
- Security: TLS, certificate pinning, cipher suites
- Performance: user-space networking, ECN, service class, TCP Fast Open
**Diagnostics** (`skills/networking-diag.md`):
- Systematic decision tree for all connection failure types
- DNS failures, TLS certificate validation, message framing
- TCP congestion, IPv6-only cellular, VPN interference, ATS
- Production crisis scenario with professional communication templates
**Legacy** (`skills/networking-legacy.md`):
- NWConnection with TLS (completion handlers)
- UDP batch (30% CPU reduction)
- NWListener, NWBrowser (Bonjour discovery)
## Automated Scanning
**Networking audit** → `axiom-audit-networking` (deprecated APIs, anti-patterns, and completeness gaps — transition handling, TLS coverage, connection cleanup, framework selection)
## Anti-Rationalization
| Thought | Reality |
|---------|---------|
| "URLSession is simple, I don't need a skill" | URLSession with structured concurrency has async/cancellation patterns. `skills/networking-discipline.md` covers them. |
| "I'll debug the connection timeout myself" | Connection failures have 8 causes (DNS, TLS, proxy, cellular). `skills/networking-diag.md` diagnoses systematically. |
| "I just need a basic HTTP request" | Even basic requests need error handling, retry, and cancellation patterns. |
| "My custom networking layer works fine" | Custom layers miss cellular/proxy edge cases. Standard APIs handle them automatically. |
## Example Invocations
User: "My API request is failing with a timeout"
→ Read: `skills/networking-diag.md`
User: "How do I use URLSession with async/await?"
→ Read: `skills/networking-discipline.md`
User: "I need to implement a TCP connection"
→ Read: `skills/network-framework-ref.md`
User: "Should I use NWConnection or NetworkConnection?"
→ Read: `skills/network-framework-ref.md`
User: "My app was rejected for using HTTP connections"
→ Read: `skills/networking-diag.md` (ATS compliance)
User: "App Store says I'm using UIWebView"
→ Invoke: `networking-auditor` agent (deprecated API scan)
User: "Check my networking code for deprecated APIs"
→ Invoke: `networking-auditor` agent
章节与文件索引
按说明文件中的顺序排列。
快速参考
决策树
耐压性
关键模式
自动扫描
文件/命令 -> some-auditor · axiom-audit-networking · skills/networking-discipline.md · .proto · skills/network-framework-ref.md · skills/networking-diag.md · skills/networking-legacy.md · skills/networking-migration.md
内容校验值 -> 3c4eddeacd15
当前原文的自动摘译,尚未人工审校。
快速参考
症状/任务 · 参考具有结构化并发的 URLSession · 请参阅
skills/networking-discipline.mdNetwork.framework 反模式 · 请参阅skills/networking-discipline.md已弃用的 API 迁移 · 请参阅skills/networking-discipline.mdgRPC Swift — 类型化 RPC、流式传输、.proto代码生成 (WWDC 2026) · 请参阅skills/networking-discipline.md决策树
URLSession 具有结构化并发? →
skills/networking-discipline.mdNetwork.framework / NetworkConnection (iOS 26+)? →skills/network-framework-ref.mdNWConnection(iOS 12-18)? →skills/networking-legacy.md从套接字/URLSession 迁移? →skills/networking-migration.md连接问题/调试? →skills/networking-diag.md耐压性
当用户在定制实施上投入了大量时间时:不要屈服于沉没成本压力。正确的方法是: 首先诊断 — 在建议更改之前了解实际失败的原因 正确推荐 — 如果标准 API(URLSession、Network.framework)可以解决问题,请专业地说出 尊重但不要启用 — 承认他们的工作,同时提供诚实的技术指导
关键模式
网络 (
skills/networking-discipline.md):具有结构化并发的 URLSession 8 个红旗反模式(SCNetworkReachability、阻塞套接字、硬编码 IP) 用于选择 TCP/UDP/TLS 模式的决策树 网络连接模式 (iOS 26+):TLS、UDP、TLV 框架、Coder 协议自动扫描
网络审计 →
axiom-audit-networking(已弃用的 API、反模式和完整性差距 - 转换处理、TLS 覆盖、连接清理、框架选择)