Skip to content

Quick Reference โšก

Start here! Common commands and workflows for Nutri-E development.

๐Ÿ“š Need details? See Full Documentation Index


Daily Workflow

1. Start New Work

git checkout main
git pull origin main
git checkout -b feature/your-feature-name

2. Make Changes & Commit

git add .
git commit -m "feat: Your change description"
git push -u origin feature/your-feature-name

3. Found a Problem? Create an Issue

If you discover bugs or issues NOT related to your current task:

gh issue create --title "Brief problem description" --body "$(cat <<'EOF'
## Problem
[What's wrong]

## Evidence
[Logs, timeline, examples]

## Proposed Fix
[How to fix it]

## References
[Links to files, PRs, issues]
EOF
)"
See CLAUDE.md โ†’ Issue Tracking for full format and Issue #50 example.

4. Create Pull Request

gh pr create --title "feat: Your feature" --body "Description"

# Auto-merge workflow monitors PR automatically
# (Handled by .github/workflows/auto-merge.yml)

# Wait for CI and Copilot review
sleep 90

# Resolve any conversations to unblock auto-merge
./scripts/resolve-pr-conversations.sh $(gh pr view --json number -q .number)

# Auto-merge will proceed automatically once all checks pass

5. After PR Merges - Clean Up

./scripts/cleanup-branches.sh

Common Commands

iOS Development

# Build project
xcodebuild -project ios/Nutri-E/Nutri-E.xcodeproj -scheme Nutri-E build

# Run tests
xcodebuild test -project ios/Nutri-E/Nutri-E.xcodeproj -scheme Nutri-E -destination 'platform=iOS Simulator,name=iPhone 15'

# Open in Xcode
open ios/Nutri-E/Nutri-E.xcodeproj

Cloudflare Workers

# Deploy to sandbox
cd cloudflare-worker-[name]
wrangler deploy --env sandbox-v2

# Deploy to production
wrangler deploy --env v2

# View logs
wrangler tail --format=pretty

Testing & Quality

# Check AI instruction sync
./scripts/check-ai-sync.sh

# Run DSLD tests
cd ios/Nutri-E
python3 test_dsld_forms.py

Memory MCP (Claude Code)

# Session start - recall all context
get_context(project: "nutri-e")
recall_decisions(project: "nutri-e")
recall_learnings(project: "nutri-e")

# Store new information
set_context(project: "nutri-e", key: "...", value: "...")
remember_decision(project: "nutri-e", decision: "...", rationale: "...")
remember_learning(project: "nutri-e", category: "gotcha|pattern|best-practice", content: "...")
remember_error(project: "nutri-e", error_pattern: "...", solution: "...")

# Debug - find solutions to errors
find_solution(project: "nutri-e", error: "error message")
search_all(project: "nutri-e", query: "search term")

File Locations

What Where
iOS App ios/Nutri-E/Nutri-E/
iOS Tests ios/Nutri-E/Nutri-ETests/
Core Data Models ios/Nutri-E/Nutri-E/Nutri_E.xcdatamodeld/
Services ios/Nutri-E/Nutri-E/Services/
Views ios/Nutri-E/Nutri-E/Views/
OpenAI Worker cloudflare-worker-openai/
DSLD Worker cloudflare-worker-dsld/
Apple Webhook cloudflare-worker-apple/
Scripts scripts/
CI/CD .github/workflows/

Quick Fixes

Problem: iOS build fails

# Clean derived data
rm -rf ~/Library/Developer/Xcode/DerivedData/Nutri-E-*
# Rebuild
xcodebuild clean build

Problem: Worker not deploying

# Check secrets are set
wrangler secret list --env v2
# Redeploy
wrangler deploy --env v2 --force

Problem: Git branch conflicts

# Abort and start fresh
git merge --abort
git checkout main
git pull origin main
git checkout -b feature/new-attempt

Important Notes

Branch Protection

  • โŒ Never commit directly to main
  • โœ… Always create feature branches
  • โœ… PRs required for all changes
  • โœ… Auto-merge enabled when tests pass

Copilot Review

  • Waits 60 seconds for review
  • Auto-resolves conversations after CI passes
  • Can reject suggestions if they don't make sense

Version Bumping

# Bug fix: 1.0.2 Build 30 โ†’ 1.0.2 Build 31
# (increment build number only)
cd ios/Nutri-E
# Edit Nutri-E.xcodeproj/project.pbxproj
# Change CURRENT_PROJECT_VERSION = 30; to CURRENT_PROJECT_VERSION = 31;

# New feature: 1.0.2 โ†’ 1.1.0 Build 1
# (change marketing version, reset build to 1)
# Edit MARKETING_VERSION = 1.1.0;
# Edit CURRENT_PROJECT_VERSION = 1;

IMPORTANT: Always edit project.pbxproj directly and commit via PR. agvtool requires specific directory structure that may not work with all setups.

App Store Production Release

Complete workflow for releasing to App Store:

# 1. Create version bump branch
git checkout main
git pull origin main
git checkout -b chore/bump-version-1.0.X-buildY

# 2. Update version in project.pbxproj
# Edit: CURRENT_PROJECT_VERSION = Y;
# (and MARKETING_VERSION if needed)

# 3. Commit and push
git add ios/Nutri-E/Nutri-E.xcodeproj/project.pbxproj
git commit -m "chore: Bump version to 1.0.X Build Y for App Store release"
git push origin chore/bump-version-1.0.X-buildY

# 4. Create PR and wait for auto-merge
gh pr create --title "chore: Bump version to 1.0.X Build Y for App Store release"

# 5. After merge, create git tag
git checkout main
git pull origin main
git tag -a v1.0.X-buildY -m "Production release: Version 1.0.X Build Y"
git push origin v1.0.X-buildY

# 6. Build and submit in Xcode
open ios/Nutri-E/Nutri-E.xcodeproj
# Product โ†’ Archive
# Organizer โ†’ Validate App
# Distribute App โ†’ App Store Connect

Manual steps in App Store Connect: 1. Go to https://appstoreconnect.apple.com 2. My Apps โ†’ Nutri-E โ†’ + Version 3. Select uploaded build 4. Add release notes 5. Submit for review

Deployment

  • Workers auto-deploy to production on merge to main
  • Manual wrangler deploy is used for sandbox deployments or emergency redeploys
  • iOS releases via TestFlight/App Store Connect (manual submission after build)

Documentation Index

๐Ÿ“˜ Core Docs

๐Ÿ”ง Development Guides

๐Ÿš€ Deployment & CI/CD

๐Ÿงช Testing

๐Ÿ› ๏ธ Scripts

๐Ÿ“ฑ Platform-Specific

๐Ÿ” Security & Privacy


Emergency Contacts

  • GitHub Issues: https://github.com/Stig-Johnny/nutri-e/issues
  • App Store: https://apps.apple.com/us/app/nutri-e/id6753125391
  • Website: https://www.nutrieapp.com

๐Ÿ’ก Tip: Bookmark this page for quick access to common commands!