<?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" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Hassen Ben Mbarek on Medium]]></title>
        <description><![CDATA[Stories by Hassen Ben Mbarek on Medium]]></description>
        <link>https://medium.com/@hassen.ben.mbarek?source=rss-9eb0a656a6da------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*3rk1X599nnTP4hD8BxRjDg.png</url>
            <title>Stories by Hassen Ben Mbarek on Medium</title>
            <link>https://medium.com/@hassen.ben.mbarek?source=rss-9eb0a656a6da------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 07:05:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@hassen.ben.mbarek/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Scoping AI Coding Assistants: Why Convention Fails and How Enforcement Works]]></title>
            <link>https://medium.com/@hassen.ben.mbarek/scoping-ai-coding-assistants-why-convention-fails-and-how-enforcement-works-7fd7382a94cf?source=rss-9eb0a656a6da------2</link>
            <guid isPermaLink="false">https://medium.com/p/7fd7382a94cf</guid>
            <category><![CDATA[agentic-applications]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[ai-agent]]></category>
            <category><![CDATA[agentic-workflow]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Hassen Ben Mbarek]]></dc:creator>
            <pubDate>Wed, 10 Jun 2026 13:59:15 GMT</pubDate>
            <atom:updated>2026-06-10T13:59:15.893Z</atom:updated>
            <content:encoded><![CDATA[<p>The problem with handing Claude the entire codebase, and what actually works instead.</p><h3>The Setup</h3><p>You’re working on a 50,000-line React app. A bug in the auth module. You ask Claude: <em>“Fix the login timeout issue in </em><em>src/auth/login.ts.&quot;</em></p><p>Claude loads your entire codebase into context.</p><p>All 50,000 lines.</p><p>Not because it needs to. Because that’s how LLMs work: they ingest everything you give them. And then you’re paying for it — tokens, latency, and cognitive load. Worse, with so much noise in context, Claude sometimes “helpfully” refactors something in a distant module that has a subtle coupling you forgot about.</p><p>This is the tax of working with AI on large codebases. Every edit to one module means loading everything, respecting boundaries you hope the AI remembers, and watching your token budget evaporate.</p><h3>The Obvious Solution (That Doesn’t Work)</h3><p>You create a .claude/context.md file. You document your module boundaries:</p><pre># Module Map<br>- MOD-001: API Layer → src/services/<br>- MOD-002: State Management → src/store<br>- MOD-003: Auth → src/auth/</pre><p>You tell Claude: <em>“Only load MOD-003 for this edit.”</em></p><p>Claude: <em>“Understood.”</em></p><p>Then Claude loads the whole codebase anyway, because… why wouldn’t it? The file is advisory. It’s sitting there in the repo, begging to be read, but there’s nothing preventing Claude from just loading everything and ignoring the boundaries.</p><p>This is the core insight: convention-based scoping fails at scale because nothing enforces it.</p><p>You can’t rely on an AI to remember to read a markdown file when it could just load the entire project. You’re asking for discipline from something that optimizes for task completion, not token efficiency.</p><h3>Why This Matters (And Gets Worse)</h3><p>The problem compounds across a team:</p><ol><li>Inconsistent enforcement — some team members remember to scope, others don’t. Some AI clients support context pinning, others don’t.</li><li>Stale context — you document that module MOD-001 owns src/utils/http.ts. Three months later, the file gets moved. The doc doesn&#39;t update. Claude edits the wrong place and confidently breaks something.</li><li>Dependency drift — your hand-drawn dependency graph says MOD-003 doesn’t depend on MOD-002. The actual code imports it five times. Claude’s mental model and reality diverge.</li><li>No CI gate — a developer writes a brief that’s completely wrong. It merges. It stays wrong until someone notices. Months later, someone’s edit goes catastrophically sideways because of a stale assumption in a brief.</li></ol><p>The root problem: you’re asking humans to manually maintain what the code already knows.</p><h3>The Real Solution: Structural Enforcement</h3><p>Here’s what actually works:</p><ol><li>Derive ownership from the code, not documentation. File ownership comes from glob patterns in a config file, not hand-listed in a brief. Dependencies come from parsing your actual import statements, not a hand-drawn graph.</li><li>Enforce at the tool level. Don’t rely on the AI to remember to load context. Use a PreToolUse hook that intercepts the first edit to a module and injects the context <em>before</em> the edit proceeds. One denied edit, one re-issued, and the brief is loaded for the session.</li><li>Make staleness a build failure. Every claim in a brief anchors to a real symbol: @anchor src/utils/http.ts::http. A CI check verifies that symbol still exists. If someone refactors and the anchor disappears, the build fails. Briefs can&#39;t rot silently.</li><li>Keep briefs minimal. Only write judgment — the invariants that silently break if ignored, the contract surface other modules rely on. Everything else (file lists, how the code works) is derived or readable from the code itself.</li></ol><h3>The Architecture That Makes It Work</h3><p>This needs three pieces:</p><h3>1. The Provider (MCP Server)</h3><p>Expose tools:</p><ul><li>scopekit_get_context(module_id) — load a module&#39;s scoped context</li><li>scopekit_resolve_module(file_path) — find which module owns a file</li><li>scopekit_list_modules() — browse the registry</li><li>scopekit_scaffold — analyze the import graph and propose modules</li><li>scopekit_verify — check briefs against the live code</li></ul><p>These are MCP tools, which means they work with Claude Desktop, Claude Code, Cursor, Cline, and any other MCP-compatible client. They’re portable.</p><h3>2. The Enforcer (PreToolUse Hook)</h3><p>When the AI tries to edit src/auth/login.ts:</p><ol><li>The hook resolves src/auth/login.ts → MOD-003.</li><li>It checks: has MOD-003’s context been loaded this session?</li><li>First touch: No. The hook denies the edit with the brief injected as the denial reason.</li><li>The AI reads the brief (module scope, invariants, dependencies).</li><li>Second touch: Yes. The hook allows the edit silently.</li></ol><p>The key insight: by denying once, you make context-loading <em>mandatory</em>. The AI doesn’t choose to load context; it must.</p><p>This is the thing that makes it work. Without it, the MCP tools are optional suggestions. With it, they’re a gate.</p><h3>3. The Verifier (CLI + CI)</h3><pre>scopekit verify</pre><p>Scans every brief:</p><ul><li>✗ Does glob src/auth/** actually match files? (else: dead scope)</li><li>✗ Does @anchor src/auth/login.ts::validateToken point at a real symbol? (else: stale claim)</li><li>✗ Does the declared dependency list match what the code actually imports? (else: drift)</li></ul><p>If anything fails, CI breaks. Briefs stay honest.</p><h3>How It Works In Practice</h3><h3>Setup (One Time)</h3><pre>bash scopekit/scripts/setup.sh &quot;My Project&quot;</pre><p>Creates AGENTS/ directory and a CLAUDE.md that tells Claude to load context before editing.</p><h3>Scaffolding (Claude Does This)</h3><p>You tell Claude: <em>“Run scopekit_scaffold.”</em></p><p>Claude:</p><ol><li>Gets a report of your real directory structure and import edges.</li><li>Proposes module boundaries based on actual coupling (not directory names).</li><li>Writes AGENTS/scopekit.json with modules and globs.</li><li>Creates AGENTS/MOD-XXX.md briefs (Contract / Invariants / Internal sections).</li></ol><p>You review and adjust. That’s it.</p><h3>A Scoped Edit</h3><pre>MOD-003: fix the login timeout issue</pre><p>Flow:</p><ol><li>Hook intercepts edit to src/auth/login.ts → resolves to MOD-003.</li><li>First touch: denies, injects MOD-003’s brief (files, invariants, dependency contracts).</li><li>Claude reads: <em>“Edit </em><em>src/auth/login.ts and </em><em>src/auth/logout.ts only. Token expiry is in a config file managed by ops; don&#39;t touch it. MOD-001 (API) contract requires all calls to go through </em><em>http.get/post; never call fetch directly.&quot;</em></li><li>Claude re-issues the edit. Hook allows it. Claude proceeds, scoped and informed.</li><li>Subsequent edits to MOD-003 files pass silently — brief is already loaded for the session.</li></ol><h3>Verification (CI)</h3><pre>scopekit verify</pre><p>Fails if:</p><ul><li>A glob matches no files (dead scope).</li><li>An anchor (@anchor src/auth/login.ts::validateToken) points at a file that no longer exists or a symbol that&#39;s been renamed.</li><li>Declared deps don’t match what the code imports.</li></ul><p>Catches drift before it causes harm.</p><h3>The Efficiency Math</h3><p>On a 100k-line project:</p><p>ApproachContext per editWasteLoad entire codebase100k LOCEverything you don’t needManual scope (hope)50k LOCHalf is still irrelevantStructural scope (briefs)3k LOC + contract slicesNone</p><p>Token savings: 30–50x smaller context per edit.</p><p>Session savings: The hook’s session-state tracking means you load MOD-003’s brief once, not ten times if you edit ten files in that module.</p><p>Reliability: Enforced boundaries + derived deps + anchored claims = no silent drift, no forgotten constraints.</p><h3>Why Conventional Tools Miss This</h3><p>Cursor’s context pinning? You have to manually pin files. It’s a UI feature, not an API. Hard to automate, easy to forget.</p><p>README documentation? Advisory. Not enforced. Drifts.</p><p>Agent spawning (@claude-agent) in some systems? You manually spawn a scoped agent per edit. Token-efficient but operationally heavy.</p><p>Markdown briefs in your repo? Same as README — advisory, drifts, ignored if the AI feels like it.</p><p>The missing piece in all of these: structural enforcement. Nothing prevents the AI from ignoring the boundaries and loading the whole codebase. And nothing catches when your briefs get stale.</p><h3>The Real Usecase: Large Teams, Fast Iteration</h3><p>This shines when:</p><ol><li>Multiple people touch the same codebase — team can’t afford to wait for context, can’t afford cascade failures from stale assumptions.</li><li>Fast iteration cycle — you’re shipping multiple changes a day to different modules. Each one should be cheap (small context), fast (enforced scope), and safe (verified briefs).</li><li>Heterogeneous clients — team uses Claude Desktop, Claude Code, Cursor, sometimes different models. Needs to work everywhere. MCP is portable.</li><li>Large codebase — 50k–500k LOC. Token waste is real money and latency.</li><li>Long-lived modules — code lives for years. Briefs need to be verified fresh in CI, not assumed correct.</li></ol><p>Smaller projects (&lt; 10k LOC)? Load everything, be happy. The overhead of maintaining briefs doesn’t pay for itself.</p><h3>Implementation: What You Actually Write</h3><p>A single config file and minimal prose:</p><pre>{<br>&quot;project&quot;: &quot;My App&quot;,<br>&quot;modules&quot;:[{ &quot;id&quot;: &quot;MOD-001&quot;, &quot;name&quot;: &quot;API Layer&quot;, &quot;globs&quot;: [&quot;src/services/**&quot;, &quot;src/utils/**&quot;] },<br>{ &quot;id&quot;: &quot;MOD-002&quot;, &quot;name&quot;: &quot;Auth&quot;, &quot;globs&quot;: [&quot;src/auth/**&quot;] }],<br>&quot;sharedContracts&quot;: [&quot;src/types/api.ts&quot;]<br>}</pre><p>One brief per module (30–100 lines):</p><pre>id: MOD-002<br>name: Auth<br>## Contract<br>- `login(user, pass)` returns a session token. @anchor src/auth/login.ts::login<br>## Invariants<br>- Tokens never go in localStorage - always httpOnly cookies. @anchor src/auth/tokens.ts::storeToke<br>## Internal<br>- The refresh-token retry logic is subtle. @anchor src/auth/refresh.ts</pre><p>That’s it. Globs are derived from your directory structure (no hand-listing). Dependencies are parsed from imports (no hand-drawing). Anchors catch staleness (verify fails if they disappear).</p><h3>The Catch</h3><p>This only works if:</p><ol><li>Your codebase has some structure — modules are actually distinct ownership areas. If everything imports from everything, there’s no boundary to enforce.</li><li>Your AI client supports MCP — Claude Desktop, Claude Code, Cursor, Cline do. Some others don’t (yet).</li><li>Your AI client supports hooks — Claude Code supports PreToolUse. Others may not (yet).</li></ol><p>For projects without structure, you need a refactor first. ScopeKit describes reality; it doesn’t fix a codebase that doesn’t have shape.</p><p>For unsupported clients, the MCP tools still work (you call them manually), but you lose the enforcement hook.</p><h3>Putting It Together</h3><p>The tooling exists to make this concrete. It’s open source: parse briefs, derive deps from imports, verify staleness, inject context via a hook. Build it once, wire it into your workflow, and your team gets scoped, enforced, verified context on every edit to every module.</p><p>The upside:</p><ul><li>30–50x smaller context → cheaper, faster responses</li><li>Enforced boundaries → no “I forgot to read the constraints” failures</li><li>Stale briefs fail CI → drift is visible, not silent</li><li>Portable across clients → works with Claude, Cursor, anything that speaks MCP</li></ul><p>The setup takes a few hours. The payoff compounds with every edit, every team member, every month the code lives.</p><p>That’s worth thinking about the next time you ask an AI to edit a large codebase and watch it load all 100k lines because nothing stopped it.</p><h3>Where to Go From Here</h3><p>If this resonates, start with the smallest version: a single module brief, a glob pattern, and a PreToolUse hook that enforces it. Verify that one anchor manually. See if the token savings are real. Then expand.</p><p>The architecture is out there. So is the code. The question is whether your team cares enough about token efficiency, boundary enforcement, and staleness-catching to invest a few hours in the setup.</p><p>Given that the cost of a single cascade failure from stale context is usually higher than the setup time, the math works out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7fd7382a94cf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[20 minutes of severe anxiety and how I got free.]]></title>
            <link>https://medium.com/@hassen.ben.mbarek/20-minutes-of-severe-anxiety-and-how-i-got-free-c04578596549?source=rss-9eb0a656a6da------2</link>
            <guid isPermaLink="false">https://medium.com/p/c04578596549</guid>
            <category><![CDATA[mental-health-awareness]]></category>
            <category><![CDATA[anxiety]]></category>
            <category><![CDATA[anxiety-disorder]]></category>
            <dc:creator><![CDATA[Hassen Ben Mbarek]]></dc:creator>
            <pubDate>Sun, 04 May 2025 11:29:49 GMT</pubDate>
            <atom:updated>2025-05-04T11:34:24.420Z</atom:updated>
            <content:encoded><![CDATA[<h3>20 minutes of anxiety and how I got free.</h3><p>I’m on my way to a hiking trip with a friend and a group of strangers, On the way its just me and my friend going to gathering destination, 15mins before reaching them I started to be anxious about nothing.</p><p>I’m a very introspective person, So as soon as something alerting or interesting crosses this skull on mine try to immediately start understanding it, but that’s the anxiety’s trap, engaging with it gives it the opportunity to eat you up.</p><p>So before reaching the gathering point I didn’t engage with it because I was driving and the road is a bit dangerous, Finally we reached the gathering and we meet everyone, and then the <strong><em>20 mins anxeity trip</em></strong> started and as soon as I realized the circumstances .. It kicked in, everyone was well equiped (I came improvised and without much notice to the hiking) the sun was hot, I didn’t have a hat on me, not much water, no food, just a snack and a banana, Its been a while since I did any physical activities, even mentally I wasn’t okay, which is the reason I went to the hiking in the first place, at this point my heart was starting to race, people started talking and I’m not even listening to anyone but my anxiety overthinking a bad scenario of how this hiking would go, maybe i’ll faint, I wouldn’t wanna ruin everyone’s journey especially not from the start, the hiking leader fortunately had an extra hat, but I still had short pants rather than sun protective pants and my legs were burning hot and we still didn’t even get into the road, and that was 5mins like a 15mins in my head.</p><p>We hit the road, the mountain was unbelieably beautiful, but what the heck at this point I didn’t see shit, I was inside my head, Am i gonna be able to go through with this? was this a mistake? man we don’t have enough water for this shit, the road a few kilometeres long (not long without the anxiety), I haven’t even walking in my neighborhood for the past year let alone cross this mountain, my lips went dry .. oh shit should I can’t preserve water, I need to drink otherwise I’ll faint, but godamn it if I drink now I won’t have anything remaining for when shit really hits the fan .. I mean we’re just at the start! well, let’s survive not and we’ll see later maybe someone will have some extra, also my friend told me he had have some extra we could share later so yeah good for me, but still, my heart wouldn’t stop racing and my body may not be able to handle this much while going up a mountain, and that was the moment I realized i’m deep anxiety and close to a panic attack.</p><p>I had anxiety for my entire life, I used to walk with 14 blood pressure back in the days, So I pretty much know how to manage my anxiety and never again having pack attacks, I just near and then go back to my senses, so in the previous paragraph I’ve tried to write down as much as I remember from the anxiety thought process for you to reasonate with, So let me very briefly explain how anxiety works and then I’ll tell you how I got free of it.</p><p>It swallaws you into a purely<strong> Internal </strong>process of unrealistic negative steam of thoughts that tries to establish a series of unrealized events that don’t remotely reflect any external truth for what’s going on around you, And that involves either social anxeity of life/sanity threatening context or both or at least that’s what I experience.</p><p>So back to the trip, At that point where I was feeling like i’m going into a panick attack, That was my Snap back to reality killswitch, I trained myself for the panick attack itself to be the key to realizing that all those thoughts are anxiety talking and none of it is real.</p><p>Here comes the snapping out process in details, Since anxiety pulls you down toward an internal process, what you need to do is basically do your best to do the opposite, <strong>turn the focus outwards</strong>, So I drunk as much water as I needed and took a nice long breaths (without stopping or anyone noticing) and that gave my brain what it needed to start the process, I looked at the trees, their beautiful shapes, the flowers and white butterflyes, the people chatting, the mountain, the ocean and its endless horizing, although the sun is hot but its a part of everything right? i started listening to the birds and the chatter, And before I noticed anything I found myself back into the moment, happy to jump and observe nature, I’m a photographer so I believe I might see things a bit differently and with more enthusiasm and appreciation that others, I’m kinda of a no rules of any kind person when I’m in nature, I don’t fear it, I would be starving to risk a dangerous encounter, first thing I did when I got back in track was go off on my own because the group was going on a straight line that they’d miss the bigger imagine as the road had some side spots with magnieficient views. That day I was missing my second half, My camera .. But I still enjoyed the trip as I should.</p><p>It was Amazing, here are some pictures if you’re interested. (I will not disclose the location as humans tend to ruin everything, So i’m selective to whom I recommend heavens on earth)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4B8pATABQV-KJXrXV1BPsQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cx91nhVAAW5F9kML33bHTw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b8dfHg7CN-urVIYPdpW-GQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KjdYOhptMW9hYISGDPBaGw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lGWqRSpkt76ugt-0Dq_yfw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pCeqoVk1dU8rS_6HtLbUFA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s3WsmCkQSDCMe8OyI_V2ig.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c04578596549" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How i built colorFlow]]></title>
            <link>https://medium.com/@hassen.ben.mbarek/how-i-built-colorflow-20569407086d?source=rss-9eb0a656a6da------2</link>
            <guid isPermaLink="false">https://medium.com/p/20569407086d</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[web-design]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[colors]]></category>
            <dc:creator><![CDATA[Hassen Ben Mbarek]]></dc:creator>
            <pubDate>Tue, 23 Jan 2024 10:06:00 GMT</pubDate>
            <atom:updated>2024-01-23T10:06:00.215Z</atom:updated>
            <content:encoded><![CDATA[<p>ColorFlow started by simply me attempting to learn Typescript. I think the best way to learn is by building stuff; it works very well when you do it on something that you already build so that you don’t get distracted by new ideas for what you’re building.</p><p>But in my case, I didn’t really have a ReactJs small project under my sleeve, so I had to find something new, unfortunately. Ironically, this inconvenience turned out to be fortunate.</p><p>So I started my journey by getting some inspiration from CodePen designs, thinking maybe I’ll find a simple yet interesting feature to build. So I ended up liking this one by <a href="https://codepen.io/marcobiedermann/details/WNGWzYR">Marco Biedermann</a> who himself inspired it from <a href="https://dribbble.com/egorfromspace">Egor Kosmache</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tOo60OWbRDsE5hdSrRbODQ.png" /></figure><p>At first glimpse, I thought, can I generate an unlimited amount of those? FYI, I’m in love with these gradients as a former graphic designer. I had a good eye for colors.</p><p>So, I went to the chatGPT and asked a ton of questions about color theory &amp; gradients, and how Hex, HSL, and gradients relate. This led me to some mathematical methods, specifically Linear Interpolation (a method of curve fitting using linear polynomials to construct new data points within the range of a discrete set of known data points). It threw me off track of learning TypeScript. I said, “Well, I’ll try to focus on both accordingly. There is a lot more than a simple color generator to be done in here.”</p><p>So, I went googling websites that generate colors to find out if the ideas I had were more evolved than the existing ones. To hell with it, then let’s think bigger. Anyway, this was all just day 2 or something where I started the project and struggled with TypeScript for a few more days. After finally making a simple colors generator, that was all of it. The Utils file was empty; only generateAnalogous was available. The rest were just anticipated to be implemented.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*aU9iJgze3-bqXGiRf718IA.png" /></figure><p>This was all there is in the App.tsx</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*TVf2hYmDh0jLqKudeJzF7A.png" /></figure><p>Then it I look at this piece of crap for a sec, well this is crap code .. so</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*SoFvr4ol45DJfqSQVWd-xg.gif" /></figure><p>Time to scale up and add support for multiple color generators. Generally, React.js developers tend to think natively about solutions because the library is abstract. This is in contrast to developers working with Angular, where even junior developers might not be familiar with Angular’s design patterns, let alone self-taught developers without experience. Anyway, initially, I didn’t consider existing design patterns but rather thought of using a Switch Case between the generators. However, I quietly realized how mistaken I was when I crafted the schema. “Oh, how could I miss this!”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/1*eT_8Cgqz7Xcz3zlnujcErA.png" /></figure><p>Little have I known,</p><pre>const generators: Generator[] = [<br>    {<br>        name: &#39;analogous&#39;,<br>        description: &#39;In color theory, analogous colors are groups of colors that are next to each other on the color wheel.&#39;,<br>        function: generateAnalogousColors,<br>        parameters: [&quot;count&quot;,<br>            &quot;baseColorOne&quot;,<br>            &quot;lerp&quot;,<br>            &quot;adjustHue&quot;,<br>            &quot;Isinterpolated&quot;],<br>    },<br>    {<br>        name: &#39;monochromatic&#39;,<br>        description: &#39;Generate Monochromatic colors&#39;,<br>        function: generateMonochromaticColors,<br>        parameters: [&#39;baseColorOne&#39;],<br><br>    },<br>    {<br>        name: &#39;pastel&#39;,<br>        description: &#39;Generate Pastel colors&#39;,<br>        function: generatePastelPairs,<br>        parameters: [&quot;count&quot;, &quot;baseColorOne&quot;, &quot;baseColorTwo&quot;, &quot;adjustHue&quot;, &quot;random&quot;],<br><br>    },<br>    // Add more generators as needed<br>];</pre><p>PS: I decided not to take the API approach because the delay would make real-time color previewing impossible.</p><p>A small rollback here; the previous version of this array didn’t contain the “parameters” property. It was cumbersome calling every generator’s function with its own parameters, and that would require a switch case alongside the Factory Pattern, making it painful to display the color options. So, I added the “parameters” property to enable me to send all params at once to the array. This way, each generator can be provided with its convenient color options:</p><pre> const colors = selectedGenerator.function({<br>        count: getCount,<br>        baseColorOne: baseColorOne,<br>        baseColorTwo: baseColorTwo,<br>        lerp: getLerp,<br>        adjustHue: getAdjustHue,<br>        random: generateSingleColor,<br>        direction: getGradDirection,<br>      });<br>      setData(colors);</pre><p>Effectively allowing a very easy and what I’d like to call “natural” option selector :</p><pre>    const naturalOptionSelector = (currentFilter: string) =&gt; {<br>        if (currentFilter) {<br>            if (props.selectedGenerator?.parameters.includes(currentFilter)) {<br>                switch (currentFilter) {<br>                    case &#39;baseColorOne&#39;:<br>                        return &lt;ColorPicker className=&#39;mr-2&#39; onChange={(color) =&gt; props.baseColorOne(color.hex)} hideAlpha={true} /&gt;;<br>                    case &#39;baseColorTwo&#39;:<br>                        return &lt;ColorPicker onChange={(color) =&gt; props.baseColorTwo(color.hex)} hideAlpha={true} /&gt;;<br>                    case &#39;lerp&#39;:<br>                        return &lt;NumberSlider type=&quot;float&quot; name=&quot;Linear interpolation&quot; onDataSend={props.handleLerp} min={0} max={1} /&gt;;<br>                    case &#39;count&#39;:<br>                        return &lt;NumberSlider type=&#39;int&#39; name=&quot;Variations amount&quot; onDataSend={props.handleCount} min={0} max={100} /&gt;;<br>                    case &#39;direction&#39;:<br>                        return &lt;SwitchComponent type=&quot;int&quot; onDataSend={props.handleGradDirection} /&gt;<br>                    case &#39;random&#39;:<br>                        return &lt;SwitchComponent type=&quot;randomColors&quot; onDataSend={props.handleGenSingleColor} /&gt;<br>                    case &#39;adjustHue&#39;:<br>                        return &lt;NumberSlider name=&quot;Hue&quot; type=&quot;int&quot; onDataSend={props.handleHue} min={0} max={360} /&gt;<br>                    default:<br>                        return null;<br>                }<br>            }<br>        }<br>    };</pre><p>And this is the final output (This is V0, V1 is in the next screenshot) :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nDXSYp2A_s1BCO1YjmCHDw.png" /></figure><p>This is just the very first version of the app; I’m still planning to scale it way further. Also, my focus was functional rather than UI/UX, but they’re equally important choices and are always based on priority.</p><p>Irony of wisdom: The goal was the smallest part of the journey; it didn’t even matter.</p><p>Update :</p><p>So I got back to this project after a few weeks to improve it by adding redux and a few new cool features, And here is the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iTyAQArd_NPDQz9CG09H9w.png" /></figure><p>GitHub : <a href="https://github.com/EagleMind/colorFlow">https://github.com/EagleMind/colorFlow</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20569407086d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unpacking the Dynamics of Focus and Distraction]]></title>
            <link>https://medium.com/@hassen.ben.mbarek/unpacking-the-dynamics-of-focus-and-distraction-6d6e8b1e1d52?source=rss-9eb0a656a6da------2</link>
            <guid isPermaLink="false">https://medium.com/p/6d6e8b1e1d52</guid>
            <category><![CDATA[focus]]></category>
            <category><![CDATA[mindfulness]]></category>
            <category><![CDATA[psychology-behind]]></category>
            <category><![CDATA[distraction]]></category>
            <dc:creator><![CDATA[Hassen Ben Mbarek]]></dc:creator>
            <pubDate>Sat, 07 Oct 2023 18:25:41 GMT</pubDate>
            <atom:updated>2023-10-07T18:28:48.532Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OmEiwGqTtRFj8SfoeVTuCg.jpeg" /></figure><h3>Unpacking the Dynamics of Focus</h3><blockquote>Focus is a state of mind in which we allocate our mental resources toward a specific subject limiting any other external or internal stimuli to a maximum rendering our attention perimeters limited only to that subject’s context.</blockquote><p><strong>How does it function?</strong></p><p>Focus can be considered a subtle process that requires a certain conditioning, when a person experiences an amplification of a thought the mind immediately starts allocating all resources into it and puts all other thought processing on hold by dislocating their resources to relocate them into that subject which makes all its relative knowledge the individual has gathered in a lifetime highly interconnected therefore easily accessible.</p><p><strong>Distraction is an expression, Shifting is a focus phenomena :</strong></p><p>Distraction is our expression towards the shift in our focus as we typically perceive events that don’t align with our intentions as negative, when our focus shifts from something to another we claim to be distracted. Both external and internal stimuli can prompt a shift in attention. Externally, it could be a sudden noise, a notification ping, or someone walking into the room. Internally, it might be a sudden thought, an emotional response, or even physical discomfort. The challenge, then, isn’t to eliminate the inherent shifting nature of our attention but to manage and direct it in ways that align with our intentions. Recognizing that distraction is not a failure of focus, but rather an emotional response to an undesired shift, can empower us to cultivate a more compassionate and effective approach to managing our attention.</p><p><strong>The Two Polarities Of Focus</strong></p><p>While Intentional Focus is when we willingly direct our attention to a subject, Unwanted Focus occurs when our attention shifts due to a distraction whether internal or external, Mihaly Csikszentmihalyi in his theory of flow suggested that when the challenge of a task exceeds one’s skill level, it can lead to anxiety. In this state, one’s focus might shift due to the feeling of being overwhelmed. On the contrary, when the skill level exceeds the challenge, it results in a state of control. Here, focus can be maintained, but the risk is that the task might become mundane or boring over time.</p><p>An instance of the negative polarity of focus is when you’re in a toxic relationship and all your focus is always shifting back like a magnet into what the other party said to you that made you feel in a certain way, To explain the skill Vs challenge in this particular case, we can suggest that when you’re not psychologically geared up or aware of certain patterns of relationship abuse you are not skilled to defend yourself of that threat or challenge so to say.</p><p>On the other hand, in the positive polarity we encounter the case of the harmonious experience we refer to as “the flow” in which we engage in an activity that we master and enjoy therefore skilled up to its challenges.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6d6e8b1e1d52" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Education System: A Rigged Game That Serves the Wealthy]]></title>
            <link>https://medium.com/@hassen.ben.mbarek/the-education-system-a-rigged-game-that-serves-the-wealthy-fdb33250b45b?source=rss-9eb0a656a6da------2</link>
            <guid isPermaLink="false">https://medium.com/p/fdb33250b45b</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[wealth-inequality]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[awareness]]></category>
            <dc:creator><![CDATA[Hassen Ben Mbarek]]></dc:creator>
            <pubDate>Sun, 17 Sep 2023 13:33:00 GMT</pubDate>
            <atom:updated>2023-09-17T13:33:00.548Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The Illusion of Educational Empowerment</strong></p><p>You might be under the impression that the educational system is your ally on the path to success. But as George Orwell wisely noted, “Ignorance is strength” for those in power. Let’s confront the dragon in the room: the system is more akin to a labyrinth, designed not to guide you to your potential, but to circulate you through a maze that serves the interests of a select few. So, ask yourself, are you the hero of your own educational journey, or are you a pawn in someone else’s game?</p><p><strong>Education and Universities: Intellectual Straitjackets and the Final Barrier of High Tuitions</strong></p><p>Far from being a fertile ground for the cultivation of the individual, the educational system often serves as an intellectual straitjacket. Paulo Freire’s concept of the “banking model of education” comes to mind, where students are seen as empty vessels to be filled with information. The standardized tests, the rigid curricula, the one-size-fits-all grading systems — these are not mere tools of assessment. They are instruments of ideological possession, designed to mold you into a compliant citizen rather than an autonomous individual.</p><p>But let’s delve deeper. The current educational model is more focused on training the mind rather than enlightening it. Training implies conditioning, a form of learning where the objective is to produce a specific output. This recalls Albert Einstein’s observation: “Education is what remains after one has forgotten what one has learned in school.” Training avoids the complexities of individual thought and the nuances of critical thinking.</p><p>Enlightenment, on the other hand, is about fostering a deep understanding, encouraging curiosity, and nurturing the ability to question and challenge established norms. This aligns with Mark Twain’s insight: “Don’t let schooling interfere with your education.” Enlightenment is about recognizing that the pursuit of knowledge and wisdom goes beyond the classroom and involves a lifelong commitment to self-discovery and growth.</p><p>Another aspect that we can’t turn our backs from it is that the universities tuition fees system don’t just limit individual access, it reinforces existing power dynamics. By making higher education financially inaccessible for many, the system ensures that wealth and influence remain concentrated. The wealthy not only maintain their economic positions but also consolidate their social capital and access to opportunities.</p><p><strong>The Job Market: A Walled Garden</strong></p><p>Now, consider the job market. It’s portrayed as a land of opportunity, a place where hard work pays off. But as Thomas Piketty’s research on economic inequality suggests, the system often perpetuates existing wealth and power dynamics. Who holds the keys to this kingdom? Often, it’s the same individuals or groups who have already secured their place atop the social hierarchy. This isn’t a meritocracy; it’s a walled garden, carefully curated to maintain the existing power dynamics.</p><p>Far from being a fertile ground for the cultivation of the individual, the educational system often serves as an intellectual straitjacket. Paulo Freire’s concept of the “banking model of education” comes to mind, where students are seen as empty vessels to be filled with information. The standardized tests, the rigid curricula, the one-size-fits-all grading systems — these are not mere tools of assessment. They are instruments of ideological possession, designed to mold you into a compliant citizen rather than an autonomous individual.</p><p>But let’s delve deeper. The current educational model is more focused on training the mind rather than enlightening it. Training implies conditioning, a form of learning where the objective is to produce a specific output. It’s akin to what Carl Jung referred to when he said, “People will do anything, no matter how absurd, to avoid facing their own souls.” Training avoids the complexities of individual thought and the nuances of critical thinking. Enlightenment, on the other hand, is about fostering a deep understanding, encouraging curiosity, and nurturing the ability to question and challenge established norms. It’s about what Socrates meant when he said, “An unexamined life is not worth living.”</p><p><strong>In Conclusion</strong></p><p>As we grapple with the unsettling realities of our educational system, it’s crucial to remember that we are not merely products of this system. We have the agency to transcend its limitations. The key lies in self-education, ambition, and the pursuit of a meaningful life.</p><p>Viktor Frankl, a psychiatrist and Holocaust survivor, argued that the search for meaning is the primary human drive. When we find meaning in our lives, we unlock a level of vitality and resilience that can be extraordinarily empowering. This is not just philosophical musing; research has shown that a sense of purpose can be a significant factor in combating depression and enhancing well-being.</p><p>So, don’t let the flaws of the system define your educational journey or your life’s trajectory. Take the reins. Read widely. Question everything. Engage with different perspectives. Set ambitious goals that align with your values and passions. In doing so, you’ll not only be enriching your own life but also contributing to a broader societal awakening.</p><p>Remember, the choice is yours. You can either be a passive observer, confined by the limitations of the system, or you can rise to the challenge, confront the chaos, and be part of the force that ushers in a new era. The first step starts with recognizing the problem, and the next steps involve taking responsibility for your own education.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fdb33250b45b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Navigating Life: The Unseen Skill More Vital Than Any Professional Mastery]]></title>
            <link>https://medium.com/@hassen.ben.mbarek/navigating-life-the-unseen-skill-more-vital-than-any-professional-mastery-2a8b9dffd874?source=rss-9eb0a656a6da------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a8b9dffd874</guid>
            <category><![CDATA[life]]></category>
            <category><![CDATA[mastery]]></category>
            <category><![CDATA[skills]]></category>
            <dc:creator><![CDATA[Hassen Ben Mbarek]]></dc:creator>
            <pubDate>Fri, 01 Sep 2023 22:55:23 GMT</pubDate>
            <atom:updated>2023-09-01T22:55:23.433Z</atom:updated>
            <content:encoded><![CDATA[<p>In a world driven by specialization and professional prowess, there’s an art that often goes unnoticed but is integral to our success — the art of navigating life. We spend countless hours honing our professional skills, attending workshops, earning certifications, and striving to be the best in our fields. But is that enough?</p><h3>The Landscape of Life</h3><p>Life is a complex tapestry woven with relationships, emotions, health, hobbies, and the very essence of our existence. Navigating this multifaceted journey requires skills that transcend professional qualifications.</p><p>A software engineer may excel at writing code, a doctor may be brilliant at diagnosing ailments, but if they cannot handle a tough conversation with a colleague, manage stress, or balance work and life, their professional skills may fall short of bringing true fulfillment.</p><h3>Life Skills: The Unsung Heroes</h3><p>Life skills such as empathy, resilience, emotional intelligence, and adaptability are not just buzzwords; they are the building blocks that empower us to face the unpredictable twists and turns of life.</p><p>In the business world, these skills translate into better leadership, collaboration, innovation, and problem-solving. They enable us to connect with colleagues and clients on a human level, which can lead to a more enriched and productive professional life.</p><h3>For Instance</h3><p>Take the case of a new software development company. The technical skills are paramount, but the company’s growth and success will be largely influenced by the ability to navigate interpersonal relationships, adapt to market changes, create a healthy work culture, and inspire a passionate team.</p><p>These attributes cannot be learned in a traditional classroom or mastered through professional training alone. They come from personal growth, self-awareness, and a willingness to embrace the complexities of human nature.</p><h3>The Harmony of Professional and Personal Mastery</h3><p>Mastering professional skills is undeniably essential in our career paths. However, it should not overshadow the necessity of developing the skills needed to navigate life.</p><p>The harmony between professional and personal mastery is the key to a fulfilling life. It enhances not only our career but our relationships, well-being, and overall happiness.</p><h3>Conclusion</h3><p>In the race to achieve professional excellence, let’s not lose sight of the broader picture. Investing in our ability to navigate life with grace, wisdom, and compassion is an investment that pays dividends in every aspect of our existence.</p><p>By embracing this holistic approach, we can create a more balanced and fulfilling path, where professional mastery is complemented by the art of living well.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a8b9dffd874" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Importance of Factual Events in Strategic Planning: Dispelling Common Misconceptions]]></title>
            <link>https://medium.com/@hassen.ben.mbarek/the-importance-of-factual-events-in-strategic-planning-dispelling-common-misconceptions-5110e6e94e64?source=rss-9eb0a656a6da------2</link>
            <guid isPermaLink="false">https://medium.com/p/5110e6e94e64</guid>
            <category><![CDATA[strategic-thinking]]></category>
            <category><![CDATA[strategic-planning]]></category>
            <dc:creator><![CDATA[Hassen Ben Mbarek]]></dc:creator>
            <pubDate>Fri, 01 Sep 2023 22:53:54 GMT</pubDate>
            <atom:updated>2023-09-01T22:53:54.818Z</atom:updated>
            <content:encoded><![CDATA[<p>In the complex and ever-changing landscape of business, strategy is often considered the key to success. It helps organizations navigate through market competition, technological evolution, and shifts in consumer behavior. However, there is a prevalent misconception that a brilliant idea, in isolation, can forge a successful strategy. This article aims to clarify why real factual events are essential in strategic planning and how misunderstandings can lead to misguided decisions.</p><h3>1. Building on the Foundation of Real Factual Events</h3><p>Strategic planning transcends mere innovation or brainstorming. It necessitates a foundation grounded in real factual events, which offer insights into market trends, consumer needs, and competitive dynamics. These events are vital for:</p><ul><li>Understanding the Market: Historical data and current events provide a lens to identify opportunities and threats.</li><li>Predicting Future Trends: Factual events allow organizations to anticipate future market behavior, facilitating proactive decision-making.</li><li>Mitigating Risks: Strategies based on concrete information help in minimizing potential risks.</li></ul><h3>2. Debunking the Myth of the ‘Great Idea’</h3><p>The notion that a great idea, by itself, can craft a successful strategy is misleading. While creativity and innovation are valuable, they must be anchored in reality. An idea without alignment with factual events can result in:</p><ul><li>Misguided Strategies: Ideas detached from market realities may lead to strategies that miss the mark.</li><li>Wasted Resources: Chasing ideas without proper substantiation can squander time, effort, and money.</li><li>Reputational Damage: Failing to fulfill promises based on poorly conceived ideas can tarnish an organization’s reputation.</li></ul><h3>3. Bridging the Gap: Merging Creativity with Facts</h3><p>The essence of successful strategic planning lies in the seamless fusion of creativity and factual analysis. Organizations can bridge this gap through:</p><ul><li>Data-Driven Decision Making: Employing data analytics ensures that ideas are validated and aligned with market facts.</li><li>Continuous Learning: Keeping abreast of current events, industry developments, and market research guarantees that strategies remain relevant.</li><li>Collaborative Approach: Fostering collaboration between creative and analytical teams promotes a well-rounded approach to planning.</li></ul><h3>Conclusion</h3><p>Strategic planning is an intricate process that demands more than a mere brilliant idea. It requires a profound comprehension of real factual events to align strategies with market truths. By acknowledging the significance of these events and dispelling the myth that an idea alone is sufficient, organizations can forge resilient strategies that contribute to lasting success.</p><p>In an unpredictable world, anchoring strategies in facts is not merely prudent, it’s imperative.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5110e6e94e64" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>