/workflow:best-practices [repo-name] [--from-prs | --from-code | --combined]from workflow
Generate project coding best practices from PR comments or codebase analysis
Ships in workflow. Installing the plugin adds it to Claude Code.
You are generating coding best practices documentation for the project. Extract patterns from PR review comments and/or codebase analysis to create actionable guidelines.
Goal: Decide where to extract best practices from
Input: $ARGUMENTS
Actions:
Create todo list with phases
Determine mode from arguments:
--from-prs → Extract from PR review comments only--from-code → Extract from codebase patterns only--combined or no flag → Use both sources (recommended)If repo name provided, use it. Otherwise use current repo.
Goal: Gather patterns from actual team feedback
Actions:
Fetch recent PRs with review comments:
gh pr list --state merged --limit 50 --json number,title
gh api repos/{owner}/{repo}/pulls/{pr_number}/comments
Categorize feedback patterns:
Note frequency of each pattern (how often mentioned)
Goal: Identify established patterns in existing code
Actions:
Sample 20-30 files across the project:
Glob("src/**/*.ts")
Glob("src/**/*.tsx")
Analyze patterns:
Check existing configs:
Read(".eslintrc.js") or Read("eslint.config.js")
Read(".prettierrc")
Read("tsconfig.json")
Goal: Create structured best practices files
Actions:
Create directory: .claude/best-practices/
Generate files by category:
.claude/best-practices/
├── README.md # Index with all categories
├── naming-conventions.md # Variable, function, file naming
├── error-handling.md # Try/catch, error types, logging
├── type-safety.md # TypeScript patterns, avoid any
├── code-organization.md # File structure, imports, exports
├── testing.md # Test patterns, coverage
└── {other-categories}.md # Based on findings
# {Category Name}
## Guidelines
### 1. {Guideline Title}
**Rule**: {Clear statement}
**Why**: {Reasoning}
**Example**:
```typescript
// Good
{good_example}
// Bad
{bad_example}
Source: {PR #123 or "codebase pattern"}
---
## Phase 5: Summary
**Goal**: Report what was generated
**Actions**:
1. Mark all todos complete
2. Show summary:
Best Practices Generated: .claude/best-practices/
Sources:
Categories: {count} Guidelines: {total} documented
Files created:
Next: Review with team and commit
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
npx claudepluginhub itamarzand88/claude-code-agentic-engineering --plugin workflow8 commands in this plugin
/1_ticketTask Ticket GeneratorCreate comprehensive task ticket with codebase analysis and clarifying questions/2_planImplementation Plan GeneratorCreate detailed implementation plan with architecture design and code examples/3_implementPlan ExecutorExecute implementation plan step-by-step with validation/4_reviewCode ReviewerCode review and quality assessment with confidence-based filtering/allComplete Workflow ExecutorComplete end-to-end workflow from task description to implementation and review/checksCode Quality ChecksRun all code quality checks (TypeScript, Prettier, Lint, Tests, Build)Other plugins' commands for the same job