<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Noa Tubić]]></title><description><![CDATA[Practical posts on Flutter and Dart: open-source packages, Claude Code skills, and tools for localization, linting, security, and app architecture.]]></description><link>https://noatubic.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6acffa2071fddf96f16c4ba1/ef8752c6-c437-4427-8048-93ad3f7a32c8.png</url><title>Noa Tubić</title><link>https://noatubic.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Sat, 28 Nov 2026 01:23:36 GMT</lastBuildDate><atom:link href="https://noatubic.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[A knowledge base for your repo and your AI agent]]></title><description><![CDATA[Keep decisions and feature docs as Markdown in your repo, wire them into your AI coding agent, and catch stale or broken docs in CI with knowledge_base.]]></description><link>https://noatubic.hashnode.dev/a-knowledge-base-for-your-repo-and-your-ai-agent</link><guid isPermaLink="true">https://noatubic.hashnode.dev/a-knowledge-base-for-your-repo-and-your-ai-agent</guid><category><![CDATA[documentation]]></category><category><![CDATA[AI]]></category><category><![CDATA[Developer Tools]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Dart]]></category><dc:creator><![CDATA[Noa Tubić]]></dc:creator><pubDate>Thu, 26 Nov 2026 16:25:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6acffa2071fddf96f16c4ba1/e9f33b0d-3ff6-4a6e-bac8-5974f99b0b6c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The code tells you what a system does. It doesn't tell you why totals are rounded per line, why a declined card is never retried, or that someone already compared three payment SDKs last spring.</p>
<p>That knowledge usually lives in a wiki nobody reviews, or in one person's head. My AI coding agent has it even worse: every session starts from zero, so it happily suggests the approach we rejected a month ago. I wanted the reasons in the repo, where both people and agents read them, and a check that tells me when they stop being true. So I wrote <code>knowledge_base</code>.</p>
<h2>What it gives you</h2>
<ul>
<li>A fixed place for decisions, feature docs, research notes, and a glossary, all plain Markdown in <code>docs/</code></li>
<li>One index per folder, one line per doc, so a reader opens only what matters</li>
<li>A block in <code>CLAUDE.md</code> or <code>AGENTS.md</code> that tells your agent to read the indexes before it works</li>
<li>A <code>/capture</code> skill that proposes what to keep when a task is done</li>
<li>A checker with thirteen checks, made for CI</li>
</ul>
<p>It works with any language and any repo. Dart is only needed to run it.</p>
<h2>Set it up in a minute</h2>
<pre><code class="language-sh">dart pub global activate --source git https://github.com/NoaTubic/knowledge_base
cd my_project
knowledge_base init
knowledge_base new feature "Payments" --paths "src/payments/**"
knowledge_base check
</code></pre>
<p><code>init</code> creates the docs folder, the three indexes, the glossary, an optional config file, and the agent wiring. It picks the agent setup your project already uses, or you choose with <code>--agent claude</code>, <code>agents</code>, <code>both</code>, or <code>none</code>. Files that already exist are kept, and running it again only updates its own block between two markers.</p>
<p><code>new</code> starts a doc from a template and adds the index line for you. Decisions get the next free number, and research notes get today's date.</p>
<h2>How a doc knows it is out of date</h2>
<p>A feature doc names the code it is about in its frontmatter:</p>
<pre><code class="language-yaml">---
title: Payments
paths:
  - "src/payments/**"
updated: 2026-11-10
---
</code></pre>
<p>Those two fields are the whole trick. If a path matches no file, the code was moved or deleted. If git shows commits under those paths after the <code>updated</code> date, the code moved on without the doc.</p>
<p>I tried it on a small demo repo. I pointed the payments doc at an old folder that no longer exists, changed the payment code twice after the doc's date, and added a cart doc that I forgot to index and that links to a page I never wrote. This is what <code>check</code> said:</p>
<pre><code class="language-text">knowledge_base  docs/ · 1 decision · 2 feature docs · 0 research notes

docs/features/cart.md
  error       Not listed in FEATURES-INDEX.md (index_missing)
  error   10  Link to a missing file: checkout.md (broken_link)

