Formats code according to Ben's style guidelines for TypeScript, Python, and general best practices. Use when formatting code, fixing linting issues, checking naming conventions, organizing imports, or when the user mentions formatting, style, linting, Prettier, Black, or ESLint.
Apply consistent code formatting and style according to established guidelines.
lowercase_with_underscoresuser_service.py, api_client.ts, data_helper.jscamelCasePascalCaseUPPER_CASE_SNAKE_CASE// Good
const userName = 'John';
const API_KEY = 'secret';
class UserService {}
function getUserData() {}
// Bad
const UserName = 'John';
const api_key = 'secret';
class userService {}
function get_user_data() {}
// Good
const config = {
host: 'localhost',
port: 3000,
timeout: 5000, // trailing comma
};
const items = [
'first',
'second',
'third', // trailing comma
];
// Bad
const config = {
host: 'localhost',
port: 3000,
timeout: 5000 // missing trailing comma
};
*)require)// Good
import { useState, useEffect } from 'react';
import { fetchUser } from '../api/users';
// Bad
import * from 'react';
const users = require('../api/users');
async/await over .then() chains// Good
async function fetchData() {
const response = await apiClient.get('/data');
return response.data;
}
// Bad
function fetchData() {
return apiClient.get('/data').then(res => res.data);
}
any type (use unknown if type is truly unknown)// Good
interface User {
id: number;
name: string;
email: string;
}
async function getUser(id: number): Promise<User> {
const response = await fetch(`/api/users/${id}`);
return response.json();
}
// Bad
async function getUser(id) {
const response = await fetch(`/api/users/${id}`);
return response.json();
}
# Good
def calculate_total(items: list[dict]) -> float:
"""Calculate total price of items."""
return sum(item['price'] for item in items)
class UserService:
"""Service for user operations."""
pass
# Bad
def CalculateTotal(items):
return sum(item['price'] for item in items)
class user_service:
pass
// Good
// Use exponential backoff to avoid overwhelming the API during outages
const retryDelay = Math.pow(2, attemptNumber) * 1000;
// Bad
// Set retry delay
const retryDelay = Math.pow(2, attemptNumber) * 1000;
# Format with Prettier
npx prettier --write "src/**/*.{ts,tsx,js,jsx}"
# Lint with ESLint
npx eslint src/ --fix
# Format code
black .
# Sort imports
isort .
# Both together
black . && isort .
When formatting code:
.then() with async/awaitAlways provide a summary of changes made and reasoning for significant modifications.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer