From 1163b60cbfa970827aa4756f5962909db90033f8 Mon Sep 17 00:00:00 2001 From: Yash Thakur Date: Mon, 14 Jul 2025 14:09:44 +0530 Subject: [PATCH 1/2] feat: implement GitFlow workflow and collaboration framework - Added comprehensive GitFlow documentation - Created collaboration helper script - Added branch protection guidelines - Created session planning template - Added PR checks workflow - Established develop branch as integration branch - Set up conventional commit standards --- .github/GITFLOW.md | 178 ++++++++++++++++++++++++++++++ .github/SESSION_TEMPLATE.md | 66 +++++++++++ .github/branch-protection.md | 23 ++++ .github/workflows/pr-checks.yml | 46 ++++++++ collaborate.sh | 189 ++++++++++++++++++++++++++++++++ 5 files changed, 502 insertions(+) create mode 100644 .github/GITFLOW.md create mode 100644 .github/SESSION_TEMPLATE.md create mode 100644 .github/branch-protection.md create mode 100644 .github/workflows/pr-checks.yml create mode 100755 collaborate.sh diff --git a/.github/GITFLOW.md b/.github/GITFLOW.md new file mode 100644 index 0000000..84969e5 --- /dev/null +++ b/.github/GITFLOW.md @@ -0,0 +1,178 @@ +# GitFlow Workflow Guide for iOS Timer App + +## 🌊 Branch Structure + +### Main Branches +- **`main`** - Production-ready code (protected) +- **`develop`** - Integration branch for features + +### Supporting Branches +- **`feature/*`** - New features +- **`release/*`** - Release preparation +- **`hotfix/*`** - Emergency fixes for production +- **`bugfix/*`** - Non-emergency bug fixes + +## 🔄 Workflow Rules + +### 1. Feature Development +```bash +# Start a new feature +git checkout develop +git pull origin develop +git checkout -b feature/your-feature-name + +# Work on feature... +git add . +git commit -m "feat: describe your feature" + +# Finish feature +git push origin feature/your-feature-name +# Create PR to develop branch +``` + +### 2. Release Process +```bash +# Start release +git checkout develop +git pull origin develop +git checkout -b release/1.x.x + +# Prepare release... +# Update version numbers, final testing + +# Finish release +git push origin release/1.x.x +# Create PR to main AND develop +``` + +### 3. Hotfix Process +```bash +# Start hotfix +git checkout main +git pull origin main +git checkout -b hotfix/fix-description + +# Fix issue... +git push origin hotfix/fix-description +# Create PR to main AND develop +``` + +## 📝 Commit Message Convention + +We follow [Conventional Commits](https://www.conventionalcommits.org/): + +- `feat:` New feature +- `fix:` Bug fix +- `docs:` Documentation changes +- `style:` Code style changes (formatting, etc.) +- `refactor:` Code refactoring +- `test:` Test additions or changes +- `chore:` Build process or auxiliary tool changes +- `perf:` Performance improvements + +### Examples: +``` +feat: add splash screen with motivational quotes +fix: resolve timer display padding issue +docs: update README with GitFlow information +style: apply Bungee font consistently +refactor: optimize color manager implementation +``` + +## 🤝 Collaboration Protocol + +### Before Starting Work +1. **Discuss the task** - We'll plan together +2. **Create an issue** - Document what we're building +3. **Choose branch type** - feature/bugfix/etc. +4. **Update local** - Always pull latest changes + +### During Development +1. **Regular commits** - Small, focused changes +2. **Test thoroughly** - Run the app, check all features +3. **Update documentation** - Keep README current +4. **Communicate progress** - Let me know if you need help + +### Code Review Process +1. **Self-review** - Check your changes first +2. **Create PR** - With detailed description +3. **Request review** - Tag relevant reviewers +4. **Address feedback** - Make requested changes +5. **Merge** - After approval + +## 🚀 Version Numbering + +We use Semantic Versioning (MAJOR.MINOR.PATCH): +- **MAJOR** - Breaking changes +- **MINOR** - New features (backwards compatible) +- **PATCH** - Bug fixes + +Current Version: 1.0.0 + +## 📋 Checklist for Each Session + +When we work together: +1. [ ] Check current branch +2. [ ] Pull latest changes +3. [ ] Discuss goals for session +4. [ ] Create/update issues +5. [ ] Work on appropriate branch +6. [ ] Test changes +7. [ ] Commit with proper messages +8. [ ] Push and create PR if ready +9. [ ] Update documentation +10. [ ] Plan next steps + +## 🛡️ Branch Protection Rules + +### Main Branch +- Require pull request reviews +- Dismiss stale reviews +- Require status checks +- Include administrators +- No force pushes + +### Develop Branch +- Require pull request reviews +- Require up-to-date branches +- No direct pushes + +## 🔧 GitFlow Commands Reference + +```bash +# Check current branch +git branch + +# Switch to develop +git checkout develop + +# Create feature branch +git checkout -b feature/feature-name + +# Push changes +git push origin feature/feature-name + +# Create pull request +gh pr create --base develop + +# Merge PR +gh pr merge --merge + +# Delete local branch +git branch -d feature/feature-name + +# Delete remote branch +git push origin --delete feature/feature-name +``` + +## 📊 Current Project Status + +- **Current Version**: 1.0.0 +- **Active Branch**: develop +- **Next Features**: TBD in discussion +- **Known Issues**: None + +--- + +*Last Updated: [Current Date]* +*Maintained by: @yashthakur1 & Claude* \ No newline at end of file diff --git a/.github/SESSION_TEMPLATE.md b/.github/SESSION_TEMPLATE.md new file mode 100644 index 0000000..3c4ac0c --- /dev/null +++ b/.github/SESSION_TEMPLATE.md @@ -0,0 +1,66 @@ +# Development Session Plan + +**Date**: [Today's Date] +**Developer**: @yashthakur1 +**Assistant**: Claude + +## 🎯 Session Goals + +1. [ ] Goal 1 +2. [ ] Goal 2 +3. [ ] Goal 3 + +## 📋 Pre-Session Checklist + +- [ ] Current branch checked +- [ ] Latest changes pulled +- [ ] No uncommitted changes +- [ ] Tests passing + +## 🔨 Tasks for This Session + +### Priority 1 +- [ ] Task description +- Branch: `feature/branch-name` +- Estimated time: X minutes + +### Priority 2 +- [ ] Task description +- Branch: `feature/branch-name` +- Estimated time: X minutes + +## 💭 Discussion Points + +- Point 1 +- Point 2 + +## 📝 Session Notes + +[Add notes during the session] + +## ✅ Session Summary + +### Completed +- [ ] Item 1 +- [ ] Item 2 + +### In Progress +- [ ] Item 1 + +### Next Steps +- [ ] Future task 1 +- [ ] Future task 2 + +## 🚀 Post-Session Actions + +- [ ] All changes committed +- [ ] PR created (if applicable) +- [ ] Documentation updated +- [ ] Tests passing +- [ ] Next session planned + +--- + +**Session Duration**: X hours +**Commits Made**: X +**PRs Created**: X \ No newline at end of file diff --git a/.github/branch-protection.md b/.github/branch-protection.md new file mode 100644 index 0000000..0c5e1f3 --- /dev/null +++ b/.github/branch-protection.md @@ -0,0 +1,23 @@ +# Branch Protection Setup + +To enable branch protection for this repository, please follow these steps on GitHub: + +## Main Branch Protection + +1. Go to Settings → Branches +2. Add rule for `main` branch: + - ✅ Require a pull request before merging + - ✅ Require approvals (1) + - ✅ Dismiss stale pull request approvals + - ✅ Require status checks to pass + - ✅ Require branches to be up to date + - ✅ Include administrators + +## Develop Branch Protection + +1. Add rule for `develop` branch: + - ✅ Require a pull request before merging + - ✅ Require approvals (1) + - ✅ Require branches to be up to date + +This ensures code quality and review process. \ No newline at end of file diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 0000000..9f14e35 --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -0,0 +1,46 @@ +name: PR Checks + +on: + pull_request: + branches: [ main, develop ] + +jobs: + build-and-test: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Build + run: | + xcodebuild clean build \ + -project TimerApp.xcodeproj \ + -scheme TimerApp \ + -destination 'platform=iOS Simulator,name=iPhone 15' \ + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_REQUIRED=NO + + - name: Check Swift Format + run: | + if which swiftformat >/dev/null; then + swiftformat --lint TimerApp + else + echo "SwiftFormat not installed, skipping..." + fi + + - name: Comment PR + uses: actions/github-script@v6 + if: always() + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '✅ Build completed successfully!' + }) \ No newline at end of file diff --git a/collaborate.sh b/collaborate.sh new file mode 100755 index 0000000..759b90a --- /dev/null +++ b/collaborate.sh @@ -0,0 +1,189 @@ +#!/bin/bash + +# Collaboration Helper Script for GitFlow +# This script helps maintain consistent workflow + +YELLOW='\033[1;33m' +GREEN='\033[0;32m' +RED='\033[0;31m' +BLUE='\033[0;34m' +NC='\033[0m' # No Color + +echo -e "${BLUE}🤝 iOS Timer App - Collaboration Helper${NC}" +echo "======================================" + +# Function to check current branch +check_branch() { + current_branch=$(git branch --show-current) + echo -e "${YELLOW}📍 Current branch:${NC} $current_branch" +} + +# Function to update branches +update_branches() { + echo -e "${YELLOW}🔄 Updating branches...${NC}" + git fetch --all + git pull origin $(git branch --show-current) +} + +# Function to start new work +start_work() { + echo -e "${BLUE}What would you like to work on?${NC}" + echo "1) New Feature" + echo "2) Bug Fix" + echo "3) Hotfix (Emergency)" + echo "4) Release Preparation" + echo "5) Documentation Update" + + read -p "Enter your choice (1-5): " choice + + case $choice in + 1) + read -p "Feature name (e.g., 'dark-mode'): " feature_name + git checkout develop + git pull origin develop + git checkout -b "feature/$feature_name" + echo -e "${GREEN}✅ Created feature/$feature_name branch${NC}" + ;; + 2) + read -p "Bug description (e.g., 'timer-overflow'): " bug_name + git checkout develop + git pull origin develop + git checkout -b "bugfix/$bug_name" + echo -e "${GREEN}✅ Created bugfix/$bug_name branch${NC}" + ;; + 3) + read -p "Hotfix description (e.g., 'crash-on-launch'): " hotfix_name + git checkout main + git pull origin main + git checkout -b "hotfix/$hotfix_name" + echo -e "${GREEN}✅ Created hotfix/$hotfix_name branch${NC}" + ;; + 4) + read -p "Release version (e.g., '1.1.0'): " version + git checkout develop + git pull origin develop + git checkout -b "release/$version" + echo -e "${GREEN}✅ Created release/$version branch${NC}" + ;; + 5) + git checkout develop + git pull origin develop + git checkout -b "docs/update-$(date +%Y%m%d)" + echo -e "${GREEN}✅ Created documentation branch${NC}" + ;; + *) + echo -e "${RED}Invalid choice${NC}" + ;; + esac +} + +# Function to check status +check_status() { + echo -e "${YELLOW}📊 Repository Status:${NC}" + echo "" + git status --short + echo "" + echo -e "${YELLOW}📝 Recent commits:${NC}" + git log --oneline -5 +} + +# Function to create commit +create_commit() { + echo -e "${BLUE}Commit Type:${NC}" + echo "1) feat - New feature" + echo "2) fix - Bug fix" + echo "3) docs - Documentation" + echo "4) style - Code style" + echo "5) refactor - Code refactoring" + echo "6) test - Tests" + echo "7) chore - Maintenance" + + read -p "Select type (1-7): " commit_type + + case $commit_type in + 1) prefix="feat" ;; + 2) prefix="fix" ;; + 3) prefix="docs" ;; + 4) prefix="style" ;; + 5) prefix="refactor" ;; + 6) prefix="test" ;; + 7) prefix="chore" ;; + *) prefix="chore" ;; + esac + + read -p "Commit message: " message + git add . + git commit -m "$prefix: $message" +} + +# Function to create PR +create_pr() { + current_branch=$(git branch --show-current) + + if [[ $current_branch == "main" ]] || [[ $current_branch == "develop" ]]; then + echo -e "${RED}❌ Cannot create PR from main/develop branch${NC}" + return + fi + + echo -e "${YELLOW}🔀 Creating Pull Request...${NC}" + + if [[ $current_branch == hotfix/* ]]; then + base_branch="main" + else + base_branch="develop" + fi + + gh pr create --base $base_branch --fill +} + +# Function to show collaboration checklist +show_checklist() { + echo -e "${BLUE}📋 Collaboration Checklist:${NC}" + echo "[ ] Discussed task objectives" + echo "[ ] Created/updated GitHub issue" + echo "[ ] Working on correct branch" + echo "[ ] Code follows style guide" + echo "[ ] Tests pass locally" + echo "[ ] Documentation updated" + echo "[ ] Ready for code review" +} + +# Main menu +while true; do + echo "" + echo -e "${BLUE}🚀 What would you like to do?${NC}" + echo "1) Start new work" + echo "2) Check status" + echo "3) Update branches" + echo "4) Create commit" + echo "5) Create pull request" + echo "6) Show checklist" + echo "7) View current branch" + echo "8) Switch branch" + echo "9) Exit" + + read -p "Enter your choice (1-9): " main_choice + + case $main_choice in + 1) start_work ;; + 2) check_status ;; + 3) update_branches ;; + 4) create_commit ;; + 5) create_pr ;; + 6) show_checklist ;; + 7) check_branch ;; + 8) + echo "Available branches:" + git branch -a + read -p "Enter branch name: " branch_name + git checkout $branch_name + ;; + 9) + echo -e "${GREEN}👋 Happy coding!${NC}" + exit 0 + ;; + *) + echo -e "${RED}Invalid choice${NC}" + ;; + esac +done \ No newline at end of file From f2ab35563420def19ed600a14043ed4a15e14164 Mon Sep 17 00:00:00 2001 From: Yash Thakur Date: Mon, 14 Jul 2025 14:11:57 +0530 Subject: [PATCH 2/2] chore: add Claude Code configuration and MCP setup - Added claude_project.json with project metadata - Created MCP server configuration - Added CLAUDE.md with development rules and context - Configured shortcuts and tools for efficient workflow --- .claude/mcp_config.json | 34 +++++++++++++++ .claude/settings.local.json | 3 +- CLAUDE.md | 85 +++++++++++++++++++++++++++++++++++++ claude_project.json | 38 +++++++++++++++++ 4 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 .claude/mcp_config.json create mode 100644 CLAUDE.md create mode 100644 claude_project.json diff --git a/.claude/mcp_config.json b/.claude/mcp_config.json new file mode 100644 index 0000000..f80f798 --- /dev/null +++ b/.claude/mcp_config.json @@ -0,0 +1,34 @@ +{ + "mcpServers": { + "git": { + "command": "mcp-server-git", + "args": [], + "env": { + "REPO_PATH": "/Users/yashthakur/Documents/GitHub/iOS-native-claudeapp" + } + }, + "github": { + "command": "mcp-server-github", + "env": { + "GITHUB_REPO": "yashthakur1/iOS-native-claudeapp" + } + }, + "filesystem": { + "command": "mcp-server-filesystem", + "args": ["/Users/yashthakur/Documents/GitHub/iOS-native-claudeapp"] + }, + "memory": { + "command": "mcp-server-memory", + "env": { + "PROJECT": "iOS Timer App" + } + } + }, + "globalShortcuts": { + "collaborate": "./collaborate.sh", + "update-repo": "./github-repo-update.sh update", + "check-branch": "git branch --show-current", + "sync": "git pull origin $(git branch --show-current)", + "status": "git status --short" + } +} \ No newline at end of file diff --git a/.claude/settings.local.json b/.claude/settings.local.json index db64712..31159bf 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -4,7 +4,8 @@ "Bash(rm:*)", "Bash(mkdir:*)", "Bash(chmod:*)", - "Bash(swift:*)" + "Bash(swift:*)", + "Bash(brew install:*)" ], "deny": [] } diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..578ffce --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,85 @@ +# Claude Code Configuration & Rules + +## 🤖 Project Context + +This is an iOS Timer/Stopwatch app built with SwiftUI. Key characteristics: +- **Design**: Bold, energetic with Bungee font and random vibrant backgrounds +- **Features**: Timer, lap tracking, motivational quotes on splash screen +- **Workflow**: GitFlow with collaborative development + +## 📋 Development Rules + +### 1. GitFlow Compliance +- **ALWAYS** work on appropriate branches (never directly on main) +- **ALWAYS** create PRs for code review +- **ALWAYS** use conventional commits + +### 2. Collaboration Protocol +- **DISCUSS** before implementing major changes +- **PLAN** features using session templates +- **TEST** all changes before committing +- **DOCUMENT** any new features or changes + +### 3. Code Standards +- **Font**: Use Bungee font for all UI text +- **Colors**: Maintain vibrant color scheme with white text +- **Style**: Follow existing SwiftUI patterns +- **Testing**: Ensure app builds and runs before committing + +## 🛠️ Available Tools + +### Scripts +- `./collaborate.sh` - Interactive collaboration helper +- `./github-repo-update.sh` - Repository management +- `./setup-github-cli.sh` - GitHub CLI setup + +### Workflows +- PR checks on all pull requests +- Auto-update repository info + +## 🎯 Current Focus + +- Version: 1.0.0 +- Branch: develop +- Status: Ready for new features + +## 💡 Quick Commands + +```bash +# Start new feature +./collaborate.sh # Choose option 1 + +# Check status +git status + +# Update repository info +./github-repo-update.sh update + +# Create PR +gh pr create --base develop +``` + +## 🚨 Important Notes + +1. **Branch Protection**: main and develop are protected +2. **Commits**: Use conventional format (feat:, fix:, docs:, etc.) +3. **PRs**: Required for all changes +4. **Testing**: Build locally before pushing + +## 📝 Session Workflow + +1. Run `./collaborate.sh` +2. Discuss goals +3. Create appropriate branch +4. Implement changes +5. Test thoroughly +6. Commit with proper message +7. Push and create PR +8. Update documentation + +## 🔗 Resources + +- [GitFlow Guide](.github/GITFLOW.md) +- [Session Template](.github/SESSION_TEMPLATE.md) +- [Branch Protection](.github/branch-protection.md) +- [Repository](https://github.com/yashthakur1/iOS-native-claudeapp) \ No newline at end of file diff --git a/claude_project.json b/claude_project.json new file mode 100644 index 0000000..3afbde0 --- /dev/null +++ b/claude_project.json @@ -0,0 +1,38 @@ +{ + "name": "iOS Timer App", + "description": "Bold iOS stopwatch app with lap tracking, Bungee font, random vibrant backgrounds, and motivational quotes", + "type": "ios-app", + "git": { + "workflow": "gitflow", + "mainBranch": "main", + "developBranch": "develop", + "featurePrefix": "feature/", + "releasePrefix": "release/", + "hotfixPrefix": "hotfix/", + "bugfixPrefix": "bugfix/" + }, + "conventions": { + "commits": "conventional", + "code": { + "language": "swift", + "style": "swiftformat", + "font": "Bungee-Regular" + } + }, + "collaboration": { + "workflow": "collaborative", + "planning": "required", + "review": "required", + "testing": "required" + }, + "tools": { + "scripts": { + "collaborate": "./collaborate.sh", + "updateRepo": "./github-repo-update.sh" + }, + "build": "xcodebuild", + "test": "xctest" + }, + "currentVersion": "1.0.0", + "nextMilestone": "TBD" +} \ No newline at end of file