Loading...
Loading...
Analyze a codebase to extract its conventions, patterns, and style. Spawns specialized analyzer agents that each focus on one aspect (structure, naming, patterns, testing, frontend). Generates a comprehensive style guide that other skills can reference. Use when starting work on an unfamiliar codebase, or to create explicit documentation of implicit conventions.
npx skill4agent add michaelboeding/skills style-guide.claude/codebase-style.md.claude/codebase-style.mdA style guide already exists for this codebase (.claude/codebase-style.md).
Options:
1. View the existing style guide
2. Regenerate it (will overwrite)
3. Cancel
What would you like to do?# Check for common indicators
ls -la # Look for package.json, requirements.txt, go.mod, Cargo.toml, etc.CONTEXT: [Primary language/framework detected in Step 1]
TASK: Analyze the codebase for [YOUR SPECIALTY] conventions and patterns.
Return a structured report of what you find.Task(agent: "style-structure", prompt: "CONTEXT: [lang/framework]. Analyze folder structure, file organization, and module patterns.")
Task(agent: "style-naming", prompt: "CONTEXT: [lang/framework]. Analyze naming conventions for files, variables, functions, classes, constants.")
Task(agent: "style-patterns", prompt: "CONTEXT: [lang/framework]. Analyze code patterns: error handling, data access, configuration, logging.")
Task(agent: "style-testing", prompt: "CONTEXT: [lang/framework]. Analyze testing patterns: file locations, naming, structure, assertions.")
Task(agent: "style-frontend", prompt: "CONTEXT: [lang/framework]. Analyze frontend/UI patterns if applicable: components, styling, state. If not a frontend project, report 'N/A'.")━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
ANALYZER PROGRESS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
☐ Structure Analyzer - Working...
☐ Naming Analyzer - Working...
☐ Patterns Analyzer - Working...
☐ Testing Analyzer - Working...
☐ Frontend Analyzer - Working...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.claude/codebase-style.md# Codebase Style Guide
> Auto-generated by codebase-style skill on [DATE]
> Primary: [Language] | Framework: [Framework] | [X] files analyzed
---
## Project Structure
[From style-structure analyzer]
### Directory Layout
- `src/` - Source code
- `tests/` - Test files
- ...
### File Organization Pattern
[Description with examples]
---
## Naming Conventions
[From style-naming analyzer]
| Element | Convention | Example |
|---------|------------|---------|
| Files | [pattern] | `user_service.py` |
| Classes | [pattern] | `UserService` |
| Functions | [pattern] | `get_user_by_id` |
| Variables | [pattern] | `user_count` |
| Constants | [pattern] | `MAX_RETRIES` |
---
## Code Patterns
[From style-patterns analyzer]
### Error Handling
```[language]
[Actual example from codebase][Actual example from codebase][Actual example from codebase][Actual example from codebase]| Category | Convention |
|---|---|
| File naming | [pattern] |
| Function naming | [pattern] |
| Error handling | [pattern name] |
| Test files | [location pattern] |
| Imports | [order/style] |
[Real example from codebase that exemplifies the patterns][What NOT to do based on codebase conventions]
### Step 6: Save and Report
1. Create `.claude/` directory if needed
2. Write `.claude/codebase-style.md`
3. Report summary to user
| Analyzer | Files Checked | Patterns Found |
|---|---|---|
| Structure | [N] | [N] |
| Naming | [N] | [N] |
| Patterns | [N] | [N] |
| Testing | [N] | [N] |
| Frontend | [N or N/A] | [N or N/A] |
---
## Agents
5 specialized analyzer agents in `agents/` directory:
| Agent | Focus | What It Looks For |
|-------|-------|-------------------|
| `style-structure` | Organization | Folders, modules, file grouping, imports |
| `style-naming` | Naming | Files, variables, functions, classes, constants |
| `style-patterns` | Code patterns | Error handling, data access, logging, config |
| `style-testing` | Testing | Location, naming, structure, assertions |
| `style-frontend` | Frontend/UI | Components, styling, state (if applicable) |
All analyzers:
- Explore the codebase independently
- Language-agnostic (detect, don't assume)
- Return structured findings
- Use Read, Grep, Glob, LS tools
---
## Integration with Other Skills
The generated `.claude/codebase-style.md` can be referenced by:
- **feature-council** - Agents can check style guide before implementing
- **debug-council** - Ensure fixes match codebase patterns
- **parallel-builder** - Each builder follows the style guide
To explicitly include:
---
## When to Re-run
Run `codebase-style` again when:
- Major refactoring has occurred
- New patterns have been introduced
- Moving to a new framework/library
- Style guide feels outdated
---
## Triggers
undefined