Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add pproenca/dot-skills --skill typescript-refactorgit clone --depth 1 https://github.com/pproenca/dot-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/pproenca/dot-skills/typescript-refactor)<a href="https://agentmods.dev/skills/pproenca/dot-skills/typescript-refactor"><img src="https://agentmods.dev/badge/skills/pproenca/dot-skills/typescript-refactor/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/pproenca/dot-skills/typescript-refactor"><img src="https://agentmods.dev/badge/skills/pproenca/dot-skills/typescript-refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- Socket pass
- Snyk pass
- NVIDIA SkillSpector pass
What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00125 | $0.02164 |
| Opus 5 | $0.00063 | $0.01082 |
| Sonnet 5 | $0.00025 | $0.00433 |
| Haiku 4.5 | $0.00013 | $0.00216 |
Grade A, and why
typescript-refactor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 126 lines — stays where its author put it; the contents beside it link to each section on GitHub.
TypeScript Refactor Best Practices
Comprehensive TypeScript and TSX refactoring and modernization guide designed for AI agents and LLMs. Contains 47 rules across 9 categories, prioritized by impact to guide automated refactoring, code review, and code generation. Current to TypeScript 6.0 and React 19.
When to Apply
Reference these guidelines when:
- Refactoring TypeScript or React/TSX code for type safety and maintainability
- Designing type architectures (discriminated unions, branded types, generics)
- Narrowing types to eliminate unsafe
ascasts - Typing React components and hooks (props, refs, events, state) in
.tsxfiles - Adopting modern TypeScript 5.x–6.0 features (
satisfies,using, const type parameters, inferred type predicates, erasable syntax,withimport attributes) - Optimizing compiler performance in large codebases (
isolatedDeclarations, project references) - Implementing type-safe error handling patterns
- Reviewing code for TypeScript quirks and pitfalls
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Type Architecture | CRITICAL | arch- |
| 2 | Type Narrowing & Guards | CRITICAL | narrow- |
| 3 | Modern TypeScript | HIGH | modern- |
| 4 | React & TSX | HIGH | tsx- |
| 5 | Generic Patterns | HIGH | generic- |
| 6 | Compiler Performance | MEDIUM-HIGH | compile- |
| 7 | Error Safety | MEDIUM | error- |
| 8 | Runtime Patterns | MEDIUM | perf- |
| 9 | Quirks & Pitfalls | LOW-MEDIUM | quirk- |
Quick Reference
1. Type Architecture (CRITICAL)
arch-discriminated-unions— Use discriminated unions over string enums for exhaustive pattern matchingarch-branded-types— Use branded types for domain identifiers to prevent value mix-upsarch-satisfies-over-annotation— Usesatisfiesfor config objects to preserve literal typesarch-interfaces-over-intersections— Extend interfaces instead of intersecting types for better error messagesarch-const-assertion— Useas constfor immutable literal inferencearch-readonly-by-default— Default to readonly types for function parameters and return valuesarch-avoid-partial-abuse— AvoidPartial<T>abuse for builder patterns
What ships with it
51 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- AGENTS.md 11 KB
- assets/templates/_template.md 786 B
- metadata.json 1.5 KB
- references/_sections.md 2.3 KB
- references/arch-avoid-partial-abuse.md 1.4 KB
- references/arch-branded-types.md 1.4 KB
- references/arch-const-assertion.md 1.3 KB
- references/arch-discriminated-unions.md 1.9 KB
- references/arch-interfaces-over-intersections.md 1.6 KB
- references/arch-readonly-by-default.md 1.2 KB
- references/arch-satisfies-over-annotation.md 1.3 KB
- references/compile-avoid-deep-recursion.md 1.4 KB
- references/compile-base-types-over-unions.md 1.6 KB
- references/compile-explicit-return-types.md 2.0 KB
- references/compile-isolated-declarations.md 1.5 KB
- references/compile-project-references.md 1.6 KB
- references/error-discriminated-error-unions.md 1.3 KB
- references/error-exhaustive-error-handling.md 1.5 KB
- references/error-result-type.md 1.5 KB
- references/error-typed-catch.md 1.2 KB
- references/generic-avoid-distributive-surprises.md 1.2 KB
- references/generic-constrain-dont-overconstrain.md 1.1 KB
- references/generic-mapped-type-utilities.md 1.4 KB
- references/generic-return-type-inference.md 1.5 KB
- references/modern-const-type-parameters.md 1.3 KB
- references/modern-erasable-syntax.md 1.7 KB
- references/modern-import-attributes.md 1.1 KB
- references/modern-noinfer-utility.md 1.2 KB
- references/modern-template-literal-types.md 1.4 KB
- references/modern-using-keyword.md 1.5 KB
- references/modern-verbatim-module-syntax.md 1.4 KB
- references/narrow-assertion-functions.md 1.7 KB
- references/narrow-custom-type-guards.md 1.8 KB
- references/narrow-eliminate-as-casts.md 1.8 KB
- references/narrow-exhaustive-switch.md 1.5 KB
- references/narrow-in-operator.md 1.6 KB
- references/perf-avoid-delete-operator.md 1.1 KB
- references/perf-map-set-over-object.md 1.6 KB
- references/perf-object-freeze-const.md 1.3 KB
- references/perf-object-keys-narrowing.md 1.6 KB
- references/perf-union-literals-over-enums.md 1.8 KB
- references/quirk-empty-object-type.md 1.4 KB
- references/quirk-excess-property-checks.md 1.6 KB
- references/quirk-structural-typing-escapes.md 1.4 KB
- references/quirk-variance-annotations.md 1.8 KB
- references/tsx-avoid-react-fc.md 1.4 KB
- references/tsx-discriminated-props.md 1.6 KB
- references/tsx-event-handler-types.md 1.4 KB
- references/tsx-extend-native-props.md 1.6 KB
- references/tsx-hook-typing.md 1.3 KB
- references/tsx-ref-as-prop.md 1.3 KB
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 126 lines · 125 tokens per session scan A d6b0351e682b
typescript-refactor is a skill published in the GitHub repository pproenca/dot-skills (205 stars, last pushed 24d ago), licensed MIT. It adds 125 tokens to every session and 2,164 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
frontend-conventions
Coding conventions, architecture patterns, and testing rules for the SkillHub React frontend. Ensures agents follow Feature-Sliced Design and use the generated OpenAPI types.
fast-typescript-check
Keep www-sacred's TypeScript fast to type-check and fast to run. Use when touching the ASCII/canvas animation components (the only real per-frame code here), tightening type-check wall-clock, or auditing a change for runtime or compiler regressions. Scoped to this repo — a React 19 / Next.js 16 component library plus…
typescript-react
Apply, review, and explain React conventions from the TypeScript Style Guide. Use automatically for TypeScript and TSX tasks involving prop-derived state, prop typing, component responsibilities, data flow, compound components, or client and server state.
electron-dev
Electron desktop apps with React, TypeScript, and Vite. Use for IPC, window/tray, PTY terminals, WebRTC, and packaging.
coding-standards
A set of general coding standards and practical patterns for TypeScript, JavaScript, React, and Node.js. It covers readable naming, simple designs, avoiding repetition, and delaying unnecessary features.
typescript-rules
React/TypeScript frontend development rules including type safety, component design, state management, and error handling. Use when implementing React components, TypeScript code, or frontend features.