Chapter 16

Cognitive Workflows: Thinking with AI

This chapter isn't about code. It's about how you use AI to think better. When this clicks, AI stops feeling like a tool and starts feeling like an external extension of your own reasoning.


From Answer Engine to Thinking Partner

Most developers use AI to get answers. Advanced developers use AI to think. The difference is fundamental: asking for answers produces code; thinking with AI produces understanding, better decisions, and ultimately better code.

A cognitive workflow is a structured way of using AI for reasoning, analysis, and exploration — not just code generation. You think out loud with AI, and AI helps you structure, challenge, and extend your own thinking.

The Shift

Beginners ask: "How do I do this?" — and get code. Advanced developers say: "Here's how I'm thinking about this. What am I missing?" — and get insight. The code follows naturally from better thinking.


🧠

Think Out Loud

Share your current thinking with AI, then ask what you're missing. This surfaces blind spots that you can't find alone — because by definition, you can't see your own blind spots.

Here's my current thinking on the data model:

I'm planning to store activities with a member field that
references FamilyMember by name. Each activity has a day
and time. I think filtering will be fast enough since we're
only dealing with ~100 activities per family.

What assumptions am I making that could be wrong?
What problems might I hit that I'm not seeing?

AI might point out: "Referencing by name is fragile — what if a member changes their name? Use an ID reference instead." Or: "100 activities is fine, but what if users want to see a month view? That's 400+ activities to filter on every render." These are the insights that prevent problems weeks later.

🧠

Externalized Working Memory

Human working memory is limited — you can hold about 4—7 items at once. AI has no such limit within a conversation. Use AI as an external memory system: have it track complex context, remember decisions, and maintain a running summary of what's been built.

We've made several decisions in this session. Summarize:

1. All architecture decisions and why we made them
2. Current state of implementation (what's done, what's left)
3. Open questions we haven't resolved yet
4. Any technical debt we've knowingly accepted

This is especially valuable in long sessions where you've been deep in implementation and may have lost track of the bigger picture. AI's summary acts as a checkpoint — you can review it, correct any misunderstandings, and proceed with clarity.

🧠

Idea Expansion Loop

Start with a rough idea and use AI to systematically expand, evaluate, and refine it. This loop transforms vague intentions into concrete, validated plans.

  1. Describe your rough idea — Even if it's vague. "I want some kind of recurring activities feature."
  2. Ask for alternatives — "What are 3-4 different ways to implement recurring activities?"
  3. Critique each alternative — "What are the pros and cons of each approach?"
  4. Choose a direction — You decide based on AI's analysis.
  5. Deepen the chosen approach — "Flesh out approach 2 in detail."

Each cycle transforms the idea: vague → concrete → evaluated → refined. Two or three cycles are usually enough to go from "I want something like..." to a fully specified feature plan.

🧠

Constraint Thinking

Before designing a solution, use AI to help you identify the constraints you should be thinking about. Constraints are often more valuable than requirements — they narrow the solution space and prevent over-engineering.

I'm about to design the authentication system.

Before I start, help me identify all the constraints
I should consider:
- Technical constraints (stack, hosting, budget)
- User experience constraints (login flow, password rules)
- Security constraints (what threats to protect against)
- Scale constraints (how many users, concurrent sessions)
- Legal constraints (data storage, privacy)

Which constraints should I define first because they'll
have the biggest impact on the design?

This workflow prevents the common mistake of designing a solution and then discovering it violates a constraint you didn't think about. By surfacing constraints upfront, you design within the right boundaries from the start.

🧠

Hypothesis Testing

When debugging or making design decisions, formulate your belief as a hypothesis and ask AI to test it. This is faster and more rigorous than vague exploration.

I have a hypothesis about why the filter is slow:

I think the issue is that we're creating a new filtered
array on every render, even when the filter criteria
haven't changed. The component re-renders because
the parent passes a new array reference each time.

Is this hypothesis consistent with the symptoms?
What evidence would confirm or disprove it?
If it's correct, what's the fix?

Framing problems as hypotheses is more productive than asking "why is this slow?" because it gives AI a specific claim to evaluate. AI can confirm, refute, or suggest alternative hypotheses — all of which move you toward the answer faster.

🧠

Meta-Reflection

The most powerful cognitive workflow is also the simplest: ask AI to challenge how you're thinking, not just what you're building.

How am I thinking about this problem incorrectly?

I'm assuming that the family planner needs real-time
sync, but maybe I'm overcomplicating things. Challenge
my assumptions. What would the simplest viable
version actually need?

This question is uncomfortable — it's asking AI to tell you you're wrong. But it's the single most valuable question for avoiding unnecessary complexity. Often, the answer reveals that the simple solution is not only sufficient but actively better.

🧠

Decision Scaffolding

When you're stuck on a complex decision, ask AI to decompose it into smaller, answerable questions. Big decisions become manageable when broken into parts.

I'm stuck deciding how to handle offline support.

Break this decision down into smaller questions I can
answer one at a time. Order them so each answer
informs the next question.

AI might decompose this into: "1. Do your users actually need offline access? 2. If yes, which features must work offline? 3. What data needs to be available locally? 4. How will you handle sync conflicts when they come back online?" Each question is answerable, and the answers build toward the final decision.


The Compound Effect

Cognitive workflows don't just help you on individual tasks — they fundamentally change how you approach problems. Over weeks of practice, you internalize the patterns: you naturally think about constraints before solutions, question your assumptions before implementing, and decompose complex decisions into manageable parts.

The developers who adopt these workflows don't just produce better code. They produce better designs, better decisions, and better thinking — and those compound over every project they work on.


🧪 Practical Exercise

Choose a feature you've been thinking about (or struggling with) and apply three cognitive workflows in sequence:

Notice how the quality of your thinking changes — not just the quality of the code. That's the real value.


Key Takeaways

Previous Chapter AI Prompt Architectures
Next Chapter The Future Developer Skillset