<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: David Bakare</title>
    <description>The latest articles on DEV Community by David Bakare (@3akare).</description>
    <link>https://dev.to/3akare</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1194969%2F65deb47b-bf9c-4254-b9f9-2d46f759f802.jpeg</url>
      <title>DEV Community: David Bakare</title>
      <link>https://dev.to/3akare</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/3akare"/>
    <language>en</language>
    <item>
      <title>Using phone chargers to detect power outages in Lagos</title>
      <dc:creator>David Bakare</dc:creator>
      <pubDate>Tue, 01 Dec 2026 20:58:37 +0000</pubDate>
      <link>https://dev.to/3akare/my-phone-charger-is-a-snitch-so-i-turned-it-into-a-blackout-detector-for-lagos-d4m</link>
      <guid>https://dev.to/3akare/my-phone-charger-is-a-snitch-so-i-turned-it-into-a-blackout-detector-for-lagos-d4m</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu8q7ah6ovrx4upsqr3ro.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu8q7ah6ovrx4upsqr3ro.png" alt=" " width="800" height="336"&gt;&lt;/a&gt;---&lt;br&gt;
title: "Using phone chargers to detect power outages in Lagos"&lt;br&gt;
published: true&lt;br&gt;
description: "How I built Outage, an app that detects blackouts when several phones in the same area stop charging at once. Built with Kiro for Kiroween 2026."&lt;/p&gt;

&lt;h2&gt;
  
  
  tags: kiro, hackathon, android, opensource
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;This post is written as part of the Kiroween 2026 hackathon. The code is open source: &lt;a href="https://github.com/3akare/outage" rel="noopener noreferrer"&gt;github.com/3akare/outage&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;In Lagos, the power goes off many times a day. When it does, there is no quick way to know if the outage is only in your house or across your whole area. Most people find out by asking neighbours.&lt;/p&gt;

&lt;h2&gt;
  
  
  The idea
&lt;/h2&gt;

&lt;p&gt;A phone on a charger knows the moment the power goes off. When the power fails in an area, every phone charging there stops charging at the same time.&lt;/p&gt;

&lt;p&gt;Outage uses that signal:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Android app detects when the charger loses power and sends a small event: the area (a map hexagon), a random install ID and the time. No name, phone number or exact location.&lt;/li&gt;
&lt;li&gt;The server checks how many phones in the same area stopped charging within 90 seconds, and how likely that is to happen by chance.&lt;/li&gt;
&lt;li&gt;If at least 3 phones agree and the chance is below 1 in 1,000, the area is marked as out.&lt;/li&gt;
&lt;li&gt;When the phones start charging again, the app rings an alarm to say the power is back.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is also a web version that runs on a simulated Lagos, so anyone can try it without an Android phone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prior work
&lt;/h2&gt;

&lt;p&gt;This idea has been tested before. GridWatch (2014) showed that phones on the same power strip recorded the same outage within about a second in 19 of 20 trials. DumsorWatch in Accra (2018) reached about 3,400 installs, but active users fell from 989 to 310 in three months. Users were paid in airtime to keep the app installed, and late payments likely caused people to leave.&lt;/p&gt;

&lt;p&gt;I focused on making the app useful to one person from day one: a personal power log, an alarm when power returns, and a list of places you care about.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I built it with Kiro
&lt;/h2&gt;

&lt;p&gt;Kiro wrote most of the code (143 of 199 commits). Before any app code, I set up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Steering files&lt;/strong&gt; with the rules the agents had to follow: no exact location, no microphone, label all simulated data, use free tiers only.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hooks&lt;/strong&gt; that check every file write against those rules. In a test, they blocked four real tool calls, including a microphone permission and a string that looked like an API key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Specs&lt;/strong&gt; with requirements, designs and tasks for the risky parts: the sensor, the detection engine and the server.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What the specs and tests caught
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Android stopping the sensor.&lt;/strong&gt; The spec required the sensor to be active for at least 90% of charging time. A test app on a Samsung phone measured only 17.7%. Using the Context7 MCP server, Kiro found the cause: returning &lt;code&gt;true&lt;/code&gt; from &lt;code&gt;onStopJob&lt;/code&gt; makes Android retry with a growing delay. After the fix it reached 73.6%. Scheduled jobs still took 22 to 32 minutes to start after plugging in, so the final app uses a broadcast receiver, which reacts within about a second.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bugs in the detection engine.&lt;/strong&gt; The engine has 12 properties that must always hold, such as "a single unplug never raises an alert". Property-based tests with fast-check found three real bugs. One only appeared with 3 phones, a 2-minute outage, a check 13 hours later, and data arriving in 2 parts. I would not have written that test by hand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Building from a phone
&lt;/h2&gt;

