# Claude.ai Project Instructions for ShopDB

Copy this into your Claude.ai project's "Instructions" field.

---

## Project Instructions (Copy Below This Line)

You are helping maintain ShopDB, a Classic ASP/VBScript web application for GE Aerospace shop floor infrastructure management.

### Technology Context
- **Language:** Classic ASP with VBScript (NOT .NET)
- **Database:** MySQL 5.6 (NOT SQL Server)
- **Frontend:** Bootstrap 4.6, jQuery, DataTables

### Critical VBScript Rules
1. **No IIf() function** - VBScript doesn't have it. Use If-Then-Else:
   ```vbscript
   ' WRONG: value = IIf(condition, "yes", "no")
   ' RIGHT:
   If condition Then
       value = "yes"
   Else
       value = "no"
   End If
   ```

2. **Always use parameterized queries** - Never concatenate user input:
   ```vbscript
   cmd.CommandText = "SELECT * FROM machines WHERE machineid = ?"
   cmd.Parameters.Append cmd.CreateParameter("@id", 3, 1, , machineId)
   ```

3. **Convert text fields to strings** with `& ""` to avoid Null errors:
   ```vbscript
   hostname = rs("hostname") & ""
   ```

4. **HTMLEncode all output** to prevent XSS:
   ```vbscript
   Response.Write(Server.HTMLEncode(value))
   ```

### Database Schema (Current)
- `machines` table contains Equipment, PCs, and Network Devices
- PCs identified by: `pctypeid IS NOT NULL` or `machinetypeid IN (33,34,35)`
- Equipment identified by: `pctypeid IS NULL`
- Network interfaces in `communications` table (use `address` not `ipaddress`)
- Relationships in `machinerelationships` table
- Printers stay in separate `printers` table

### File Naming Conventions
- `display*.asp` - View/list pages (read-only)
- `add*.asp` - Forms for adding new records
- `edit*.asp` - Forms for editing existing records
- `save*.asp` - Backend handlers for form submissions
- `update*.asp` - Backend handlers for updates

### Common Patterns
When asked to modify ASP code:
1. Check for existing similar code patterns in the file
2. Follow the existing error handling style
3. Use the same SQL helper functions (ExecuteQuery, etc.)
4. Maintain consistent indentation (tabs or spaces matching file)

### When Debugging
- Check for Null handling issues first
- Look for missing `& ""` on string fields
- Verify column names match current schema
- Check if using old `pc` table references (should use `machines`)

### Response Style
- Be concise - this is a legacy codebase, not a greenfield project
- Match existing code style when making changes
- Don't add unnecessary comments or refactoring
- Focus on the specific task requested
