Claude Code: AI-Powered Development

AI-assisted development workflow for faster, higher-quality builds using iterative testing and architectural thinking.

Claude CodeNext.jsTypeScriptSupabaseTest-Driven

My Approach: Architecture-First, Test-Driven

I use Claude Code as an intelligent pair programmer, but not as a replacement for thinking. I follow a highly iterative, architecture-first approach that emphasizes quick feedback loops, clean slate testing, and persistent debugging until true resolution.

The key difference: I debug from data → state → UI, which mirrors how I build. When integration fails (race conditions, stale state), I go back to architectural fixes rather than quick hacks.

My 6-Layer Architecture

1. Types & Contracts First (Foundation Layer)

Types drive everything. ICPRefinerData, ICPModelType, PrimaryICP - all defined upfront. Strict TypeScript boundaries everywhere. Database schema matches the types (JSONB fields aligned with TS interfaces).

claude-code-session.sh

you@devbefore we build anything, let's define the types for the ICP refiner
claudeCreating type definitions in @/types/icp.ts...
$export interface ICPRefinerData { modelType: ICPModelType; primaryIcp: PrimaryICP; alternatives: AlternativeICP[]; }
you@devperfect. now match the database schema to these types
claudeCreating migration with JSONB columns aligned to TypeScript interfaces...
Types and schema in sync. Foundation ready.

2. Database Schema & API Layer (Data Layer)

Supabase tables (folder_progress, research_journeys), API routes built next. Data persistence is first-class, not an afterthought. I test by checking the database directly.

claude-code-session.sh

you@devcan you see what's in the database?
claudeChecking Supabase tables...
$SELECT * FROM folder_progress WHERE user_id = '...'
claudeI see 3 folders. One has status 'generating', but created_at is 2 hours ago. Looks like a stale state from a failed generation.
you@devyeah clean that up and add a timeout check

3. State Management Architecture (Integration Layer)

Parent containers manage DB sync. Child components manage local workflow. Props down, callbacks up. When this doesn't work seamlessly, I know something is architecturally wrong.

claude-code-session.sh

you@devthe accordion is showing stale data after I accept the primary ICP
claudeLet me check the data flow... Parent (IcpRefinerFolder) syncs with DB, child (PrimaryICPAccordion) manages local state. The callback isn't triggering the parent's refetch.
you@devfix the architecture. callbacks should flow up to trigger DB sync
claudeRefactoring: onAccept callback now triggers parent's mutate() to refetch. One-way data flow restored.
you@devtesting
Data flows correctly now.

4. Component Hierarchy (UI Layer)

Folder → Accordion → Molecules pattern. Atomic design throughout. Components receive data as props, trigger actions via callbacks. UI layer is the last layer built.

claude-code-session.sh

$components/ atoms/ # Button, Input, Badge molecules/ # ICPCard, GenerateButton organisms/ # PrimaryICPAccordion templates/ # IcpRefinerFolder
you@devbuild the UI layer now that data and state are solid
claudeBuilding component hierarchy following atomic design...

5. Testing = End-to-End Integration

I don't test components in isolation. I test full user flows: "Select B2B → generate → accept → hard refresh → should still show B2B". Database resets for clean slate. This catches race conditions, state mismatches, data loss.

claude-code-session.sh

you@devreset icp data again
$supabase db reset --linked
you@devtesting full flow: select B2B → generate → accept → hard refresh
ERROR:After refresh: showing 'No model selected' instead of B2B
you@devdata loss on refresh. check the database
claudeDatabase shows modelType: 'b2b' but UI isn't hydrating. Race condition in initial load.

6. Polish Last (Enhancement Layer)

Animations, onboarding tours, mobile responsiveness - these come after core functionality is proven. But polish shouldn't break core functionality.

claude-code-session.sh

you@devok core features work. now add the onboarding tour and accordion animations
claudeAdding Framer Motion animations and intro.js tour...
you@devthe animation is breaking the accordion collapse
claudeAnimation lifecycle interfering with state updates. Let me add layout='preserve' and adjust timing...
you@devbetter. make sure it still works after hard refresh
Tested 5 times with refresh - animations work, core functionality intact.

What Makes This Different

Most developers use AI for code generation. I use it for architectural thinking. My debugging style reveals the process: "Check the database" (data layer), "What's in console for State check" (state layer), "Runtime TypeError at line X" (UI layer).

I debug from data → state → UI, which mirrors how I build. When integration fails, I go back to architectural fixes.