General JavaScript/TypeScript

Enforce JavaScript and TypeScript hygiene across module structure and API boundaries.

1|Updated May 2, 2026
One-click install
npx skills add https://github.com/Levironexe/architect --skill general-javascript-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: General JavaScript/TypeScript
Source: https://github.com/Levironexe/architect/tree/main/skills/meta/general-js
Command: npx skills add https://github.com/Levironexe/architect --skill general-javascript-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

In JavaScript and TypeScript codebases, inconsistent naming, scattered environment access, weak error handling, and leaky imports create brittle systems that are hard to refactor and easy to break.

Core Features & Use Cases

  • Environment centralization: Move all runtime configuration and validated env access into src/config, preventing scattered process.env usage and enabling fail-fast startup behavior.
  • Reusable structure and boundaries: Enforce a consistent project layout with src for application code, src/utils for framework-agnostic helpers, and src/errors for typed Error classes.
  • Safer API contracts: Define explicit input/output types for API boundaries so modules never return raw database objects and response shapes remain stable.

Quick Start

Tell your coding agent to apply this skill’s rules by proposing a refactor plan that centralizes environment handling in src/config, moves typed errors into src/errors, and introduces explicit src/types contracts for each API boundary.

Frequently Asked Questions about General JavaScript/TypeScript

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

FAQPage Schema
How do I centralize environment configuration in JavaScript and TypeScript services?

To centralize environment configuration in JS/TS services, move all runtime configuration and validated environment access into a dedicated src/config directory. This prevents scattered process.env usage and enables fail-fast startup behavior across modules.

What is the best way to structure typed error handling in TypeScript?

The best way to structure typed error handling in TypeScript is to place typed Error classes in a dedicated src/errors directory. This isolates error management and ensures consistent, typed error boundaries across application modules.

How do I organize framework-agnostic utilities in a JS/TS codebase?

To organize framework-agnostic utilities in a JS/TS codebase, isolate reusable helpers into a dedicated src/utils directory. This separates pure logic from application code and maintains consistent module boundaries for easier refactoring.

Why should I define explicit input and output types for API boundaries in TypeScript?

Defining explicit input and output types for API boundaries in TypeScript prevents leaky imports and ensures response shapes remain stable. This practice stops modules from returning raw database objects, creating maintainable architecture.

Can I use this code hygiene refactoring approach for stabilizing existing JavaScript services?

Yes, you can use this code hygiene refactoring approach for stabilizing existing JavaScript services. It applies to refactoring tasks where configuration, utilities, typed error handling, and API boundaries must be reorganized consistently across modules.