Skip to content
Back to skills

Typescript Monorepo Clean Code

ASecurity

Apply clean code principles to TypeScript monorepos. Use when a repo needs package boundaries, import discipline, shared type ownership, error handling conventions, module sizing, naming, refactoring, or clean implementation review.

  • 3 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added September 12, 2026
code-qualitytypescriptgorefactoringapi

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 12, 2026

npx -y skills add pax-k/pax-fullstack-harness --skill typescript-monorepo-clean-code --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Typescript Monorepo Clean Code?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Typescript Monorepo Clean Code
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pax-k-typescript-monorepo-clean-code/badge)](https://www.skillsdirectory.com/skills/pax-k-typescript-monorepo-clean-code)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: typescript-monorepo-clean-code
description: Apply clean code principles to TypeScript monorepos. Use when a repo needs package boundaries, import discipline, shared type ownership, error handling conventions, module sizing, naming, refactoring, or clean implementation review.
---

# TypeScript Monorepo Clean Code

## Purpose

Turn broad clean-code preferences into concrete TypeScript and monorepo rules agents can follow and reviewers can enforce.

## Inspect First

- workspace packages, app/package boundaries, `tsconfig` references, aliases, exports, lint rules, architecture docs, and golden patterns
- source files with repeated patterns, oversized modules, cross-package imports, and duplicated type definitions

## Procedure

1. Define package responsibilities.
   - Apps compose features and runtime wiring.
   - API packages own contracts, routers, validation, and service orchestration.
   - DB packages own schema, migrations, seed data, and typed persistence.
   - UI packages own reusable primitives and shared composition pieces.

2. Set TypeScript rules.
   - Prefer explicit domain types at package boundaries.
   - Keep validation schemas close to ingress points and exported when reused.
   - Avoid broad `any`, ambient globals, hidden side effects, and circular imports.
   - Keep error handling typed and observable.

3. Keep modules small enough to review.
   - Split by responsibility, not by arbitrary layers.
   - Extract only when duplication or complexity is real.
   - Keep generated code and hand-written code clearly separated.

4. Document local rules.
   - Create or update `docs/quality/typescript-clean-code.md` from `assets/templates/typescript-clean-code.md.tmpl`.
   - Feed canonical examples into `golden-pattern-extractor`.
   - Feed boundary risks into `architecture-boundary-enforcer`.

## Validation

- Run lint, typecheck, tests, and boundary checks.
- Confirm examples cite real local files.
- Confirm new rules do not contradict existing architecture docs.

## Completion Criteria

- Agents have concrete TypeScript monorepo rules for imports, types, errors, modules, and ownership.
- Clean-code guidance is repo-specific enough to review against.
- Follow-up refactors are separated from feature work unless they block the task.

Files in this skill

  • SKILL.md2.2 KB
  • agents/openai.yaml210 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.