&lt;p&gt;Halfway through the hackathon my laptop broke and went in for repair. Because the work was already running in Kiro Web cloud sessions, I could continue from my phone. Kiro released its Android app around that time, and I used it for most of the remaining work.&lt;/p&gt;

&lt;p&gt;Some feedback on the Android app:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A notification when a task finishes would help a lot.&lt;/li&gt;
&lt;li&gt;Sometimes my sent prompt did not appear, only the reply, until I restarted the app.&lt;/li&gt;
&lt;li&gt;It can lag in long sessions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Browser: &lt;a href="https://outage-api.bakaredavid007.workers.dev/app/simulate" rel="noopener noreferrer"&gt;open the simulated Lagos&lt;/a&gt;, pick an area, tap "Use this place", then "Replay a blackout here".&lt;/li&gt;
&lt;li&gt;Android: &lt;a href="https://github.com/3akare/outage/releases/latest" rel="noopener noreferrer"&gt;download the APK&lt;/a&gt; and tap "Try Judge mode".&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Limits and next steps
&lt;/h2&gt;

&lt;p&gt;The sensor has only been tested on two Samsung phones so far. Few people use the app yet, so most real areas show "no data". Next is a field test with real phones across Lagos, and testing on other phone brands.&lt;/p&gt;

</description>
      <category>kiro</category>
      <category>hackathon</category>
      <category>android</category>
      <category>opensource</category>
    </item>
    <item>
      <title>How I built PinMe with Kiro: a messenger that uses a PIN instead of your phone number</title>
      <dc:creator>David Bakare</dc:creator>
      <pubDate>Tue, 01 Dec 2026 20:08:55 +0000</pubDate>
      <link>https://dev.to/3akare/how-i-built-pinme-with-kiro-a-messenger-that-uses-a-pin-instead-of-your-phone-number-m4n</link>
      <guid>https://dev.to/3akare/how-i-built-pinme-with-kiro-a-messenger-that-uses-a-pin-instead-of-your-phone-number-m4n</guid>
      <description>&lt;h1&gt;
  
  
  How I built PinMe with Kiro
&lt;/h1&gt;

&lt;p&gt;I built PinMe for the Kiroween 2026 hackathon, using Kiro from start to finish. This post covers what PinMe is, how Kiro built it, and what happened when my laptop broke halfway through.&lt;/p&gt;

&lt;h2&gt;
  
  
  What PinMe is
&lt;/h2&gt;

&lt;p&gt;PinMe is a messenger where you chat with a PIN instead of your phone number. You pick a name, and you get an 8-character PIN like 2A4F9C1B. You give that PIN to people instead of your number.&lt;/p&gt;

&lt;p&gt;You can have more than one PIN. I can give one to friends and another one to people I buy and sell with online. If someone starts bothering me, I burn that PIN. They can't message it again, the PIN is never given to anyone else, and they never see my other PINs.&lt;/p&gt;

&lt;p&gt;I built it because in Nigeria your phone number is linked to your NIN, and your bank sends OTPs to it. I didn't like that I had to give that number to every buyer, seller or delivery rider I dealt with. BlackBerry Messenger used PINs years ago, so I used the same idea and added burning.&lt;/p&gt;

&lt;p&gt;Messages are end-to-end encrypted in the browser. The server only passes encrypted messages along and deletes them once they're delivered.&lt;/p&gt;

