/claude-code-superpowers:naming-conventionsfrom claude-code-superpowers
Teaches Claude Code's naming conventions for files, types, functions, and variables. Use when naming new code to match the existing codebase style.
Ships in claude-code-superpowers. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Claude Code uses a set of naming conventions that encode the role of a file or identifier in its name. A file named BashTool.tsx is a Tool implementation with UI concerns. A file named BashTool.ts is a Tool implementation with no UI. A function named isConcurrencySafe returns a boolean about concurrency. A function named getBranch fetches a value. A constant named MAX_STATUS_CHARS is a numeric limit. These are not accidental — reading the name tells you the role without reading the implementation.
At ~512K lines across 1,884 files, Claude Code is too large for any individual to hold in memory. Naming conventions serve as a file-system-level type system: you can predict what's in a file before opening it. AgentTool/AgentTool.tsx will export a Tool<Input, Output> that has UI progress output. state/AppStateStore.ts will export the AppState type and initial state. hooks/useCanUseTool.ts will export a React hook returning a permission-checking function.
Files:
src/tools/[Name]Tool/[Name]Tool.ts[x] — .tsx if the tool renders JSX outputsrc/commands/[kebab-name]/index.ts or src/commands/[kebab-name].tssrc/hooks/use[Name].ts — always prefixed with usesrc/components/[Name].tsxsrc/utils/[name].ts — lowercase, describe the domain (e.g., git.ts, path.ts)src/types/[name].ts — lowercase file, PascalCase exportsIdentifiers:
PascalCase (e.g., ToolUseContext, AppState, PermissionResult)camelCase starting with a verb (e.g., createTaskStateBase, normalizeMessages, getGitStatus)is/has prefix (e.g., isConcurrencySafe, isReadOnly, hasWorktreeChanges, isENOENT)on[Event] prefix (e.g., onProgress, onChangeAppState, onCompactProgress)UPPER_SNAKE_CASE for numeric/string limits; PascalCase for object constants (e.g., MAX_STATUS_CHARS, IDLE_SPECULATION_STATE)export const BashTool, export const FileReadTool)Promise return type is the indicator, not a naming convention// Source: src/tools/BashTool/BashTool.tsx
// File name: [Name]Tool.tsx — Tool with JSX rendering
// Export name: matches file (BashTool)
export const BashTool: Tool<typeof inputSchema> = {
// Boolean method: is prefix
isConcurrencySafe(input) { ... },
isReadOnly(input) { ... },
isDestructive(input) { ... },
// Verb prefix: call, description
async call(args, context, canUseTool) { ... },
async description(input, options) { ... },
}
// Source: src/context.ts
// Constant: UPPER_SNAKE_CASE for a numeric limit
const MAX_STATUS_CHARS = 10_000
// Function: verb prefix (get)
export const getGitStatus = memoize(async (): Promise<string | null> => { ... })
export const getBranch = async (): Promise<string> => { ... }
export const getIsGit = async (): Promise<boolean> => { ... }
// Source: src/state/AppStateStore.ts
// Type: PascalCase
export type AppState = DeepImmutable<{
// Boolean fields: is prefix
isBriefOnly: boolean
kairosEnabled: boolean
replBridgeConnected: boolean
// Object constant: PascalCase
expandedView: 'none' | 'tasks' | 'teammates'
}>
// Source: src/Tool.ts
// Callback types: on prefix
export type ToolCallProgress<P> = (progress: P) => void
// Used as: onProgress, onChangeAppState, onCompactProgress
// Source: src/hooks/useCanUseTool.ts
// React hook: use prefix
export function useCanUseTool(): CanUseToolFn { ... }
// Source: src/utils/file.ts
// Boolean helper: is prefix
export function isENOENT(err: unknown): boolean { ... }
The getIsGit naming is notable: it returns Promise<boolean>, so it uses the get verb prefix (because it fetches from disk/git) combined with the boolean it returns. This is consistent: getX fetches, isX describes a property — when a function does both, get takes precedence.
Before — inconsistent naming:
// Wrong: file named searchHelper.ts in tools/
// Wrong: function named checkIfSearch instead of isSearch
// Wrong: constant named maxResults instead of MAX_RESULTS
// Wrong: callback named handleProgress instead of onProgress
export function checkIfSearch(command: string): boolean { ... }
const maxResults = 100
const handleProgress = (data: ProgressData) => { ... }
After — names that match the Claude Code conventions:
// File: src/utils/bash.ts (utility, lowercase, domain-named)
// File: src/tools/SearchTool/SearchTool.ts (Tool, PascalCase + Tool suffix)
export function isSearchCommand(command: string): boolean { ... } // is prefix for boolean
const MAX_RESULTS = 100 // UPPER_SNAKE_CASE for limit
const onProgress = (data: ProgressData) => { ... } // on prefix for callback
searchHelper.ts instead of SearchTool.tscheckPermission instead of hasPermission or isPermissionGrantedhandleProgress or progressCallback instead of onProgressmaxTokens or defaultTimeout don't use UPPER_SNAKE_CASEusei, j, k) are fine — don't verbose-name loop indicesis prefix for boolean-returning functions is the most important convention; the others are softermodule-organisation — naming conventions for files extend to directory structuretool-definition — canonical names for Tool methods (call, description, inputSchema)types-and-interfaces — PascalCase type namingWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
16 skills in this plugin
/async-concurrencyTeaches Claude Code's concurrency model: isConcurrencySafe() for parallel tool execution, AbortController propagation for cancellation, Promise.all() for parallel initialization, and the StreamingToolExecutor for concurrent progress streams. Use this when writing tools that could benefit from parallel execution, need to respect cancellation, or must stream partial results. Read-only tools that don't declare concurrency safety are needlessly serialized.
/build-tool-factoryTeaches how to create a new Claude Code tool using the buildTool() factory from src/Tool.ts.
Use this whenever adding a new capability to Claude Code — buildTool is the only correct entry
point. It fills in safe defaults for isConcurrencySafe, isReadOnly, isDestructive,
checkPermissions, and userFacingName so you only implement what your tool actually needs.
/creating-skillsGenerated from the plugin's indexed repository (techymt/claude-code-superpowers) — no native marketplace selected
npx claudepluginhub p/techymt-claude-code-superpowersOther plugins' skills for the same job