Files
halloween-test/.claude/git-workflow.md
snowprint 1c7c00204b docs(project): complete project setup and documentation
- Add agent system constitution with time recording standards
- Add Git workflow documentation for all agents
- Add comprehensive time recording policy (UTC + GMT+8)
- Add CHANGELOG with version history
- Add CONTRIBUTING guide with Git workflow and commit conventions
- Add project specification document
- Add README with project overview
- Add .gitignore for macOS and editor files
- Update CLAUDE.md with project requirements and metadata

Project initialized: 2025-10-04 08:50:35 UTC / 16:50:35 GMT+8
2025-10-04 17:31:19 +08:00

5.0 KiB

Git Workflow Reference for AI Agents

Repository Information

Remote URL: ssh://gitea@git.shihong.me:2222/snowprint/halloween-test.git

Agent-Specific Git Guidelines

For All Agents

When working with code:

  1. Always check current branch before making changes
  2. Commit logical units of work separately
  3. Write descriptive commit messages following convention
  4. Never commit without testing changes first

DevOps Engineer Agent - Critical Responsibilities

As the DevOps engineer, you have special responsibilities for version control:

Repository Health

  • Monitor commit history quality
  • Ensure branch strategy is followed
  • Verify no sensitive data is committed
  • Maintain clean, linear history when possible

Pre-commit Validation

Before any commit, verify:

  • No credentials or API keys
  • No large binary files (unless necessary)
  • .gitignore is properly configured
  • File permissions are appropriate
  • No debug code or console.logs left behind

Branch Management

  • Enforce feature branch workflow
  • Ensure main branch is protected
  • Review merge requests for quality
  • Tag releases appropriately

Security Checks

  • Scan for accidentally committed secrets
  • Verify SSH keys are properly managed
  • Ensure repository access is controlled
  • Monitor for suspicious commits

Product Manager Agent

When committing specification or documentation changes:

git commit -m "docs(spec): update event requirements"
git commit -m "docs(readme): clarify deployment process"

Code Reviewer Agent

After reviewing code, document findings:

git commit -m "docs(review): add code review notes for PR #X"

Test Engineer Agent

When adding or updating tests:

git commit -m "test(validation): add HTML5 validation tests"
git commit -m "test(responsive): add mobile layout tests"

UX Expert Agent

When making design-related changes:

git commit -m "style(layout): improve mobile ASCII art display"
git commit -m "feat(a11y): enhance keyboard navigation"

Minimalist Geek Webpage Builder Agent

When implementing features:

git commit -m "feat(page): implement Halloween event page"
git commit -m "feat(ascii): add McDonald's ASCII logo"
git commit -m "style(theme): apply terminal aesthetic"

Commit Message Templates

Feature Implementation

feat(component): add new feature

- Implement core functionality
- Add responsive behavior
- Ensure accessibility compliance

Closes #issue-number

Bug Fix

fix(component): resolve specific issue

- Identify root cause
- Implement solution
- Add regression test

Fixes #issue-number

Documentation

docs(file): update documentation

- Add missing information
- Clarify existing content
- Fix typos and formatting

Common Git Operations

Starting Work

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

Committing Changes

git add <specific-files>  # Prefer specific files over git add .
git commit -m "type(scope): description"

Updating Branch

git fetch origin
git rebase origin/main
# Resolve conflicts if any
git rebase --continue

Pushing Changes

git push origin feature/descriptive-name

What NOT to Commit

Never commit:

  • Passwords, API keys, tokens
  • Private SSH keys
  • Database credentials
  • Personal information
  • Large binary files (unless necessary)
  • IDE-specific files (covered by .gitignore)
  • Temporary or cache files
  • node_modules or similar dependencies

Always commit:

  • Source code
  • Documentation
  • Configuration templates (without secrets)
  • .gitignore file
  • README and guides
  • Project specifications

Emergency Procedures

Accidentally Committed Sensitive Data

# If not pushed yet
git reset --soft HEAD~1
# Remove sensitive data
git add .
git commit -m "fix: remove sensitive data"

# If already pushed - contact DevOps immediately
# May require force push and secret rotation

Wrong Branch

# Move uncommitted changes to correct branch
git stash
git checkout correct-branch
git stash pop

Need to Undo Last Commit

# Keep changes
git reset --soft HEAD~1

# Discard changes (careful!)
git reset --hard HEAD~1

Quality Gates

Before pushing to remote:

  1. Code compiles/runs without errors
  2. All tests pass
  3. HTML5 validation passes
  4. Responsive design verified
  5. Commit message follows convention
  6. No sensitive data included
  7. .gitignore is up to date

Repository Maintenance

Regular Tasks (DevOps)

  • Weekly: Review commit history
  • Monthly: Clean up stale branches
  • Per release: Create version tags
  • Ongoing: Monitor repository size

Release Process

# Create release tag
git checkout main
git pull origin main
git tag -a v1.0.0 -m "Release: Halloween Event Page v1.0.0"
git push origin v1.0.0

Resources

  • Project spec: project-spec.md
  • Contributing guide: CONTRIBUTING.md
  • Project guidance: CLAUDE.md
  • Agent constitution: .claude/constitution.md