소스 정보
- 저장소
- Purushot14/user-agent-parser
- 최근 소스 활동
- 2026년 3월 18일 12:59
- 감지된 SKILL.md 언어
- 영어
- 스타
- 7
- 포크
- 1
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/Purushot14/user-agent-parser --skill pr-review명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | pr-review |
| description | Review PR changes against project standards and post feedback |
| argument-hint | [PR number] [--comment] |
Review PR changes against project standards for this user-agent parsing library.
/pr-review # Review current branch's PR
/pr-review 123 # Review PR #123
/pr-review --comment # Post review as PR comment
# Detect repo
REPO=$(git remote get-url origin | sed 's/.*github.com[:/]\(.*\)\.git/\1/' | sed 's/.*github.com[:/]\(.*\)/\1/')
gh pr view --json number,title,baseRefName,headRefName,files
git diff origin/main...HEAD --name-only
git diff origin/main...HEAD --stat
If a PR number was provided, use gh pr view <number> and gh pr diff <number> instead.
| Category | Patterns |
|---|---|
| Parser Core | user_agent_parser/parser.py |
| Advanced Engine | user_agent_parser/advanced_engine.py |
| Analytics | user_agent_parser/analytics.py |
| Public API | user_agent_parser/__init__.py |
| Constants/Devices | user_agent_parser/constants.py, user_agent_parser/modern_devices.py |
| Tests | tests/**/*.py |
| CI/Config | .github/workflows/*, pyproject.toml, poetry.lock |
| Docs | *.md, CHANGELOG.md |
Read changed files and verify against these standards:
| Check | Standard |
|---|---|
| Regex tested | Every new/changed regex has real UA string test cases |
| browser_rules order | New entries don't break priority (Edge before Chrome, Chrome before Safari, etc.) |
| _token bounds | Every self._token[n] access has len() guard |
| Compiled patterns | Hot-path regex uses cached compiled patterns, not re.compile() per call |
| ReDoS safety | No nested quantifiers or overlapping alternations that cause catastrophic backtracking |
| Check | Standard |
|---|---|
| parse() 7-tuple | parse() still returns (browser, browser_version, os, os_version, device_type, device_name, device_host) |
| Public API stable | Functions in __init__.py / __all__ unchanged in signature |
| AdvancedResult fields | No removed/renamed fields in AdvancedResult, BrowserCapabilities, SecurityFingerprint |
| DeviceCategory enum | No removed/renamed enum values, only additions |
| Constants immutable | OS, DeviceType, DeviceName attributes not changed, only extended |
| Check | Standard |
|---|---|
| No match/case | match/case requires 3.10+ — use if/elif |
| No union syntax | X | Y in types requires 3.10+ — use Union[X, Y] |
| No TypeAlias | Requires 3.10+ — use plain assignment |
| No ParamSpec | Requires 3.10+ — use typing_extensions if needed |
| Check | Standard |
|---|---|
| lru_cache returns immutable | Cached functions return tuples, not lists/dicts/sets |
| Cache key hashable | All arguments to cached functions are hashable |
| No cache side effects | Cached functions are pure (no mutations, no I/O) |
| Check | Standard |
|---|---|
| New features tested | New parser/engine features have parametrized test cases |
| Real UA strings | Tests use real-world user agent strings, not fabricated ones |
| Edge cases covered | Empty string, None, very long strings, missing parentheses |
| New source files | New .py files in user_agent_parser/ have test coverage |
| Check | Standard |
|---|---|
| Batch processing | ThreadPoolExecutor usage includes proper cleanup (with statement) |
| No shared mutation | Batch operations don't share mutable state across threads |
| Check | Standard |
|---|---|
| Type hints | Public functions have parameter and return type hints |
| CHANGELOG | Non-trivial changes have CHANGELOG.md entry |
| Device code format | MOBILE_DEVICE_CODE_NAME entries follow key→name format, no duplicates |
| Consistent naming | New methods/constants follow existing naming patterns |
Structure findings by severity:
## PR Review: #<number> - <title>
**Files Changed:** N | **Additions:** +N | **Deletions:** -N
### 🔴 Critical (blocks merge)
- [ ] `user_agent_parser/parser.py:78` - `self._token[3]` accessed without bounds check
- [ ] `user_agent_parser/__init__.py:15` - `parse()` return changed from 7-tuple to 8-tuple — breaks all consumers
- [ ] `user_agent_parser/parser.py:45` - New browser regex `(Chrome|CriOS)(\d+)*` has nested quantifier — ReDoS risk
### 🟡 Standards (should fix)
- [ ] `user_agent_parser/advanced_engine.py:120` - Uses `match/case` — Python 3.10+ only, project supports 3.8+
- [ ] `tests/test_user_agent_parser.py` - New Brave detection has no parametrized test cases
- [ ] Missing CHANGELOG.md entry for new feature
### 🟢 Suggestions (nice to have)
- [ ] `user_agent_parser/parser.py:90` - Add type hint to `get_device_name()` return
- [ ] `user_agent_parser/advanced_engine.py:45` - Browser detection duplicates logic from parser.py — consider reuse
---
**Verdict:** APPROVE | REQUEST_CHANGES | COMMENT
*Review based on project standards in CLAUDE.md*
| Condition | Verdict |
|---|---|
| No critical issues, 0-2 standards issues | APPROVE |
| No critical issues, 3+ standards issues | COMMENT |
| Any critical issues | REQUEST_CHANGES |
Based on verdict:
# Clean — approve
gh pr review <number> --approve --body "$(cat <<'EOF'
<review-report>
EOF
)"
# Suggestions only — comment
gh pr review <number> --comment --body "$(cat <<'EOF'
<review-report>
EOF
)"
# Critical issues — request changes
gh pr review <number> --request-changes --body "$(cat <<'EOF'
<review-report>
EOF
)"
| File | Key Checks |
|---|---|
parser.py | Regex correctness, browser_rules order, _token bounds, lru_cache mutation, compiled pattern caching |
advanced_engine.py | AdvancedResult field stability, confidence bounds [0,1], DeviceCategory enum stability, ThreadPoolExecutor cleanup |
analytics.py | Thread safety in BatchProcessor, export format correctness |
constants.py | No changed existing values, consistent MOBILE_DEVICE_CODE_NAME format, no duplicate keys |
modern_devices.py | DeviceSpec format consistency |
__init__.py | Public API unchanged, all consistent, parse() 7-tuple preserved |
tests/*.py | Parametrized with real UA strings, edge cases covered, backward compat verified |
CHANGELOG.md | Entry exists for non-trivial changes |
.github/workflows/* | Python version matrix includes 3.8–3.15, codecov integration intact |
pyproject.toml | Python requirement still >=3.8, no incompatible dependency versions |