# Claude's Development Session Checklist

## Starting a New Project

### 1. Initial Setup
```bash
# Create project directory
mkdir -p /home/claude/chat-workflow/projects/{project-name}
cd /home/claude/chat-workflow/projects/{project-name}

# Copy state template
cp /home/claude/chat-workflow/templates/state-template.json ./state.json

# Create subdirectories
mkdir -p requirements architecture src tests deployment docs
```

### 2. Requirements Gathering Checklist
- [ ] Ask about main purpose
- [ ] Identify target users
- [ ] List core features (3-5)
- [ ] Discuss tech preferences
- [ ] Understand timeline
- [ ] Clarify scale expectations
- [ ] Check integration needs
- [ ] Review security requirements
- [ ] Confirm deployment target
- [ ] Define success metrics

### 3. Architecture Phase Checklist
- [ ] Create system design diagram
- [ ] Design database schema
- [ ] Define API endpoints
- [ ] Plan authentication flow
- [ ] Document data flow
- [ ] Create component diagram
- [ ] List external dependencies
- [ ] Define error handling strategy
- [ ] Plan testing approach
- [ ] Get user approval

### 4. Implementation Checklist

#### Backend Setup
```bash
# Node.js project
npm init -y
npm install express cors dotenv
npm install -D nodemon jest eslint

# Python project
python -m venv venv
source venv/bin/activate
pip install flask flask-cors python-dotenv
pip install -D pytest black flake8
```

#### Frontend Setup
```bash
# React with Vite
npm create vite@latest frontend -- --template react
cd frontend
npm install axios react-router-dom

# Next.js
npx create-next-app@latest frontend
cd frontend
npm install axios
```

#### Database Setup
```bash
# PostgreSQL with Prisma
npm install prisma @prisma/client
npx prisma init

# MongoDB
npm install mongoose

# Redis
npm install redis
```

### 5. Testing Checklist
- [ ] Unit tests for utilities
- [ ] API endpoint tests
- [ ] Integration tests
- [ ] Frontend component tests
- [ ] E2E critical paths
- [ ] Performance benchmarks
- [ ] Security tests
- [ ] Error handling tests

### 6. Deployment Checklist
- [ ] Environment variables configured
- [ ] Docker files created
- [ ] Docker compose for local dev
- [ ] Production configs
- [ ] CI/CD pipeline
- [ ] Monitoring setup
- [ ] Logging configured
- [ ] Backup strategy
- [ ] Rollback plan
- [ ] Documentation complete

## Common Commands Reference

### File Operations
```bash
# View project structure
ls -la

# Check current directory
pwd

# View file content
cat filename

# Create and edit files
# Use create_file tool

# Search in files
grep -r "search_term" .
```

### Git Operations (Simulated)
```bash
# Save current state
cp -r src src.backup.$(date +%Y%m%d_%H%M%S)

# View changes
diff src.backup src
```

### Testing Commands
```bash
# Node.js
npm test
npm run test:coverage

# Python
pytest
pytest --cov=.

# Run specific test
npm test -- --testNamePattern="auth"
```

### Docker Commands
```bash
# Build image
docker build -t app-name .

# Run container
docker run -p 3000:3000 app-name

# Docker Compose
docker-compose up
docker-compose down
```

### Process Management
```bash
# Check running processes
ps aux | grep node

# Kill process
kill -9 PID

# Check ports
netstat -tulpn | grep LISTEN
lsof -i :3000
```

## Error Handling Patterns

### Common Issues & Solutions

1. **Port Already in Use**
```bash
# Find and kill process
lsof -i :3000
kill -9 PID
```

2. **Permission Denied**
```bash
chmod +x script.sh
```

3. **Module Not Found**
```bash
npm install missing-module
# or
pip install missing-module
```

4. **Database Connection Failed**
- Check connection string
- Verify credentials
- Ensure database is running

## Communication Templates

### Starting Conversation
"I'll help you build [application type]. Let me start by understanding your requirements. First, could you tell me what the main purpose of this application is?"

### Confirming Understanding
"Based on what you've told me, I understand you need [summary]. Is this correct? Should I proceed with this approach?"

### Showing Progress
"I've completed [component]. Here's what I've implemented: [brief description]. Let me show you the code and test it."

### Requesting Feedback
"I've implemented [feature] with [approach]. Would you like me to modify anything or shall I continue with [next step]?"

### Handling Issues
"I encountered [issue]. I can solve this by either [option 1] or [option 2]. Which approach would you prefer?"

## Quality Checks

### Before Moving to Next Phase
- [ ] Current phase tasks complete
- [ ] Code tested and working
- [ ] User feedback incorporated
- [ ] Documentation updated
- [ ] State.json updated
- [ ] No critical issues pending

### Before Deployment
- [ ] All tests passing
- [ ] Security vulnerabilities checked
- [ ] Performance acceptable
- [ ] Documentation complete
- [ ] Deployment configs tested
- [ ] Rollback plan ready

## Quick Wins

### Performance
- Add caching (Redis)
- Implement pagination
- Optimize database queries
- Use compression
- Enable CORS properly

### Security
- Input validation
- Rate limiting
- JWT authentication
- HTTPS only
- Environment variables for secrets

### User Experience
- Clear error messages
- Loading states
- Responsive design
- Keyboard shortcuts
- Accessibility features

## Session Management

### Saving Progress
```bash
# Update state.json with current status
# Document completed tasks
# Create backup of working code
```

### Resuming Work
```bash
# Check state.json for current phase
# Review last completed tasks
# Continue from last checkpoint
```

## Remember

1. **Communicate clearly** - Explain what you're doing
2. **Test frequently** - Verify each component works
3. **Get feedback** - Confirm approach before major work
4. **Document well** - Future Claude or user should understand
5. **Follow best practices** - Security, performance, maintainability
