general-utility-functions

Provide reusable utility functions for encryption, formatting, detection, storage, transformation, and validation in TypeScript projects.

Updated Mar 1, 2026
One-click install
npx skills add https://github.com/wonkpentink/agent-skills-fe --skill general-utility-functions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: general-utility-functions
Source: https://github.com/wonkpentink/agent-skills-fe/tree/main/skills/general-utility-functions
Command: npx skills add https://github.com/wonkpentink/agent-skills-fe --skill general-utility-functions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide consolidates the general-purpose utilities found in src/lib/utils/ that provide common operations across the entire application. They are component-agnostic and help standardize encryption, formatting, detection, storage, transformation, and validation tasks.

Core Features & Use Cases

  • Encryption/Decryption: AES-based data protection for tokens and sensitive values.
  • Formatting: Phone, currency, and data formatting for consistent UI displays.
  • Detection & Storage: Device/browser/OS checks and secure storage helpers.
  • Transformation & Validation: String/array/object helpers with robust typing.
  • This toolkit is designed to be used across features, hooks, and pages to avoid duplication and ensure type safety.

Quick Start

Use formatPhoneNumber to normalize a phone input and rupiahCurrencyFormat to display a price in IDR.

Frequently Asked Questions about general-utility-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I standardize phone and currency formatting in a TypeScript project?

Standardize phone and currency formatting by applying reusable pure functions like formatPhoneNumber and rupiahCurrencyFormat. These utilities normalize input values and return consistently formatted strings for UI displays across your TypeScript project.

What is the best way to encrypt sensitive tokens in TypeScript web applications?

AES-based encryption utilities provide data protection for sensitive tokens and values. They use pure-function design with safe error handling to standardize security across features, hooks, and pages without duplicating logic in your application.

Can I use pure utility functions for localStorage and device detection in TypeScript?

Yes, you can use pure utility functions for localStorage and device detection. These helpers perform device, browser, and OS checks alongside secure storage operations while satisfying strong TypeScript typing constraints across your application.

How do I handle string, array, and object transformations with type safety?

Handle string, array, and object transformations using robustly typed helper functions. These utilities ensure type safety during data transformation and validation tasks, preventing runtime errors across your application's features.

Do I need specific dependencies to run these TypeScript formatting and encryption utilities?

No specific dependencies are required to run these TypeScript formatting and encryption utilities. They are component-agnostic, dependency-free functions designed to be applied across all features and pages for standardizing data handling.