mit einem Klick
new-network-package
Scaffold a new network interceptor package (e.g. Chopper, Retrofit) using the shared ispectify base. Trigger on "/new-network-package" or when the user asks to add support for a new HTTP client.
Menü
Scaffold a new network interceptor package (e.g. Chopper, Retrofit) using the shared ispectify base. Trigger on "/new-network-package" or when the user asks to add support for a new HTTP client.
Create a well-structured git commit for staged or unstaged changes — analyze the diff, match the project's existing commit style, write a clear message, and create the commit. Use this skill when the user asks to commit, save changes, check in code, write a commit message, prepare changes for push, or wrap up a piece of work — even when they don't say "commit" explicitly (e.g. "let's save this", "ship it", "сохрани изменения").
Use this skill when modifying ISpect network, WebSocket, database, BLoC, or trace logging behavior, including requests like "add capture", "fix redaction", "interceptor logs wrong data", "DB trace broken", "request IDs missing", or "payload should not leak". It preserves correlation IDs, redaction defaults, and package boundaries.
Scaffold a new database or storage interceptor in `packages/ispectify_db/example` using the shared ISpect DB tracing API. Use when adding support for a new backend such as Hive, SharedPreferences, Drift, Isar, Realm, Sembast, ObjectBox, Firestore, secure storage, or another storage driver.
Use this skill when asked to test, verify, validate, run checks, fix analyzer failures, or confirm CI readiness for an ISpect package, including vague requests like "check this package", "проверь тесты", "why CI fails", or "make it green". It chooses the correct Dart vs Flutter commands and adds README/version checks only when relevant.
Use this skill when asked to update versions, prepare a release, sync changelogs, rebuild README files, fix README drift, validate package dependencies, or handle prerelease bumps in ISpect, including "release prep", "bump dev version", "sync docs", "README check failed", or "version mismatch".
Write or update CHANGELOG.md entries following the project's established style. Use when adding features, fixing bugs, or making any changes that need changelog documentation. Trigger on "/changelog" or when the user asks to update the changelog.
| name | new-network-package |
| description | Scaffold a new network interceptor package (e.g. Chopper, Retrofit) using the shared ispectify base. Trigger on "/new-network-package" or when the user asks to add support for a new HTTP client. |
Scaffold and implement a new ispectify_<client> package that integrates a third-party HTTP client with the ISpect logging toolkit.
Every network interceptor package follows the same structure built on shared abstractions from ispectify:
packages/ispectify_<client>/
lib/
ispectify_<client>.dart # Public barrel export
src/
interceptor.dart # Main interceptor class
settings.dart # Settings (extends BaseNetworkInterceptorSettings)
settings_builder.dart # Builder (extends BaseNetworkInterceptorSettingsBuilder)
data/
_data.dart # Barrel export for data classes
request.dart # <Client>RequestData — toJson() for request metadata
response.dart # <Client>ResponseData — toJson() for response metadata
error.dart # <Client>ErrorData — toJson() for error metadata (if applicable)
models/
_models.dart # Barrel export for log models
request.dart # <Client>RequestLog extends NetworkRequestLog
response.dart # <Client>ResponseLog extends NetworkResponseLog
error.dart # <Client>ErrorLog extends NetworkErrorLog
utils/ # Optional: serializers for opaque types (FormData, Multipart, etc.)
test/
interceptor_test.dart
settings_test.dart
settings_builder_test.dart
pubspec.yaml
analysis_options.yaml
README.md
LICENSE
These are already in ispectify — import and extend, never reimplement:
| What | Purpose |
|---|---|
NetworkJsonKeys | All JSON key constants (method, url, headers, data, status-code, etc.) |
NetworkMapRedactor | Redaction pipeline: redactUrl(), redactHeaders(), redactData(), redactMapField(), redactPathFields(), redactRedirects(), redactMultipart() |
BaseNetworkInterceptor | Mixin with safeLog(), shouldProcess(), redactUrlAndPath(), bodyAsMap(), payload (NetworkPayloadSanitizer) |
BaseNetworkInterceptorSettings | Abstract settings: enabled, enableRedaction, print* flags, AnsiPen colors |
BaseNetworkInterceptorSettingsBuilder<B> | Fluent builder with .development(), .production(), .staging(), .disabled() presets |
NetworkRequestLog / NetworkResponseLog / NetworkErrorLog | Base log classes |
NetworkPayloadSanitizer | decodeJsonGracefully(), toStringKeyMap(), ensureMap(), header normalization |
RedactionService | Pluggable redaction with key-based, pattern-based, and composite strategies |
RequestIdGenerator | Unique request ID generation for request-response correlation |
packages/ispectify_<client>/.pubspec.yaml:
ispectify_<client>version.config (single source of truth)ispectify (use dependency_overrides for local dev), the HTTP client packagetest, mocktail (or equivalent)analysis_options.yaml — include the root analysis options.dependency_overrides pointing to local ../ispectify path.settings.dart — extend BaseNetworkInterceptorSettings:
class ISpect<Client>InterceptorSettings extends BaseNetworkInterceptorSettings {
const ISpect<Client>InterceptorSettings({
// All base params forwarded to super
super.enabled,
super.enableRedaction,
super.printRequestData,
super.printRequestHeaders,
super.printResponseData,
super.printResponseHeaders,
super.printResponseMessage,
super.printErrorData,
super.printErrorHeaders,
super.printErrorMessage,
super.requestPen,
super.responsePen,
super.errorPen,
// Client-specific filters:
this.requestFilter,
this.responseFilter,
this.errorFilter,
});
final bool Function(<ClientRequest>)? requestFilter;
final bool Function(<ClientResponse>)? responseFilter;
final bool Function(<ClientError>)? errorFilter;
// copyWith() — forward all fields
}
settings_builder.dart — extend BaseNetworkInterceptorSettingsBuilder<Self>:
class ISpect<Client>InterceptorSettingsBuilder
extends BaseNetworkInterceptorSettingsBuilder<ISpect<Client>InterceptorSettingsBuilder> {
// Factory constructors: .development(), .production(), .staging(), .disabled()
// Client-specific filter methods: withRequestFilter(), withResponseFilter(), withErrorFilter()
// build() → ISpect<Client>InterceptorSettings
}
data/request.dart — <Client>RequestData:
class <Client>RequestData {
<Client>RequestData(this.request);
final <ClientRequest> request;
Map<String, dynamic> toJson({
RedactionService? redactor,
Set<String>? ignoredValues,
Set<String>? ignoredKeys,
}) {
final map = <String, dynamic>{
// --- Identity ---
NetworkJsonKeys.method: request.method,
NetworkJsonKeys.url: request.url.toString(),
// ... map all fields using NetworkJsonKeys
// --- Payload ---
NetworkJsonKeys.headers: ...,
NetworkJsonKeys.data: ...,
};
if (redactor == null) return map;
// Use shared redaction pipeline:
NetworkMapRedactor.redactUrl(map, redactor);
NetworkMapRedactor.redactHeaders(map, redactor, ignoredValues: ignoredValues, ignoredKeys: ignoredKeys);
NetworkMapRedactor.redactData(map, redactor, ignoredValues: ignoredValues, ignoredKeys: ignoredKeys);
return map;
}
}
Apply the same pattern for ResponseData and ErrorData.
Field ordering convention (consistent across all packages):
For requests: Identity → Payload → Timing → Behaviour → Meta For responses: Status → Identity → Payload → Redirects → Meta → Request (nested, last) For errors: Error summary → Response → Request (nested, last)
Extend base network log classes:
class <Client>RequestLog extends NetworkRequestLog {
<Client>RequestLog(
super.message, {
required super.method,
required super.url,
required super.path,
required <Client>InterceptorSettings settings,
required <Client>RequestData requestData,
super.requestId,
super.body,
RedactionService? redactor,
Map<String, String>? headers,
}) : super(
settings: settings,
headers: headers?.map(MapEntry.new),
metadata: requestData.toJson(redactor: redactor),
);
}
final class ISpect<Client>Interceptor with BaseNetworkInterceptor {
ISpect<Client>Interceptor({
required ISpectLogger logger,
ISpect<Client>InterceptorSettings? settings,
RedactionService? redactor,
});
// Use mixin helpers:
// - safeLog(() => buildLog(...)) — prevents log failures from breaking HTTP pipeline
// - shouldProcess(settings.enabled, filter, value) — consolidated enable + filter check
// - redactUrlAndPath(url, redactor) — returns (redactedUrl, redactedPath)
// - payload.body(), payload.headersMap(), payload.ensureMap() — payload normalization
// configure() method — runtime reconfiguration with enableRedaction param
}
Cover:
configure() runtime changestoJson() structuredependency_overrides in the new package's pubspec.yaml for local dev.bash/publish.sh..github/workflows/test.yml..github/workflows/validate_versions.yml.bash/update_versions.sh to include the new package.CLAUDE.md monorepo structure section.NetworkJsonKeys.*.NetworkMapRedactor.* methods.metadata via requestData.toJson() to enable JSON export.configure() must include enableRedaction parameter.redactHeaders() returns the result — if you need type conversion (e.g. Map<String, String>), do it in your data class, not in the shared utility.safeLog().version.config — never hardcode in pubspec.yaml.Before marking complete, verify:
dart analyze --fatal-infos / flutter analyze --fatal-infos — zero issuesNetworkMapRedactor exclusivelyBaseNetworkInterceptorSettingsBaseNetworkInterceptorSettingsBuilder<Self>BaseNetworkInterceptor mixinNetworkRequestLog / NetworkResponseLog / NetworkErrorLogmetadata passed to log constructorsconfigure() includes enableRedaction