docs/features/payments.md
  warn     5  Path matches no file: src/payments_v1/** (dead_path)
  info     6  2 commits changed the code this doc covers since 2026-11-10 (latest 2026-11-26). Re-read it, then set updated (stale_doc)

2 errors, 1 warning, 1 info
</code></pre>
<p>It exited with code 1, so CI would fail on the two errors. The stale doc is only info by default. <strong>A doc can be right even after the code changes</strong>, so the tool asks you to re-read it instead of blocking the merge. If your team wants it stricter, one line in <code>knowledge_base.yaml</code> turns it into a warning or an error.</p>
<h2>Knowing what to read before you change code</h2>
<p>The <code>for</code> command goes the other way. Give it files and it lists the feature docs that cover them:</p>
<pre><code class="language-sh">knowledge_base for src/payments/retry.ts
knowledge_base for --since origin/main
</code></pre>
<pre><code class="language-text">docs/features/payments.md  Payments
  src/payments/retry.ts
</code></pre>
<p>With <code>--since</code> it looks at everything your branch changed, which makes a good last step before a merge.</p>
<h2>Letting the agent propose, not write</h2>
<p>At the end of a task you type <code>/capture</code> in your agent, optionally with a topic, like <code>/capture payment retries</code>. The agent goes back over the session and tests each thing it learned against three questions. Would someone act differently for knowing it? Is it missing from the code, tests, and history? Is it still true at the end of the session?</p>
<p>Whatever passes gets a home: a decision, a feature doc, a research note, a glossary term, or a one-line note in the nearest <code>CLAUDE.md</code>. Then it shows you a plan with the files and the rule behind each one. It writes only after you approve, and it never commits.</p>
<p>The bar is high on purpose. Most tasks add nothing, and the skill says so plainly. I'd rather have ten docs that are true than a hundred that are noise.</p>
<h2>Running it in CI</h2>
<pre><code class="language-yaml">- uses: dart-lang/setup-dart@v1
- run: dart pub global activate --source git https://github.com/NoaTubic/knowledge_base
- run: knowledge_base check --format github
</code></pre>
<p>The <code>github</code> format turns findings into annotations on the pull request. Give the checkout <code>fetch-depth: 0</code> so the stale check can see the full history. There is also <code>--format json</code> for scripts and <code>--only</code> to run a subset of checks.</p>
<h2>Start with one doc</h2>
<p>Run <code>knowledge_base init</code> in a repo you work on every day, write one feature doc for the part that confuses new people most, and add the check to CI. The code and the full list of checks are here:</p>
<p><a class="embed-card" href="https://github.com/NoaTubic/knowledge_base">https://github.com/NoaTubic/knowledge_base</a></p>

<p>Feedback and issues are welcome on GitHub.</p>
]]></content:encoded></item><item><title><![CDATA[A Riverpod 3 architecture for Flutter apps]]></title><description><![CDATA[A Riverpod 3 architecture for Flutter: base notifiers, Either error handling, pagination, mappers, and global loading and error UI for every feature.]]></description><link>https://noatubic.hashnode.dev/a-riverpod-3-architecture-for-flutter-apps</link><guid isPermaLink="true">https://noatubic.hashnode.dev/a-riverpod-3-architecture-for-flutter-apps</guid><category><![CDATA[Flutter]]></category><category><![CDATA[Dart]]></category><category><![CDATA[Riverpod]]></category><category><![CDATA[software architecture]]></category><category><![CDATA[State Management ]]></category><dc:creator><![CDATA[Noa Tubić]]></dc:creator><pubDate>Tue, 24 Nov 2026 20:24:31 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6acffa2071fddf96f16c4ba1/7b902d03-db82-47f9-8e23-c9ab3b0bc6ee.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Riverpod tells you how to hold state. It doesn't tell you how a feature should be put together. So every project, and often every developer, ends up with a different answer.</p>
<p>Almost every screen still does the same thing. Show a spinner, call the API, then show the data or an error. Without a shared structure, every notifier writes that again, slightly differently each time.</p>
<p>After a few projects I stopped reinventing it. <code>riverpod_architecture</code> is the structure I now start every Flutter app with.</p>
<h2>What it does</h2>
<p>Each feature follows the same path: a repository returns either a failure or the data, a notifier turns that into state, and the screen renders the state. The package gives you the pieces for each layer:</p>
<ul>
<li>Mappers that turn API responses into your own models, and forms into requests</li>
<li><code>BaseNotifier</code>: one <code>execute()</code> call sets loading, then data or error</li>
<li><code>PaginatedNotifier</code>: infinite lists with next page, refresh, and errors that keep the items already loaded</li>
<li>Global loading, failure, and info messages for the whole app</li>
<li>Sealed states, so the compiler checks you handled every case</li>
</ul>
<p>It's built on Riverpod 3 and uses <code>Either</code> for results, so a failure is a value you return, not an exception you hope someone catches.</p>
<h2>Try it</h2>
<pre><code class="language-sh">flutter pub add riverpod_architecture flutter_riverpod either_dart
</code></pre>
<p>Your repository returns either a failure or the data:</p>
<pre><code class="language-dart">EitherFailureOr&lt;User&gt; getUser(int id) async {
  try {
    return Right(User.fromJson(await api.getUser(id)));
  } catch (error, stackTrace) {
    return Left(Failure(title: 'Could not load user', error: error, stackTrace: stackTrace));
  }
}
</code></pre>
<p>The notifier is a few lines:</p>
<pre><code class="language-dart">class UserNotifier extends AutoDisposeBaseNotifier&lt;User&gt; {
  @override
  void prepareForBuild() {}

  Future&lt;void&gt; fetchUser(int id) =&gt; execute(
        ref.read(userRepositoryProvider).getUser(id),
        globalFailure: false, // show errors on this screen
      );
}
</code></pre>
<p>And the screen switches over the state:</p>
<pre><code class="language-dart">switch (ref.watch(userNotifierProvider)) {
  BaseInitial() || BaseLoading() =&gt; const CircularProgressIndicator(),
  BaseError(:final failure) =&gt; Text(failure.title),
  BaseData(:final data) =&gt; UserCard(user: data),
}
</code></pre>
<p>Forget a case and it won't compile.</p>
<h2>One call, many behaviors</h2>
<p><code>execute()</code> takes a few switches for the cases that come up again and again:</p>
<pre><code class="language-dart">await execute(
  repository.saveProfile(profile),
  withLoadingState: false, // keep the form on screen
  globalLoading: true,     // dim the whole app instead
  globalFailure: true,     // show the error as a snackbar
);
</code></pre>
<p>Saving a form is the classic example. You don't want the form replaced by a spinner. You want an overlay, and an error message that leaves the user's input alone. That's one call instead of a page of state handling.</p>
<p>By default, failures go to a single <code>BaseWidget</code> near the top of your app, so you decide once how errors look. Pass <code>globalFailure: false</code> when a screen should show its own error, like the user screen above.</p>
<h2>Pagination without the edge cases</h2>
<p>Paginated lists are where hand-written notifiers usually break. You load page 2 twice, or an error wipes out the 40 items already on screen.</p>
<p><code>PaginatedNotifier</code> handles that. You write one method that loads a page:</p>
<pre><code class="language-dart">@override
PaginatedEitherFailureOr&lt;User&gt; getListOrFailure(int page, [void parameter]) =&gt;
    repository.getUsers(page: page);
</code></pre>
<p><strong>The notifier tracks the page, ignores duplicate "load more" calls, and keeps the loaded items when a page fails.</strong> Your screen calls <code>getNextPage()</code> when the user nears the end, and <code>refresh()</code> for pull to refresh.</p>
<h2>When you don't need it</h2>
<p>For a small app with two or three screens, Riverpod's own <code>AsyncNotifier</code> and <code>AsyncValue</code> are enough. Adding base classes there is more structure than the app needs.</p>
<p>It pays off when you have dozens of screens and want them to load, fail, and paginate the same way. It also helps when a new teammate should be able to open any notifier and know where everything is.</p>
<p>The package started as a Riverpod 3 port of Q Agency's Q-Architecture, and the credit for the original design is theirs.</p>
<h2>Try it yourself</h2>
<p>Pick one screen that loads data and move its notifier to <code>BaseNotifier</code>. If it feels lighter, do the next one. The example app has a single user screen and a paginated list:</p>
<p><a class="embed-card" href="https://github.com/NoaTubic/riverpod_architecture">https://github.com/NoaTubic/riverpod_architecture</a></p>
<p><a class="embed-card" href="https://pub.dev/packages/riverpod_architecture">https://pub.dev/packages/riverpod_architecture</a></p>

<p>Feedback and issues are welcome on GitHub.</p>
]]></content:encoded></item><item><title><![CDATA[Block rooted and jailbroken devices in Flutter]]></title><description><![CDATA[Detect rooted, jailbroken, emulated, and debugged devices in Flutter before runApp, then block, log, or allow each signal with one simple policy.]]></description><link>https://noatubic.hashnode.dev/block-rooted-and-jailbroken-devices-in-flutter</link><guid isPermaLink="true">https://noatubic.hashnode.dev/block-rooted-and-jailbroken-devices-in-flutter</guid><category><![CDATA[Flutter]]></category><category><![CDATA[mobile security]]></category><category><![CDATA[Android]]></category><category><![CDATA[iOS]]></category><category><![CDATA[Security]]></category><dc:creator><![CDATA[Noa Tubić]]></dc:creator><pubDate>Tue, 24 Nov 2026 20:22:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6acffa2071fddf96f16c4ba1/0bc558f2-ef77-4f2c-bec9-6ac24b9b1d9b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>If your app handles payments, health data, or anything else worth stealing, a rooted phone is a problem. Root access lets other apps read your storage, hook your code, and change what your app sees.</p>
<p>Most teams agree they should check for this. Then the check ends up scattered across <code>main()</code>, a splash screen, and a few platform channels, with no clear rule for when to block and when to just log.</p>
<p>I wanted one place for it. So I wrote <code>device_integrity_guard</code>.</p>
<h2>What it does</h2>
<p>It runs a set of checks before <code>runApp</code>, and then either starts your app or shows a block screen.</p>
<ul>
<li>Root on Android: known <code>su</code> binaries, root apps, and a writable system folder</li>
<li>Jailbreak on iOS: known jailbreak files and write access outside the app sandbox</li>
<li>Emulators, from the device info Android and iOS report</li>
<li>An attached debugger</li>
</ul>
<p>A policy decides what each signal means. You can block it, only log it, or allow it, and you can switch all of it off in debug builds.</p>
<h2>Try it</h2>
<pre><code class="language-sh">flutter pub add device_integrity_guard
</code></pre>
<p>Then wrap your app in <code>main()</code>:</p>
<pre><code class="language-dart">Future&lt;void&gt; main() async {
  final guard = DeviceIntegrityGuard(
    policy: DeviceIntegrityPolicy(
      allowDebugMode: !kReleaseMode,
      blockOnCompromise: kReleaseMode,
    ),
    onViolation: (result) =&gt; debugPrint('${result.blockedSignals}'),
  );
  await runGuardedApp(app: const MyApp(), guard: guard);
}
</code></pre>
<p>That's the whole setup. In a release build, a rooted or jailbroken device gets the block screen instead of your app. In debug, the checks are skipped, so you can still work on an emulator.</p>
<h2>Block, log, or allow</h2>
<p>The part I use most is the policy. Not every signal deserves the same answer.</p>
<p>A rooted phone in production is usually a block. An emulator in your QA build is expected. A debugger attached to a release build is worth knowing about, even if you don't block it yet.</p>
<p>So each detector can be switched on or off, each kind of signal can be allowed or not, and <code>onViolation</code> hands you the full result. That includes every signal, the reason for each one, and how long the scan took. Send it to your analytics first, see what real users trigger, and only then turn on blocking.</p>
<h2>Your own screen and your own checks</h2>
<p>The default block screen shows a short English message and the list of what was found. You can pass your own widget instead, or a builder that receives the summary of what was found:</p>
<pre><code class="language-dart">await runGuardedApp(
  app: const MyApp(),
  guard: guard,
  blockedBuilder: (summary) =&gt; MyBlockedScreen(summary: summary),
);
</code></pre>
<p>Checks are pluggable too. Implement <code>IntegritySignalDetector</code> for anything specific to your app, like an APK signature check, and add it next to the built-in ones.</p>
<h2>What it can't do</h2>
<p>These checks run on the device, so a determined attacker can hide from them. <strong>Treat this as your first line, not your only one.</strong> For anything that really matters, pair it with server-side attestation: Play Integrity on Android and App Attest on iOS. The guard keeps casual tampering and test devices out of production. Attestation lets your backend refuse requests from a device it can't trust.</p>
<p>One iOS detail: the jailbreak check also asks whether the <code>cydia://</code> URL scheme can be opened. iOS only answers that if <code>cydia</code> is listed under <code>LSApplicationQueriesSchemes</code> in your <code>Info.plist</code>, so add it there.</p>
<h2>Try it yourself</h2>
<p>Add the package, ship it with blocking off and logging on for one release, and look at what your users actually trigger. The example app and the full API are here:</p>
<p><a class="embed-card" href="https://github.com/NoaTubic/device_integrity_guard">https://github.com/NoaTubic/device_integrity_guard</a></p>
<p><a class="embed-card" href="https://pub.dev/packages/device_integrity_guard">https://pub.dev/packages/device_integrity_guard</a></p>

<p>Feedback and issues are welcome on GitHub.</p>
]]></content:encoded></item><item><title><![CDATA[Write your Flutter lint rules in YAML]]></title><description><![CDATA[Write your Flutter team's lint rules in YAML: design tokens, layering, widget and Riverpod rules, checked on every save with no analyzer plugin.]]></description><link>https://noatubic.hashnode.dev/write-your-flutter-lint-rules-in-yaml</link><guid isPermaLink="true">https://noatubic.hashnode.dev/write-your-flutter-lint-rules-in-yaml</guid><category><![CDATA[Flutter]]></category><category><![CDATA[Dart]]></category><category><![CDATA[Linter]]></category><category><![CDATA[Code Quality]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Noa Tubić]]></dc:creator><pubDate>Tue, 24 Nov 2026 20:20:06 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6acffa2071fddf96f16c4ba1/0e04148e-83e8-46b2-9662-51ecbae3e48f.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Every codebase has house rules. Use the design tokens, not <code>Colors.grey</code>. Don't let <code>domain/</code> import <code>presentation/</code>. Never call <code>ref.watch</code> from a button handler.</p>
<p>They live in a style guide or a wiki page, and nothing checks them. So they drift. The worst kind is a design token typo: <code>'Text/bdy'</code> instead of <code>'Text/body'</code>. Token lookups usually fall back to a default color, so nothing fails. The diff looks fine in review, and a pink widget ships.</p>
<p>The Dart analyzer can't express rules like these. The usual answer is a custom analyzer plugin: a second package, Dart code per rule, and upkeep every time the analyzer changes. For a handful of project conventions, that felt like too much. So I wrote <code>house_rules</code>, where a rule is a few lines of YAML.</p>
<h2>What it does</h2>
<pre><code class="language-yaml">rules:
  avoid_palette_colors:
    severity: error
    exclude: [lib/theme/**]
    palette: Colors
    allowed: [transparent, white]
</code></pre>
<p>That's the whole rule. It ships with ten of them, all configured from one <code>house_rules.yaml</code>:</p>
<ul>
<li><code>known_design_tokens</code>: every token you look up by string must exist</li>
<li><code>layer_boundaries</code>: which folders may import which</li>
<li><code>no_watch_in_callback</code>: no <code>ref.watch</code> inside handlers and listeners</li>
<li><code>no_widget_returning_function</code> and <code>no_method_in_build</code></li>
<li><code>avoid_palette_colors</code>, <code>avoid_raw_colors</code>, <code>avoid_inline_text_styles</code> and <code>magic_spacing</code> for design system discipline</li>
<li><code>unjustified_ignore</code>: a suppression comment has to say why</li>
</ul>
<h2>Try it</h2>
<pre><code class="language-sh">dart pub global activate house_rules
house_rules init              # writes a starter house_rules.yaml
house_rules                   # see what it finds
house_rules --update-baseline # accept what is already there
</code></pre>
<p>After the baseline, only new problems fail. It needs Dart 3.11 or newer.</p>
<h2>What a finding looks like</h2>
<p>This is the output on the example project in the repo:</p>
<pre><code class="language-text">lib/features/cart/presentation/widgets/cart_row.dart
  12:12    ERROR   avoid_palette_colors
           `Colors.grey` bypasses the design tokens

  21:48    ERROR   known_design_tokens
           'Text/bdy' is not a defined design token
           did you mean:
             'Text/body'
             'Text/headline'
</code></pre>
<p>Each finding says why the rule exists and, where it can, what you probably meant. <code>known_design_tokens</code> reads your token map, so it knows the real names and catches the typo before it ships.</p>
<h2>Fast enough to run on every save</h2>
<p>It only parses files and never resolves types. That is a real limit, but it keeps a scan cheap. On a 2,937-file Flutter app with all ten rules, the compiled binary checks the whole project in 0.285 seconds, and a single file in 0.08 seconds.</p>
<p>That makes it practical as an editor or agent hook:</p>
<pre><code class="language-sh">house_rules --hook "$CHANGED_FILE"
</code></pre>
<p>It stays silent when the file is clean and exits with code 2 when it isn't. If the linter itself crashes, it exits 0. <strong>A broken linter should never be the reason someone can't commit.</strong></p>
<h2>Adopting it on an old codebase</h2>
<p>Turning on a new rule in an existing project usually means hundreds of findings on day one. <code>--update-baseline</code> records them, so CI stays green and only new violations fail.</p>
<p>The baseline is keyed by a hash of the offending code, not by line numbers, so it survives <code>dart format</code> and unrelated edits. For rules where every finding is a real bug, set <code>baseline: false</code> and they can never be hidden.</p>
<p>There are also Markdown, HTML, JSON and GitLab Code Quality reports, and a <code>--check-docs</code> mode that fails when your written guidelines and your config disagree.</p>
<h2>Try it on your project</h2>
<p>Run <code>house_rules init</code>, keep the two or three rules you already agree on, and baseline the rest. You can tighten it later. The code and the docs for every rule are here:</p>
<p><a class="embed-card" href="https://github.com/NoaTubic/house_rules">https://github.com/NoaTubic/house_rules</a></p>
<p><a class="embed-card" href="https://pub.dev/packages/house_rules">https://pub.dev/packages/house_rules</a></p>

<p>Feedback and issues are welcome on GitHub.</p>
]]></content:encoded></item><item><title><![CDATA[Diagnosing slow home Wi-Fi from the Mac terminal]]></title><description><![CDATA[Find out why home Wi-Fi is slow using tools built into macOS: check channel width, DNS lookup time, and bufferbloat, then compare before and after.]]></description><link>https://noatubic.hashnode.dev/diagnosing-slow-home-wi-fi-from-the-mac-terminal</link><guid isPermaLink="true">https://noatubic.hashnode.dev/diagnosing-slow-home-wi-fi-from-the-mac-terminal</guid><category><![CDATA[networking]]></category><category><![CDATA[wifi]]></category><category><![CDATA[macOS]]></category><category><![CDATA[terminal]]></category><category><![CDATA[troubleshooting]]></category><dc:creator><![CDATA[Noa Tubić]]></dc:creator><pubDate>Tue, 24 Nov 2026 20:18:16 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6acffa2071fddf96f16c4ba1/a593b1cf-b3fe-41cc-b822-9b0cd7122fbf.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>My video calls stuttered every time something in the house was uploading. The speed test said 47 Mbps down, which looked fine and explained nothing.</p>
<p>A speed test gives you one number. It doesn't say whether the problem is the Wi-Fi link, the DNS server, or a router that chokes under load. macOS ships with everything you need to tell those apart, and you install nothing.</p>
<h2>What the checks cover</h2>
<ul>
<li>The Wi-Fi link: band, channel, channel width, signal, and link rate</li>
<li>How many nearby networks sit on each channel</li>
<li>Idle latency to the router and to the internet</li>
<li>DNS lookup time for each server</li>
<li>Speed and latency under load</li>
</ul>
<h2>Run them in order</h2>
<p>Run these one at a time. A speed test running next to a ping fills the ping with load latency, and then you can't tell idle from busy.</p>
<pre><code class="language-sh">system_profiler SPAirPortDataType
route -n get default | grep gateway
ping -c 30 ROUTER_IP
ping -c 30 1.1.1.1
traceroute -n -m 5 1.1.1.1
networkQuality -v
</code></pre>
<p>The second command prints your router's address, which goes in place of <code>ROUTER_IP</code>.</p>
<p>For DNS, time a lookup of a name that nobody has cached:</p>
<pre><code class="language-sh">dig @ROUTER_IP x$RANDOM.wikipedia.org | grep "Query time"
dig @1.1.1.1 x$RANDOM.wikipedia.org | grep "Query time"
</code></pre>
<p>The random prefix forces a real lookup every time. Run each line five times and take the middle value.</p>
<h2>Reading the Wi-Fi link</h2>
<p>The first command prints your current network. The example output in this post is from my own home network.</p>
<pre><code class="language-text">PHY Mode: 802.11ax
Channel: 161 (5GHz, 40MHz)
Signal / Noise: -59 dBm / -97 dBm
Transmit Rate: 154
</code></pre>
<p>Subtract the noise from the signal. Here that gives 38 dB, which is very good, so distance from the router is not the problem.</p>
<p><strong>Channel width is the line people miss.</strong> This router uses a 40 MHz channel, and the link rate tops out at 154 Mbps. An 80 MHz channel should roughly double that with the same signal.</p>
<p>The same command lists nearby networks under "Other Local Wi-Fi Networks". Count them per channel. On 5 GHz, pick a channel that no neighbor uses. On 2.4 GHz, use only channel 1, 6, or 11 at 20 MHz, because every other channel overlaps the ones next to it.</p>
<h2>Reading latency and DNS</h2>
<p>The router ping should be a few milliseconds with no loss. My router answered in 3.5 to 5 ms, with a spike of 45 to 90 ms about every 12 seconds.</p>
<p>If the router ping jumps around, the problem is inside your home. If the router is steady and 1.1.1.1 is not, the problem is on your provider's side, and the traceroute shows at which hop the delay starts.</p>
<p>Then compare the DNS times. My router took 41 to 176 ms per uncached lookup. 1.1.1.1 took 49 to 54 ms. Every new site you open pays that difference.</p>
<h2>Reading the load test</h2>
<p><code>networkQuality</code> fills the line in both directions and measures how the connection responds while it is busy.</p>
<pre><code class="language-text">Uplink capacity: 37.314 Mbps
Downlink capacity: 47.365 Mbps
Responsiveness: Low (497.084 milliseconds | 120 RPM)
Idle Latency: 51.692 milliseconds | 1160 RPM
</code></pre>
<p>RPM is round trips per minute. 120 RPM means each round trip took about half a second under load, against 52 ms when idle.</p>
<p><strong>That gap is bufferbloat.</strong> The line is fine until something uses it. Then every packet waits in a queue inside the router. Calls stutter when someone uploads photos, and a faster plan does not fix it.</p>
<h2>Fixes, cheapest first</h2>
<p>DNS is a setting on the Mac, so it is safe to change and easy to undo:</p>
<pre><code class="language-sh">networksetup -setdnsservers Wi-Fi 1.1.1.1 1.0.0.1 8.8.8.8
networksetup -setdnsservers Wi-Fi empty
</code></pre>
<p>The first line switches to public DNS servers. The second puts it back.</p>
<p>The rest lives in the router's settings:</p>
<ul>
<li>Set 5 GHz to 80 MHz width on a channel your neighbors don't use</li>
<li>Set 2.4 GHz to channel 1, 6, or 11 at 20 MHz</li>
<li>Turn on SQM or Smart Queue, set to about 90% of your measured speeds, to stop bufferbloat</li>
</ul>
<p>One caution. Wireless repeaters and mesh units copy the router's channel, so they drop and reconnect after a channel change. Make the change at a time when you can reach them for a restart.</p>
<h2>Change one thing, then run it again</h2>
<p>Run the same checks in the same order after every change.</p>
<p>On my network, switching DNS took the median lookup from 123 ms to 55 ms. In the same second run the download went from 47 to 62 Mbps, but a DNS change can't raise throughput. That is the normal variation between two runs. Responsiveness stayed Low, at 113 RPM.</p>
<p>The second run shows what a fix did. It also stops you from giving a fix credit for things it didn't do.</p>
<h2>Try it yourself</h2>
<p>Run the commands above in order and write the numbers down before you change anything. If <code>networkQuality</code> rates your responsiveness as Low, look for SQM or Smart Queue in your router's settings before you pay for a faster plan.</p>
<p>Feedback and corrections are welcome.</p>
]]></content:encoded></item><item><title><![CDATA[PortWatch: your dev servers in the Mac menu bar]]></title><description><![CDATA[PortWatch is an open source macOS menu bar app that lists dev servers, databases, and launchd jobs with CPU and memory use, and stops them cleanly.]]></description><link>https://noatubic.hashnode.dev/portwatch-your-dev-servers-in-the-mac-menu-bar</link><guid isPermaLink="true">https://noatubic.hashnode.dev/portwatch-your-dev-servers-in-the-mac-menu-bar</guid><category><![CDATA[macOS]]></category><category><![CDATA[Swift]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Developer Tools]]></category><category><![CDATA[Productivity]]></category><dc:creator><![CDATA[Noa Tubić]]></dc:creator><pubDate>Tue, 24 Nov 2026 20:04:34 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6acffa2071fddf96f16c4ba1/40ce3c80-2df6-47e8-b0d1-9b2f62dd5986.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>As I write this, my Mac has 7 dev servers listening on ports, two databases running, and a Next.js server on port 3000 holding 1.3 GB of memory. Everything it tracks adds up to 14.1 GB.</p>
<p>I only know that because I built a menu bar app to tell me. Without it, the answer is spread across terminal tabs, and you find out a server is still alive when the next one refuses to start on the same port.</p>
<p>The app is called PortWatch. It's open source, written in Swift, and it runs on macOS 13 or later.</p>
<h2>What it shows</h2>
<ul>
<li>Projects: every process started from a folder inside your projects folder, grouped by project, with its ports</li>
<li>Databases and services: everything Homebrew services manages, running or stopped</li>
<li>Jobs: your own launchd agents, with their state and last exit code</li>
<li>Other: every other process listening on a port, collapsed by default</li>
</ul>
<p>A server and its child processes count as one row. My Next.js server is 4 processes, and it shows as one line with one memory figure, which is the number I wanted anyway.</p>
<p>The menu bar item shows the number of dev servers and the combined CPU and memory. It turns orange when a process stays above 80% CPU for 30 seconds or goes over 2 GB of memory. You can change both limits in the settings.</p>
<h2>Stopping things so they stay stopped</h2>
<p>Killing a process by hand has two common ways to go wrong. You kill the parent and a child keeps the port. Or you kill a database that Homebrew manages, and it starts again a second later.</p>
<p>PortWatch stops a process with SIGTERM first, the polite signal that lets it clean up. If it's still alive after 3 seconds, the menu offers Force Kill.</p>
<p><strong>Services go through their manager.</strong> A Homebrew service is stopped with <code>brew services</code>, and a launchd agent with <code>launchctl</code>, so nothing respawns behind your back. You can also stop everything in one project with one click.</p>
<p>Stopping a database, a third-party process, or a Claude Code session asks for confirmation first. System daemons are shown read-only, and PortWatch never asks for your password.</p>
<h2>Build it in one command</h2>
<p>There is no prebuilt download. The app isn't signed with an Apple Developer ID, so you build it yourself. You need the Xcode command line tools.</p>
<pre><code class="language-sh">git clone https://github.com/NoaTubic/portwatch.git
cd portwatch
./scripts/build.sh install
open /Applications/PortWatch.app
</code></pre>
<p>By default it looks for your projects in the first of <code>~/Projects</code>, <code>~/Developer</code>, <code>~/Code</code>, <code>~/dev</code>, <code>~/src</code>, or <code>~/repos</code> that exists. Control-Option-P opens the menu from anywhere.</p>
<h2>What it found on my machine</h2>
<p>The binary inside the app has a <code>--dump</code> switch that prints what the menu would show. This is part of the output from my own Mac, with most projects cut out:</p>
<pre><code class="language-text">TOTAL servers 7 cpu 65.8% mem 14.1 GB alert false
blog  cpu 2.1% mem 227 MB
    :8765 Python server.py --host 127.0.0.1  [tree] cpu 0.2% mem 22 MB pids 1
     Claude Code  [claude] cpu 1.9% mem 205 MB pids 1
blog-studio  cpu 0.3% mem 51 MB
    :4321 python uvicorn studio.app:app --host  [tree] cpu 0.3% mem 51 MB pids 2
SERVICES
    :3306 mariadb  [service] cpu 0.0% mem 210 MB pids 2
    :5432 postgresql@16  [service] cpu 0.2% mem 96 MB pids 6
</code></pre>
<p>Two database servers are running side by side, MariaDB and PostgreSQL 16, each with its port and memory. The Other section, which I cut, listed 29 more entries. Most of them are editor helpers and vendor agents that listen on a port all day.</p>
<p>Claude Code sessions get their own row per project. A server that a session starts through a shell is a separate row, so stopping the server never kills the session.</p>
<h2>Why it doesn't slow the Mac down</h2>
<p>A tool that watches your CPU shouldn't be the thing using it. The simple way to build this is to run <code>ps</code> and <code>lsof</code> on a timer, which starts two new processes every few seconds, forever.</p>
<p>PortWatch reads process data straight from the kernel instead, through <code>sysctl</code> and <code>libproc</code>. One call returns every process on the machine. It refreshes every 5 seconds while the menu is closed and every 2 seconds while it's open.</p>
<p>On my machine, with about 950 processes running, it uses roughly 0.3% of one CPU core and 14 MB of memory with the menu closed.</p>
<p>It starts a helper process only when it has to: <code>launchctl</code> to read launchd state, <code>brew services</code> when you start or stop a service, and <code>ps</code> for system daemons while the Other section is open.</p>
<h2>The same thing from the terminal</h2>
<p>The switches work without opening the menu, which is handy in scripts:</p>
<pre><code class="language-sh">cd /Applications/PortWatch.app/Contents/MacOS
./PortWatch --dump         # print what the menu would show
./PortWatch --stop 3000    # stop the dev server on port 3000
./PortWatch --demo         # run the app with made-up data
</code></pre>
<p><code>--demo</code> is the safe way to look around before you point it at real processes.</p>
<h2>Read this before you trust it</h2>
<p>PortWatch sends signals to other processes and is not sandboxed. That is its job, but it's also a good reason to read the code first. It's ten Swift files.</p>
<p>It can only stop processes owned by your user. Processes started by an app in <code>/Applications</code>, such as an editor's language servers, are left out of projects, so they don't crowd the list.</p>
<h2>Try it yourself</h2>
<p>Build it, open the menu, and expand the Other section once. Then stop the servers you forgot about. Feedback and issues are welcome.</p>
<p><a class="embed-card" href="https://github.com/NoaTubic/portwatch">https://github.com/NoaTubic/portwatch</a></p>
]]></content:encoded></item><item><title><![CDATA[An n8n ops platform for domain health, leads, and content]]></title><description><![CDATA[Self-hosted n8n workflows for outbound: daily SPF, DKIM, and DMARC checks, inbound lead scoring, and AI drafts, on PostgreSQL and Cloudflare Workers.]]></description><link>https://noatubic.hashnode.dev/an-n8n-ops-platform-for-domain-health-leads-and-content</link><guid isPermaLink="true">https://noatubic.hashnode.dev/an-n8n-ops-platform-for-domain-health-leads-and-content</guid><category><![CDATA[automation]]></category><category><![CDATA[n8n]]></category><category><![CDATA[PostgreSQL]]></category><category><![CDATA[Cloudflare Workers]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Noa Tubić]]></dc:creator><pubDate>Thu, 15 Oct 2026 07:13:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6acffa2071fddf96f16c4ba1/0042a4c5-7d80-4702-bbbc-aa7b47750775.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>A sending domain loses its DMARC record during a DNS change. Nobody notices until reply rates drop a week later. Meanwhile, a hot inbound lead waits in the same queue as a student who typed "Hi".</p>
<p>Outbound teams fight these small fires every week. I wanted one place that catches them early, so I built OpsPulse. It's a set of n8n workflows, a PostgreSQL database, and a dashboard on Cloudflare Workers.</p>
<h2>What it does</h2>
<p>It's three tools that share one database and one dashboard:</p>
<ul>
<li><p>DomainPulse checks SPF, DKIM, DMARC, and MX for every sending domain at 07:00 UTC each day</p>
</li>
<li><p>Lead Router scores inbound leads, sorts them into hot, warm, and cold, and drafts a reply</p>
</li>
<li><p>Content Flow turns one article into LinkedIn, Twitter/X, and newsletter drafts you approve one by one</p>
</li>
<li><p>A lead enrichment webhook takes a domain and returns company data, tech stack, and likely contacts</p>
</li>
</ul>
<p>n8n and PostgreSQL run on Railway. The language model is Llama 3.3 70B on Groq's free tier. The dashboard is a single Cloudflare Worker that serves the page and proxies calls to n8n.</p>
<h2>Try it</h2>
<p>You need an n8n instance, a PostgreSQL database, a Groq API key, and a Cloudflare account. Start with the tables:</p>
<pre><code class="language-sh">git clone https://github.com/NoaTubic/n8n-outbound-infra
cd n8n-outbound-infra
psql "$DATABASE_URL" -f db/schema.sql
psql "$DATABASE_URL" -f db/schema-lead-router.sql
psql "$DATABASE_URL" -f db/schema-content.sql
</code></pre>
<p><code>schema.sql</code> also adds five example domains, so swap them for your own. Then import the JSON files from <code>workflows/</code> in the n8n editor, add a PostgreSQL and a Groq credential, and activate them. Last, set your n8n URL and a new <code>STATUS_API_KEY</code> in <code>ops-worker/wrangler.toml</code> and deploy the dashboard:</p>
<pre><code class="language-sh">cd ops-worker
npm install
npx wrangler login
npx wrangler deploy
</code></pre>
<h2>Lead scoring is plain code, on purpose</h2>
<p>It's tempting to send every lead to a model and ask "is this good?". I didn't. The score comes from a short Code node with four factors: company size, role, budget, and message length. The top score is 120. Hot is 80 and up, warm is 50 to 79, and cold is everything below.</p>
<p>The model runs after that, as a second opinion. It checks the lead against your ideal customer profile and returns a 1 to 10 fit score, reasons, and concerns. If the call fails, the lead is still saved with its score.</p>
<p>Because the rules are plain JavaScript, you can test them without n8n. I ran the node's code on four sample leads:</p>
<pre><code class="language-text">VP Marketing, 200-1000, 15k-50k    110  hot
Head of Growth, 50-200, 5k-15k      95  hot
Marketing Manager, 10-50, 1k-5k     60  warm
Student, 1-10, under-1k, "Hi"       25  cold
</code></pre>
<p>Each lead also stores its <code>scoring_breakdown</code>, so a salesperson can see why a lead landed where it did. <strong>A score you can explain is a score people trust.</strong> Hot leads go to <code>sales_urgent</code>, warm ones to <code>sales_queue</code>, and both get a drafted reply. Cold leads go to <code>nurture</code> with no reply.</p>
<p>The same email on the same day is processed once. A double-clicked form doesn't create two leads.</p>
<h2>Domain checks with a public DNS API</h2>
<p>DomainPulse needs no DNS library. It calls Google's public DNS-over-HTTPS endpoint, which takes no key. You can try the SPF check from a terminal:</p>
<pre><code class="language-sh">curl -s 'https://dns.google/resolve?name=example.com&amp;type=TXT'
</code></pre>
<p>The answer is JSON, and one of the TXT records is <code>v=spf1 -all</code>. The workflow looks for a record that starts with <code>v=spf1</code> and flags <code>+all</code>, which lets anyone send mail as you. DMARC lives at <code>_dmarc.example.com</code>, and DKIM is checked on the <code>google</code> selector.</p>
<p>Each domain then gets a status. Missing SPF, missing MX, or <code>+all</code> is critical. Missing DMARC or DKIM is a warning. The workflow compares each result with the previous check and only writes an alert when something changed, so you don't get the same warning every morning.</p>
<h2>When a model call fails</h2>
<p>Groq's free tier has rate limits, so calls do fail. The enrichment and content workflows each fire three model calls in parallel, and every one has n8n's <code>continueOnFail</code> turned on.</p>
<p>If one branch fails, the job finishes with status <code>partial</code> and keeps what the other two found. Each error goes into a JSON log column, marked as retryable (429 and 5xx) or permanent (other 4xx). One rate limit never throws away a whole job. Debugging is a single query:</p>
<pre><code class="language-text">SELECT input_domain, status, error_log
FROM enrichment_jobs
WHERE status IN ('failed', 'partial')
ORDER BY created_at DESC LIMIT 10;
</code></pre>
<p>Content drafts work the same way. A failed draft is stored as <code>failed</code>, and the other platforms still show up for review. When you approve the last draft of an article, the article itself is marked approved.</p>
<h2>Try it yourself</h2>
<p>Start with DomainPulse. Add your own sending domains, run the watchdog once from the n8n editor, and see what it finds. The repo has an architecture doc, notes on every workflow, and a runbook with test requests:</p>
<p><a class="embed-card" href="https://github.com/NoaTubic/n8n-outbound-infra">https://github.com/NoaTubic/n8n-outbound-infra</a></p>
<p><a class="embed-card" href="https://ops-pulse.noatubic.workers.dev">https://ops-pulse.noatubic.workers.dev</a></p>

<p>Feedback and issues are welcome on GitHub.</p>
]]></content:encoded></item><item><title><![CDATA[Four Claude Code skills to audit a Flutter app]]></title><description><![CDATA[Four Claude Code skills that audit a Flutter app before release: OWASP security, dependencies, localization, and App Store and Google Play readiness.]]></description><link>https://noatubic.hashnode.dev/four-claude-code-skills-to-audit-a-flutter-app</link><guid isPermaLink="true">https://noatubic.hashnode.dev/four-claude-code-skills-to-audit-a-flutter-app</guid><category><![CDATA[Flutter]]></category><category><![CDATA[claude]]></category><category><![CDATA[Security]]></category><category><![CDATA[Mobile Development]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[Noa Tubić]]></dc:creator><pubDate>Wed, 14 Oct 2026 22:18:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6acffa2071fddf96f16c4ba1/8aa3cced-c1df-4995-a96f-68d9f80c5b9e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Security, dependencies, localization, and store readiness, each checked by one command before you ship</p>
<p>Before a release I used to run the same mental checklist. Is the privacy manifest there? Is anything in <code>pubspec.yaml</code> abandoned? Did someone hardcode a string again? Is a token sitting in the source?</p>
<p>A checklist in your head gets skipped when the deadline is close. So I turned mine into four Claude Code skills. Each one reads the project, works through a fixed list of checks, and writes a Markdown report with a fix for every finding.</p>
<h2>The four skills</h2>
<p>Security: <code>/owasp-mobile-audit</code> covers all ten OWASP Mobile Top 10 (2024) categories plus six newer checks, like hardcoded secrets, data leaking into logs, and unsafe sharing. It works on Flutter, native Android, and native iOS code.</p>
<p>Dependencies: <code>/flutter-dependency-audit</code> looks at seven things in your packages: outdated and abandoned ones, duplicates that do the same job, license conflicts, known CVEs, loose version constraints, and leftover dependency overrides.</p>
<p>Localization: <code>/flutter-localization-audit</code> runs eight checks: hardcoded strings, missing ARB keys, the l10n setup, plural and gender forms, RTL layouts, locale-aware dates and numbers, broken interpolation, and the fallback locale.</p>
<p>Store readiness: <code>/flutter-store-readiness</code> runs eight checks for App Store and Google Play: the iOS Privacy Manifest, Android Data Safety, permission strings, screenshots, age rating, metadata limits, and the platform configs such as signing and <code>targetSdk</code>.</p>
<h2>Try it</h2>
<p>Install the ones you want:</p>
<pre><code class="language-sh">npx skills add NoaTubic/owasp-mobile-audit-skill
npx skills add NoaTubic/flutter-dependency-audit-skill
npx skills add NoaTubic/flutter-localization-audit-skill
npx skills add NoaTubic/flutter-store-readiness-skill
</code></pre>
<p>Then, inside Claude Code, in your Flutter project:</p>
<pre><code class="language-text">/flutter-store-readiness
</code></pre>
<p>Each skill saves its report in the project root, for example <code>store_readiness_report.md</code>. You can also run only the checks you care about:</p>
<pre><code class="language-text">/owasp-mobile-audit M9,AE2
/flutter-dependency-audit security,licenses
/flutter-localization-audit hardcoded,arb
/flutter-store-readiness ios
</code></pre>
<h2>What a report looks like</h2>
<p>Every report uses the same shape. It opens with a summary: a count per severity, from Critical to Info. The store readiness report also gives each platform a status of ready, issues found, or blocking.</p>
<p>Then each category gets its findings. A finding has the file and line, the evidence, and one sentence on how to fix it. The report also lists what's already done right, so you don't "fix" something that works. It ends with the three to five fixes that matter most.</p>
<p>The severity scale is about consequences, not style. In the store readiness skill, Critical means an automatic rejection, like a missing Privacy Manifest or debug signing on a release build. In the security skill, Critical means something directly exploitable, like a hardcoded credential or disabled TLS.</p>
<h2>A few things they catch that people miss</h2>
<ul>
<li><p>A Privacy Manifest that exists but leaves out a Required Reason API your code or an SDK uses</p>
</li>
<li><p>Permission strings like "This app needs the camera", which Apple tends to reject as too vague</p>
</li>
<li><p>A package that hasn't had a release in years, with an active alternative</p>
</li>
<li><p>Dates shown with <code>DateTime.toString()</code> instead of a locale-aware formatter</p>
</li>
<li><p>An API key in source, or a token written to the logs</p>
</li>
</ul>
<h2>What they are and aren't</h2>
<p>These are skills, so Claude does the reading. That means they understand context a regex can't, like whether a string is user-facing or a log tag. <strong>It also means a finding is a well-argued suggestion, not a proof.</strong> Check each one before you act on it, and keep your real scanners and your store review in the loop. The skills are there to catch the obvious misses early.</p>
<h2>Try it yourself</h2>
<p>Run <code>/flutter-store-readiness</code> on your app before the next release and fix the Critical items first. The skills, their checks, and the full report templates are here:</p>
<p><a class="embed-card" href="https://github.com/NoaTubic/owasp-mobile-audit-skill">https://github.com/NoaTubic/owasp-mobile-audit-skill</a></p>
<p><a class="embed-card" href="https://github.com/NoaTubic/flutter-dependency-audit-skill">https://github.com/NoaTubic/flutter-dependency-audit-skill</a></p>
<p><a class="embed-card" href="https://github.com/NoaTubic/flutter-localization-audit-skill">https://github.com/NoaTubic/flutter-localization-audit-skill</a></p>
<p><a class="embed-card" href="https://github.com/NoaTubic/flutter-store-readiness-skill">https://github.com/NoaTubic/flutter-store-readiness-skill</a></p>

<p>Feedback and issues are welcome on GitHub.</p>
]]></content:encoded></item><item><title><![CDATA[A health check for your Flutter translations]]></title><description><![CDATA[Find unused ARB keys, missing translations, placeholder mismatches and hardcoded strings in your Flutter app, then prune the dead keys safely.]]></description><link>https://noatubic.hashnode.dev/a-health-check-for-your-flutter-translations</link><guid isPermaLink="true">https://noatubic.hashnode.dev/a-health-check-for-your-flutter-translations</guid><category><![CDATA[Flutter]]></category><category><![CDATA[Dart]]></category><category><![CDATA[localization]]></category><category><![CDATA[i18n]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Noa Tubić]]></dc:creator><pubDate>Wed, 14 Oct 2026 22:15:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6acffa2071fddf96f16c4ba1/d7dfbf13-80bf-4d55-bfa2-67466f856cf5.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Translation files only grow. Features get removed, screens get rewritten, but nobody deletes the old keys, because nobody is sure they are unused.</p>
<p>I ran into this on a production Flutter app with about 2,900 Dart files and 2,400 translation keys. 365 keys were never used. 38 were missing in one of the languages. 247 strings in Dart code never went through localization at all. And 10 translations had invisible zero-width characters hiding in them.</p>
<p>The analyzer doesn't report any of that, and neither does the code generator. So I wrote a small tool that does.</p>
<h2>What it does</h2>
<p><code>l10n_health</code> reads your <code>.arb</code> files and your Dart code together and reports:</p>
<ul>
<li><p>keys that no code uses</p>
</li>
<li><p>keys missing in one language, or identical to the template (likely never translated)</p>
</li>
<li><p>placeholders that differ between languages, like <code>{name}</code> vs <code>{userName}</code></p>
</li>
<li><p>broken ICU messages and plural forms a language needs, like Croatian <code>few</code></p>
</li>
<li><p>hardcoded text that should be a translation, and the existing key to use when there is one</p>
</li>
<li><p>invisible Unicode: zero-width spaces, bidi controls, look-alike spaces</p>
</li>
</ul>
<p>It works with Flutter's <code>gen_l10n</code> and with <code>flutter_intl</code>, and it finds your setup on its own. A full run on that big app takes about a quarter of a second.</p>
<h2>Try it</h2>
<pre><code class="language-sh">dart pub global activate l10n_health
l10n_health
</code></pre>
<p>Or as a dev dependency, so the whole team runs the same version:</p>
<pre><code class="language-sh">dart pub add --dev l10n_health
dart run l10n_health
</code></pre>
<p>This is the output on the small example project in the repo:</p>
<pre><code class="language-text">Placeholder mismatches (placeholder_mismatch)  1
  error lib/l10n/app_de.arb:4:3  Placeholders in "greeting" differ from en: missing {name}, unexpected {userName}

Hardcoded strings (hardcoded_string)  2
  warn  lib/main.dart:22:9  Hardcoded text "Please select a pharmacy" bypasses localization (prose, en)
  warn  lib/main.dart:24:9  Hardcoded "Close"; use the existing key "close"

Unused keys (unused_key)  2
  warn  lib/l10n/app_en.arb:11:3  Key "legacyBanner" is never used in Dart code
  warn  lib/l10n/app_en.arb:12:3  Key "close" is never used in Dart code
</code></pre>
<p>For a report you can open in the browser or attach in CI:</p>
<pre><code class="language-sh">l10n_health --format html -o l10n.html
</code></pre>
<h2>Deleting keys without fear</h2>
<p>Finding dead keys is half the job. Removing them is where people get nervous, so <code>prune</code> is careful:</p>
<pre><code class="language-sh">l10n_health prune          # dry run, writes nothing
l10n_health prune --apply  # removes the keys from every language
</code></pre>
<p>It edits the files as text, so your diff is only the removed lines. Every file is checked to be valid JSON before anything is written. <strong>If a key also appears as a plain string somewhere</strong>, it might be looked up dynamically, so it is held back and listed for you to review instead of deleted.</p>
<p>After pruning, regenerate and build. If a key was still used, you find out at compile time, not from a user.</p>
<h2>In CI</h2>
<p>Record the current state once, then fail only on new problems:</p>
<pre><code class="language-sh">l10n_health --update-baseline
l10n_health --fail-on warning
</code></pre>
<p>There are also <code>--format gitlab</code> and <code>--format github</code> outputs, so findings show up inline in merge requests and pull requests.</p>
<h2>Try it on your project</h2>
<p>Run <code>l10n_health</code> once in your app and look at the unused keys first. They're usually the quickest win. Everything else is documented here:</p>
<p><a class="embed-card" href="https://github.com/NoaTubic/l10n_health">https://github.com/NoaTubic/l10n_health</a></p>
<p><a class="embed-card" href="https://pub.dev/packages/l10n_health">https://pub.dev/packages/l10n_health</a></p>

<p>Feedback and issues are welcome on GitHub.</p>
]]></content:encoded></item></channel></rss>