Hacker

masimhanif

@masimhanif

Joined Aug 2026Student at National University of Technology, IslamabadPakistan

Projects

  • Flag Offline Shield

    Flagsmith Experimentation HackathonNov 2026

    Flag Offline Shield is a portable Flagsmith Agent Skill plus a Next.js 15 Control Room that hardens JS/TS apps against Flagsmith API and network outages. The problem: if flagsmith.init() is called without non-empty defaultFlags, or without handling init() rejections, an outage can crash the app or leave flags empty. flagsmith/isomorphic rejects init() on network failure even when defaultFlags is provided, which is easy to miss. Local public/flags.json files also drift from live flags, and a naive `flagsmith eval --js > public/flags.json` can wipe a good snapshot because @flagsmith/cli v2.0.0 may exit 0 on failure. Raw `flagsmith flag list --json` also wastes agent context on extra metadata. Who uses it: teams shipping Flagsmith-backed JS/TS features (checkouts, banners, discounts, in-app assistants) and the coding agents that help them. You copy skills/flag-offline-shield/ into a target repo as .agents/skills/flag-offline-shield/. A companion sample app (https://github.com/codedbyasim/flag-offline-shield-sample-app, branch live-demo-run) is left unpatched, with a stale snapshot and unprotected SDK usage, so npm test fails under an outage until the skill has run. How it works: the skill follows SKILL.md end to end. check-drift.mjs fetches live flags with a low-token CLI query and scans JS/TS with the TypeScript compiler API in one call, then the agent shows an impact table and stops at Human Approval Gate #1. After explicit approval it creates branch chore/flag-offline-shield-sync, bakes a validated public/flags.json via flagsmith eval --js (atomic write, never a raw redirect), patches defaultFlags, init() rejection handling, and inline fallbacks, then runs verify-outage.mjs (flagsmith/isomorphic against a mock server and an unreachable endpoint, plus optional --smoke) and a strict re-audit. It stops again at Gate #2 with the full git diff before any commit, push, or gh pr create. The skill is read-only on live flags: it never runs flag enable, disable, update, or delete, and it will not commit `flagsmith environment document` output. The Control Room at localhost:3000 runs unprotected and shielded clients side by side (a $120/year checkout preview that keeps FLASH20 / 20% off from the snapshot during a simulated outage), a live drift viewer, an approval gate, and the measured token figures. GitHub Actions uses Flagsmith/setup-cli@v1 to run the same tests, outage check, and --fail-on-findings audit. A snapshot-sync PR is opened only after a human workflow_dispatch with open_pr: true. The recorded demo follows this workflow on the sample app, shows the Control Room and a green CI run, and ends on the local diff plus the PR command. It does not push or open a live PR.

  • Pulse — Live Incident Command Center

    The Zerops ChallengeAug 2026

    Pulse is a real-time incident management platform for dev teams. When something breaks in production, a responder declares an incident and gets a private live room plus an auto-generated public status page — no login required for viewers. Team members post updates and everyone in the room sees them appear instantly via WebSockets and Redis (Valkey) pub/sub, with a live presence indicator showing who's active. The public status page mirrors incident state in real time and filters out internal-only notes server-side. Screenshots and logs can be attached to any update, stored in object storage. When an incident is marked "Resolved," a background worker sends the full timeline to the Anthropic Claude API, which drafts a postmortem — summary, probable root cause, action items — that a responder reviews and publishes to the status page. Architecture: a Next.js frontend and an Express/WebSocket API are public-facing; PostgreSQL, Valkey, object storage, and a background worker sit entirely on Zerops' private network, wired together via a single zerops.yaml. All six services were provisioned, deployed, and verified end-to-end on Zerops, including cross-service private networking for the AI postmortem pipeline. This is a focused MVP built solo in 48 hours — the real-time coordination core is fully working; auth, paging/alerting, and third-party monitoring integrations are the natural next steps beyond the hackathon scope.