AI Coding Tools Intermediate Project 24 of 24

Build a Smart Code Variable Assistant with AI

Create an AI-powered tool that generates perfect variable names using personas, conversation management, and smart prompting techniques.

What You'll Build

A specialized AI persona that understands different coding contexts (frontend, backend, data science)
Smart variable name suggestions based on code context and purpose
Reusable conversation templates you can save and modify
Multiple naming conventions (camelCase, snake_case, kebab-case) with explanations
A personal library of your best variable naming patterns

What You'll Need

Claude or ChatGPT

We'll use either Claude or ChatGPT to create our variable naming assistant. Both work great for this project.

Text Editor

Any text editor to save your prompts and organize your variable naming templates.

1

Create Your Variable Naming Persona

First, we'll create a specialized AI persona that understands different coding contexts and can suggest appropriate variable names. This persona will adapt its suggestions based on whether you're working on frontend, backend, or data science code.

Prompt to Copy

You are VariableWiz, an expert programming assistant specialized in creating perfect variable names. Your expertise covers:

- Frontend development (React, Vue, vanilla JS)
- Backend development (Node.js, Python, Java)
- Data science and analysis
- Database design
- API development

When I give you code context, you should:
1. Suggest 3-5 variable name options
2. Explain why each name works well
3. Show the appropriate naming convention (camelCase, snake_case, etc.)
4. Consider readability, maintainability, and team standards
5. Ask clarifying questions if the context isn't clear

Your tone should be helpful and educational. Always explain your reasoning so I can learn better naming patterns.

Reply with 'I'm VariableWiz, your variable naming expert! What code are you working on?' to confirm you understand this role.

What to look for: The AI should respond as VariableWiz and confirm it understands its role as a variable naming expert. It should ask what code you're working on, showing it's ready to help with specific contexts.

2

Test Your Persona with Real Code

Now let's test VariableWiz with a real coding scenario. We'll give it some context and see how it suggests variable names, focusing on getting multiple options with clear explanations.

Prompt to Copy

I'm building a React component that displays a user's profile information. I need variables for:

1. A boolean that tracks if the user's data is currently loading
2. An object that holds all the user's personal information (name, email, avatar, etc.)
3. A function that handles updating the user's profile picture
4. An array that contains the user's recent activity items
5. A string that stores any error messages from API calls

This is for a team project using TypeScript, so clarity is important. What would you suggest?

What to look for: VariableWiz should provide multiple naming options for each variable, explain why each name works well, use appropriate React/JavaScript conventions (camelCase), and consider the TypeScript context you mentioned.

3

Save This Conversation as a Template

Now we'll save this conversation so you can reuse this VariableWiz setup anytime. In ChatGPT, you'll use the share feature. In Claude, you'll copy the conversation URL and save the initial persona prompt.

For ChatGPT Users

1. Click the share button in your ChatGPT conversation
2. Copy the shared link
3. Create a new text file and save this template:

# VariableWiz Template - Saved [Today's Date]

## Initial Persona Prompt:
[Paste the VariableWiz persona prompt from Step 1]

## Sample Usage:
[Paste your React component example from Step 2]

## ChatGPT Share Link:
[Paste the shared conversation link here]

## Notes:
- Works great for React/TypeScript projects
- Always gives multiple options with explanations
- Good for team projects where clarity matters

What to look for: You should have a reusable template that lets you quickly restart VariableWiz conversations. Test the shared link to make sure it loads your persona correctly.

4

Create Context-Specific Variations

Let's create specialized versions of VariableWiz for different coding contexts. This shows how persona variations can adapt to specific needs while maintaining the core functionality.

Database VariableWiz Prompt

You are DatabaseWiz, a specialized variable naming expert for database work. You focus on:

- SQL table and column names
- Database connection variables
- Query result variables
- Migration and schema naming
- ORM model properties

