Latest / AI Fire Daily / #39 Neil: A Guide To A Context-Aware AI Development Workflow
Transcript
- 0:00We've all been there, haven't we? You're deep
- 0:02in your code, you've got your AI helper running,
- 0:04and you ask it something. Maybe refactor a component,
- 0:07debug a little function, and it just completely
- 0:11misses the point. Oh yeah. Is your old code,
- 0:12or it's like, it's got digital amnesia. Forgets
- 0:16everything you just told it about the project
- 0:17structure, like five minutes ago. Digital amnesia,
- 0:20I like that. It's spot on, really. You're in
- 0:24the zone, things are clicking, and then the AI
- 0:26just... loses the plot entirely, super frustrating.
- 0:30Exactly, and that frustration, that constant
- 0:34need to re -explain things, that's really what
- 0:36we're diving into today. Our goal is basically
- 0:39mastering AI context so we can all be more productive,
- 0:42because the core issue is that lack of... continuous
- 0:46context. These tools often feel like a blank
- 0:48slate every time you prompt them. Which waste
- 0:50so much time. It really does. And it's a known
- 0:53problem, right? People are thinking about this.
- 0:54There's even this kind of futuristic idea floating
- 0:58around called MCP servers, Model Context Protocol
- 1:00servers. The idea is these servers would let
- 1:04AIs automatically tap into a project's full context.
- 1:07Like, really understand. Think of it like a permanent
- 1:11memory for the AI. Deep understanding. Yeah,
- 1:13and it's important to say, while these dedicated
- 1:17MCP servers themselves might still be mostly
- 1:19concepts, maybe just around the corner, the ideas
- 1:21driving them, those are incredibly valuable right
- 1:24now. They give us a sort of roadmap for how we
- 1:27can... today, teach our current AIs, chat, GPT,
- 1:30Gemini, Claude, whatever you use, teach them
- 1:33to grasp our projects on a much deeper level.
- 1:36Exactly. So that's our mission for this deep
- 1:38dive. We're going to unpack 10 practical techniques,
- 1:41all based on those MCP ideas, things you can
- 1:43actually use now, to give your AI a better memory,
- 1:45basically, a clearer picture of your project,
- 1:48which should really boost your productivity,
- 1:50get the AI working with you, not against you.
- 1:52So think of this as just a calm, curious look
- 1:56at how we can make AI truly work for us, moving
- 1:59beyond those simple one -off questions towards
- 2:02something more like an informed partnership.
- 2:05Let's dig in. OK, so first up, something really
- 2:08fundamental, the project structure itself. This
- 2:12first idea comes from the concept of a file system
- 2:14MCP. Imagine an AI server that could just read
- 2:17and understand your whole project directory.
- 2:19Know where every file is automatically. Exactly.
- 2:22So how do we do that now, practically speaking?
- 2:24Well, it's actually pretty straightforward. Before
- 2:26you ask the AI to do something involving files,
- 2:29give it the structure first. You can just run
- 2:31a tree if you're on Windows or Ellsvoord R on
- 2:34Mac or Linux. Copy that output. Paste it right
- 2:37into your prompt. It's like, here are the blueprints.
- 2:39Gotcha. So you'd say something like? Yeah, you'd
- 2:41say, here's my project's directory structure.
- 2:43Then paste the tree output. And then follow up
- 2:46with, OK, I just moved button .tsx from Cirque
- 2:49Components over to Cirque Design System Adams.
- 2:52Based on the structure I gave you, find all the
- 2:54files and Cirque pages using this button and
- 2:57rewrite their import paths. Ah, OK. You're giving
- 3:00it a concrete map. No guesswork. Precisely. So
- 3:04why is knowing that file location so crucial
- 3:06for the AI? Well, without that map, it's just
- 3:09guessing, right? Especially in a big project,
- 3:12or one that changes a lot. Those guesses about
- 3:15where files are, that leads to wrong suggestions,
- 3:18broken code, just misunderstanding what you even
- 3:21want. Giving it the structure avoids all that
- 3:23hassle. So basically, it prevents AI from making
- 3:26assumptions about file paths. That's the core
- 3:28of it. OK, so that's where things are. What about
- 3:30how they got there? The history. Good point.
- 3:33That leads us straight into Git context. This
- 3:36comes from the Git MCP idea, an AI that knows
- 3:39your commit history, branches, recent changes,
- 3:42the whole story of the code. Like it's been pair
- 3:44programming with you the whole time. Kinda, yeah.
- 3:46So the practical step here is running commands
- 3:48like git log or git diff locally, and then just
- 3:52copying that output into the prompt. Exactly.
- 3:54You give the AI a clear snapshot of the project's
- 3:57evolution. OK, so an example might be... You
- 3:59can say, here's the commit history between tag
- 4:01v1 .2 .0 and the current main branch. Then paste
- 4:04the output of, say, git log v1 .2 .0 .head1 line.
- 4:08Then ask, based only on these commits, please
- 4:11draft some concise release notes for v1 .3 .0.
- 4:15Categorize them into new features, bug fixes,
- 4:17and improvements. Nice. You're giving it the
- 4:19actual changelog, not just bits of code. So how
- 4:22does this historical context make the AI a better
- 4:24collaborator? Well, it shifts it from just generating
- 4:27code to being more like a knowledgeable teammate.
- 4:31OK. It sees the why behind changes, the problem
- 4:34solved, the direction you're heading. Right.
- 4:36So the code it suggests, or the summaries it
- 4:38writes, they're just much more relevant because
- 4:40it gets the intent. It lets AI understand project
- 4:42evolution and recent changes. Yeah, which is
- 4:44crucial. Which leads nicely into the next idea,
- 4:47creating a kind of memory bank. Ah, yes. The
- 4:50Memory Bank, the concept, the Memory Bank MCP,
- 4:53was this server that holds all your project decisions,
- 4:56your coding conventions, architectural rules,
- 4:59and it remembers them across sessions. Dream
- 5:01it, right? No more repeating yourself. Definitely
- 5:03the dream. So how do we mimic that today? You
- 5:06can use features like custom instructions if
- 5:09your AI tool supports them. Or, and this works
- 5:12anywhere, just start every conversation with
- 5:14a really clear system prompt. Okay. Lay down
- 5:18the law from the start. Establish the project's
- 5:21DNA for the AI. So a system prompt might look
- 5:24like. Yeah, like right at the top. System prompt.
- 5:27Okay, for this whole chat, stick to these project
- 5:29rules. One, language is KypeScript. Two, use
- 5:32Axios for all API calls. Three, React components
- 5:36are function components with hooks. Clear rule.
- 5:39Now, help me create a user profile component.
- 5:41I have to admit, I still wrestle with prompt
- 5:43drift myself sometimes. Keeping the AI consistently
- 5:46on track can be genuinely tough. Well, for sure,
- 5:49it happens. But this memory bank approach, setting
- 5:52it up, what's the biggest benefit? Does it outweigh
- 5:54that initial effort? That's a fair question.
- 5:57It does take a little setup. But think about
- 5:58how much time you spend correcting the AI later,
- 6:01right? Re -explaining conventions, fixing code
- 6:04that doesn't fit the pattern. That drift adds
- 6:06up. So this memory bank approach, it front loads
- 6:09that effort, but it pays off over time with consistency.
- 6:13It ensures consistent AI behavior across all
- 6:15interactions. Exactly. Consistency is key. And
- 6:18speaking of keys, knowing how the pieces connect.
- 6:21Absolutely. Which brings us to analyzing code
- 6:24relationships. This is inspired by the knowledge
- 6:27graph memory idea, an AI server that automatically
- 6:30maps out all the dependencies. Which functions
- 6:32call which? Which components use others? Like
- 6:35a big interconnected web. Wow, that would be
- 6:38powerful. How do we approximate that? We can
- 6:39use our IDEs, actually, features like find all
- 6:42references or go to definition. Ah, okay. Use
- 6:45the tools we already have. Right. Get that dependency
- 6:48info and then feed it to the AI. So you could
- 6:50say... You might prompt it like this. Okay, I'm
- 6:53refactoring the Calculaprice function in utilscalculations
- 6:56.js. My IDE shows it's used in the components
- 7:00card .js, page checkout .js, and order service
- 7:05.js. Based on that, what are the potential risks
- 7:08here, and what steps should I take to avoid breaking
- 7:11things during the refactor? Okay, so you're giving
- 7:13it the dependency map. Why is understanding these
- 7:16links so important for the AI? Because it lets
- 7:18the AI predict the ripple effects. If it knows
- 7:21everywhere that calculate price function is used,
- 7:23it can warn you before you break something downstream.
- 7:25Oh, yeah. It can suggest safer ways to refactor.
- 7:28It shifts it from just coding to being more preventative.
- 7:31It helps AI foresee impact and avoid breaking
- 7:34things. Which is always good, less debugging.
- 7:36What about external info, like docs? Yeah, good
- 7:38question. Technique five is about retrieving
- 7:41web and API documentation. This comes from the
- 7:44Fetching Context 7 MCP ideas. The vision was
- 7:48an AI that could just pull the latest docs for
- 7:50any library, automatically. Instant up -to -date
- 7:53info. Okay, so for now, it's on us. For now,
- 7:55yeah. Instead of hoping the AI finds the right
- 7:58docs, or worse, makes something up. Hallucinates.
- 8:01Exactly. You go to the official docs yourself,
- 8:03copy the relevant bit, could be text, could be
- 8:05a code example, and paste that directly into
- 8:07your prompt. You're curating the info. Okay,
- 8:09so like... I'm using chart .js version 4 .4.
- 8:12Here's the official docs snippet for donut charts.
- 8:16Then you paste the snippet. Right. And then based
- 8:18on this specific documentation, write the code
- 8:21for a donut chart showing this data. Sales 60,
- 8:25marketing 25, dev 15. You're giving it the ground
- 8:28truth. How does providing that specific curated
- 8:31info prevent those AI hallucinations? Well, it
- 8:34directly counters them. You're providing concrete
- 8:36facts from a trusted source. The AI doesn't have
- 8:39to guess or rely on possibly outdated training
- 8:41data. Right. It has the authoritative answer
- 8:43right there. Dramatically boosts accuracy and
- 8:45reliability. It provides concrete factual knowledge
- 8:48for the AI. Makes sense. Less time debugging
- 8:51the AIs on the app than the creativity. Exactly.
- 8:54OK, next up, leveraging intelligent search. This
- 8:58stems from the Tavoli MCP concept, a specialized
- 9:01search engine for developers. Understood code?
- 9:04problems. That sounds amazing. So how do we get
- 9:06close to that now? If you're using an AI with
- 9:09web browsing built in, like Gemini or the latest
- 9:13chat GPT, you can guide it search. Don't just
- 9:16ask a generic question. Tell it how to search.
- 9:19Instruct it to search, synthesize, and pull answers
- 9:22from reliable sources only. Oh, OK. Like giving
- 9:24it research instructions. Pretty much. So you
- 9:26could say, I'm getting a course. Pre -flight
- 9:28request did not succeed error with AWS Lambda
- 9:31and API Gateway. Please search the web, specifically
- 9:34looking for official AWS documentation and reputable
- 9:37tech articles on configuring cores for this setup.
- 9:40Then summarize the top three common solutions
- 9:42you find. OK, so it's targeted problem solving.
- 9:45What's the key difference between doing that
- 9:46and just Googling it myself? The synthesis part
- 9:49is key. The AI isn't just giving you links. Right.
- 9:52It's reading multiple sources, figuring out the
- 9:54common patterns, the most frequent fixes, and
- 9:57presenting a concise summary. Distilling it down.
- 9:59Yeah. It's a focused, solution -driven search,
- 10:02not just information retrieval. It's a focused,
- 10:05synthesis -driven search, specifically for solutions.
- 10:07That could save a lot of time sifting through
- 10:09search results. Definitely. OK, number seven.
- 10:13Connecting personal notes. Inspired by Obsidian
- 10:16MCP, the idea of an AI plugging directly into
- 10:20your personal knowledge base. Your notes, your
- 10:23requirements. Your brain, basically. Sort of,
- 10:25yeah. How do we do that, practically? You just
- 10:27copy and paste. Open your notes app, Obsidian,
- 10:30Notion, Plain Text, whatever. Find the notes
- 10:32relevant to what you're working on, copy them,
- 10:34paste them into the prompt. Give the AI a peek
- 10:37into your specific thoughts. Exactly. So you
- 10:39could write, here are my notes on the login page
- 10:41requirements, and paste your bullet points, email
- 10:44password fields, standard email validation, password
- 10:47eight chars, Google sign in button, then ask.
- 10:52Based only on these requirements, generate the
- 10:55basic HTML and CSS for this form. How does giving
- 10:58it these personal notes, which aren't really
- 11:00code, how does that personalize the AIs help?
- 11:02It makes the output truly specific to your project,
- 11:06your thinking. Often, the little details, the
- 11:09nuances, the specific constraints, they only
- 11:11live in those notes. Giving the AI that context
- 11:15helps to generate something that actually matches
- 11:17your vision, not just a generic template. AI
- 11:20gains insight into your unique project specifics
- 11:23and thoughts. That's really powerful for getting
- 11:25tailored results. Now, what about really complex
- 11:28tasks? Good transition. Let's talk about applying
- 11:31sequential thinking. This comes from the sequential
- 11:33thinking MCP idea, an AI that automatically breaks
- 11:37down big problems into logical steps, like how
- 11:41an experienced developer thinks. OK. How do we
- 11:43encourage that? This one's actually super easy
- 11:46to apply and really effective. You just explicitly
- 11:48ask the AI to think step by step or break down
- 11:51the problem first. Just tell it to slow down
- 11:53and show its work. Pretty much. It prompts it
- 11:55to use a more structured approach and actually
- 11:57explain its reasoning. So an example. You could
- 11:59say, I need to build a shopping cart feature.
- 12:02Please think step -by -step and outline a detailed
- 12:05plan. Include, one, the data structure for the
- 12:08cart. Two, key API endpoints needed. Add, remove,
- 12:14update. Three, the main client -side logic. Ah,
- 12:18okay. Forces it to be methodical. Does asking
- 12:21it to think step -by -step actually make the
- 12:23AI, like, smarter? or is something else going
- 12:26on? It's less about making it intrinsically smarter
- 12:29and more about forcing it to show its process
- 12:31and follow a logical path. Okay. It reduces the
- 12:33chance of it jumping to conclusions or skipping
- 12:35crucial steps. Right. It guides the AI towards
- 12:38outputs that are more structured, more reliable,
- 12:40easier for us to understand and verify. Less
- 12:43rework. It guides the AI toward more structured,
- 12:45reliable outputs. That are more trustworthy code.
- 12:48Makes sense. Okay. Technique 9 deals with something
- 12:49critical. Handling environment variables securely.
- 12:52based on the InVault MCP concept, an AI server
- 12:55that helps access secrets and environment variables
- 12:57without ever exposing them. Super important.
- 12:59And the rule today is absolutely critical, right?
- 13:02Paramount. You never, ever paste API keys, passwords,
- 13:07any secrets directly into an AI prompt. Full
- 13:10stop. Never, ever. So what do we do? You instruct
- 13:13the AI. to write code that retrieves secrets
- 13:16from environment variables using standard methods,
- 13:19like process .env in Node or os .getinv in Python.
- 13:24OK. Tell it how to get the secret securely. Exactly.
- 13:27So a prompt might be, write a Python function
- 13:29to call the OpenAI API. Do not put the API key
- 13:32in the code. Read it from an environment variable
- 13:35called OpenIAPI key. If that variable isn't set,
- 13:37the function should raise an error. Perfect.
- 13:40Keeps the secret safe, out of the code, out of
- 13:42the prompt. Ooh. Imagine securely managing secrets
- 13:46for like a billion AI queries automatically,
- 13:48never risking exposure. That scale is mind -boggling.
- 13:51It really is. But even on our scale, why is the
- 13:53security aspect just so vital right now? It's
- 13:56just fundamental secure coding practice. Hard
- 13:58coding secrets or accidentally pasting them into
- 14:00a prompt, that's how major breaches happen. Compromised
- 14:03accounts, stolen data. So teaching the AI and
- 14:06ourselves to use environment variables. properly
- 14:09protects that sensitive info. It prevents those
- 14:12potentially catastrophic, really costly mistakes.
- 14:15It's about building secure habits. It protects
- 14:17sensitive information, preventing costly data
- 14:19breaches. Absolutely priceless in the long run.
- 14:22OK, one more. Last one, number 10. Integrating
- 14:24API contracts. Inspired by APSpec MCP, an AI
- 14:28that could read, say, an OpenAPI or Swagger file
- 14:30to know exactly how an API endpoint works. The
- 14:33precise structure, requests, responses. Exactly.
- 14:36So practically, we copy the relevant part of
- 14:38our spec file. That's the idea. Find the specific
- 14:40endpoint definition in your OpenAPI .json or
- 14:43Swagger .yaml. Copy that whole definition, the
- 14:47YAML or JSON block. Paste it directly into the
- 14:49prompt. Give the AI the undeniable contract for
- 14:52that endpoint. OK, so, like, I need a JavaScript
- 14:54function. Here's the OpenATI 3 .0 spec for the
- 14:57user's user endpoint. Then paste the spec lock.
- 14:59Right. Then, based strictly on this spec, write
- 15:02a fetch function called getUserBide that takes
- 15:05userIde. Make sure it handles the 200 success
- 15:07response and the 404 error case correctly, as
- 15:11defined. Got it. How does giving it that explicit
- 15:14API contract make the interaction more precise.
- 15:18It just removes all the ambiguity. The AI doesn't
- 15:21have to guess about parameters or what the response
- 15:23looks like or which status codes mean what. It
- 15:26has the blueprint. Exactly. The code it generates
- 15:28for talking to your API will be perfectly aligned
- 15:30with your backend. Fewer integration bugs, smoother
- 15:34development. It gives AI an exact blueprint for
- 15:37API communication. So that's 10 techniques, 10
- 15:41ways to give our AI better context, all inspired
- 15:44by those future -facing MCP server ideas. And
- 15:48the big idea, the main takeaway here, is pretty
- 15:51simple, really. You don't need to wait for those
- 15:53futuristic servers. You can effectively be the
- 15:55MCP server for your AI. right now. That's it,
- 15:58exactly. The power isn't in waiting for new tools,
- 16:00it's in how we use the tools we have. Adopting
- 16:03that context -first mindset every time you write
- 16:05a prompt, it changes everything. And when you
- 16:06start doing this, providing file structure, get
- 16:09history, that memory bank system prompt, the
- 16:11API specs, you will see a difference, a really
- 16:14noticeable difference. The quality of the AI's
- 16:16output goes way up, and your productivity. It
- 16:20really does get a significant boost. It's about
- 16:22having a richer, more informed, and just more
- 16:25reliable conversation with these tools. And maybe
- 16:27a final thought to leave you with. What if, by
- 16:30giving AI this deeper context, we're not just
- 16:32making the AI more useful, but we're also subtly
- 16:35changing how we approach problem solving, how
- 16:38we structure our own thoughts about the code?
- 16:40That's deep. But yeah, maybe. I'd say just try
- 16:43one or two of these techniques. Next time you're
- 16:45working with an AI, pick one, give it a shot,
- 16:47see how it feels, see what happens. Thank you
- 16:48for joining us for this deep dive on mastering
- 16:50AI context. We really hope it helps you build
- 16:53smarter, build faster, and maybe with a little
- 16:55less frustration.