Extract and generate coding best practices from PR review comments. Use when the user asks to "extract best practices", "analyze PR comments", "generate coding standards", "create best practices from PRs", or "update coding guidelines from reviews".
View on GitHubItamarZand88/claude-code-agentic-engineering
agi
January 25, 2026
Select agents to install to:
npx add-skill https://github.com/ItamarZand88/claude-code-agentic-engineering/blob/main/plugin/skills/best-practices-extractor/SKILL.md -a claude-code --skill best-practices-extractorInstallation paths:
.claude/skills/best-practices-extractor/# Best Practices Extractor
Extract coding best practices from PR review comments and codebase analysis to generate `.claude/best-practices/` documentation.
## When to Use
- Initial setup of coding standards for a project
- Regular updates to capture new team feedback
- Analyzing PR comments to document patterns
- Generating best practices from code review history
## Extraction Methods
All outputs are saved to `.claude/pr-review-comments/`.
### Method 1: Incremental Update (Recommended)
For regular updates - fast and tracks state:
```bash
cd plugin/skills/best-practices-extractor
bash scripts/incremental_update.sh OWNER REPO_NAME
```
First run does full extraction; subsequent runs fetch only new PRs.
**Output**: `.claude/pr-review-comments/{repo}_inline_comments.ndjson`
### Method 2: Full Extraction
For first-time setup or comprehensive analysis:
```bash
bash scripts/extract_pr_comments.sh REPO_NAME
```
**Output**: `.claude/pr-review-comments/{repo}_inline_comments.ndjson`
### Method 3: Sort by File Tree
Organize extracted comments by directory structure:
```bash
bash scripts/sort_comments_by_filetree.sh .claude/pr-review-comments/{repo}_inline_comments.ndjson
```
**Output**: `.claude/pr-review-comments/sorted/`
## Generating Best Practices
After extracting comments:
1. **Identify patterns** - Look for recurring feedback themes
2. **Categorize** - Group by type (naming, error-handling, type-safety, etc.)
3. **Create documentation** - Generate `.claude/best-practices/` files
### Output Structure
```
.claude/best-practices/
├── README.md # Index
├── naming-conventions.md
├── error-handling.md
├── type-safety.md
├── testing.md
└── ...
```
### Guideline Format
Each guideline should include:
```markdown
## [Number]. [Title]
**Guideline:** [Clear statement]
**Why:** [Impact explanation]
**Example:**
```typescript
// Good
{example}
// Bad
{counter_example}
```
**Source:** PR #{number}
```
## Prerequisites
- **GitHub CLI (`gh`)**