// Analyzes your codebase to discover and document coding standards, patterns, and conventions. Creates coding-standards.md with file naming, TypeScript patterns, testing standards, and architectural patterns actually used in your project.
| name | Coding Standards Analysis |
| description | Analyzes your codebase to discover and document coding standards, patterns, and conventions. Creates coding-standards.md with file naming, TypeScript patterns, testing standards, and architectural patterns actually used in your project. |
Autonomous Standards Documentation Skill
This skill analyzes an existing codebase to identify and document coding standards, patterns, and conventions. It creates a comprehensive standards document that other skills can reference.
docs/coding-standards.mdYou are now operating as Standards Analyst. Your role is to analyze the codebase and document observable patterns and conventions.
Look for and analyze:
eslint.config.js or .eslintrc.*.prettierrc or prettier.config.jstsconfig.json.editorconfigvitest.config.ts or jest.config.jsplaywright.config.tsExtract configured rules and standards.
File Organization:
TypeScript Patterns:
any, unknown, neverComponent Patterns (React/Vue/etc):
Testing Patterns:
Error Handling:
State Management:
Data Fetching:
Styling:
Create docs/coding-standards.md:
# Coding Standards
> Auto-generated by Standards Skill on {date}
> Based on analysis of existing codebase
## Project Overview
**Type**: {monorepo|single-app|library}
**Primary Language**: {TypeScript|JavaScript|etc}
**Framework**: {React|Vue|Next.js|etc}
## Tool Configurations
### TypeScript
- Config: `tsconfig.json`
- Strict mode: {enabled|disabled}
- Target: {ES version}
- Key compiler options: {list important ones}
### Linting
- Tool: ESLint
- Config: {path to config}
- Key rules: {list notable rules}
### Formatting
- Tool: Prettier
- Config: {path to config}
- Settings: {key settings}
### Testing
- Framework: {Vitest|Jest|etc}
- Runner: {Playwright|etc for E2E}
- Coverage target: {percentage if specified}
## File Naming Conventions
### Components
Pattern: `{pattern observed}`
Examples:
- `SmokerCard.tsx`
- `BookingForm.tsx`
### Routes
Pattern: `{pattern observed}`
Examples:
- `login.tsx`
- `$smokerId.tsx`
### Utilities
Pattern: `{pattern observed}`
Examples:
- `auth.ts`
- `supabase.ts`
### Tests
Pattern: `{pattern observed}`
Examples:
- `SmokerCard.test.tsx`
- `auth.test.ts`
## Directory Structure
{observed directory tree}
**Key Patterns**:
- {pattern 1}
- {pattern 2}
## TypeScript Conventions
### Type Definitions
Preference: {interface|type|both}
Example from codebase:
```typescript
{actual example from code}
Pattern: {observed pattern}
Example from codebase:
{actual example from code}
Preference: {named|default|mixed}
Examples:
{actual examples from code}
Standard pattern observed:
{actual example from codebase}
JSDoc usage: {consistent|sparse|none}
Example:
{actual example}
Pattern: {co-located|separate test dir|both}
Framework: {Vitest|Jest} Pattern observed:
{actual example from codebase}
{observed from config or practice}
Approach: {React Router loaders|useEffect|React Query|etc}
Example:
{actual example from codebase}
Library: {Zod|Yup|none observed}
Example:
{actual example if found}
Pattern observed:
{actual example}
{observed pattern or "Not used"}
{Tailwind|CSS Modules|styled-components|etc}
{pattern observed}
Example:
{actual example}
{observed pattern}
{conventional commits|other pattern observed}
{pattern if observable from .git}
{observed pattern - JSDoc|inline|minimal}
{observed from existing READMEs}
{Explanation with examples from codebase}
{Explanation with examples from codebase}
{Based on .eslintrc rules and code review patterns}
This document was generated by analyzing the existing codebase. Update it as conventions evolve.
#### Step 5: Return JSON Summary
```json
{
"status": "completed",
"standards_doc": {
"path": "/full/path/to/docs/coding-standards.md",
"generated_at": "{ISO timestamp}"
},
"summary": {
"project_type": "{type}",
"primary_language": "{language}",
"framework": "{framework}",
"test_framework": "{test framework}",
"styling": "{styling approach}",
"state_management": "{approach}"
},
"conventions": {
"file_naming": {
"components": "{pattern}",
"tests": "{pattern}",
"utilities": "{pattern}"
},
"typescript": {
"strict_mode": true,
"prefer_interface": false,
"no_any": true
},
"testing": {
"framework": "{framework}",
"location": "{co-located|separate}",
"coverage_target": "{percentage}"
}
}
}
Sample Files to Examine:
Pattern Detection:
Config First:
No Tool Configs:
Inconsistent Patterns:
Multiple Conventions:
Monorepo:
If analysis fails:
If no code found: