<?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: Shadow Coderr</title>
    <description>The latest articles on DEV Community by Shadow Coderr (@shadowcoderr).</description>
    <link>https://dev.to/shadowcoderr</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3909186%2Ff8297d58-4138-42fb-8371-c16632ec81cc.png</url>
      <title>DEV Community: Shadow Coderr</title>
      <link>https://dev.to/shadowcoderr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shadowcoderr"/>
    <language>en</language>
    <item>
      <title>Give Your AI Agent Eyes: Meet ContextGraph — The Offline Flight Recorder for Web Apps</title>
      <dc:creator>Shadow Coderr</dc:creator>
      <pubDate>Sat, 02 May 2026 15:14:52 +0000</pubDate>
      <link>https://dev.to/shadowcoderr/give-your-ai-agent-eyes-meet-contextgraph-the-offline-flight-recorder-for-web-apps-5f98</link>
      <guid>https://dev.to/shadowcoderr/give-your-ai-agent-eyes-meet-contextgraph-the-offline-flight-recorder-for-web-apps-5f98</guid>
      <description>&lt;p&gt;IDE-based AI agents are powerful — but they're &lt;strong&gt;blind&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;GitHub Copilot, Cursor, and Claude can't see your running browser. They don't know your live DOM, your real API traffic, or your accessibility tree. They're writing tests for an app they've never actually &lt;em&gt;seen&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;ContextGraph fixes that.&lt;/strong&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  What Is ContextGraph?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.npmjs.com/package/@shadowcoderr/context-graph" rel="noopener noreferrer"&gt;ContextGraph&lt;/a&gt; is a CLI tool that acts like a &lt;strong&gt;flight data recorder for your browser&lt;/strong&gt;. You navigate your app manually — it silently captures everything: DOM snapshots, accessibility trees, network traffic, screenshots, Playwright locators, and more.&lt;/p&gt;

&lt;p&gt;When you're done, it exports a single &lt;code&gt;ai_context_bundle.md&lt;/code&gt; file you can paste directly into any AI agent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your AI can now "see" your app — without MCP, without cloud, without any security compromise.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @shadowcoderr/context-graph
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  The Problem It Solves
&lt;/h2&gt;

&lt;p&gt;In enterprise environments, MCP is frequently &lt;strong&gt;blocked by security policy&lt;/strong&gt;. Cloud-based recording tools are off the table. AI agents generate hallucinated selectors because they've never seen your actual UI.&lt;/p&gt;

&lt;p&gt;The result? You spend more time fixing broken AI-generated tests than writing them yourself.&lt;/p&gt;

&lt;p&gt;ContextGraph bridges this gap using only &lt;strong&gt;Playwright&lt;/strong&gt; — already whitelisted on most QA teams' machines — and outputs structured, offline, AI-ready intelligence.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Your Browser Session → ContextGraph → Structured Output → AI Agent → Generated Tests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  ⚡ Quick Start (Under 2 Minutes)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Install&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @shadowcoderr/context-graph
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Capture your app&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;context-graph &lt;span class="nt"&gt;--mode&lt;/span&gt; browser &lt;span class="nt"&gt;--url&lt;/span&gt; https://your-app.com
&lt;span class="c"&gt;# Navigate freely — every page is captured automatically&lt;/span&gt;
&lt;span class="c"&gt;# Press Ctrl+C when done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Paste into your AI agent&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="c"&gt;# Bundle auto-generates at:
&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;-&lt;span class="n"&gt;graph&lt;/span&gt;-&lt;span class="n"&gt;output&lt;/span&gt;/&lt;span class="n"&gt;bundles&lt;/span&gt;/&lt;span class="n"&gt;ai_context_bundle&lt;/span&gt;.&lt;span class="n"&gt;md&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste it into Copilot Chat, Cursor, or Claude → ask for tests → done.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔑 What Gets Captured
&lt;/h2&gt;

&lt;p&gt;For every page you navigate, ContextGraph saves:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;File&lt;/th&gt;
&lt;th&gt;What's Inside&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;DOM&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Sanitised HTML — scripts stripped, Shadow DOM inlined&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;a11y_tree.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Full ARIA hierarchy — most semantically dense representation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;locators.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;5+ selector strategies per element, ranked by resilience&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;api_inventory.json&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Every API endpoint observed, normalised path params&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;screenshot.png&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Full-page capture&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ai_context_bundle.md&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Everything above in one file, ready for your AI&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  🔒 Enterprise-Safe by Design
&lt;/h2&gt;

&lt;p&gt;Security wasn't an afterthought. ContextGraph enforces a &lt;strong&gt;5-layer redaction pipeline before any disk write&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Header stripping (auth, cookie, x-api-key)&lt;/li&gt;
&lt;li&gt;URL sanitisation (token, api_key, secret, password params)&lt;/li&gt;
&lt;li&gt;Pattern matching (JWT, Bearer, credit cards, SSNs, AWS keys)&lt;/li&gt;
&lt;li&gt;Key-based redaction&lt;/li&gt;
&lt;li&gt;Custom user-defined rules&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Hardcoded invariants that cannot be disabled:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; content is always stripped&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;type="password"&lt;/code&gt; inputs are always &lt;code&gt;[REDACTED]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Zero outbound connections. Zero telemetry. Zero update checks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Every redaction is logged to &lt;code&gt;logs/redaction_audit.jsonl&lt;/code&gt; for compliance review.&lt;/p&gt;




&lt;h2&gt;
  
  
  🤖 Real AI Workflow Example
&lt;/h2&gt;

&lt;p&gt;After pasting &lt;code&gt;ai_context_bundle.md&lt;/code&gt; into your AI agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I am testing the app shown in this session context.

Using ONLY the locators from the "Interactive Elements" tables above,
generate Playwright TypeScript tests that:
  1. Navigate to the login page and log in with valid credentials
  2. Assert the dashboard renders correctly
  3. Test the shopping cart add/remove flow
  4. Cover the checkout form submission

Use test.describe() groups per page. Include assertions for
visible elements and navigation outcomes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No hallucinated selectors. No guessed API paths. Your AI works from &lt;strong&gt;ground truth&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  🏢 4 Enterprise Patterns
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Pattern A — AI Test Generation&lt;/strong&gt;&lt;br&gt;
Browse your app → paste bundle → get &lt;code&gt;.spec.ts&lt;/code&gt; files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pattern B — Regression Detection&lt;/strong&gt;&lt;br&gt;
Capture before and after a release. Compare locator drift to find tests that will break &lt;em&gt;before&lt;/em&gt; they break in CI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pattern C — Undocumented App Onboarding&lt;/strong&gt;&lt;br&gt;
Spend 1–2 hours navigating an unfamiliar internal app → &lt;code&gt;api_inventory.json&lt;/code&gt; gives you a full API surface. No Swagger docs needed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pattern D — Manual Test Conversion&lt;/strong&gt;&lt;br&gt;
Follow your manual test script step-by-step in recorder mode → output is a &lt;code&gt;.spec.ts&lt;/code&gt; file.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why This Matters for QA Teams
&lt;/h2&gt;

&lt;p&gt;Most AI coding tools are built for greenfield development. QA engineers deal with the messy reality of &lt;strong&gt;legacy apps, undocumented APIs, and locked-down enterprise environments&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;ContextGraph was built specifically for that reality:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;✅ No cloud required&lt;/li&gt;
&lt;li&gt;✅ No MCP required
&lt;/li&gt;
&lt;li&gt;✅ Works inside enterprise perimeters&lt;/li&gt;
&lt;li&gt;✅ Uses Playwright (already approved on most teams)&lt;/li&gt;
&lt;li&gt;✅ Produces audit-ready redaction logs&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Try It Now
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; @shadowcoderr/context-graph
context-graph &lt;span class="nt"&gt;--mode&lt;/span&gt; browser &lt;span class="nt"&gt;--url&lt;/span&gt; https://your-app.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📦 &lt;a href="https://www.npmjs.com/package/@shadowcoderr/context-graph" rel="noopener noreferrer"&gt;npm package&lt;/a&gt;&lt;br&gt;
⭐ &lt;a href="https://github.com/shadowcoderr/ContextGraph" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;&lt;br&gt;
📖 &lt;a href="https://github.com/shadowcoderr/ContextGraph/blob/main/README.md" rel="noopener noreferrer"&gt;Full Documentation&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Give your AI the eyes it was missing.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If this saved you time or unblocked your team, drop a ⭐ on GitHub and share it with your QA community — it means a lot as an indie dev.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>playwright</category>
      <category>testing</category>
      <category>ai</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
