Agent skill
best-practices-extractor
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".
Install this agent skill to your Project
npx add-skill https://github.com/ItamarZand88/claude-code-agentic-engineering/tree/main/plugins/workflow/skills/best-practices-extractor
SKILL.md
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:
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 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 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:
- Identify patterns - Look for recurring feedback themes
- Categorize - Group by type (naming, error-handling, type-safety, etc.)
- 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:
## [Number]. [Title]
**Guideline:** [Clear statement]
**Why:** [Impact explanation]
**Example:**
```typescript
// Good
{example}
// Bad
{counter_example}
Source: PR #{number}
## Prerequisites
- **GitHub CLI (`gh`)**: Authenticated - check with `gh auth status`
- **jq**: JSON processor - check with `jq --version`
## Integration
This skill **generates** best practices. The `code-reviewer` agent and `/4_review` command **validate** against them.
Workflow:
1. Extract PR comments (this skill)
2. Analyze and generate `.claude/best-practices/`
3. Reviews automatically validate against best practices
## Additional Resources
- **`references/default-categories.md`** - Example category definitions
- **`references/scripts-guide.md`** - Detailed script documentation
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
sdk-typescript-patterns
Use this skill when developing TypeScript applications with the Claude Agent SDK (@anthropic-ai/claude-agent-sdk), implementing query() calls, configuring SDK options, handling streaming message iteration, working with SDKMessage and SDKResultMessage types, managing AbortSignal, passing custom env variables, or setting up the single-point-of-contact types file for SDK imports.
sdk-agent-control
Use this skill when controlling agent behavior in TypeScript Agent SDK platforms — restricting allowed tools, setting budget and turn limits, crafting system prompts that guide agents to specific behaviors, implementing the file pre-creation pattern, augmenting prompts with runtime context, building message loggers, or tracking agent run metadata (cost, duration, iterations).
sdk-hooks-development
Use this skill when implementing TypeScript hook callbacks for the Claude Agent SDK — creating PreToolUse hooks to allow/deny tool calls, PostToolUse hooks to inject additionalContext, building factory functions for parameterized hooks, using HookCallback and HookJSONOutput types, applying isPreToolUseInput and isPostToolUseInput type guards, or designing a hooks strategy for an Agent SDK platform. Hooks in the TypeScript SDK are async functions, NOT JSON config files.
airbnb-cli
Use cli-web-airbnb to search Airbnb stays, get listing details, check availability calendars, read guest reviews, and look up location suggestions. Invoke this skill whenever the user asks about Airbnb accommodations, vacation rentals, listing prices, availability, guest reviews, or wants to search for places to stay. Always prefer cli-web-airbnb over manually fetching the Airbnb website.
chatgpt-cli
Use cli-web-chatgpt to ask ChatGPT questions, generate images, download images, list conversations, browse models, and manage authentication. Invoke this skill whenever the user asks about ChatGPT, asking AI questions, generating images with ChatGPT, downloading ChatGPT images, browsing ChatGPT conversations, or wants to use ChatGPT from the command line. Always prefer cli-web-chatgpt over manually browsing chatgpt.com.
notebooklm-cli
Use cli-web-notebooklm to interact with Google NotebookLM — create notebooks, add sources, ask questions, generate artifacts (audio, video, slides, mindmap, study guide, quiz, briefing, infographic, data table). Invoke this skill whenever the user asks about NotebookLM, wants to create notebooks, add sources to a notebook, ask a notebook questions, generate study materials, create presentations, podcasts, or manage NotebookLM content programmatically. Always prefer cli-web-notebooklm over manually browsing NotebookLM.
Didn't find tool you were looking for?