You've carefully organized your project. Clean folder structure. Consistent naming conventions. Clear separation of concerns.
Then you ask AI to add a new feature, and it:
- Creates files in the wrong directories
- Uses different naming patterns than your existing code
- Ignores your architectural decisions entirely
Sound familiar?
This is one of the most common frustrations with AI coding assistants. Let's understand why it happens and how to fix it.
Why AI Ignores Your Structure
1. AI Doesn't "See" Your Full Project
When you make a request, AI typically sees:
- The current file you're editing
- Maybe a few related files
- Your prompt
It doesn't automatically understand:
- Your overall folder structure
- Why you organized things that way
- Your naming conventions across the codebase
- Architectural patterns you've established
AI is working with incomplete information.
2. Training Data Overrides Your Patterns
AI models are trained on millions of codebases. When you ask it to "create a new component," it draws from:
- React documentation patterns
- Popular open-source projects
- Common conventions across many codebases
Your specific project conventions? They're a tiny signal compared to the training data. The AI defaults to "common patterns" rather than "your patterns."
3. No Persistent Memory
Each AI interaction starts relatively fresh. Even if you explained your project structure yesterday, AI doesn't remember:
- That you put utilities in
src/lib/notsrc/utils/ - That you use kebab-case for file names
- That you separate API routes by domain
You end up repeating yourself constantly—or more likely, just fixing the AI's output manually.
4. Instruction Files Are Inconsistent
If you're using static instruction files (AGENTS.md, CLAUDE.md), they might:
- Be outdated compared to your actual patterns
- Be missing entirely in some projects
- Conflict with each other across repos
- Not be specific enough about structure
"Follow clean code principles" doesn't tell AI where to put files.
The Real Cost
This isn't just annoying—it has real consequences:
Constant Corrections
Every AI-generated file needs manual fixes:
- Move to the right directory
- Rename to match conventions
- Refactor to fit your architecture
The productivity gain from AI gets eaten by cleanup work.
Inconsistent Codebase
When corrections slip through code review (they will), your codebase accumulates inconsistencies:
- Some components in
/components, others in/ui - Mixed naming conventions
- Multiple patterns for the same thing
Technical debt grows with every AI interaction.
Developer Frustration
Developers lose trust in AI assistance:
- "It never gets the structure right anyway"
- "I'll just write it myself"
- "AI-generated code always needs rewriting"
You're not getting the productivity benefits AI should provide.
How to Fix It
The Manual Approach (Partial Fix)
You can try to include structure information in every prompt:
Create a new React component for user settings.
Our project structure:
- Components go in src/components/{domain}/
- Use PascalCase for component files
- Each component has index.tsx and styles.ts
- Tests go in __tests__/ subdirectory
Problems:
- Tedious to include every time
- Easy to forget details
- Different developers include different information
- Prompts become walls of text
Project Documentation (Better, Not Great)
You could maintain a PROJECT_STRUCTURE.md file and reference it:
See PROJECT_STRUCTURE.md for conventions.
Create a new component for user settings.
Problems:
- AI might not read the file correctly
- Documentation drifts from reality
- Still requires manual inclusion in prompts
- Not enforced automatically
The SuperClawd Solution (Actually Works)
SuperClawd lets you define your project structure as skills that automatically apply to every AI interaction.
Define Your Structure Once
Create a skill that describes your project organization:
# Project Structure
## Directory Organization
- `/src/components/{domain}/` - React components grouped by domain
- `/src/lib/` - Utility functions and helpers
- `/src/hooks/` - Custom React hooks
- `/src/services/` - API service functions
- `/src/types/` - TypeScript type definitions
## File Naming
- Components: PascalCase (e.g., `UserSettings.tsx`)
- Utilities: camelCase (e.g., `formatDate.ts`)
- Types: PascalCase with `.types.ts` suffix
- Tests: Same name with `.test.ts` suffix
## Component Structure
Each component directory contains:
- `index.tsx` - Main component
- `styles.ts` - Styled components or CSS modules
- `types.ts` - Component-specific types
- `__tests__/` - Test files
## Import Conventions
- Use absolute imports from `@/`
- Group imports: external, internal, relative
- Sort alphabetically within groups
Automatic Application
Once defined, this skill applies to every Claude Code session:
- No need to include in prompts
- Every team member gets the same instructions
- Delivered on demand into every Claude Code session
Stays Current
Update the skill when your structure evolves:
- Change applies instantly across the team
- No files to sync or documentation to update
- Single source of truth
What Good Structure Instructions Include
Directory Mapping
Be explicit about what goes where:
## Where to Put Things
| Type | Location | Example |
|------|----------|---------|
| React components | `/src/components/{domain}/` | `/src/components/auth/LoginForm/` |
| API services | `/src/services/` | `/src/services/userService.ts` |
| Custom hooks | `/src/hooks/` | `/src/hooks/useAuth.ts` |
| Utilities | `/src/lib/` | `/src/lib/formatters.ts` |
| Types | `/src/types/` | `/src/types/user.types.ts` |
| Constants | `/src/constants/` | `/src/constants/routes.ts` |
Naming Conventions
Cover all the cases:
## Naming Conventions
### Files
- Components: `PascalCase.tsx` (e.g., `UserProfile.tsx`)
- Hooks: `camelCase.ts` with `use` prefix (e.g., `useAuth.ts`)
- Services: `camelCase.ts` with `Service` suffix (e.g., `userService.ts`)
- Types: `PascalCase.types.ts` (e.g., `User.types.ts`)
- Tests: `{name}.test.ts` (e.g., `UserProfile.test.tsx`)
### Folders
- Component folders: `PascalCase` (e.g., `UserProfile/`)
- Domain folders: `kebab-case` (e.g., `user-management/`)
### Code
- Variables/functions: `camelCase`
- Constants: `SCREAMING_SNAKE_CASE`
- Types/Interfaces: `PascalCase`
- Enums: `PascalCase` with `PascalCase` members
Architectural Patterns
Explain your patterns:
## Architecture Patterns
### Component Pattern
We use the container/presenter pattern:
- Container components handle logic and state
- Presenter components are pure UI
- Container passes data as props to presenter
### API Layer
- All API calls go through service functions
- Services handle request/response transformation
- Components never call fetch/axios directly
### State Management
- Local state for component-specific data
- React Query for server state
- Context for shared UI state (theme, auth)
Results You Can Expect
Teams using SuperClawd for project structure see:
Immediate Improvements
- AI creates files in correct directories
- Naming matches your conventions
- New code fits your architecture
Long-term Benefits
- Consistent codebase even as team scales
- Faster code reviews (fewer structural issues)
- New developers productive faster (AI teaches patterns)
- Less technical debt from AI-generated code
Common Questions
"What if different projects have different structures?"
Create project-specific skills. SuperClawd lets you have multiple workspaces or skill sets for different projects.
"Our structure is complex—won't this be a huge skill?"
Break it into multiple focused skills:
- Directory Structure
- Naming Conventions
- Component Patterns
- API Patterns
Apply the relevant ones to each project.
"What if someone doesn't agree with the structure?"
That's a team discussion, not an AI problem. Once you agree on conventions, SuperClawd ensures everyone (including AI) follows them.
Stop Fighting Your AI
AI ignoring your project structure isn't inevitable. It happens because AI lacks context about your specific conventions.
Give it that context consistently, and the problem disappears.
SuperClawd makes this automatic:
- Define your structure once
- Apply to every AI interaction
- Keep your codebase consistent
Stop manually fixing AI-generated file locations. Start getting code that fits your project from the first generation.
Ready to make AI respect your project structure? Get started with SuperClawd and create your first structure skill in minutes.
Use code WELCOME for free credits when you sign up!