// Research and extract an engineer's coding style, patterns, and best practices from their GitHub contributions. Creates structured knowledge base for replicating their expertise.
| name | engineer-expertise-extractor |
| description | Research and extract an engineer's coding style, patterns, and best practices from their GitHub contributions. Creates structured knowledge base for replicating their expertise. |
Extract and document an engineer's coding expertise by analyzing their GitHub contributions, creating a structured knowledge base that captures their coding style, patterns, best practices, and architectural decisions.
Researches an engineer's work to create a "digital mentor" by:
Knowledge Preservation:
Consistency:
Learning:
Using GitHub CLI (gh), the skill:
Categorizes findings into:
Creates structured folders:
engineer_profiles/
โโโ [engineer_name]/
โโโ README.md (overview)
โโโ coding_style/
โ โโโ languages/
โ โโโ naming_conventions.md
โ โโโ code_structure.md
โ โโโ formatting_preferences.md
โโโ patterns/
โ โโโ common_solutions.md
โ โโโ design_patterns.md
โ โโโ code_examples/
โโโ best_practices/
โ โโโ code_quality.md
โ โโโ testing_approach.md
โ โโโ performance.md
โ โโโ security.md
โโโ architecture/
โ โโโ design_decisions.md
โ โโโ tech_choices.md
โ โโโ trade_offs.md
โโโ code_review/
โ โโโ feedback_style.md
โ โโโ common_suggestions.md
โ โโโ review_examples.md
โโโ examples/
โโโ by_language/
โโโ by_pattern/
โโโ notable_prs/
Contains:
Captures:
Example:
# Coding Style: [Engineer Name]
## Naming Conventions
### Variables
- Use descriptive names: `userAuthentication` not `ua`
- Boolean variables: `isActive`, `hasPermission`, `canEdit`
- Collections: plural names `users`, `items`, `transactions`
### Functions
- Verb-first: `getUserById`, `validateInput`, `calculateTotal`
- Pure functions preferred
- Single responsibility
### Classes
- PascalCase: `UserService`, `PaymentProcessor`
- Interface prefix: `IUserRepository`
- Concrete implementations: `MongoUserRepository`
## Code Structure
### File Organization
- One class per file
- Related functions grouped together
- Tests alongside implementation
- Clear separation of concerns
### Function Length
- Max 20-30 lines preferred
- Extract helper functions
- Single level of abstraction
Captures:
Example:
# Common Patterns: [Engineer Name]
## Dependency Injection
Used consistently across services:
\`\`\`typescript
// Pattern: Constructor injection
class UserService {
constructor(
private readonly userRepo: IUserRepository,
private readonly logger: ILogger
) {}
}
\`\`\`
**Why:** Testability, loose coupling, clear dependencies
## Error Handling
Consistent error handling approach:
\`\`\`typescript
// Pattern: Custom error types + global handler
class ValidationError extends Error {
constructor(message: string) {
super(message);
this.name = 'ValidationError';
}
}
// Usage
if (!isValid(input)) {
throw new ValidationError('Invalid input format');
}
\`\`\`
**Why:** Type-safe errors, centralized handling, clear debugging
Captures:
Example:
# Best Practices: [Engineer Name]
## Testing
### Unit Test Structure
- AAA pattern (Arrange, Act, Assert)
- One assertion per test preferred
- Test names describe behavior
- Mock external dependencies
\`\`\`typescript
describe('UserService', () => {
describe('createUser', () => {
it('should create user with valid data', async () => {
// Arrange
const userData = { email: 'test@example.com', name: 'Test' };
const mockRepo = createMockRepository();
// Act
const result = await userService.createUser(userData);
// Assert
expect(result.id).toBeDefined();
expect(result.email).toBe(userData.email);
});
});
});
\`\`\`
### Test Coverage
- Aim for 80%+ coverage
- 100% coverage for critical paths
- Integration tests for APIs
- E2E tests for user flows
## Code Review Standards
### What to Check
- [ ] Tests included and passing
- [ ] No console.logs remaining
- [ ] Error handling present
- [ ] Comments explain "why" not "what"
- [ ] No hardcoded values
- [ ] Security considerations addressed
Captures:
Example:
# Architectural Decisions: [Engineer Name]
## Decision: Microservices vs Monolith
**Context:** Scaling user service
**Decision:** Start monolith, extract services when needed
**Reasoning:**
- Team size: 5 engineers
- Product stage: MVP
- Premature optimization risk
- Easier debugging and deployment
**Trade-offs:**
- Monolith pros: Simpler, faster development
- Monolith cons: Harder to scale later
- Decision: Optimize for current needs, refactor when hitting limits
## Decision: REST vs GraphQL
**Context:** API design for mobile app
**Decision:** REST with versioning
**Reasoning:**
- Team familiar with REST
- Simple use cases
- Caching easier
- Over-fetching not a problem yet
**When to reconsider:** If frontend needs complex queries
Captures:
Example:
# Code Review Style: [Engineer Name]
## Review Approach
### Priority Order
1. Security vulnerabilities
2. Logic errors
3. Test coverage
4. Code structure
5. Naming and style
### Feedback Style
- Specific and constructive
- Explains "why" behind suggestions
- Provides examples
- Asks questions to understand reasoning
### Common Suggestions
**Security:**
- "Consider input validation here"
- "This query is vulnerable to SQL injection"
- "Should we rate-limit this endpoint?"
**Performance:**
- "This N+1 query could be optimized with a join"
- "Consider caching this expensive operation"
- "Memoize this pure function"
**Testing:**
- "Can we add a test for the error case?"
- "What happens if the API returns null?"
- "Let's test the boundary conditions"
**Code Quality:**
- "Can we extract this into a helper function?"
- "This function is doing too many things"
- "Consider a more descriptive variable name"
./scripts/extract_engineer.sh [github-username]
Interactive workflow:
Output: Structured profile in engineer_profiles/[username]/
./scripts/analyze_repo.sh [repo-url] [engineer-username]
Focuses analysis on specific repository contributions.
./scripts/update_profile.sh [engineer-username]
Adds new PRs and updates existing profile.
Pull Requests:
gh pr list --author [username] --limit 100 --state all
gh pr view [pr-number] --json title,body,files,reviews,comments
Code Changes:
gh pr diff [pr-number]
gh api repos/{owner}/{repo}/pulls/{pr}/files
Reviews:
gh pr view [pr-number] --comments
gh api repos/{owner}/{repo}/pulls/{pr}/reviews
Commits:
gh api search/commits --author [username]
Pattern Recognition:
Style Extraction:
Best Practice Identification:
Problem: New engineer needs to learn team standards Solution: Provide senior engineer's profile as reference
Benefits:
Problem: Teaching good code review skills Solution: Study experienced reviewer's feedback patterns
Benefits:
Problem: Senior engineer leaving, knowledge lost Solution: Extract their expertise before departure
Benefits:
Problem: Inconsistent coding styles across team Solution: Extract patterns from best engineers, create standards
Benefits:
Problem: Agent needs to code like specific engineer Solution: Provide extracted profile to agent
Benefits:
When an agent has access to an engineer profile, it can:
Code Generation:
Code Review:
Problem Solving:
Example Agent Prompt:
"Using the profile at engineer_profiles/senior_dev/, write a user service
following their coding style, patterns, and best practices. Pay special
attention to their error handling approach and testing standards."
DO:
DON'T:
Regular Updates:
Quality Control:
For Learning:
For Replication:
What This Extracts:
What This Doesn't Capture:
Potential additions:
engineer_profiles/
โโโ senior_dev/
โโโ README.md
โ # Senior Dev - Staff Engineer
โ Expertise: TypeScript, Node.js, System Design
โ Focus: API design, performance optimization
โ
โโโ coding_style/
โ โโโ typescript_style.md
โ โโโ naming_conventions.md
โ โโโ code_structure.md
โ
โโโ patterns/
โ โโโ dependency_injection.md
โ โโโ error_handling.md
โ โโโ examples/
โ โโโ service_pattern.ts
โ โโโ repository_pattern.ts
โ
โโโ best_practices/
โ โโโ testing_strategy.md
โ โโโ code_quality.md
โ โโโ performance.md
โ
โโโ architecture/
โ โโโ api_design.md
โ โโโ database_design.md
โ โโโ scaling_approach.md
โ
โโโ code_review/
โ โโโ feedback_examples.md
โ โโโ review_checklist.md
โ
โโโ examples/
โโโ notable_prs/
โโโ pr_1234_auth_refactor.md
โโโ pr_5678_performance_fix.md
This skill transforms an engineer's GitHub contributions into a structured, reusable knowledge base. It captures their expertise in a format that:
The goal: Make expertise scalable, learnable, and replicable.
"The best way to learn is from those who have already mastered it."