# Improve TypeScript Clean Code

Teams lose time when TypeScript code grows duplicated, complex, and hard to test. This skill guides Claude, Codex, and Claude Code toward simpler functions, clearer names, and safer structure.

## Install

```bash
npx skillstore add doubleslashse/clean-code
```

## Metadata

- Status: approved
- Slug: doubleslashse-clean-code
- Skillstore revision: r1
- Version status: missing
- Tree hash: 2c4a7d8fd0fbeb1b783619543332ec571a3dc59297d7297411d37c7591dbc66b
- Author: DoubleslashSE
- GitHub username: DoubleslashSE
- License: MIT
- Repository: https://github.com/DoubleslashSE/claude-workflows/tree/main/Plugins/dotnet-tdd/skills/clean-code
- Ref: 72d5025b022c77f7a51bdf5c1637c689c80e89d1
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network, filesystem
- Quality score: 79
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/doubleslashse-clean-code
- Manifest: https://skillstore.pages.dev/api/skills/doubleslashse-clean-code/manifest

## Capabilities

- Explains DRY, KISS, and YAGNI with TypeScript examples.
- Shows before and after patterns for validation, fetch logic, and conditionals.
- Provides naming, function design, error handling, and formatting guidance.
- Promotes small functions, immutable updates, and dependency injection.
- Suggests feature-based code organization for Node.js and TypeScript projects.

## Use Cases

- Refactor Pull Requests: Identify duplication, complex branches, and unclear names before merging TypeScript changes.
- Plan Code Cleanup: Create a focused cleanup checklist for services, handlers, and utility modules.
- Teach Clean Code: Use concise examples to explain maintainability principles during onboarding or mentoring.

## Prompt Templates

### Review Naming

```
Review this TypeScript file for unclear names. Suggest clearer names and explain each change briefly.
```

### Reduce Duplication

```
Find repeated logic in this module. Propose shared helpers or constants that keep behavior unchanged.
```

### Simplify Flow

```
Analyze this function for nested conditionals, mixed abstraction levels, and unnecessary configuration. Return a prioritized cleanup plan.
```

### Refactor Architecture

```
Review this feature folder for clean code, dependency injection, error handling, and testability. Propose staged refactors with risks.
```

## Limitations

- It provides guidance only and does not run linters, tests, or formatters.
- Examples are illustrative and may need adaptation for each codebase.
- It focuses on TypeScript and Node.js, not every language or framework.
- It does not replace project-specific architecture or security review.

## Best Practices

- Ask for behavior-preserving changes before requesting large refactors.
- Provide real project constraints so recommendations fit the codebase style.
- Review generated suggestions with tests and code owners.

## Anti Patterns

- Requesting broad rewrites without explaining the current behavior.
- Applying every principle mechanically when simpler code already exists.
- Using examples as drop-in production code without adapting them.

## Security Audit

- Audited at: 2026-07-06T11:15:31.341\+00:00
- Summary: All static findings are false positives caused by TypeScript documentation examples and Markdown fence delimiters. The skill contains guidance and sample snippets, with no executable scripts, no real network requests, and no prompt injection text found.

## Stats

- Views: 290
- Downloads: 11
- Favorites: 0
- Popularity score: 0