Your naming suggestions should:
1. Follow database conventions (snake_case typically)
2. Be clear for other developers reading queries
3. Consider both singular/plural appropriately
4. Work well with ORMs like Sequelize, Prisma, etc.
5. Avoid reserved SQL keywords

Always provide 3-4 options with explanations of why each works well in database contexts.

I'm working on a database schema for an e-commerce app. I need good names for:
1. A table that stores customer order information
2. A column that tracks when an order was last modified
3. A variable in my Node.js code that holds the database connection
4. A function that calculates total order value including tax

What do you suggest?

What to look for: DatabaseWiz should suggest names using snake_case conventions, explain database-specific considerations, and provide options that work well with both raw SQL and ORM tools.

5

Build Your Variable Naming Library

Finally, let's organize all your variable naming conversations into a personal library. This creates a searchable reference of naming patterns you can use for future projects.

Library Template to Save

# My Variable Naming Library

## Quick Access Links
- General VariableWiz: [Your ChatGPT/Claude link]
- DatabaseWiz: [Your database conversation link]
- Add more specialized versions here...

## Best Patterns I've Learned

### React/Frontend
- Loading states: `isLoading`, `isDataLoading`, `isFetching`
- User data: `userData`, `userProfile`, `currentUser`
- Error handling: `errorMessage`, `apiError`, `validationErrors`

### Database
- Tables: `user_profiles`, `order_items`, `payment_methods`
- Timestamps: `created_at`, `updated_at`, `last_modified`
- Connections: `dbConnection`, `database`, `db`

### Common Functions
- Handlers: `handleSubmit`, `onUserUpdate`, `processPayment`
- Validators: `validateEmail`, `isValidPassword`, `checkPermissions`
- Calculators: `calculateTotal`, `computeDiscount`, `getTaxAmount`

## Project-Specific Patterns
[Add your own discoveries here as you use the tool]

---
Last updated: [Today's date]

What to look for: You should have a growing reference document that combines your saved AI conversations with patterns you've learned. This becomes your personal variable naming guidebook that improves over time.

Common Issues

The AI suggests names that don't match my team's conventions

Add your team's specific naming conventions to the persona prompt. For example: "Our team uses PascalCase for React components and prefixes all boolean variables with 'is' or 'has'."

The more specific you are about your team's standards, the better suggestions you'll get.

ChatGPT shared links aren't working

Make sure you're copying the full share URL and that your conversation isn't too long. Very long conversations sometimes don't share properly.

If sharing fails, save the initial persona prompt in your text file and start fresh when needed.

The AI gives too many options and I get overwhelmed

Modify your persona to ask for fewer options: "Always suggest exactly 3 variable names with brief explanations."

You can also ask follow-up questions like "Which of these 5 options would you recommend most for a beginner team?"

What You Learned

AI Persona Creation

You learned how to create specialized AI personas that adapt their responses to specific coding contexts and provide consistent, expert-level suggestions.

Conversation Management

You practiced saving and organizing AI conversations so you can reuse effective prompts and build a personal library of useful interactions.

Context-Aware Variable Naming

You learned how proper variable naming changes based on context (frontend vs database vs API) and how to get AI to understand these differences.

Reusable AI Workflows

You built a system for creating, testing, saving, and organizing AI-powered workflows that you can use across multiple projects and share with teammates.

Tips for Going Further

Create Language-Specific Versions

Build specialized personas for Python (snake_case), Java (camelCase with specific patterns), or C# (PascalCase for methods). Each language has its own conventions that AI can learn.

Add Code Review Integration

Expand your persona to also review existing variable names in your code and suggest improvements. This helps refactor legacy projects with better naming.

Build Team Templates

Create shared conversation templates that include your team's specific naming conventions, so everyone gets consistent suggestions that match your codebase style.

Track Naming Patterns

Keep notes on which AI suggestions worked best in real projects. This helps you refine your persona prompts and build better naming intuition over time.