Skip to content
Skills Library
Programming · Review & audit

clean-arch-observability

/clean-arch-observability

Use when adding or reviewing logging or analytics in a Flutter feature: log levels, what to log and not to log, global uncaught-exception logging, which levels to upload per environment, and analytics ids for pages and buttons (<feature>_ids.dart, <Feature>AnalyticsId).

Licence
MIT
Last repository change
31.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 31.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Use when adding or reviewing logging or analytics in a Flutter feature: log levels, what to log and not to log, global uncaught-exception logging, which levels to upload per environment, and analytics ids for pages and buttons (<feature>_ids.dart, <Feature>AnalyticsId).

Original author description

Use when adding or reviewing logging or analytics in a Flutter feature: log levels, what to log and not to log, global uncaught-exception logging, which levels to upload per environment, and analytics ids for pages and buttons (<feature>_ids.dart, <Feature>AnalyticsId).

How it works

  1. Logging
  2. Analytics
  3. Checklist before finishing
Original SKILL.md headings · 77 lines, 423 words
SKILL.md preview
---
name: clean-arch-observability
description: Use when adding or reviewing logging or analytics in a Flutter feature: log levels, what to log and not to log, global uncaught-exception logging, which levels to upload per environment, and analytics ids for pages and buttons (<feature>_ids.dart, <Feature>AnalyticsId).
---

# Logging and analytics rules

## Logging

Use the shared logger from `core/logging`. Never `print`.

### What to log

- **Expected exceptions, when you catch them** (for example an external library that throws instead of returning errors): log in the `catch` block.
- **Unexpected uncaught exceptions:** one global mechanism logs them all (`FlutterError.onError`, `PlatformDispatcher.instance.onError`, and a guarded zone). Do not rely on each feature to do it.
- **Traces that let you follow what the user did:** every navigation, and the lifecycle of business processes (start and end of a tracked activity, for example).

### What never to log

- Personal information (an email address is the one allowed exception).
- Secrets: passwords, keys, tokens, and so on.

### Levels

| Level | Use for |
|---|---|
| **Fine** | Normal situation, used for debugging on a test environment |
| **Info** | Normal situation, used to follow user actions in production |
| **Warning** | Abnormal but expected situation (network error, validation error) |
| **Severe** | Unexpected situation (unknown server error, unexpected exception) |

### What to upload

| Environment | Upload |
|---|---|
| Test | Fine, Info, Warning, Severe |
| Production | Info, Warning, Severe |

### Avoid noise

Do not log actions that are automatic and frequent (a timer every 5 seconds) each time: it makes logs unreadable and exhausts logging quotas. Temporary Fine logs for debugging one feature are fine.

## Analytics

### Ids live with the feature

Define ids per feature in `<feature_name>_ids.dart`, in the feature's root folder, as a `<FeatureName>AnalyticsId` class.

### Pages

Assign an id to every page. Define them as static strings at the top of the class:

- `page = '<FeatureName>Page'`
- `<pageName>Page = '<FeatureName><PageName>Page'`

### Buttons and other clickable elements

Assign an id to every button and clickable element. Define them below the page ids, as static fields or methods, as `AnalyticsId` instances:

- `<action>Button = AnalyticsId('<Action>Button', page)`
- `<action>Button(String page) => AnalyticsId('<Action>Button', page)` when a multi-page feature has name conflicts

```dart
// features/transfers/transfers_ids.dart
abstract final class TransfersAnalyticsId {
  static const page = 'TransfersPage';
  static const detailsPage = 'TransfersDetailsPage';

  static const submitButton = AnalyticsId('SubmitButton', page);
  static AnalyticsId cancelButton(String page) => AnalyticsId('CancelButton', page);
}
```

## Checklist before finishing

- [ ] Caught expected exceptions are logged; none are swallowed silently
- [ ] No sensitive data in log messages
- [ ] Correct level per message; levels uploaded per environment
- [ ] Navigation traces exist
- [ ] `<feature>_ids.dart` has the page ids and an id for every button

Versions

The database has no other skills named clean-arch-observability.

Database snapshot: 13.11.2026 · package version 6dfd4be3b3a5 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100logging-guide
    Implement structured logging with proper log levels and sensitive data handling. Use when: adding logging, debugging, setting up observability. Not for: metrics, traces, and alerting design — use /observability; error code taxonomy — use /error-code-guide. Keywords: logging, log…
  • 100clean-arch-di-routing
    Use when wiring a Flutter Clean Architecture feature into the app: writing <feature>_providers.dart, editing bootstrap/global_providers.dart, choosing provider vs get_it, async startup dependencies, registering routes and guards (auto_route or go_router), AppConfig…
  • 100clean-arch-domain
    Use when creating or editing the domain layer of a Flutter feature (features/<feature>/domain): entities, abstract repository interfaces, use cases, domain failures. Rules for what belongs in domain, naming, and what it must never import.
  • 100dotnet-source-generated-logging
    Write .NET logs with the LoggerMessage source generator for ILogger calls. USE FOR: adding or reviewing log statements built from [LoggerMessage] partial methods — message templates, log levels, event ids, exception logging, and logging scopes.
  • 100logging-standards
    Structured logging standards: log levels, structured fields, correlation IDs, PII masking, and event naming. TRIGGER when: adding log statements, configuring loggers, or reviewing log output. SKIP: metrics and alerting (use monitoring-observability); error control flow (use…
  • 100logging-standards
    Comprehensive logging standards — what to log, when to log, log format/schema, what never to log (PII/secrets), Pino setup, request correlation, frontend error logging, CloudWatch config, Sentry integration. Load whenever writing any code that logs, instruments, or debugs.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.