AGENTS.md 파일 추가
This commit is contained in:
18
AGENTS.md
Normal file
18
AGENTS.md
Normal file
@@ -0,0 +1,18 @@
|
||||
질문에 대한 답변과 설명은 한국어로 한다.
|
||||
|
||||
## Quality Assurance Guidelines
|
||||
|
||||
### Commit Standards
|
||||
1. Write in Korean.
|
||||
2. Use the present tense in the subject line (e.g., "Add feature" not "Added feature").
|
||||
3. Keep the subject line to 50 characters or less.
|
||||
4. Add a blank line between the subject and body.
|
||||
5. Keep the body to 72 characters or less per line.
|
||||
6. Within a paragraph, only break lines when the text exceeds 72 characters.
|
||||
7. Describe changes to public API features and do not include implementation details such as package-private code.
|
||||
8. Do not mention test code in commit messages.
|
||||
9. Do not use any prefix (such as "fix:", "update:", "docs:", "feat:", etc.) in the subject line.
|
||||
10. Do not start the subject line with a lowercase letter unless the first word is a function name or another identifier that is conventionally lowercase and there is a clear, justifiable reason for the exception. Otherwise, always start with an uppercase letter.
|
||||
11. Do not include tool advertisements, branding, or promotional content in commit messages.
|
||||
12. Use separate git commands to stage files before committing.
|
||||
13. Always validate commits using `work/scripts/check-commit-message-rules.sh` and fix until validation passes.
|
||||
71
work/scripts/check-commit-message-rules.sh
Executable file
71
work/scripts/check-commit-message-rules.sh
Executable file
@@ -0,0 +1,71 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if a commit message follows project rules
|
||||
# Rules: 50/72 formatting, no advertisements/branding
|
||||
# Usage: ./check-commit-message-rules.sh [commit-hash]
|
||||
# If no commit-hash is provided, checks the latest commit
|
||||
|
||||
# Determine which commit to check
|
||||
if [ $# -eq 0 ]; then
|
||||
commit_ref="HEAD"
|
||||
echo "Checking latest commit..."
|
||||
else
|
||||
commit_ref="$1"
|
||||
echo "Checking commit: $commit_ref"
|
||||
fi
|
||||
|
||||
# Get the commit message
|
||||
commit_message=$(git log -1 --pretty=format:"%s%n%b" "$commit_ref")
|
||||
|
||||
# Split into subject and body
|
||||
subject=$(echo "$commit_message" | head -n1)
|
||||
body=$(echo "$commit_message" | tail -n +2 | sed '/^$/d')
|
||||
|
||||
echo "Checking commit message format..."
|
||||
echo "Subject: $subject"
|
||||
|
||||
# Check subject line length
|
||||
subject_length=${#subject}
|
||||
if [ $subject_length -gt 50 ]; then
|
||||
echo "[FAIL] Subject line too long: $subject_length characters (max 50)"
|
||||
exit_code=1
|
||||
else
|
||||
echo "[PASS] Subject line length OK: $subject_length characters"
|
||||
exit_code=0
|
||||
fi
|
||||
|
||||
# Check body line lengths if body exists
|
||||
if [ -n "$body" ]; then
|
||||
echo "Checking body line lengths..."
|
||||
while IFS= read -r line; do
|
||||
line_length=${#line}
|
||||
if [ $line_length -gt 72 ]; then
|
||||
echo "[FAIL] Body line too long: $line_length characters (max 72)"
|
||||
echo "Line: $line"
|
||||
exit_code=1
|
||||
fi
|
||||
done <<< "$body"
|
||||
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
echo "[PASS] All body lines within 72 characters"
|
||||
fi
|
||||
else
|
||||
echo "[INFO] No body content to check"
|
||||
fi
|
||||
|
||||
# Check for advertisements, branding, or promotional content
|
||||
echo "Checking for advertisements and branding..."
|
||||
if echo "$commit_message" | grep -qi "generated with\|claude code\|anthropic\|co-authored-by.*claude\|🤖"; then
|
||||
echo "[FAIL] Commit message contains advertisements, branding, or promotional content"
|
||||
exit_code=1
|
||||
else
|
||||
echo "[PASS] No advertisements or branding detected"
|
||||
fi
|
||||
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
echo "[PASS] Commit message follows all rules"
|
||||
else
|
||||
echo "[FAIL] Commit message violates project rules"
|
||||
fi
|
||||
|
||||
exit $exit_code
|
||||
Reference in New Issue
Block a user