スキル一覧に戻る
lorenzogirardi

scm

by lorenzogirardi

0🍴 0📅 2026年1月22日
GitHubで見るManusで実行

SKILL.md


name: scm description: >- Git workflow and source control management for ecommerce team. Covers Conventional Commits, branch strategy, PR workflow, and conflict resolution. Triggers on "git", "commit", "branch", "merge", "rebase", "pull request", "PR", "conventional commits", "git workflow", "push", "commit message". PROACTIVE: MUST invoke when performing Git operations. allowed-tools: Read, Write, Edit, Bash, Glob, Grep

ABOUTME: Git workflow skill for ecommerce project

ABOUTME: Covers Conventional Commits, GitHub Flow, and team collaboration

Source Control Management (SCM) Skill

Quick Reference

PrincipleRule
Atomic CommitsOne logical change per commit
Conventional Commitstype(scope): description format
Branch Namingtype/ticket-description format
PR Size< 400 lines of code changes
Never Force PushTo shared branches (main)

Branching Strategy (GitHub Flow)

main ─────●───────●───────●───────●──────
          │       ↑       │       ↑
          ↓       │       ↓       │
feature ──●──●──●─┘ fix ──●──●────┘

Branches:

  • main: Always deployable (protected)
  • feature/*: New features
  • fix/*: Bug fixes
  • chore/*: Maintenance
  • docs/*: Documentation

Conventional Commits

Format

<type>(<scope>): <description>

[optional body]

[optional footer]

Types

TypeDescriptionExample
featNew featurefeat(cart): add quantity selector
fixBug fixfix(auth): correct token refresh logic
docsDocumentationdocs(api): update endpoint docs
styleFormattingstyle(frontend): fix indentation
refactorCode restructurerefactor(orders): extract validation
testTeststest(catalog): add search tests
choreBuild/toolingchore(deps): update dependencies
perfPerformanceperf(redis): optimize cache keys
ciCI configci(actions): add security scan

Scopes (Ecommerce)

ScopeArea
authAuthentication module
catalogProducts, categories
cartShopping cart
ordersOrder processing
checkoutCheckout flow
frontendNext.js app
backendFastify API
infraTerraform/K8s
ciGitHub Actions

Branch Naming

<type>/<ticket>-<description>

Examples:
- feature/ECOM-123-user-wishlist
- fix/ECOM-456-cart-total-calculation
- chore/ECOM-789-update-node-version

Commit Workflow

TDD Commit Pattern

# Red phase
git add tests/
git commit -m "test(auth): add login validation tests"

# Green phase
git add src/
git commit -m "feat(auth): implement login validation"

# Refactor phase
git add src/
git commit -m "refactor(auth): extract validation helpers"

Multi-line Commit (HEREDOC)

git commit -m "$(cat <<'EOF'
feat(cart): add persistent cart storage

- Store cart in Redis with user session
- Expire after 7 days of inactivity
- Merge guest cart on login

Closes #123
EOF
)"

Pull Request Workflow

Before Creating PR

# 1. Ensure branch is up to date
git fetch origin
git rebase origin/main

# 2. Run tests locally
npm run test

# 3. Check linting
npm run lint

# 4. Review changes
git diff origin/main...HEAD
git log origin/main..HEAD --oneline

PR Description Template

## Summary
- Brief description (1-3 bullet points)

## Changes
- Added X feature
- Modified Y component
- Fixed Z bug

## Testing
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed

## Screenshots (if UI changes)
[Before/After]

## Related Issues
Closes #123

PR Size Guidelines

SizeLinesReview Time
XS< 50Minutes
S50-200< 30 min
M200-400< 1 hour
L400-800Hours
XL> 800Split required

Conflict Resolution

Understanding Conflicts

<<<<<<< HEAD (current branch)
const timeout = 5000;
=======
const timeout = 10000;
>>>>>>> feature-branch (incoming)

Resolution Commands

# Keep current branch version
git checkout --ours path/to/file

# Keep incoming version
git checkout --theirs path/to/file

# After manual resolution
git add path/to/file
git rebase --continue

Safety Rules

Never Do

# Never force push to main
git push --force origin main  # DANGEROUS

# Never rebase shared branches
git rebase main  # on shared feature branch

# Never reset pushed commits
git reset --hard HEAD~3  # if already pushed

Safe Alternatives

# Use force-with-lease
git push --force-with-lease

# Merge instead of rebase on shared
git merge origin/main

# Revert instead of reset
git revert <sha>

Common Operations

Undo Operations

# Undo last commit (keep changes)
git reset --soft HEAD~1

# Undo uncommitted changes
git checkout -- path/to/file

# Revert pushed commit
git revert <sha>

Stashing

# Stash changes
git stash save "WIP: feature description"

# List stashes
git stash list

# Apply and drop
git stash pop

Checklist

Before committing:

  • Changes are atomic (one logical change)
  • Commit message follows Conventional Commits
  • Tests pass locally
  • No debug code or console.logs
  • No secrets or credentials
  • Branch is up to date with main

Before creating PR:

  • Rebased on latest main
  • All commits have meaningful messages
  • PR is < 400 lines
  • Description explains what and why
  • Related issues linked
  • CI checks pass

スコア

総合スコア

40/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です