Skip to main content
rule CX Codex

patterns — Claude Code rule: what it does, how to install

patterns sets standard TypeScript interfaces for APIs and repositories, provides a useDebounce hook, and defines a workflow for evaluating skeleton repos.

MIT ★ 6,739 updated 2026-01-23

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add WorldFlowAI/everything-claude-code
/plugin install everything-claude-code@everything-claude-code
Open on GitHub

What patterns does

The rule introduces shared TypeScript structures to keep code style predictable. It specifies an ApiResponse<T> contract with success indicators, error strings, payload slots, and pagination meta fields. For data access, it defines a generic Repository<T> interface containing standard query and mutation signatures. A React useDebounce hook implementation handles deferred updates.

When new functionality is requested, the rule instructs Claude Code to search for vetted skeleton projects instead of building from scratch. It directs parallel agents to inspect candidates across security, extensibility, relevance, and implementation planning before cloning the chosen base.

Because the examples depend on TypeScript interfaces and React state primitives, the rule offers little value in non-TypeScript or non-React codebases.

What it helps with

  • standardize API payloads and pagination metadata envelopes
  • apply a common Repository interface across persistence layers
  • add debounced value handling with a standard React hook
  • evaluate third-party skeleton repos before starting feature builds

Example prompts for the agent

  • Write an API route that formats the result using our ApiResponse structure
  • Generate an entity persistence layer conforming to the Repository pattern
  • Search for skeleton repos for our new module and evaluate them for security and extensibility

How to install patterns

1Plugin marketplace

/plugin marketplace add WorldFlowAI/everything-claude-code
/plugin install everything-claude-code@everything-claude-code

2Manually: put the files in place

.claude/rules/patterns.md

The paths frontmatter field limits the files

Step by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use

Questions about patterns

How to install patterns in Claude Code?

Run /plugin marketplace add WorldFlowAI/everything-claude-code followed by /plugin install everything-claude-code@everything-claude-code. Alternatively, place the content directly into .claude/rules/patterns.md.

What does patterns do?

It guides the agent with shared TypeScript response formats, CRUD repository signatures, a debounce hook snippet, and an evaluation rubric for skeleton repos.

What dependencies does this rule require?

The provided patterns rely directly on TypeScript and React hooks (useState and useEffect), making them suited for that specific stack.

Source text

patterns.md · MIT
# Common Patterns

## API Response Format

```typescript
interface ApiResponse<T> {
  success: boolean
  data?: T
  error?: string
  meta?: {
    total: number
    page: number
    limit: number
  }
}
```

## Custom Hooks Pattern

```typescript
export function useDebounce<T>(value: T, delay: number): T {
  const [debouncedValue, setDebouncedValue] = useState<T>(value)

  useEffect(() => {
    const handler = setTimeout(() => setDebouncedValue(value), delay)
    return () => clearTimeout(handler)
  }, [value, delay])

  return debouncedValue
}
```

## Repository Pattern

```typescript
interface Repository<T> {
  findAll(filters?: Filters): Promise<T[]>
  findById(id: string): Promise<T | null>
  create(data: CreateDto): Promise<T>
  update(id: string, data: UpdateDto): Promise<T>
  delete(id: string): Promise<void>
}
```

## Skeleton Projects

When implementing new functionality:
1. Search for battle-tested skeleton projects
2. Use parallel agents to evaluate options:
   - Security assessment
   - Extensibility analysis
   - Relevance scoring
   - Implementation planning
3. Clone best match as foundation
4. Iterate within proven structure

© Affaan Mustafa · MIT · WorldFlowAI/everything-claude-code

Similar IDE rules

All IDE rules for Frontend and UI →

From the same set29

The whole set →
refactor-clean refactor-clean identifies unused code across your codebase, categorizes findings by risk level, and removes them with test verification. Runs the full test suite before and after each deletion to catch regressions. CX Codex +1 ★ 6,739repo stars security security is a Claude Code rule that checks changes for exposed secrets, input validation, and protection against web attacks before commit. CX Codex +1 ★ 6,739repo stars code-review code-review is a Claude Code command that checks uncommitted changes for security flaws and code-quality issues. It reports findings and blocks commits when it detects CRITICAL or HIGH severity problems. CX Codex +1 ★ 6,739repo stars git-workflow The git-workflow rule defines commit formats (feat, fix, docs and five other types), PR steps, and a three-stage flow with planner, TDD-guide and code-reviewer agents. CX Codex +1 ★ 6,739repo stars verify The verify command checks the build, types, lint, tests, logs, and Git state. Use it before a commit or pull request. CX Codex +1 ★ 6,739repo stars performance performance — a Claude Code rule that matches model to task and keeps heavy refactors away from the tail of the context window. CX Codex +1 ★ 6,739repo stars coding-style coding-style is a Claude Code rule for code structure and quality checks. It applies while an agent writes or changes code. CX Codex +1 ★ 6,739repo stars hooks The hooks rule defines actions before and after tool calls, plus a final session check. It helps run code checks and review Git-related changes. CX Codex +1 ★ 6,739repo stars

Project sponsors

Companies that keep this analytics open