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/wangjianqi/appstore/06-network-apinpx skills add wangjianqi/AppStore --skill 06-network-apigit clone --depth 1 https://github.com/wangjianqi/AppStoreWrote 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/wangjianqi/appstore/06-network-api)<a href="https://agentmods.dev/skills/wangjianqi/appstore/06-network-api"><img src="https://agentmods.dev/badge/skills/wangjianqi/appstore/06-network-api.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.00037 | $0.03221 |
| Opus 5 | $0.00018 | $0.01611 |
| Sonnet 5 | $0.00007 | $0.00644 |
| Haiku 4.5 | $0.00004 | $0.00322 |
Grade A, and why
network-api 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 — 413 lines — stays where its author put it; the contents beside it link to each section on GitHub.
网络 / API 层
网络层架构
- 基础层:URLSession(禁止引入 Alamofire,除非已存在)
- 封装层:
NetworkService.swift统一处理请求、错误、重试 - 接口定义:每个模块有对应
XxxAPI.swift,定义 endpoint + 参数
NetworkService 完整封装
protocol NetworkServiceProtocol {
func request<T: Decodable>(_ endpoint: APIEndpoint) async throws -> T
func upload<T: Decodable>(_ endpoint: APIEndpoint, data: Data) async throws -> T
}
final class NetworkService: NetworkServiceProtocol {
private let session: URLSession
private let keychain: KeychainStorage
private let config: APIConfig
init(session: URLSession = .shared, keychain: KeychainStorage = .shared, config: APIConfig = .current) {
self.session = session
self.keychain = keychain
self.config = config
}
func request<T: Decodable>(_ endpoint: APIEndpoint) async throws -> T {
let urlRequest = try buildRequest(for: endpoint)
let response: T = try await executeWithRetry(urlRequest, maxRetries: endpoint.retryCount)
return response
}
func upload<T: Decodable>(_ endpoint: APIEndpoint, data: Data) async throws -> T {
var urlRequest = try buildRequest(for: endpoint)
urlRequest.httpBody = data
urlRequest.setValue("application/octet-stream", forHTTPHeaderField: "Content-Type")
return try await execute(urlRequest)
}
private func buildRequest(for endpoint: APIEndpoint) throws -> URLRequest {
var components = URLComponents(string: config.baseURL + endpoint.path)
if let parameters = endpoint.queryParameters {
components?.queryItems = parameters.map { URLQueryItem(name: $0.key, value: "\($0.value)") }
}
guard let url = components?.url else { throw NetworkError.invalidURL }
var request = URLRequest(url: url)
request.httpMethod = endpoint.method.rawValue
request.timeoutInterval = endpoint.timeout
if endpoint.requiresAuth {
guard let token = keychain.loadToken() else { throw NetworkError.unauthorized }
request.setValue("Bearer \(token)", forHTTPHeaderField: "Authorization")
}
if let body = endpoint.body {
request.httpBody = try JSONSerialization.data(withJSONObject: body)
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
}
request.setValue("application/json", forHTTPHeaderField: "Accept")
request.setValue(Bundle.main.appVersion, forHTTPHeaderField: "X-App-Version")
request.setValue(UIDevice.current.systemVersion, forHTTPHeaderField: "X-iOS-Version")
return request
}
private func execute<T: Decodable>(_ request: URLRequest) async throws -> T {
#if DEBUG
logRequest(request)
#endif
let (data, urlResponse) = try await session.data(for: request)
#if DEBUG
logResponse(data, response: urlResponse)
#endif
guard let httpResponse = urlResponse as? HTTPURLResponse else {
throw NetworkError.invalidResponse
}
switch httpResponse.statusCode {
case 200...299:
do {
let decoder = JSONDecoder()
decoder.keyDecodingStrategy = .convertFromSnakeCase
decoder.dateDecodingStrategy = .iso8601
return try decoder.decode(T.self, from: data)
} catch {
throw NetworkError.decodingFailed
}
case 401:
throw NetworkError.unauthorized
case 400...499:
if let errorBody = try? JSONDecoder().decode(ErrorResponse.self, from: data) {
throw NetworkError.clientError(httpResponse.statusCode, errorBody.message)
}
throw NetworkError.clientError(httpResponse.statusCode, "客户端错误")
case 500...599:
throw NetworkError.serverError(httpResponse.statusCode)
default:
throw NetworkError.unknown
}
}
}
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 · 413 lines · 37 tokens per session scan A 566723cc3e0a
network-api is a skill published in the GitHub repository wangjianqi/AppStore (10 stars, last pushed 3mo ago), licensed MIT. It adds 37 tokens to every session and 3,221 once invoked, about $0.0002 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-31.
Other skills, from other repositories
ipaship-audit
Use when auditing iOS/Android app submissions for compliance with Apple App Store Review Guidelines or Google Play Developer Policies. Scan .ipa, .apk, or .zip files against official store policies, generate structured compliance reports, and identify violations with remediation steps.
view-specifications
Guide for writing view specification documents and a starter template for SwiftUI and cross-platform views.
project-structure
Directory layout, file responsibilities, and Xcode integration for meta-loop projects.
argent-settings-permissions
Grant, deny, or reset an app's runtime permissions (camera, microphone, photos, contacts, notifications, calendar, location, location-always, media-library, motion, reminders) on an iOS simulator or Android device using the argent settings-permissions tool - without navigating the system Settings UI. Use when the…
argent-react-native-optimization
Optimizes a React Native app by profiling first to find real bottlenecks, then sweeping for mechanical issues. Entry-point for all performance work. Use when the app feels slow, user asks to optimize, fix re-renders, reduce jank, or improve startup. Delegates to argent-react-native-profiler for measurement.
mobile-automation
Control Android and iOS devices, emulators and simulators — launch apps, tap, swipe, type, take screenshots, read the accessibility tree. Use when a task involves a mobile device or app, mobile UI testing, or reproducing a bug on a phone.