&lt;p&gt;Try it: &lt;a href="https://pinme.bakaredavid007.workers.dev" rel="noopener noreferrer"&gt;https://pinme.bakaredavid007.workers.dev&lt;/a&gt;&lt;br&gt;
Code: &lt;a href="https://github.com/3akare/pinme" rel="noopener noreferrer"&gt;https://github.com/3akare/pinme&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Starting with a spec
&lt;/h2&gt;

&lt;p&gt;I didn't start by asking Kiro to "build a messenger". I started with a spec in the Kiro IDE.&lt;/p&gt;

&lt;p&gt;A Kiro spec has three files:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;requirements.md: what the app must do, written as rules. Mine has 25 requirements and 227 acceptance criteria.&lt;/li&gt;
&lt;li&gt;design.md: how it will be built. Kiro read the Cloudflare and libsodium docs before writing it, and it ended up with 39 correctness properties.&lt;/li&gt;
&lt;li&gt;tasks.md: the build broken into steps. Mine has 117 tasks.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The most useful rules were the ones about what the app must never do. For example: "the server shall not store any data that links one PIN to another PIN of the same user." If that breaks, burning a PIN means nothing, and it's the kind of thing that breaks quietly. Writing it as a requirement meant Kiro had to build to it and test it.&lt;/p&gt;

&lt;p&gt;Then I clicked Run all tasks. Kiro's log shows it went through all 117 tasks in one evening, from about 5:45 pm to 8 pm.&lt;/p&gt;

&lt;h2&gt;
  
  
  Steering files
&lt;/h2&gt;

&lt;p&gt;Steering files are rules Kiro reads while it works. I have six. Each one only loads for the part of the code it's about. The security rules are always on. The protocol rules only load when Kiro is working on server code. The UI rules only load when it's working on screens.&lt;/p&gt;

&lt;p&gt;That kept the security rules in front of Kiro on every task, without filling every prompt with rules that didn't apply.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hooks
&lt;/h2&gt;

&lt;p&gt;Hooks run automatically while Kiro works. I set up four:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When Kiro saves encryption or shared code, the tests for that code run.&lt;/li&gt;
&lt;li&gt;When Kiro saves server code, it checks the change against the security rules and fixes anything it finds.&lt;/li&gt;
&lt;li&gt;When the message format changes, it checks that the docs still match the code.&lt;/li&gt;
&lt;li&gt;When Kiro finishes, the linter runs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Property tests
&lt;/h2&gt;

&lt;p&gt;Each of the 39 correctness properties became a property-based test. Instead of me picking a few examples, the test library throws thousands of random inputs at each rule.&lt;/p&gt;

&lt;p&gt;One example: burning a PIN twice has to leave everything exactly the same as burning it once. The project has 369 tests, and 30 of the test files are property tests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Then my laptop broke
&lt;/h2&gt;

&lt;p&gt;Halfway through the hackathon my laptop had to go in for repair, and all I had left was my phone.&lt;/p&gt;

&lt;p&gt;I kept going with Kiro Web, which runs Kiro in cloud sessions, so my code, spec and steering were all still there. Around the same time Kiro released its Android app, and I did a lot of the remaining work from it.&lt;/p&gt;

&lt;p&gt;The Android app did the job, but it has some problems:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It doesn't notify you when a task finishes, so I kept opening it to check.&lt;/li&gt;
&lt;li&gt;Sometimes my prompt didn't show after I sent it. Only the reply showed, and older prompts disappeared until I restarted the app.&lt;/li&gt;
&lt;li&gt;It lags sometimes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I still finished the project, partly from a phone, which I didn't expect to be possible.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;Writing the rules first changed how I build. Before, I'd write code and test it afterwards. With Kiro, I wrote down what the app must and must never do, Kiro turned those rules into tests, and then it built against them. For an app where mistakes don't show up in a demo, like a messenger that's meant to be private, that made a big difference.&lt;/p&gt;

&lt;p&gt;The whole spec is in the .kiro folder of the repo if you want to see how it's set up.&lt;/p&gt;

</description>
      <category>kiro</category>
      <category>hackathon</category>
      <category>kiroween</category>
      <category>privacy</category>
    </item>
  </channel>
</rss>
