A quick reference for writing consistent and meaningful commit messages.
| Type | Emoji | When to Use | Example |
|---|---|---|---|
feat |
β¨ | Introducing a new feature | feat(auth): add OAuth2 login |
fix |
π | Fixing a bug | fix(api): handle null response from DynamoDB |
docs |
π | Documentation changes only | docs(readme): add ECS architecture diagram |
style |
π | Formatting, whitespace, missing semicolons (no logic change) | style(lambda): reformat handler indentation |
refactor |
β»οΈ | Code restructure without adding features or fixing bugs | refactor(sqs): simplify message retry logic |
test |
β | Adding or updating tests | test(api): add unit tests for token validation |
chore |
π§ | Build process, config, dependency updates | chore(deps): upgrade AWS SDK to v3 |
perf |
β‘οΈ | Performance improvements | perf(cache): add ElastiCache for session lookup |
ci |
π· | CI/CD pipeline changes | ci(github-actions): add deploy workflow to ECS |
build |
π¦ | Changes affecting build system or external dependencies | build(docker): update base image to node 20 |
revert |
βͺ | Reverting a previous commit | revert: revert feat(auth): add OAuth2 login |
<type>(<scope>): <short summary>
[optional body β explain WHY, not WHAT]
[optional footer β e.g. BREAKING CHANGE, issue refs]
- β
Use imperative mood β
add featurenotadded feature - β Keep subject under 50 characters
- β No period at the end of the subject line
- β Separate subject and body with a blank line
- β Explain why in the body, not what (the diff already shows what)
feat(ecs): add auto-scaling policy for task count
fix(vpc): correct private subnet CIDR block overlap
docs(patterns): add Saga pattern with Step Functions
refactor(lambda): extract DynamoDB client to shared layer
chore(cdk): update constructs library to v2.80.0
perf(apigw): enable response caching for GET endpoints
ci(github-actions): add ECR push step to deploy pipeline
test(sqs): add integration test for dead-letter queue| Scope | Meaning |
|---|---|
ecs |
ECS service or task definition changes |
eks |
Kubernetes / EKS related |
lambda |
Lambda function changes |
vpc |
Networking / VPC config |
apigw |
API Gateway |
sqs / sns |
Messaging services |
rds / dynamo |
Database changes |
iam |
IAM roles or policies |
cdk / cfn |
Infrastructure as Code |
cicd |
Pipeline configuration |
patterns |
Architecture pattern docs |
π Reference: conventionalcommits.org