<?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 Fred Chan on Medium]]></title>
        <description><![CDATA[Stories by Fred Chan on Medium]]></description>
        <link>https://medium.com/@fred.chan_92610?source=rss-1eb32ccb2753------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*tBJE_erNeyLKtKpQa8wHgA.png</url>
            <title>Stories by Fred Chan on Medium</title>
            <link>https://medium.com/@fred.chan_92610?source=rss-1eb32ccb2753------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 10:20:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fred.chan_92610/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[The Tech Polarity Trap: When Pushing for Innovation Triggers Reactionary Resistance]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@fred.chan_92610/the-tech-polarity-trap-when-pushing-for-innovation-triggers-reactionary-resistance-f1eeedc1da97?source=rss-1eb32ccb2753------2"><img src="https://cdn-images-1.medium.com/max/754/1*JRzdXD_c7Mkf66Ko2nNAgA.png" width="754"></a></p><p class="medium-feed-snippet">&#x201C;Fred, you are an AI Psychotic, and you need to seek medical treatment.&#x201D;</p><p class="medium-feed-link"><a href="https://medium.com/@fred.chan_92610/the-tech-polarity-trap-when-pushing-for-innovation-triggers-reactionary-resistance-f1eeedc1da97?source=rss-1eb32ccb2753------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@fred.chan_92610/the-tech-polarity-trap-when-pushing-for-innovation-triggers-reactionary-resistance-f1eeedc1da97?source=rss-1eb32ccb2753------2</link>
            <guid isPermaLink="false">https://medium.com/p/f1eeedc1da97</guid>
            <category><![CDATA[leadership]]></category>
            <category><![CDATA[future-of-work]]></category>
            <category><![CDATA[tech-fatigue]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[polarity-management]]></category>
            <dc:creator><![CDATA[Fred Chan]]></dc:creator>
            <pubDate>Tue, 07 Jul 2026 04:13:07 GMT</pubDate>
            <atom:updated>2026-07-07T04:13:07.688Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How a Structured AI Workflow Framework Shaped the StudyNode Capstone Project]]></title>
            <link>https://medium.com/@fred.chan_92610/how-a-structured-ai-workflow-framework-shaped-the-studynode-capstone-project-5d81fe15806f?source=rss-1eb32ccb2753------2</link>
            <guid isPermaLink="false">https://medium.com/p/5d81fe15806f</guid>
            <category><![CDATA[capstone-project]]></category>
            <category><![CDATA[spec-driven-development]]></category>
            <category><![CDATA[agent-skills]]></category>
            <category><![CDATA[playwright-automation]]></category>
            <category><![CDATA[ai-driven-development]]></category>
            <dc:creator><![CDATA[Fred Chan]]></dc:creator>
            <pubDate>Tue, 05 May 2026 13:34:41 GMT</pubDate>
            <atom:updated>2026-05-05T13:34:41.670Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview</h3><p>This document covers <em>how</em> the work was structured — specifically, how the Agent Skills framework was used as a development discipline throughout the project.</p><p>Agent Skills is an open-source collection of engineering workflow skills, each encoding the process a engineer follows at a specific phase of software development. Rather than relying on ad-hoc instinct at each phase, the framework provides a decision flowchart that routes a task to the appropriate skill:</p><pre>Task arrives<br>    │<br>    ├── Vague idea/need refinement? ──→ idea-refine<br>    ├── New project/feature/change? ──→ spec-driven-development<br>    ├── Have a spec, need tasks? ──────→ planning-and-task-breakdown<br>    ├── Implementing code? ────────────→ incremental-implementation<br>    ├── Writing/running tests? ────────→ test-driven-development<br>    ├── Something broke? ──────────────→ debugging-and-error-recovery<br>    ├── Reviewing code? ───────────────→ code-review-and-quality<br>    │   └── Security concerns? ───────→ security-and-hardening<br>    ├── Writing docs/ADRs? ───────────→ documentation-and-adrs<br>    └── Deploying/launching? ─────────→ shipping-and-launch</pre><p>The framework defines a full lifecycle sequence for a complete feature:</p><pre>idea-refine → spec-driven-development → planning-and-task-breakdown<br>  → incremental-implementation → test-driven-development<br>  → code-review-and-quality → documentation-and-adrs → shipping-and-launch</pre><p>The sections below walk through each stage as it was applied to this project, with the artifacts produced at each step.</p><h3>Stage 1 — Idea Refinement (idea-refine)</h3><p>The problem: StudyNode allowed users to upload PDF files to lessons but provided no way to query their content. A user wanting to find a specific concept had to open each PDF manually. The Q&amp;A feature idea was vague at first — “some kind of AI chat for lessons” — before being structured into a defined opportunity.</p><p>The idea-refine skill enforces divergent thinking before convergent: generate multiple directions, evaluate tradeoffs, then converge on a scoped proposal before writing any spec.</p><p>Outcome: The initial idea was refined into a concrete problem statement: authenticated users need to ask natural language questions about lesson PDFs and receive grounded answers, with conversation history persisted across sessions. This shaped the user stories that appeared in the spec.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/0*zufddWAZWmWUik6R" /></figure><p>idea-refine skill output — divergent options evaluated &amp; converged into a scoped problem statement before any spec was written</p><h3>Stage 2 — Spec-Driven Development (spec-driven-development)</h3><p>The most consistently applied skill in this project. No feature was implemented without a written spec. Three formal specs were produced:</p><p>SpecFeaturedocs/specs/SPEC-enhancements-2026–04–17.mdMarkdown rendering, Save chat as Markdown, PDF thumbnailsdocs/specs/SPEC-ai-metadata-autofill.mdAI-powered form field suggestions on lesson createdocs/specs/SPEC-gemini-context-cache.mdGemini context caching for reduced Q&amp;A latency</p><h3>What the spec template enforced</h3><p>Each spec followed a consistent structure that forced decisions to be made in writing before code was written:</p><pre>Objective         → What problem are we solving, and for whom?<br>Deliverables      → What files change?<br>API Contract      → Exact request/response shapes, error codes, field types<br>Client Behaviour  → State machine, trigger logic, edge case handling<br>data-testid spec  → Every new testid named before the component existed<br>Boundaries        → Always / Ask first / Never (scope control)<br>Testing Strategy  → How will this be verified?<br>Open Questions    → Unresolved risks that must be answered before building</pre><h3>The data-testid spec as a Playwright bridge</h3><p>One concrete payoff: data-testid requirements appeared in the spec <em>before</em> the component was written. For example, SPEC-ai-metadata-autofill.md named create-lesson-autofill-loading as the testid for the shimmer state. The Playwright test then used that attribute as its gate:</p><pre>// From e2e/specs/create-lesson-autofill.spec.ts<br>await expect(page.locator(&#39;[data-testid=&quot;create-lesson-autofill-loading&quot;]&#39;)).toBeVisible();</pre><p>The spec became the contract between the component author and the test author — in this case, the same person, but the discipline prevented testids from being invented ad-hoc after the fact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0sZOGkQZ1WluUICz" /></figure><p>The Boundaries table and data-testid specification — scope decisions</p><h3>The Boundaries table as scope control</h3><p>The Always / Ask first / Never table in each spec was one of the highest-value additions. For the AI Autofill feature:</p><p>AlwaysAsk firstNeverPreserve existing data-testid attrsAdding autofill to EditLessonPageRe-trigger on second/third fileSilent fail on error or oversized fileChanging Gemini modelOverwrite a user-typed fieldCap tags at 3 client-sideAny change to genres RLS policyBlock form navigation while autofilling</p><p>Without this table, “should EditLessonPage also get autofill?” becomes a mid-implementation decision point. Written down in advance, it’s a closed question.</p><h3>The Open Questions block as risk surfacing</h3><p>SPEC-ai-metadata-autofill.md included:</p><pre>- Confirm Deno Deploy request body limit (expected ~1–10 MB; 5 MB client cap is conservative)<br>- Verify GCP_VERTEX_SA_KEY secret is available to the new function</pre><p>Both were validated before the build phase began. The 5 MB client-side cap came directly from answering the first question, not from a runtime discovery after deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/0*an1JsZ7UioHn944K" /></figure><p>/agent-skills:spec before implementation begins, producing the structured spec template that all subsequent work was gated</p><h3>Stage 3 — Planning and Task Breakdown (planning-and-task-breakdown)</h3><p>With a spec confirmed, the planning-and-task-breakdown skill decomposed each feature into a sequenced, verifiable task list. Tasks were written to tasks/plan.md and tasks/todo.md.</p><p>The discipline the skill enforces: every task must have a clear done state. Not “implement caching” but “implement cache lookup in lesson-qa-ask; done when: function checks lesson_qa_cache before downloading PDFs, test passes.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/0*b2YeKZ1enmVz9h0h" /></figure><p>Task plan before build execution</p><p>This granularity prevented the common failure of a large half-finished task that was difficult to test incrementally.</p><h3>Stage 4 — Incremental Implementation (incremental-implementation)</h3><p>The framework’s instruction: build in thin vertical slices, verify each slice before expanding. For this project that meant:</p><p>Gated verification loop after every task:</p><pre>npm run typecheck &amp;&amp; npm run lint   # after every task<br>npm run build                        # at each phase checkpoint</pre><p>Zero TypeScript errors and zero ESLint violations were maintained throughout the project. A build failure was always addressed immediately, never deferred.</p><p>The Long-Context RAG pivot as mid-project re-specification:</p><p>The most significant implementation event was abandoning the Vector-Search RAG architecture mid-build. The incremental-implementation skill’s emphasis on verifying each slice before expanding meant the flaws in the architecture became visible <em>before</em> the full pipeline was deployed. The decision to pivot was made deliberately, backed by a written analysis (ADR-002), rather than discovered in production.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*Am26jSlc2vTk0IpH" /></figure><p>Zero Typescript errors, zero ESLint violation, clean build — the gated verification loop that was run after each incremental task</p><h3>Stage 5 — Test-Driven Development and Browser Testing (test-driven-development, browser-testing-with-devtools)</h3><p>Final test count: 60 tests, all passing.</p><p>The test suite covers:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cyGbeekn2m89R9oC" /></figure><p>The key discipline from the test-driven-development skill: acceptance criteria in the spec become test assertions. For example, the autofill spec’s acceptance criterion “second file drop does not re-trigger autofill” maps directly to:</p><pre>// Drop a second file<br>await page.dispatchEvent(&#39;[data-testid=&quot;create-lesson-file-input&quot;]&#39;, &#39;change&#39;, ...);<br>// Shimmer must NOT appear again<br>await expect(page.locator(&#39;[data-testid=&quot;create-lesson-autofill-loading&quot;]&#39;)).not.toBeVisible();</pre><p>The browser-testing-with-devtools skill was applied for debugging asynchronous race conditions — particularly the Playwright timing patterns around async React state (gate on toHaveValue before interacting with a form loaded from Supabase, rather than relying on goto() completion alone).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*Fh_4sul9HFznUHk-" /></figure><p>All 60 Playwright tests passing — covering auth flows, lesson CRUD, Q&amp;A panel, admin settings, AI autofill</p><h3>Stage 6 — Code Review and Security Hardening (code-review-and-quality, security-and-hardening)</h3><p>A formal five-axis code review was conducted after the core Q&amp;A feature shipped. The axes: correctness, readability, architecture, security, performance.</p><p>The security-and-hardening skill structured the review to look specifically for:</p><ul><li>Input validation at system boundaries (prompt injection — implemented)</li><li>Data leakage via console logs (14 console.log calls removed from LessonDetailPage)</li><li>Credential exposure (Supabase anon key rotated)</li><li>Access control policy correctness (RLS policies audited — one policy found equivalent to USING (true) through a logic error, corrected)</li><li>Signed URL duration (reduced from 3600s to 900s)</li></ul><p>Ten issues were identified and addressed. This is documented in full in ADR-003 and §8 of the capstone report.</p><p>The key discipline: security review as a scheduled phase, not an afterthought. The framework names it as a distinct step in the lifecycle rather than something that happens if time permits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/0*E4fiKJgun_ZkUuJw" /></figure><p>/agent-skills: security-and-hardening review</p><h3>Stage 7 — Documentation and ADRs (documentation-and-adrs)</h3><p>Three Architecture Decision Records were written, each capturing the <em>why</em> behind a significant decision rather than just the <em>what</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*cEKkDYPB1ebhLBks" /></figure><p>Three Architecture Decision Records</p><p>The framework’s distinction: specs capture what to build; ADRs capture why this approach over the alternatives. ADR-002 includes a comparison table of Vector-Search vs Long-Context RAG across seven dimensions. That reasoning is now permanently accessible to anyone who reads the codebase and wonders why the lesson_chunks table exists but is never populated.</p><p>CLAUDE.md as living institutional memory:</p><p>A CLAUDE.md file at the project root accumulates gotchas and decisions that don’t warrant a full ADR but must not be forgotten — ES256 JWT deployment requirement, the nginx .mjs MIME type fix, the Supabase silent-update-on-RLS-block gotcha. The documentation-and-adrs skill treats this as the operational layer of documentation: not the <em>why</em>, but the <em>watch out</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*M8VS3TkkFNMcGTxO" /></figure><p>ADR-002 comparison table — Vector-Search RAG vs Long-Context RAG evaluation before pivot</p><h3>Outcomes: What the Framework Gave the Project</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-mO11jNzLJJxYgr4" /></figure><p>The most significant outcome: the Long-Context RAG pivot. Without the spec-first discipline, the Vector-Search architecture would likely have been deployed before its flaws became clear — because the implementation would have been treated as evidence of correctness. Writing the spec forced a clear definition of what “working” meant, which made the flaws visible earlier.</p><h3>Reflection</h3><p>The agent-skills framework is not a set of rules — it is a set of structured questions asked at the right moment. “What is the boundary of this feature?” is a question the spec-driven-development skill forces you to answer in writing before you build. “What are the alternatives and why was this one chosen?” is the question the documentation-and-adrs skill forces you to answer after.</p><p>For a solo project, the discipline of writing answers to those questions before proceeding was the primary check against the most common failure mode: building the wrong thing correctly.</p><p>Human orchestration, AI execution. The development was orchestrated by the author, with Claude Code agents executing tasks through the agent-skills framework. Each skill invocation (/agent-skills:spec, /agent-skills:plan, /agent-skills:build) delegated execution to a specialised agent persona, but the decision of <em>which skill to invoke, when, and on what scope</em> remained a human judgement call. The framework did not remove human direction — it made that direction more deliberate by giving each phase a name and a defined entry/exit condition.</p><p>Exploratory testing as a quality layer. Automated tests verify that defined acceptance criteria are met. Exploratory testing — navigating the live app as a user, without a script — caught several bugs that the test suite missed: visual regressions, state management edge cases, and UX friction points that only become apparent when interacting with the app naturally. A number of these were fixed during development sessions before they ever reached the test suite. This reinforced the principle that automated coverage and manual exploration are complementary, not substitutes.</p><p><em>Framework: </em><a href="https://github.com/addyosmani/agent-skills"><em>Agent Skills</em></a><em> by Addy Osmani — open-source, MIT licensed.</em></p><p><em>Project repository: </em><a href="http://github.com/fredchan23/playwright-test-site"><em>github.com/fredchan23/playwright-test-site</em></a></p><p><em>Live demo: </em><a href="https://playwright-test-site-yn7dptrbqa-as.a.run.app/"><em>playwright-test-site-yn7dptrbqa-as.a.run.app</em></a><em> — login: </em>uat1-test@gmail.com / Abcd1234# (expires 23 May 2026)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5d81fe15806f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Automation Mirage: Beyond the Cost-Cutting Illusion]]></title>
            <link>https://medium.com/@fred.chan_92610/the-automation-mirage-beyond-the-cost-cutting-illusion-29a2820cca32?source=rss-1eb32ccb2753------2</link>
            <guid isPermaLink="false">https://medium.com/p/29a2820cca32</guid>
            <category><![CDATA[digital-transformation]]></category>
            <category><![CDATA[automation-software]]></category>
            <category><![CDATA[business-strategy]]></category>
            <category><![CDATA[workforce-development]]></category>
            <category><![CDATA[technology-innovation]]></category>
            <dc:creator><![CDATA[Fred Chan]]></dc:creator>
            <pubDate>Wed, 18 Dec 2024 13:05:48 GMT</pubDate>
            <atom:updated>2024-12-18T13:06:30.242Z</atom:updated>
            <content:encoded><![CDATA[<p>In a typical boardroom scenario, a frustrated CEO demands an explanation for the latest software glitch. The IT Manager, under pressure, blurts out the magic words: “<strong>We need automation testing!</strong>”</p><p>But is this the silver bullet, or just another buzzword bandied about in high-level meetings?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z-ZMfeSXVgn5qPBiF1Orqw.png" /><figcaption>Credit: Microsoft Copilot</figcaption></figure><p>The allure of software automation has become a siren song in corporate corridors, promising salvation through technological efficiency. Executives lean forward, eyes gleaming at the prospect of slashing costs, eliminating human error, and transforming their organizations into lean, mean, digital machines. Yet, beneath this seductive narrative lies a far more complex reality.</p><p><strong>The Seductive Power of Automation</strong></p><p>Automation has become the ultimate business panacea. In boardrooms across industries, it’s marketed as a straightforward solution to seemingly insurmountable challenges. The pitch is compelling: reduce labor costs, increase productivity, and minimize human error — all with the click of a button. Executives hear a narrative of round-the-clock operations, standardized processes, and immediate return on investment.</p><p>But here’s the uncomfortable truth: software automation is not a magic wand. It’s a strategic tool that requires significant investment, expertise, and a nuanced understanding of organizational dynamics.</p><p><strong>The Hidden Costs of Quick Fixes</strong></p><p>The upfront costs of automation are far from trivial. Beyond the glossy presentations and promising demos, organizations must contend with substantial expenses. Software licenses, complex hardware infrastructure, and the development of sophisticated integration systems demand significant financial commitment. Moreover, the human element cannot be overlooked.</p><p>Contrary to popular belief, automation doesn’t eliminate the need for skilled professionals — it transforms their roles. Data scientists, engineers, and specialist teams become crucial in designing, developing, and maintaining these automated systems. The workforce isn’t replaced; it’s reimagined.</p><p><strong>Strategic Value Over Cost-Cutting</strong></p><p>True digital transformation transcends mere cost reduction. Forward-thinking organizations recognize automation as a catalyst for innovation and competitive advantage. Consider the potential: AI-powered chatbots delivering personalized customer experiences, predictive maintenance systems preventing equipment failures before they occur, and data-driven strategies that transform decision-making processes.</p><p>These aren’t pipe dreams but tangible realities for organizations willing to look beyond the simplistic “cut costs” narrative.</p><p><strong>Navigating the Automation Landscape</strong></p><p>Successful automation requires a strategic approach:</p><p>1. Establish clear, measurable goals that extend beyond immediate financial savings.<br>2. Conduct thorough cost-benefit analyses that consider long-term organizational impact.<br>3. Implement pilot programs to test feasibility and identify potential challenges.<br>4. Create a culture of continuous monitoring and adaptive improvement.</p><p><strong>The Human Element</strong></p><p>Perhaps the most critical aspect of automation is recognizing that technology serves human objectives, not the other way around. Upskilling the workforce, fostering a culture of continuous learning, and maintaining human creativity and critical thinking remain paramount.</p><p><strong>A Call for Nuanced Dialogue</strong></p><p>It’s time to reframe the conversation. Automation should not be viewed as a cost-cutting mechanism but as a strategic enabler of innovation, efficiency, and growth. Organizations must cultivate a more sophisticated understanding that balances technological potential with human expertise.</p><p>The next time someone in a boardroom suggests automation as a simple solution, pause. Ask deeper questions. Explore the strategic implications. Recognize that true digital transformation is a journey of continuous learning, adaptation, and human-centered innovation.</p><p>In the end, software automation is not about replacing humans — it’s about empowering them to achieve extraordinary things.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29a2820cca32" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>