Research and extract an engineer's coding style, patterns, and best practices from their GitHub contributions. Creates structured knowledge base for replicating their expertise.
Research and extract an engineer's coding style, patterns, and best practices from their GitHub contributions. Creates structured knowledge base for replicating their expertise.
Engineer Expertise Extractor
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.
What This Skill Does
Researches an engineer's work to create a "digital mentor" by:
# 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
Architecture Documentation
Captures:
Design decisions
Technology choices
Trade-offs made
System design approaches
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
Code Review Documentation
Captures:
Feedback patterns
Review approach
Common suggestions
Communication style
Example:
# Code Review Style: [Engineer Name]## Review Approach### Priority Order1. 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"
Using This Skill
Extract Engineer Profile
./scripts/extract_engineer.sh [github-username]
Interactive workflow:
Enter GitHub username
Select repository scope (all/specific org)
Choose analysis depth (last N PRs)
Specify focus areas (languages, topics)
Extract and organize findings
Output: Structured profile in engineer_profiles/[username]/
Focuses analysis on specific repository contributions.
Update Existing Profile
./scripts/update_profile.sh [engineer-username]
Adds new PRs and updates existing profile.
Research Sources
GitHub CLI Queries
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]
Analysis Techniques
Pattern Recognition:
Identify recurring code structures
Extract common solutions
Detect naming patterns
Find architectural choices
Style Extraction:
Analyze formatting consistency
Extract naming conventions
Identify comment patterns
Detect structural preferences
Best Practice Identification:
Look for testing patterns
Find error handling approaches
Identify security practices
Extract performance optimizations
Use Cases
1. Onboarding New Engineers
Problem: New engineer needs to learn team standards Solution: Provide senior engineer's profile as reference
Benefits:
Real examples from codebase
Understand team conventions
See decision-making process
Learn best practices
2. Code Review Training
Problem: Teaching good code review skills Solution: Study experienced reviewer's feedback patterns
Benefits:
Learn what to look for
Understand feedback style
See common issues
Improve review quality
3. Knowledge Transfer
Problem: Senior engineer leaving, knowledge lost Solution: Extract their expertise before departure
Benefits:
Preserve tribal knowledge
Document decisions
Maintain code quality
Reduce bus factor
4. Establishing Team Standards
Problem: Inconsistent coding styles across team Solution: Extract patterns from best engineers, create standards
Benefits:
Evidence-based standards
Real-world examples
Buy-in from team
Consistent codebase
5. AI Agent Training
Problem: Agent needs to code like specific engineer Solution: Provide extracted profile to agent
Benefits:
Match expert's style
Follow their patterns
Apply their best practices
Maintain consistency
Profile Usage by Agents
When an agent has access to an engineer profile, it can:
Code Generation:
Follow extracted naming conventions
Use identified patterns
Apply documented best practices
Match architectural style
Code Review:
Provide feedback in engineer's style
Check for common issues they'd catch
Apply their quality standards
Match their priorities
Problem Solving:
Use their common solutions
Follow their architectural approach
Apply their design patterns
Consider their trade-offs
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."